// -------------------------------------------------------------------------------------------
//new window for order form
function newWindow(pup) {
pupWindow = window.open(pup,'popWin', 'width=740,height=525,top=40,left=40,status=yes,menubar=no,scrollbars=yes,toolbar=no,resizable=yes')
pupWindow.focus()
}
// -------------------------------------------------------------------------------------------
//sendform for DBIA login
function sendForm() {
	if (document.dbiaForm.userId.value == null || document.dbiaForm.userId.value == "" || document.dbiaForm.userId.value == " ") {
		alert ("Please enter your User ID");
		document.dbiaForm.userId.focus();
		document.dbiaForm.userId.select();
		return false;
	}
	if (document.dbiaForm.password.value == null || document.dbiaForm.password.value == "" || document.dbiaForm.password.value == " ") {
		alert ("Please enter your Password");
		document.dbiaForm.password.focus();
		document.dbiaForm.password.select();
		return false;
	}
	if (document.dbiaForm.endorsement.value == null || document.dbiaForm.endorsement.value == "" || document.dbiaForm.endorsement.value == " ") {
		alert ("Please enter person to send reports to.");
		document.dbiaForm.endorsement.focus();
		document.dbiaForm.endorsement.select();
		return false;
	}
}
// -------------------------------------------------------------------------------------------
function sendForm2() {
	if (document.DnBDirect.SearchStringCompany.value == "Please Enter Company Name" || document.DnBDirect.SearchStringCompany.value == "" || document.DnBDirect.SearchStringCompany.value == " ") {
		alert ("Please enter a company to search for.");
		document.DnBDirect.SearchStringCompany.focus();
		document.DnBDirect.SearchStringCompany.select();
		return false;
	}
	if (document.DnBDirect.StateOrRegion.value == "xxx" || document.DnBDirect.StateOrRegion.value == "1X" || document.DnBDirect.StateOrRegion.value == "2X") {
		alert ("Please select a state or province.");
		document.DnBDirect.StateOrRegion.focus();
		return false;
	}
}

// -------------------------------------------------------------------------------------------
function changePageTo(selector) 
{
	var s = selector.options[selector.selectedIndex].value;
	if (s) { self.location = s }
}
// -------------------------------------------------------------------------------------------
function SetState(f)
{
	var bAllowOptionNameChange;
	bAllowOptionNameChange = true;
	
	//alert (navigator.appVersion.substring(0, 3))
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		if (navigator.appVersion.substring(0, 3) == "2.0")
			bAllowOptionNameChange = false;
	}

	if ( f.country.options[ f.country.selectedIndex ].value == "124")
	{
		if (bAllowOptionNameChange)
			f.StateOrRegion.options[ 0 ].text = "Select a Country:";
			for(var i = 0; i < f.StateOrRegion.length; ++i)
			{
				if(f.StateOrRegion.options[i].value == "1X") 
				{
					f.StateOrRegion.options[i].selected = true;
					break;
				}
			}
	}
	else if ( f.country.options[ f.country.selectedIndex ].value == "840")
	{
		if (bAllowOptionNameChange)
			f.StateOrRegion.options[ 0 ].text = "Select a Province:";
		// take dropdown to USA options
		for(var i = 0; i < f.StateOrRegion.length; ++i)
		{
			if(f.StateOrRegion.options[i].value == "2X") 
			{
				f.StateOrRegion.options[i].selected = true;
				break;
			}
		}
	}
	else
	{
		f.StateOrRegion.selectedIndex = 0;
		if (bAllowOptionNameChange)
			f.StateOrRegion.options[ 0 ].text = "Not Required";
	}
	return true;
}
// -------------------------------------------------------------------------------------------
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
// -------------------------------------------------------------------------------------------
// Used in the forms on the product pages
function checkInfo() {

if (document.InfoRequest.fname.value == null || document.InfoRequest.fname.value == "") {
  alert ("Please specify your FIRST name.");
  InfoRequest.fname.focus();
  InfoRequest.fname.select();
  return false;
 }
 
 if (document.InfoRequest.lname.value == null || document.InfoRequest.lname.value == "") {
  alert ("Please specify your LAST name.");
  InfoRequest.lname.focus();
  InfoRequest.lname.select();
  return false;
 }
 
 if (document.InfoRequest.title.value == "") {
  alert ("Please specify your TITLE.");
  InfoRequest.title.focus();
  return false;
 }
 
 if (document.InfoRequest.company.value == null || document.InfoRequest.company.value == "") {
  alert ("Please specify your COMPANY.");
  InfoRequest.company.focus();
  InfoRequest.company.select();
  return false;
 }

 if (document.InfoRequest.email.value == null || document.InfoRequest.email.value=="" || (document.InfoRequest.email.value.indexOf('@') == -1) || (document.InfoRequest.email.value.indexOf('.') == -1) || (document.InfoRequest.email.value.length < 6)) {
  alert ("Please specify your E-MAIL.");
  InfoRequest.email.focus();
  InfoRequest.email.select();
  return false;
 }
 
 if (document.InfoRequest.phone.value == null || document.InfoRequest.phone.value == "") {
  alert ("Please specify your PHONE.");
  InfoRequest.phone.focus();
  InfoRequest.phone.select();
  return false;
 }

 if (document.InfoRequest.address.value == null || document.InfoRequest.address.value=="") {
  alert ("Please specify your STREET ADDRESS.");
  InfoRequest.address.focus();
  InfoRequest.address.select();
  return false;
 }
 
 if (document.InfoRequest.postalcode.value == null || document.InfoRequest.postalcode.value == "") {
  alert ("Please specify your POSTAL CODE.");
  InfoRequest.postalcode.focus();
  InfoRequest.postalcode.select();
  return false;
 }

 if (document.InfoRequest.country.value == null || document.InfoRequest.country.value == "") {
  alert ("Please specify your COUNTRY.");
  InfoRequest.country.focus();
  return false;
 }

 if (document.InfoRequest.product.value == null || document.InfoRequest.product.value == "") {
  alert ("Please specify a PRODUCT.");
  InfoRequest.product.focus();
  InfoRequest.product.select();
  return false;
 }
 
 if (document.InfoRequest.hearabout.value == "") {
  alert ("Please specify how you HEARD ABOUT US.");
  InfoRequest.hearabout.focus();
  return false;
 }
 
 if (document.InfoRequest.comments.value == null || document.InfoRequest.comments.value=="") {
  alert ("Please specify your COMMENTS.");
  InfoRequest.comments.focus();
  InfoRequest.comments.select();
  return false;
 }
 
}
//-->