<!-- Begin

if (document.images)
	{
   // Main Menu Buttons - Top
		   aboutOn = new Image();
		   aboutOn.src = "/images/aboutBut02.gif";
		   aboutOff = new Image();
		   aboutOff.src = "/images/aboutBut01.gif"
		   
		   claimOn = new Image();
		   claimOn.src = "/images/clmprocBut02.gif";
		   claimOff = new Image();
		   claimOff.src = "/images/clmprocBut01.gif"
		
		   customerOn = new Image();
		   customerOn.src = "/images/custservBut02.gif";
		   customerOff = new Image();
		   customerOff.src = "/images/custservBut01.gif"
		
		   eligOn = new Image();
		   eligOn.src = "/images/eligBut02.gif";
		   eligOff = new Image();
		   eligOff.src = "/images/eligBut01.gif"
	
	
	   // Global Menu Buttons
			   homeOn = new Image();
			   homeOn.src = "/images/homeBut02.gif";
			   homeOff = new Image();
			   homeOff.src = "/images/homeBut01.gif"
			
			   searchOn = new Image();
			   searchOn.src = "/images/searchBut02.gif";
			   searchOff = new Image();
			   searchOff.src = "/images/searchBut01.gif"

   // Bottom Menu Buttons
			   contactusOn = new Image();
			   contactusOn.src = "/images/contactBut02.gif";
			   contactusOff = new Image();
			   contactusOff.src = "/images/contactBut01.gif"
			
			   privacyOn = new Image();
			   privacyOn.src = "/images/privacyBut02.gif";
			   privacyOff = new Image();
			   privacyOff.src = "/images/privacyBut01.gif"
			
			   termsOn = new Image();
			   termsOn.src = "/images/termsBut02.gif";
			   termsOff = new Image();
			   termsOff.src = "/images/termsBut01.gif"
			
			   sitemapOn = new Image();
			   sitemapOn.src = "/images/sitemapBut02.gif";
			   sitemapOff = new Image();
			   sitemapOff.src = "/images/sitemapBut01.gif"

			   loginOn = new Image();
			   loginOn.src = "/images/loginBut02.gif";
			   loginOff = new Image();
			   loginOff.src = "/images/loginBut01.gif"

			   asotpaOn = new Image();
			   asotpaOn.src = "/images/asotpaBut02.gif";
			   asotpaOff = new Image();
			   asotpaOff.src = "/images/asotpaBut01.gif"

			   documentsOn = new Image();
			   documentsOn.src = "/images/documentBut02.gif";
			   documentsOff = new Image();
			   documentsOff.src = "/images/documentBut01.gif"

			   dentalOn = new Image();
			   dentalOn.src = "/images/dentalBut02.gif";
			   dentalOff = new Image();
			   dentalOff.src = "/images/dentalBut01.gif"
			   
			   dentistOn = new Image();
			   dentistOn.src = "/images/dentistBut02.gif";
			   dentistOff = new Image();
			   dentistOff.src = "/images/dentistBut01.gif"
			   
			  visionOn = new Image();
			  visionOn.src = "/images/visionBut02.gif";
			  visionOff = new Image();
			  visionOff.src = "/images/visionBut01.gif"
			  
			   fsaOn = new Image();
			   fsaOn.src = "/images/fsaBut02.gif";
			   fsaOff = new Image();
			   fsaOff.src = "/images/fsaBut01.gif"

}

function showImage(imageName)
		{
		   if (document.images)
		   {
			  document[imageName].src = eval(imageName + "On.src");
		   } 
		}

function hideImage(imageName)
		{
		   if (document.images)
		   {
			  document[imageName].src = eval(imageName + "Off.src");
		   } 
		}



function continueProcessing()
{
	return true;
}

function refresh()
	{
		window.location.reload( true );
	}


function noenter() 
{
  	return !(window.event && window.event.keyCode == 13); 
}


function emailCheckIT(calform) {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(calform.emailBox.value)){
		return (true)
		}
		alert("Invalid E-mail Address! Please re-enter.")
		return (false)
		}


function sendContactEmail(calform)
{
		if (!validRequired(calform.userName,"Contact Name"))
					return false;
		
		if (!emailCheckIT(calform))
					return false;

		if (!validRequired(calform.messageBox,"Message"))
					return false;

		return true;

}


function validRequired(formField,fieldLabel)
{
  var result = true;

  if (formField.value == "")
  {
    alert('Please enter a value for the "' + fieldLabel +'" field.');
    formField.focus();
    result = false;
  }

  return result;
}

function checkUserType(){
	var radioSelected = false;
		
	for (i = 0;  i < calform.TypeOfLogin.length;  i++){
			if (calform.TypeOfLogin[i].checked) 	
			radioSelected = true;
		}
	if (!radioSelected)
		{
				alert("No option selected. ");
				return false;}

	return true;
}

function checkMenuItem(){
	var radioSelected = false;
		
	for (i = 0;  i < calform.TypeOfMenu.length;  i++){
			if (calform.TypeOfMenu[i].checked) 	
			radioSelected = true;
		}
	if (!radioSelected)
		{
				alert("No option selected. ");
				return false;}

	return true;
}

function checkFirstProvider()
{
	//ValField(theField,DataType,DataMin,DataMax,DataMask,DataValidChars,required,DisplayFieldName){
	//DataType= a=alpha an=AlphaNumeric n=Numeric
	var f=document.calform;
	
	if (!validRequired(calform.userFirstName,"Provider First Name"))
					return false;
	if (!validRequired(calform.userLastName,"Provider Last Name"))
					return false;
	
	if (! ValField(f.LicenseNumber,'n',2,10,'','','y','License Number')) return false;
	if ((calform.LicenseState.options[calform.LicenseState.selectedIndex].value == "0"))
	  {
			alert("No State was selected. ")
			return false
		}
	if (! ValField(f.TINSSN,'n',9,9,'','','y','TIN')) return false;
	if (! ValField(f.ZIP,'n',5,5,'','','y','ZIP')) return false;
	
	
	return true;
}

function checkFirstSubscriber()
{
	//ValField(theField,DataType,DataMin,DataMax,DataMask,DataValidChars,required,DisplayFieldName){
	//DataType= a=alpha an=AlphaNumeric n=Numeric
	var f=document.calform;
	
	if (!validRequired(calform.userFirstName,"Subscriber First Name"))
					return false;
	if (!validRequired(calform.userLastName,"Subscriber Last Name"))
					return false;

	if (! ValField(f.TINSSN,'n',9,9,'','','y','Subscriber ID or SSN')) return false;
	
	if (! ValField(f.dateBirth,'an',10,10,'','','y','Date of Birth')) return false;
	return true;
}


function checkSSNFormat()
{
	if (! ValField(calform.TINSSN,'n',9,9,'','','y','Subscriber ID ')) return false;
//	if (! IsDate(calform.birthDate)) return false;
	
	return true;
}


function checkPasswordEntry()
{
	//ValField(theField,DataType,DataMin,DataMax,DataMask,DataValidChars,required,DisplayFieldName){
	//DataType= a=alpha an=AlphaNumeric n=Numeric
	var f=document.calform;
	if (! isEmail(f.Email)) return false;
	if (! isEmail(f.Email2)) return false;
	if (! CompareValues(f.Email,f.Email2,'N','Email and Retype Email do not match')) return false;
	if (! ValField(f.Password1,'an',8,16,'','','y','Password')) return false;
	if (! ValField(f.Password2,'an',8,16,'','','y','ReType Password')) return false;
	if (! CompareValues(f.Password1,f.Password2,'N','Password and Retype Password do not match')) return false;
	if (! ValField(f.SecretAnswer,'an',3,50,'','','y','Answer to Secret Question')) return false;
	return true;
}

function checkLoginEntry()
{
	//ValField(theField,DataType,DataMin,DataMax,DataMask,DataValidChars,required,DisplayFieldName){
	//DataType= a=alpha an=AlphaNumeric n=Numeric
	var f=document.calform;
	if (! isEmail(f.Email)) return false;
	if (! ValField(f.Password1,'an',8,16,'','','y','Password')) return false;
	return true;
}

	function unHider()
	{
		document.all.div1.style.display = 'none';
		document.all.div2.style.display = 'block';
	}
	function hider()
	{
		document.all.div1.style.display = 'block';
		document.all.div2.style.display = 'none';
	}

function showBoxTypeUser()
	{
	  if ((calform.TypeOfLogin.options[calform.TypeOfLogin.selectedIndex].value == "1"))
	  {
		 unHider();
	  }else {
		 hider(); 
		}
	}

function checkBoxTypeUser()
	{
	  if ((calform.TypeOfLogin.options[calform.TypeOfLogin.selectedIndex].value == "1"))
	  { 
		if (! ValField(calform.LicenseNumber,'n',4,4,'','','y','AZ License Number')) return false;
	  }else {
		if (! IsDate(calform.birthDate)) return false;
		}
	
	return true;
	}



function checkDropDownZero(formField,fieldLabel)
	{
	  var result = true;

	  if (formField.options[formField.selectedIndex].value == "0")
	  {
		alert('Select a value in the ' + fieldLabel + ' field.');
		formField.focus();
		result = false;
	  }
	
	  return result;
	}



function forgotPasswordEntry()
{
	var f=document.calform;
    if (!checkDropDownZero(calform.TypeOfLogin,"Type of User"))
	  	return false;
	if (!validRequired(calform.userFirstName,"Subscriber First Name"))
		return false;
	if (!validRequired(calform.userLastName,"Subscriber Last Name"))
		return false;
	if (! isEmail(f.Email)) return false;
	if (! ValField(f.TINSSN,'n',9,9,'','','y','Subscriber ID or Tax Identification Number')) return false;
	
	if (! checkBoxTypeUser()) return false;
	
	return true;
}

	//ValField(theField,DataType,DataMin,DataMax,DataMask,DataValidChars,required,DisplayFieldName){
	//DataType= a=alpha an=AlphaNumeric n=Numeric

function forgotPasswordChg()
{
	var f=document.calform;
	if (! ValField(f.SecretAnswer,'an',1,30,'','','y','Secret Answer')) return false;
	return true;
}

function forgotPasswordNew()
{
	var f=document.calform;
	if (! ValField(f.Password1,'an',8,16,'','','y','Password')) return false;
	if (! ValField(f.Password2,'an',8,16,'','','y','ReType Password')) return false;
	if (! CompareValues(f.Password1,f.Password2,'N','Password and Retype Password do not match')) return false;
	return true;
}


function editProfileInfo()
{
	var f=document.calform;
	if (! ValField(f.SecretAnswer,'an',1,50,'','','y','Secret Answer')) return false;
	if (! ValField(f.Password0,'an',8,16,'','','y','Current Password')) return false;

	if ((document.calform.Password1.value != "") || (document.calform.Password2.value != ""))
		{
			if (! ValField(f.Password1,'an',8,16,'','','y','New Password')) return false;
			if (! ValField(f.Password2,'an',8,16,'','','y','ReType New Password')) return false;
			if (! CompareValues(f.Password1,f.Password2,'N','Password and Retype Password do not match')) return false;
		}
	
	return true;
}

	function formatMoney(thisStr) {
		thisStr -= 0;
		thisStr = (Math.round(thisStr*100))/100;
		return (thisStr == Math.floor(thisStr)) ? thisStr + '.00' 
			: ( (thisStr*10 == Math.floor(thisStr*10)) ? 
			thisStr + '0' : thisStr);
	}	

	function filterString(thisStr){
		re = /[^.0-9]/g;	
		newVar = thisStr.replace(re,'');
		if(newVar == ''){
			$newVar = 0.0;
		}
		return(newVar);
	}

	function reCalc(){
	
		agip = parseFloat(filterString(document.calcForm.agip.value));		
		hcfsa = parseFloat(filterString(document.calcForm.hcfsa.value));
		dcfsa = parseFloat(filterString(document.calcForm.dcfsa.value));
		totalpretax = agip + hcfsa + dcfsa;
		bracket = parseInt(document.calcForm.bracket.options[document.calcForm.bracket.options.selectedIndex].value);
		totalsavings = (bracket / 100) * totalpretax;
		numchecks = parseInt(filterString(document.calcForm.numchecks.value));
		percheck = totalsavings * (1 / numchecks);
			
		document.calcForm.agip.value = '$' + String(formatMoney(agip));
		document.calcForm.hcfsa.value = '$' + String(formatMoney(hcfsa));
		document.calcForm.dcfsa.value = '$' + String(formatMoney(dcfsa));
		document.calcForm.totalpretax.value = '$' + String(formatMoney(totalpretax));
		document.calcForm.totalsavings.value = '$' + String(formatMoney(totalsavings));
		document.calcForm.percheck.value = '$' + String(formatMoney(percheck));
		
	}
	function reCalcEmp(){
	
		agip = parseFloat(filterString(document.calcForm.agip.value));		
		hcfsa = parseFloat(filterString(document.calcForm.hcfsa.value));
		dcfsa = parseFloat(filterString(document.calcForm.dcfsa.value));
		totalpretax = agip + hcfsa + dcfsa;
		bracket = parseInt(document.calcForm.bracket.options[document.calcForm.bracket.options.selectedIndex].value);
		totalsavings = (bracket / 100) * totalpretax;
		numchecks = parseInt(filterString(document.calcForm.numchecks.value));
		percheck = totalsavings * (1 / numchecks);
			
		document.calcForm.agip.value = '$' + String(formatMoney(agip));
		document.calcForm.hcfsa.value = '$' + String(formatMoney(hcfsa));
		document.calcForm.dcfsa.value = '$' + String(formatMoney(dcfsa));
		document.calcForm.totalpretax.value = '$' + String(formatMoney(totalpretax));
		document.calcForm.totalsavings.value = '$' + String(formatMoney(totalsavings));
		document.calcForm.percheck.value = '$' + String(formatMoney(percheck));
		
	}
//  End -->
