<!--
//*****************************************
//Macromedia Dreamweaver MX Image Rollovers
//*****************************************
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//***********************************************
//Macromedia Dreamweaver MX Check Plugin Behavior
//***********************************************
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false;
  document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo;
  }
  if (!ok) theURL=altURL;
  if (theURL) window.location=theURL;
}

function processSubmit(form)
{
	//validates input for ELD website app/policies pages	
	if (form.canada.checked == true && form.state.options[form.state.selectedIndex].value != -1)
	{
		alert("Please unselect US state or uncheck CANADA checkbox and try again.")
		return;
	}
	
	if (form.canada.checked == false && form.state.options[form.state.selectedIndex].value == -1)
	{
		alert("Please select US state or check CANADA checkbox.")
		return;
	}

	form.submit();
}

function checkForCanada(formPage, productIndex)
{
	//Check if selected product is Canada specific.
	if (productIndex.text.search(/Canadian/i) > -1)
		{formPage.canada.checked=true;
		formPage.state.value=-1;}
	else
		{formPage.canada.checked=false;}
} 

//***********************************************************
//Displays today's date in the following format: MMM DD, YYYY
//***********************************************************
function displayDateMDY()
{
	var months=new Array(13);
	months[1]="Jan";
	months[2]="Feb";
	months[3]="Mar";
	months[4]="Apr";
	months[5]="May";
	months[6]="Jun";
	months[7]="Jul";
	months[8]="Aug";
	months[9]="Sep";
	months[10]="Oct";
	months[11]="Nov";
	months[12]="Dec";
	var today=new Date();
	var month=months[today.getMonth() + 1];
	var day=today.getDate();
	var year=today.getFullYear();
	//if (year<100) year="19" + time.getYear();
	//else year=time.getYear();
	document.write(month + " " + day + ", " + year);
}


//***************************************
//Opens a link in an informational window
//***************************************
function infoW(href,width,height) 
{
	
	// if width or height not supplied set default values (as for ContactUS page)  
	//(modified by igor Jan 19,2006)
	if (width==null)
	{width=500;}
	
	
	if (height==null)
	{height=700;}
	// -----------------------------------------------------
	
	window.open(href,"Viewer","width="+width+",height="+height+",screenX=0,screenY=0,dependent,scrollbars,resizable,menubar=0,status=0")
}

//***************************************
//Opens a link in an informational window
//***************************************
function bannerPopUp(href) 
{
	window.open(href,'viewer','width=400,height=300,screenX=0,screenY=0,dependent,scrollbars=1,resizable=0,menubar=0,status=0');
	
	//Lindy's
	//window.open('content/weeklyTechTipPopup.html','newWin','width=400,height=400,scrollbars=0,toolbars=0,status=0,resizable=0');
}

//**************************************************************************************
//Used for links in child windows.  Closes child window and opens link in parent window.
//**************************************************************************************
function openInParent(href){
	if (this.opener!=null)
	{
		window.close();
		opener.focus();
		opener.top.location.href=href;
	}
	else
	{
		window.location.href=href;
	}
}


//***************************************************************************************
//This function takes an expression and evaluates it. If the phone number field contains
//these characters, then the function returns true, otherwise, the function will return
//false and disable the submit button. The submit button is run on an "onChange" event in
//the phone number field.
//***************************************************************************************
function isNumber(str) {
	var criteria=/\(?\d{3}\)?[-\/\.]\d{3}[-\/\.]\d{4}/;
	var ok=criteria.exec(str);
	if(!ok){
		alert(str + " " + "is not a valid number");

	}
 }


//***************************************************************************************
//This function gets the element by Id and then sets the disable property to true to
//disable the submit button.
//***************************************************************************************
function disableButton(){
	obj=document.getElementById('Submit');
 	obj.disabled=true;
}


//***************************************************************************************
//This function enables the submit button in the same way as the disable button disables
//the submit button.
//***************************************************************************************
function enableButton(){
	obj=document.getElementById('Submit');
 	obj.disabled=false;
}


//***************************************************************************************
//This function takes the values from the validatefields() function and uses it to test
//if any of the text boxes or radio buttons are empty or not checked. If they are, then
//a message displays the field name where the missing information is.
//***************************************************************************************
function validateFieldArray(flds){
	for(var i=0; i<flds.length; i++){
		
		//if the field is a radio button it is validated differently
		if((flds[i][0][0].type!=null)&&(flds[i][0][0].type=="radio")){
			//cycle through each option and test if it is checked
			for(var j=0; j<flds[i][0].length; j++){
				if (flds[i][0][j].checked==true){
					//if an option is checked exit
					return true;
				}
			}
			//if no options were checked, prompt the user
			alert("Please enter " + flds[i][1]);
			flds[i][0][0].focus();
			return false;
			
		}else if(flds[i][0].value==""){ //for non-radio button fields
			alert("Please enter" + " " + flds[i][1]);
			flds[i][0].focus();
			//disableButton();
			return false;
		}
 	}
	//if we get here then all fields are non-radio buttons and none of their values was the empty string
	return true;
}


//***************************************************************************************
//This function looks at each element in the document and holds an array of form objects.
//The array corresponds to the particular form object name. Then these values are passed
//up to the validateArray() function.
//***************************************************************************************
/*
function validateFields(){
	var frm=document.forms.frmValidation;
	var flds=new Array();
	flds[flds.length]=[frm.tFName, "a First Name."];
	flds[flds.length]=[frm.tLName, "a Last Name."];
	flds[flds.length]=[frm.company, "a Company Name."];
	flds[flds.length]=[frm.address, "an Address."];
 	flds[flds.length]=[frm.city, "a City."];
 	flds[flds.length]=[frm.state, "a State."];
	flds[flds.length]=[frm.zip, "a Zip Code."];
	flds[flds.length]=[frm.phone, "a Phone Number."];
	flds[flds.length]=[frm.fax, "a valid fax number"];
	flds[flds.length]=[frm.email, "an Email Address."];
	flds[flds.length]=[frm.tbondarea, "a comment for the type of bonds you are requesting."];
	return validateFieldArray(flds);
}
*/

//-->