function setWindowStatus(objText){
/**********************************************************************
Function: SetWindowStatus
Purpose:  Set the forms window.status to some text
Parameters: objtext is the text string passed to be displayed
**********************************************************************/
	var form = document.forms(0);  

	window.status=objText;
	return true;	
}
	
function clearWindowStatus(){
/**********************************************************************
Function: ClearWindowStatus
Purpose:  Set the forms window.status to nothing
Parameters: NONE
**********************************************************************/
	var form = document.forms(0);

	window.status=''
	return true;
}

function change(color)
{
	var el=event.srcElement
	if (el != null)
	{
		if (el.tagName=="INPUT"&&el.type=="submit")
		{
			if (el.className!='initial3')
			event.srcElement.style.backgroundColor=color
		}
	}
}

function JumpTo(url)
{
	window.location=url;
	}


function IsVal(msg,val)	
{
if (isNaN(val))
	{
		var write
		write = msg + " has to be Numeric"
		alert(write)
		return false
	}
return true
}

// Check whether string s is empty.
// returns true if the string is empty
function isEmpty(StringToCheck)
{   
		
	return ((StringToCheck == null) || (StringToCheck.length == 0))
	
}



// Returns true if string s is empty or 
// whitespace characters only.
function isWhitespace (StringToCheck)
{
	var reWhitespace = /^\s+$/
    return (isEmpty(StringToCheck) || reWhitespace.test(StringToCheck));
}




// Returns the string after triming it.
function trimTheString(stringToTrim)
{
		
		var flag = true;
		var i = 0;
		if (isWhitespace(stringToTrim)==true)
			return "";
		while ((i < stringToTrim.length) && (flag)) {
			retChar = stringToTrim.charAt(i++);
			if (retChar != " ") flag = false;
		}
		if (flag) return "";
		var j = stringToTrim.length-1;
		flag = true;
		while ((j >= 0) && (flag)) {
			retChar = stringToTrim.charAt(j--);
			if (retChar != " ") flag = false;
		}
		if (flag) return "";
		stringToTrim = stringToTrim.substring(i-1,j+2);
		return stringToTrim;
}



//Checks for numeric value.
//it does not allow decimal;

function isInteger (StringToCheck)
{
   	var i;
   	var valid;
   	valid = true;
	var reInteger = /^\d+$/
	if (valid == true && isWhitespace(StringToCheck)) 
       	{
		alert("Field cannot be left blank");
		valid = false;
		return false;
	}
    if ( valid == true  && reInteger.test(StringToCheck) == false)
	{
		alert("Field should contain only numeric value");
		valid = false
		return false;
	}
    if (valid == true  && parseInt(StringToCheck) > 32767 )
	{
		alert("This value can not be more that 32767. please checkit");
		valid == false 
		return false;
	}
	return true;
}


function isLongInteger (StringToCheck)
{
   	var i;
   	var valid;
   	valid = true;
	var reInteger = /^\d+$/
	if (valid == true && isWhitespace(StringToCheck)) 
       	{
		alert("Field cannot be left blank");
		valid = false;
		return false;
	}
    if ( valid == true  && reInteger.test(StringToCheck) == false)
	{
		alert("Field should contain only numeric value");
		valid = false
		return false;
	}
	return true;
}





//Checks for numeric value.
//it allows decimal;

function isFloat (StringToCheck)

{   
	var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/	
	if (isWhitespace(StringToCheck)) 
       	{
		alert("Field cannot be left blank");
		return false;
	}       
	if (reFloat.test(StringToCheck) == false)
	{
		alert("Field should contain only numeric value");
		return false;
	}
    return true;
}




//Checks for numeric value.
//allows decimal. Allows + or - sign at the begining

function isSignedFloat (StringToCheck)

{   
	var reSignedFloat = /^(((\+|-)?\d+(\.\d*)?)|((\+|-)?(\d*\.)?\d+))$/	
	if (isWhitespace(StringToCheck)) 
       	{
		alert("Field cannot be left blank");
		return false;
	}       
	if (reSignedFloat.test(StringToCheck) == false)
	{
		alert("Field should contain only numeric value");
		return false;
	}

}




//Checks for numeric value.
//allows decimal. Allows + or - sign at the begining
//allows $ sign

function isSignedDollarFloat (StringToCheck)
{   
	var reSignedFloat = /^(((\+|-)\$?\d+(\.\d*)?)|((\+|-)\$?(\d*\.)?\d+))$/	
	if (isWhitespace(StringToCheck)) 
       	{
		alert("Field cannot be left blank");
		return false;
	}       
	if (reSignedFloat.test(StringToCheck) == false)
	{
		alert("Field should contain only numeric value");
		return false;
	}

}



//Checks for Alphbets, lower or upper case.
//allows decimal. Allows + or - sign at the begining
//allows $ sign

function isAlphaOnly (StringToCheck)
{   

	var reAlphabetic = /\d/;
	if (reAlphabetic.test(StringToCheck) == true)
	{
		alert("Field should not contain any numbers ");
		return false;
	}
	else
		return true;
}	


//Checks for Alphbets, lower or upper case.
//allows decimal. Allows + or - sign at the begining
//allows $ sign

function isAlphabetic (StringToCheck)
{   
	var reAlphabetic = /^[a-zA-Z]+$/;
	if (isWhitespace(StringToCheck)) 
       	{
		//alert("Field cannot be left blank");
		return false;
	}       
	if (reAlphabetic.test(StringToCheck) == false)
	{
		//alert("Field should contain only characters ");
		return false;
	}
}	





//Checks for Alphanumerics, lower or upper case.

function isAlphanumeric (StringToCheck)

{   var reAlphanumeric = /^[a-zA-Z0-9]+$/

    	if (isWhitespace(StringToCheck)) 
       	{
		alert("Field cannot be left blank");
		return false;
	}       
	if (reAlphanumeric.test(StringToCheck) == false)
	{
		alert("Field can contain digits and charecters value");
		return false;
	}
}




function xIsDate(ctr)
{
  if (ctr.value == "")
   {
   alert("Enter Date in (MM/DD/YYYY) or (M/D/YYYY) format");
   ctr.focus()
   return false;
	}
 if (ctr.value.length > 10)
    {
     alert("Date length cannot exceed 10 characters");
     ctr.focus()
     return false;
    }
     
if(ctr.value.length!=10 && ctr.value.length!=9 && ctr.value.length!=8)
{
   alert("Enter Date in (MM/DD/YYYY) or (M/D/YYYY) format");
   ctr.focus()
   return false;

}


if(ctr.value.length==10)
{
	 if ((ctr.value.charAt(2) != "../index.html") || (ctr.value.charAt(5) != "../index.html"))
     		{
		   alert("Enter Date in (MM/DD/YYYY) or (M/D/YYYY) format");
		   ctr.focus()
		   return false;
		}
	nummonth = ctr.value.charAt(0)+ctr.value.charAt(1)
	numday = ctr.value.charAt(3)+ctr.value.charAt(4)
	numyear = ctr.value.charAt(6)+ctr.value.charAt(7) + ctr.value.charAt(8)+ctr.value.charAt(9)
}

	if(ctr.value.length==8)
		{
			 if ((ctr.value.charAt(1) != "../index.html") || (ctr.value.charAt(3) != "../index.html"))
		     		{
		   alert("Enter Date in (MM/DD/YYYY) or (M/D/YYYY) format");
				   ctr.focus()
				   return false;
				}
			nummonth = ctr.value.charAt(0)
			numday = ctr.value.charAt(2)
			numyear = ctr.value.charAt(4)+ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)
		}	

if(ctr.value.length==9)
	{
		 if (((ctr.value.charAt(1) != "../index.html") || (ctr.value.charAt(4) != "../index.html")) &&((ctr.value.charAt(2) != "../index.html") || (ctr.value.charAt(4) != "../index.html")))
	     		{
		   alert("Enter Date in (MM/DD/YYYY) or (M/D/YYYY) format");
			   ctr.focus()
			   return false;
			}
		if (ctr.value.charAt(1)== "../index.html") 
			{
			nummonth = ctr.value.charAt(0)
			numday = ctr.value.charAt(2)+ctr.value.charAt(3)
			numyear =ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)+ ctr.value.charAt(8)
			}
		else
			{
			nummonth = ctr.value.charAt(0)+ctr.value.charAt(1)
			numday = ctr.value.charAt(3)
			numyear =ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)+ ctr.value.charAt(8)
			}
	}	



if (numyear.length < 4)
	 {
	  alert("Year format is YYYY")
	  return false;
	 }
	 
	if (!IsVal("Day value in date",numday))
	{
	 return false;
	}
	if (!IsVal("Month value in date",nummonth))
	{
	 return false;
	}
	if (!IsVal("Year value in date",numyear)) 
	{
	 return false;
	}
	day = parseInt(numday,10)
	month = parseInt(nummonth,10)
	year = parseInt(numyear,10)
        if (isNaN(day) || isNaN(month) || isNaN(year))
            {
		alert("Invalid Date");
		return false;
	    }
       
	if ((day < 0) || (month < 0) || (year < 0))
	{
		alert("Invalid character in Date");
		return false;
	}
	if ((day == 0) || (month == 0) || (year == 0))
	{
		alert("Invalid Date");
		return false;
	}
	   if (month > 12)
	  {
	   alert("Month can not be greater than 12");
	   return false;
	   }

	  if (day > 31 )
	   {
	     alert("Day can not be greater than 31")
	     return false;
	   }
	   if ((month==4)||(month==6)||(month==9)||(month==11))
	   {
	       if (day > 30 ) 
	       {
	        alert("Day can not be greater than 30")
	        return false;
	        }
	   }
	   if (month==2)
	    {
	      if  ((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) 
	          {
	            
	             if (day > 29)
	                {
	                 alert("Day can not be greater than 29 for a Leap Year")
	                  return false;
	                }        
	               
	           }  
	           else     
	            {
	                if (day > 28)
	                {
	                 alert("Day can not be greater than 28 for a non-leap year")
	                  return false;
	                 } 
	             }    
	        }  
	if (numyear < 1900)
	{
		alert("Year can not be less than 1900.");
		return false;
	}
	return true
	
}	

function isEmail(StringToCheck)
{
	
	var reEmail = /^.+\@.+\..+$/	
	var numstr =" ~`!#$%^&*()+=[{]}|\<>?,:';";    
	///~`!#$%^&*()+=[{]}|\<>?,:;'\"

	var ThisChar;
	
         
	
	StringToCheck=trimTheString(StringToCheck);
	for(var i=0;i<StringToCheck.length;i++)
	{
	j=i+1;
	ThisChar=StringToCheck.substring(i,j);
		if(numstr.indexOf(ThisChar)!= -1){		
			alert("Sorry, Special Character are Not allowed in this Field");
			return false;
			}
	}

	if (reEmail.test(StringToCheck) == false)
	{
		alert("Please enter Valid Email address");
		return false;
	}
	return true;
}
	
function ValidateZip(StringToCheck)
{
	 var FirstFive;
	 var LastFour;
	 var Dash;
	 var TempFieldValue;
	 var reInteger = /^\d+$/
     var stringToTrim
	 var flagObj = 0

	if ( StringToCheck.type == 'text' )
	{
		FieldValue=StringToCheck.value;
		flagObj = 1
	}
	else
		FieldValue=StringToCheck;

	FieldValue = trimTheString (FieldValue);

	 if(FieldValue=="")
	 {
		alert("Please specify a zip code.");
		return false;
	 }
	 TempFieldValue= new String(FieldValue);
	 
	if (TempFieldValue.length != 5 && TempFieldValue.length != 9 && TempFieldValue.length != 10)
	{
		alert("The zip code should be specified in NNNNN-NNNN format.");
		return false;
	}
//	 TempFieldValue.length==9 || 
	if (FieldValue.length==5)
	{
	 	if (reInteger.test(TempFieldValue) == false)
		{
			alert("Field should contain only numeric value");
			return false;
		}
	}
	// added
	if(TempFieldValue.length==9)
	{
		if (reInteger.test(TempFieldValue) == false)
		{
			alert("Field should contain only numeric value.");
			return false;
		}
		else
		{
			FirstFive=TempFieldValue.substr(0,5);
			LastFour=TempFieldValue.substr(5,4);
			if (isNaN(FirstFive)==true || isNaN(LastFour)==true)
			{
				alert("The zip code should be specified in NNNNN-NNNN format.");
				return false;
			}
			else //if(isInteger(FirstFive)==true && isInteger(LastFour)==true)(
			{
				TempFieldValue = FirstFive + "-" + LastFour;
			}
		}
	}
	// end of add

	if (TempFieldValue.length==10)
		{
			FirstFive=TempFieldValue.substr(0,5);
			LastFour=TempFieldValue.substr(6,4);
			Dash=TempFieldValue.substr(5,1);

			if (isIntegerNoMsg(FirstFive)==false || isIntegerNoMsg(LastFour)==false)
			{
				alert("The zip code should be specified in NNNNN-NNNN format.");
				return false;
			}
			if(Dash!="-")
			{
				alert("The Zip code should be specified in NNNNN-NNNN format.");
				return false;
			} 
		}
		if ( flagObj == 1)
		{
			StringToCheck.value = TempFieldValue;
		}
		return true;
	}	

// This function is used so that no internal messages are returned
function isIntegerNoMsg (StringToCheck)
{
   	var i;
   	var valid;
   	valid = true;
	var reInteger = /^\d+$/
	if (valid == true && isWhitespace(StringToCheck)) 
       	{
		alert("Field cannot be left blank");
		valid = false;
		return false;
	}
    if ( valid == true  && reInteger.test(StringToCheck) == false)
	{
		valid = false
		return false;
	}
    if (valid == true  && parseInt(StringToCheck) > 32767 )
	{
		valid == false 
		return false;
	}
	return true;
}

function Validate_Time(FieldValue)
 {

 var TempFieldValue;
 var TempHour;
 var TempMinute;
 var Devider;
 var reInteger = /^\d+$/
	
 FieldValue=trimTheString(FieldValue);
	
 TempFieldValue= new String(FieldValue)
 if (TempFieldValue.length<4 || TempFieldValue.length>5)
 {
 	alert("Invalid Time");
 	return false;
 }
	
 if (TempFieldValue.indexOf(".")!=-1)
 {
 	alert("The Time should be specified in HH:MM format.");
 	return false;
 }  
	
 if (TempFieldValue.length==5)
 {
 	Devider=TempFieldValue.substr(2,1);
 	if (Devider!=":")
 	{
 		alert("The Time should be specified in HH:MM format.");
 		return false;
 	}
		  
 }
	
 if (TempFieldValue.indexOf(":")==-1)
 {
 	TempHour=TempFieldValue.substr(0,2);
 	TempMinute=TempFieldValue.substr(2,2);
 }
 else
 {
 	TempHour=TempFieldValue.substr(0,2);
 	TempMinute=TempFieldValue.substr(3,2);
 }
	
 if (reInteger.test(TempHour) == false || reInteger.test(TempMinute) == false)
 //if (isNaN(TempHour)==true || isNaN(TempMinute)==true)
 {
 	alert("The Time should be specified in HH:MM format.");
 	return false;
 }
 else
 {
 	if (parseInt(TempHour)>23 || parseInt(TempHour)<0)
 	{
 		alert("The hour value should not exceed 23.");
 		return false;
 	}
 	if (parseInt(TempMinute)>59 || parseInt(TempMinute)<0)
 	{
 		alert("The minute value should not exceed 59.");
 		return false;
 	}	
 }
 return true
}

//Function ReplaceString
//By Shashidhar Rao. L
// Purpose : it will replace a charecter in a string with the given charecter
function ReplaceString(lstrString, lcharReplaceChar, lstrReplaceWith)
{
	if (lstrString == "" || lstrString == null)
	{
		return ""
	}
	else
	{
		var lintcounter, lintcurrLoc, retText, lintStringLength
		retText = ""
		for (lintcounter =0 ; lintcounter < lstrString.length; lintcounter++)
			if (lstrString.charAt(lintcounter) == lcharReplaceChar)
				retText = retText + lstrReplaceWith;
			else
				retText = retText + lstrString.charAt(lintcounter)
		return retText;
	}
}

function ReplaceAllDangerChars(lstrSourceString)
{
	if (lstrSourceString == "" || lstrSourceString == null)
		return ""
	else
	{
		var ReplacedString
		ReplacedString = ReplaceString(lstrSourceString, "'", "\'");
		ReplacedString = ReplaceString(ReplacedString, '"', '\"');
		return ReplacedString;
	}
}

// Function StripDash
// Added by Piyush
// Date added 05 Dec 2000
// Last modified 05 Dec 2000
// Purpose	This function will return the string with dashes removed

function StripDash(szSSNNo)
{
	var szStrippedSSN;
	var intCount;
	szStrippedSSN = "";
	var arrSSN;
	if (trimTheString(szSSNNo) != "")
	{
		arrSSN = szSSNNo.split("-");
		for(intCount = 0; intCount<arrSSN.length; intCount++)
		{
			szStrippedSSN = szStrippedSSN + arrSSN[intCount];
		}
	}
	return(szStrippedSSN);
}

// Fucntion FormatPhone
// Added by Piyush
// Date added 05 Dec 2000
// Last modified 05 Dec 2000
// Last modified 27 Sept 2001
// To validate alphabetic characters 
// updated by Chetan H
// Input Tel#, FormName, FieldName
// Purpose	To format the SSN # entered into actual SSN format

function FormatPhone(szPhoneNo,szFormName,szFieldName,szFormatOrNot)
{
	var arrSSN;
	var intCount;
	var szStrippedPhone;
	var FieldToStore;
	var strLength
	var strCharAtPos
	var strStrpPhoneNo
	
	if (szFormatOrNot != "")
	{
		szPhoneNo = trimTheString(szPhoneNo)
		strLength = szPhoneNo.length;
		
		szPhoneNo = trimTheString(szPhoneNo) ;
		
		strStrpPhoneNo = "";
	
		for (ctr=1; ctr <= strLength ; ctr++)
		{
			strCharAtPos = szPhoneNo.charAt(ctr-1)
			if(!((strCharAtPos=="(") || (strCharAtPos==")") || (strCharAtPos==" ") || (strCharAtPos=="-")))
			{
				strStrpPhoneNo = strStrpPhoneNo + strCharAtPos
			}
		}
		szPhoneNo = strStrpPhoneNo
		
		if (strLength > 7)
		{
			szStrippedPhone = StripDash(szPhoneNo);
			FirstPart = szStrippedPhone.substr(0,3)
			SecondPart = szStrippedPhone.substr(3,3)
			ThirdPart = szStrippedPhone.substr(6,4)
			if (!(isNaN(FirstPart) || isNaN(SecondPart) || isNaN(ThirdPart)))
			{	
				FullPhone = "(" + FirstPart + ")" + SecondPart + "-" + ThirdPart;
				eval('document.'+szFormName+'.'+szFieldName).value=FullPhone;
			}
			else
			{
				alert("Please Enter a numeric value")
				eval('document.'+szFormName+'.'+szFieldName).focus();
			}			
//			FullPhone = "(" + FirstPart + ")" + SecondPart + "-" + ThirdPart;
//			eval('document.'+szFormName+'.'+szFieldName).value=FullPhone;
		}
		
		if ((strLength)<=7 && (strLength)>3)
		{
			szStrippedPhone = StripDash(szPhoneNo);
			FirstPart = szStrippedPhone.substr(0,3)
			SecondPart = szStrippedPhone.substr(3,4)
			if(!(isNaN(FirstPart) || isNaN(SecondPart)))
			{
				FullPhone =  FirstPart + "-" + SecondPart;
				eval('document.'+szFormName+'.'+szFieldName).value=FullPhone;
			}
			else
			{
				alert("Please Enter a numeric value")			
				eval('document.'+szFormName+'.'+szFieldName).focus();
			}	
		//	FullPhone =  FirstPart + "-" + SecondPart;
		//	eval('document.'+szFormName+'.'+szFieldName).value=FullPhone;
		}
		
		if (strLength <=3)
		{
		
		eval('document.'+szFormName+'.'+szFieldName).value=szPhoneNo;
		}
	}
	
	else
	{
//		eval('document.'+szFormName+'.'+szFieldName).value=szPhoneNo;
		if(!(isNaN(StripDashAndBracket(szPhoneNo))))
		{
			eval('document.'+szFormName+'.'+szFieldName).value=szPhoneNo;
		}
		else
		{
			alert("Please Enter a numeric value")
			eval('document.'+szFormName+'.'+szFieldName).focus();
		}		
	}
}


// Fucntion FormatDate
// Added by Annal
// Date added 12 Jan 2001
// Last modified 12 Jan 2001
// Input Date, FormName, FieldName
// Purpose	To format the Date value

function FormatDate(szFormName,szFieldName)
{
	var strDate;
	var strDay;
	var strMonth;
	var strYear;
	
	var objVal;
	
	ObjVal =eval('document.'+szFormName+'.'+szFieldName);
	
	if (ObjVal.value=="")
	{
	   return true;
	}
	
	if (IsProperDate(ObjVal)==true)
		{
			// After coming out of 'IsProperDate' function if the date value contains '/' then 
			// it means that the value is of correct format. So this value is returned
			if (FindChar(ObjVal.value,"../index.html")==true)
			{
			  strDate = ObjVal.value;
			}
			else if (ObjVal.value.length == 8)
			{
				strDay   = ObjVal.value.charAt(0)+ObjVal.value.charAt(1)
				strMonth = ObjVal.value.charAt(2)+ObjVal.value.charAt(3)
				strYear  = ObjVal.value.charAt(4)+ObjVal.value.charAt(5)+ObjVal.value.charAt(6)+ObjVal.value.charAt(7)
	
				strDate  = strDay +"/"+ strMonth +"/"+ strYear
			}
			else if (ObjVal.value.length == 6)
			{
				strDay   = "0"+ ObjVal.value.charAt(0)
				strMonth = "0" + ObjVal.value.charAt(1)
				strYear  = ObjVal.value.charAt(2)+ObjVal.value.charAt(3)+ObjVal.value.charAt(4)+ObjVal.value.charAt(5)
	
				strDate  = strDay +"/"+ strMonth +"/"+ strYear
			}					
			ObjVal.value=strDate;
			
			return true;
		}
	else
		{
			ObjVal.focus();
			return false;
		}
}


// To find whether there is '/' character present in the date value.

function FindChar(strValue,strChar)
    {
		for(i=0;i<strValue.length;i++)
		{
			if (strValue.charAt(i)==strChar)
			{
				return true;
			}
		}
		return false;
    }
    
// To validate the date value (MM/DD/YYYY) or (M/D/YYYY) or (MMDDYYYY) or (MDYYYY) format
    
function IsProperDate(ctr)
   	{   		
			if (ctr.value.length > 10)
			{
			     alert("Date length cannot exceed 10 characters");
			     ctr.focus()
			     return false;
			}
			     
			if(ctr.value.length!=10 && ctr.value.length!=9 && ctr.value.length!=8 && ctr.value.length!=6)
			{
			   alert("Enter Date in (MM/DD/YYYY) or (M/D/YYYY) or (MMDDYYYY) or (MDYYYY) format");
			   ctr.focus()
			   return false;
			}


			if(ctr.value.length==10)
			{
				 if ((ctr.value.charAt(2) != "../index.html") || (ctr.value.charAt(5) != "../index.html"))
			     		{
					   alert("Enter Date in (MM/DD/YYYY) or (M/D/YYYY) or (MMDDYYYY) or (MDYYYY) format");
					   ctr.focus()
					   return false;
					}
				nummonth = ctr.value.charAt(0)+ctr.value.charAt(1)
				numday   = ctr.value.charAt(3)+ctr.value.charAt(4)
				numyear  = ctr.value.charAt(6)+ctr.value.charAt(7) + ctr.value.charAt(8)+ctr.value.charAt(9)
			}

			if(ctr.value.length==8)
			{
				if ((ctr.value.charAt(1) != "../index.html") || (ctr.value.charAt(3) != "../index.html"))
				{
				   
				   if (FindChar(ctr.value,"../index.html")==true)
				   {
						alert("Enter Date in (MM/DD/YYYY) or (M/D/YYYY) or (MMDDYYYY) or (MDYYYY) format");
						ctr.focus()
						return false;
				   }
				   else
				   {
						nummonth = ctr.value.charAt(0)+ctr.value.charAt(1)
						numday   = ctr.value.charAt(2)+ctr.value.charAt(3)
						numyear  = ctr.value.charAt(4)+ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)
				   }	
				}
				else
				{
					nummonth = ctr.value.charAt(0)
					numday   = ctr.value.charAt(2)
					numyear  = ctr.value.charAt(4)+ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)
				}	
			}	

			if(ctr.value.length==9)
			{
				if (((ctr.value.charAt(1) != "../index.html") || (ctr.value.charAt(4) != "../index.html")) &&((ctr.value.charAt(2) != "../index.html") || (ctr.value.charAt(4) != "../index.html")))
				{
				   alert("Enter Date in (MM/DD/YYYY) or (M/D/YYYY) or (MMDDYYYY) or (MDYYYY) format");
				   ctr.focus()
				   return false;
				}
				if (ctr.value.charAt(1)== "../index.html") 
				{
						nummonth = ctr.value.charAt(0)
						numday   = ctr.value.charAt(2)+ctr.value.charAt(3)
						numyear  = ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)+ ctr.value.charAt(8)
				}
				else
				{
						nummonth = ctr.value.charAt(0)+ctr.value.charAt(1)
						numday   = ctr.value.charAt(3)
						numyear  = ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)+ ctr.value.charAt(8)
				}
			}	
 
            if(ctr.value.length==6)
			{
				nummonth = ctr.value.charAt(0)
				numday   = ctr.value.charAt(1)
				numyear  = ctr.value.charAt(2)+ctr.value.charAt(3) + ctr.value.charAt(4)+ctr.value.charAt(5)
				
			}	


				if (numyear.length < 4)
				{
					alert("Year format is YYYY")
					return false;
				}
				 
				if (!IsVal("Day value in date",numday))
				{
					return false;
				}
				if (!IsVal("Month value in date",nummonth))
				{
					return false;
				}
				if (!IsVal("Year value in date",numyear)) 
				{
					return false;
				}
				day = parseInt(numday,10)
				month = parseInt(nummonth,10)
				year = parseInt(numyear,10)
			    if (isNaN(day) || isNaN(month) || isNaN(year))
			    {
					alert("Invalid Date");
					return false;
				}
			       
				if ((day < 0) || (month < 0) || (year < 0))
				{
					alert("Invalid character in Date");
					return false;
				}
				if ((day == 0) || (month == 0) || (year == 0))
				{
					alert("Invalid Date");
					return false;
				}
			    if (month > 12)
				{
				   alert("Month cannot be greater than 12");
				   return false;
				}

				if (day > 31 )
				{
				     alert("Day cannot be greater than 31")
				     return false;
				}
				if ((month==4)||(month==6)||(month==9)||(month==11))
				{
					if (day > 30 ) 
				    {
				        alert("Day cannot be greater than 30")
				        return false;
				    }
				}
				if (month==2)
				{
					if  ((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) 
				    {
						if (day > 29)
				        {
							alert("Day cannot be greater than 29 for a Leap Year")
				            return false;
				        }        
				               
				    }  
				    else     
				    {
				        if (day > 28)
				        {
							alert("Day cannot be greater than 28 for a non-leap year")
				            return false;
				        } 
				    }    
				}  
				if (numyear < 1900)
				{
					alert("Year cannot be less than 1900.");
					return false;
				}
				return true;
	}
   
   // End of Addition by Annal Ahmed
   
   		
	/*-------------------------------------------------------------------------------------------------------------
	Function Name      : RemoveChar()
	Author             : Tapas Ranjan Paul
	Purpose            : To remove the a particular character
	Creation Date      : 15/06/2001
	Last Modified Date : 
	---------------------------------------------------------------------------------------------------------------*/
			
	
	function RemoveChar(szUserValue,szChar)
	{
	   var szNewValue="";
	    var i=0; 
		 for(i=0;i<szUserValue.length;i=i+1)
	    { 
	     if (szUserValue.charAt(i)!=szChar)
			szNewValue = szNewValue + szUserValue.charAt(i)
	    }
	    return szNewValue;
	}
/*------------------------------------------------------------------------------------------------------------------------------
	Function Name      : FormatFieldAsMoney()
	Author             : Shweta Sharma
	Purpose            : To format money field
	Creation Date      : 11/25/2002
-------------------------------------------------------------------------------------------------------------------------------*/
	function FormatFieldAsMoney(szFormName,szFieldName) 
	{
		//this function converts the number in its nearest integer value and adds .00  at the ends
		var szMoneyVal;
		var NumberValue,ReturnValue;
		szMoneyVal=eval('document.'+szFormName+'.'+szFieldName).value;
		if (isNaN(szMoneyVal)){
			ReturnValue="0.00"
		}
		else
		{
			NumberValue=Math.round(szMoneyVal*Math.pow(10,0))/Math.pow(10,0);	
			ReturnValue=NumberValue + "." + "00"
		}
		eval('document.'+szFormName+'.'+szFieldName).value=ReturnValue;
	}			
/*-------------------------------------------------------------------------------------------------------------
Function Name      : FormatDollar()
Author             : Tapas Ranjan Paul
Purpose            : To format dollar fields 
Creation Date      : 15/06/2001
Last Modified Date : 
---------------------------------------------------------------------------------------------------------------*/
function FormatDollar(szFormName,szFieldName,NumbertoChange,strChar)
{
	var lintLoopCounter, decimalLocation
	var afterDecimal, beforeDecimal, revString = "", commaString = "", lstrFinal = ""; 
	var ReturnString
	if (FindChar(NumbertoChange,",") == false)
	{	decimalLocation = NumbertoChange.indexOf(".");
		//alert(decimalLocation)
		if (decimalLocation == "-1" )
			decimalLocation = NumbertoChange.length
		afterDecimal = NumbertoChange.substr(decimalLocation+1)
		beforeDecimal = NumbertoChange.substr(0,decimalLocation)
	
		for (lintLoopCounter=beforeDecimal.length-1; lintLoopCounter >= 0 ; lintLoopCounter--)
			revString = revString + beforeDecimal.charAt(lintLoopCounter)
	
		for (lintLoopCounter=0; lintLoopCounter <= revString.length-1 ; lintLoopCounter+=3 )
			commaString = commaString + revString.substr(lintLoopCounter, 3) + ","

		if (commaString.charAt(commaString.length-1) == "," )
			commaString = commaString.substr(0, commaString.length-1)

		revString = commaString;
		lstrFinal = ""
		for (lintLoopCounter=revString.length-1; lintLoopCounter >= 0 ; lintLoopCounter--)
			lstrFinal = lstrFinal + revString.charAt(lintLoopCounter)
	
		if (trimTheString(afterDecimal) == "" )
			ReturnString = lstrFinal
		else
			ReturnString = lstrFinal + "." + afterDecimal
			
		//alert(ReturnString);
		//return (ReturnString);
		//obj.value = ReturnString;
		//document.ObjForm.objField.value = ReturnString; 
		eval('document.'+szFormName+'.'+szFieldName).value=ReturnString;
	}
	else
	{
		eval('document.'+szFormName+'.'+szFieldName).value=NumbertoChange;		
	}	
} 

/*----------------------------------------------------------------------
Function Name           : ShowPopup(url, winname, width, height) 
Parameters				: url - the url of the popup window
						  winname - name of the popup window
						  width - width of the popup window
						  height - height of the popup window
Author                  : R Sham
Purpose                 : Loading the popup window in the center of the screen.
			
Creation Date           : 12 June 2001
Last Modified Date      : 12 June 2001
------------------------------------------------------------------------*/
function ShowPopup(url, winname, width, height) 
{
	var MyURL = url;
	var MyWindowName = winname;
	var MyWidth = width;
	var MyHeight = height;
	var MyScrollBars = 'Yes';
	var MyResizable = 'Yes';
	var MyMenuBar = 'No';
	var MyToolBar = 'No';
	var MyStatusBar = 'No';

	    if (document.all)
	        var xMax = screen.width, yMax = screen.height;
	    else
	        if (document.layers)
	            var xMax = window.outerWidth, yMax = window.outerHeight;
	        else
	            var xMax = 640, yMax=480;

	    var xOffset = (xMax - MyWidth)/2, yOffset = (yMax - MyHeight)/2;


		window.open(MyURL,MyWindowName,'width=' + MyWidth + ',height=' + MyHeight + ',screenX= ' + xOffset + ',screenY=' + yOffset + ',top=' + yOffset + ',left=' + xOffset + ',scrollbars=' + MyScrollBars + ',resizable=' + MyResizable + ',menubar=' + MyMenuBar + ',toolbar=' + MyToolBar + ',status=' + MyStatusBar + '');
}

function ValidateCanadaZipCode(stringToCheck)
{
	//Correct format is ANA NAN - where A is Alphabate and N is Number.
	var intValid = 0;
	var first3chars, last3chars;
	var reAlphabetic = /^[a-zA-Z]/;
	
	first3chars = stringToCheck.substr(0,3);
	last3chars = stringToCheck.substr(4,3);
	if (stringToCheck.length != 7 && intValid == 0)
	{
		intValid = 1;	//length <> 7
	}
	else if(stringToCheck.substr(3,1) != " " && intValid == 0)
	{
		intValid = 1;	//no space in b/w
	}
	else if (isNaN(stringToCheck.substr(1,1))||isNaN(stringToCheck.substr(4,1))||isNaN(stringToCheck.substr(6,1)))
	{
		intValid = 1; //char at N position are not number.
	}
	else if (reAlphabetic.test(stringToCheck.substr(0,1)) == false || reAlphabetic.test(stringToCheck.substr(2,1)) == false ||reAlphabetic.test(stringToCheck.substr(5,1)) == false)
	{
		intValid = 1;
	}
	
	if (intValid == 1)
	{
		alert ("The zip-code should be specified in ANA NAN format.");
		return false;
	}
	else
	{
		return true;
	}

}

function nmIsDate(ctr)
{
 
  if (ctr.value == "")
   {
   return false;
	}
 if (ctr.value.length > 10)
    {
     return false;
    }
     
if(ctr.value.length!=10 && ctr.value.length!=9 && ctr.value.length!=8)
{
   return false;
}


if(ctr.value.length==10)
{
	 if ((ctr.value.charAt(2) != "../index.html") || (ctr.value.charAt(5) != "../index.html"))
     		{
		   return false;
		}
	nummonth = ctr.value.charAt(0)+ctr.value.charAt(1)
	numday = ctr.value.charAt(3)+ctr.value.charAt(4)
	numyear = ctr.value.charAt(6)+ctr.value.charAt(7) + ctr.value.charAt(8)+ctr.value.charAt(9)
}

	if(ctr.value.length==8)
		{
			 if ((ctr.value.charAt(1) != "../index.html") || (ctr.value.charAt(3) != "../index.html"))
		     		{
				   return false;
				}
			nummonth = ctr.value.charAt(0)
			numday = ctr.value.charAt(2)
			numyear = ctr.value.charAt(4)+ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)
		}	

if(ctr.value.length==9)
	{
		 if (((ctr.value.charAt(1) != "../index.html") || (ctr.value.charAt(4) != "../index.html")) &&((ctr.value.charAt(2) != "../index.html") || (ctr.value.charAt(4) != "../index.html")))
	     		{
			   return false;
			}
		if (ctr.value.charAt(1)== "../index.html") 
			{
			nummonth = ctr.value.charAt(0)
			numday = ctr.value.charAt(2)+ctr.value.charAt(3)
			numyear =ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)+ ctr.value.charAt(8)
			}
		else
			{
			nummonth = ctr.value.charAt(0)+ctr.value.charAt(1)
			numday = ctr.value.charAt(3)
			numyear =ctr.value.charAt(5) + ctr.value.charAt(6)+ctr.value.charAt(7)+ ctr.value.charAt(8)
			}
	}	



if (numyear.length < 4)
	 {
	  return false;
	 }
	 
	if (!IsVal("Day value in date",numday))
	{
	 return false;
	}
	if (!IsVal("Month value in date",nummonth))
	{
	 return false;
	}
	if (!IsVal("Year value in date",numyear)) 
	{
	 return false;
	}
	day = parseInt(numday,10)
	month = parseInt(nummonth,10)
	year = parseInt(numyear,10)
        if (isNaN(day) || isNaN(month) || isNaN(year))
            {
		return false;
	    }
       
	if ((day < 0) || (month < 0) || (year < 0))
	{
		return false;
	}
	if ((day == 0) || (month == 0) || (year == 0))
	{
		return false;
	}
	   if (month > 12)
	  {
	   return false;
	   }

	  if (day > 31 )
	   {
	     return false;
	   }
	   if ((month==4)||(month==6)||(month==9)||(month==11))
	   {
	       if (day > 30 ) 
	       {
	        return false;
	        }
	   }
	   if (month==2)
	    {
	      if  ((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) 
	          {
	            
	             if (day > 29)
	                {
	                  return false;
	                }        
	               
	           }  
	           else     
	            {
	                if (day > 28)
	                {
	                  return false;
	                 } 
	             }    
	        }  
	if (numyear < 1900)
	{
		return false;
	}
	return true;	
}	


/*------------------------------------------------------------------------------------------------------------------------------
	Function Name      : fnShowFraudDisclaimer()
	Author             : Aman Gulyani
	Purpose            : Show the Fraud Disclaimer Statement
	Creation Date      : 11/25/2002
-------------------------------------------------------------------------------------------------------------------------------*/
function fnShowFraudDisclaimer(ClientID, RequestID, RequestVerID)
{
	var sURL="FraudDisclaimerda8a.html?hidClientId="+ClientID+"&hidRequestID="+RequestID+"&hidRequestVerID="+RequestVerID;
	ShowPopup(sURL, "FraudDisclaimer", "600", "300")
}

function fnShowFraud(ClientID, RequestID, RequestVerID)
{
	var sURL="../GetAQuote/FraudDisclaimerda8a.html?hidClientId="+ClientID+"&hidRequestID="+RequestID+"&hidRequestVerID="+RequestVerID+"&CalledFrom=Quote";
	ShowPopup(sURL, "FraudDisclaimer", "600", "300")
}

function GenCode(NameObj, CodeObj)
{
	if (trimTheString(NameObj.value) != "" && trimTheString(CodeObj.value) == "")
	{
		var lstrSource, lstrCode, lintFirstSpace, lstrFirstWord, lstrSecondWord;
		lstrSource = new String(trimTheString(NameObj.value));
		lintFirstSpace = lstrSource.indexOf(" ");
		if ( lintFirstSpace >=2 && (lstrSource.length - lintFirstSpace) > 2)
		{
			lstrFirstWord  = lstrSource.substring(0,lintFirstSpace);
			lstrSecondWord  = lstrSource.substring(lintFirstSpace+1, lstrSource.length);
			lstrCode = lstrFirstWord.substring(0,2) + lstrSecondWord.substring(0,2);
			lstrCode = lstrCode.toUpperCase();
		}
		else
		{
			if (lintFirstSpace >= 4 || lintFirstSpace == -1)
				lstrCode = lstrSource.substring(0,4);
			else
				lstrCode = trimTheString(lstrSource.substring(0,2)) + "01";
		}
		CodeObj.value = lstrCode;
	}
}

function checkCountry_OUS()
{
    var countryIndex = document.forms(0).ddCOUNTRY.options.selectedIndex;
    var countryCode = document.forms(0).ddCOUNTRY.options(countryIndex).value;
	if (countryCode == "OS")
	{
		validatorEnabled(rfvSTATE_OUS, true);
		document.forms(0).txtSTATE_OUS.disabled = false
	}
	else
	{
		validatorEnabled(rfvSTATE_OUS, false);
		document.forms(0).txtSTATE_OUS.disabled = true
	}
}

function checkState_OUS()
{
    var stateIndex = document.forms(0).ddSTATE_OS.options.selectedIndex;
    var stateCode = document.forms(0).ddSTATE_OS.options(stateIndex).value;

	if (stateCode == "OS")
	{
		validatorEnabled(rfvSTATE_OUS, true);
		document.forms(0).txtSTATE_OUS.disabled = false;
		document.forms(0).txtSTATE_OUS.focus();
	}
	else
	{
		validatorEnabled(rfvSTATE_OUS, false);
		document.forms(0).txtSTATE_OUS.disabled = true;
	}
}

function checkState_OUS_Life()
{
    var stateIndex = document.forms(0).ddSTATE_OS.options.selectedIndex;
    var stateCode = document.forms(0).ddSTATE_OS.options(stateIndex).value;

	if (stateCode == "OS")
	{
		document.getElementById("trSTATE_OUS").style.display = "block";
		validatorEnabled(rfvSTATE_OUS, true);
		document.forms(0).txtSTATE_OUS.disabled = false;
	}
	else
	{
		document.getElementById("trSTATE_OUS").style.display = "none";
		validatorEnabled(rfvSTATE_OUS, false);
		document.forms(0).txtSTATE_OUS.disabled = true;
	}
}

function checkMailState_OUS()
{
    var stateIndex = document.forms(0).ddMAIL_STATE_OS.options.selectedIndex;
    var stateCode = document.forms(0).ddMAIL_STATE_OS.options(stateIndex).value;

	if (stateCode == "OS")
	{
		document.forms(0).txtMAIL_STATE_OUS.disabled = false;
		document.forms(0).txtMAIL_STATE_OUS.focus();
	}
	else
	{
		document.forms(0).txtMAIL_STATE_OUS.disabled = true;
	}
}

function checkState_OUS_GAQ(pstrAddressType)
{
	switch(pstrAddressType)
	{
	case "LOCATION":
		var stateIndex = document.forms(0).ddSTATE.options.selectedIndex;
		var stateCode = document.forms(0).ddSTATE.options(stateIndex).value;
		if (stateCode == "OS")
		{
			document.forms(0).txtSTATE_OUS.disabled = false;
			document.forms(0).txtSTATE_OUS.focus();
		}
		else
		{
			document.forms(0).txtSTATE_OUS.disabled = true;
		}
		break;

	case "MAIL":
		var stateIndex = document.forms(0).ddMAIL_STATE.options.selectedIndex;
		var stateCode = document.forms(0).ddMAIL_STATE.options(stateIndex).value;
		if (stateCode == "OS")
		{
			document.forms(0).txtMAIL_STATE_OUS.disabled = false;
			document.forms(0).txtMAIL_STATE_OUS.focus();
		}
		else
		{
			document.forms(0).txtMAIL_STATE_OUS.disabled = true;
		}
		break;
	}
}

function setState_OS()
{
	validatorEnabled(rfvSTATE_OUS, true);
	document.forms(0).txtSTATE_OUS.disabled = false;
	document.forms(0).txtSTATE_OUS.focus();
}

function setState_CA_US()
{
	validatorEnabled(rfvSTATE_OUS, false);
	document.forms(0).txtSTATE_OUS.disabled = true;
}

function setMailState_Dropdown(pbooStateOUS, pbooDealerSearch)
{
    var intIndex = document.forms(0).ddMAIL_COUNTRY.options.selectedIndex;
    var strCountry = document.forms(0).ddMAIL_COUNTRY.options(intIndex).value;

	if (pbooStateOUS == "true")
	{
		validatorEnabled(rfvMAIL_STATE_OUS, false);
		document.forms(0).txtMAIL_STATE_OUS.disabled = true;
	}

	switch(strCountry)
	{
	case "CA":
        document.forms(0).ddMAIL_STATE_CA.style.width = "80%";
		document.forms(0).ddMAIL_STATE_CA.selectedIndex = 0;
        
        document.forms(0).ddMAIL_STATE_OS.style.width = "0";
		document.forms(0).ddMAIL_STATE_OS.selectedIndex = 0;
        
        document.forms(0).ddMAIL_STATE_US.style.width = "0";
		document.forms(0).ddMAIL_STATE_US.selectedIndex = 0;
		
		if (pbooDealerSearch == "false")
		{
			document.all["rfvMAIL_STATE"].controltovalidate="ddMAIL_STATE_CA";
		}
		else
		{
			document.forms(0).ddSTATE.style.width = "0";
			document.forms(0).ddSTATE.selectedIndex = 0;
		}
		break;

	case "OS":
        document.forms(0).ddMAIL_STATE_CA.style.width = "0";
		document.forms(0).ddMAIL_STATE_CA.selectedIndex = 0;

        document.forms(0).ddMAIL_STATE_OS.style.width = "80%";
		document.forms(0).ddMAIL_STATE_OS.selectedIndex = 0;

        document.forms(0).ddMAIL_STATE_US.style.width = "0";
		document.forms(0).ddMAIL_STATE_US.selectedIndex = 0;
		
		if (pbooDealerSearch == "false")
		{
			document.all["rfvMAIL_STATE"].controltovalidate="ddMAIL_STATE_OS";
		}
		else
		{
			document.forms(0).ddSTATE.style.width = "0";
			document.forms(0).ddSTATE.selectedIndex = 0;
		}
		break;

	case "US":
        document.forms(0).ddMAIL_STATE_CA.style.width = "0";
		document.forms(0).ddMAIL_STATE_CA.selectedIndex = 0;

        document.forms(0).ddMAIL_STATE_OS.style.width = "0";
		document.forms(0).ddMAIL_STATE_OS.selectedIndex = 0;

        document.forms(0).ddMAIL_STATE_US.style.width = "80%";
		document.forms(0).ddMAIL_STATE_US.selectedIndex = 0;
		
		if (pbooDealerSearch == "false")
		{
			document.all["rfvMAIL_STATE"].controltovalidate="ddMAIL_STATE_US";
		}
		else
		{
			document.forms(0).ddSTATE.style.width = "0";
			document.forms(0).ddSTATE.selectedIndex = 0;
		}
		break;
	}
}

function setState_Dropdown(pbooStateOUS, pbooDealerSearch)
{
    var intIndex = document.forms(0).ddCOUNTRY.options.selectedIndex;
    var strCountry = document.forms(0).ddCOUNTRY.options(intIndex).value;

	if (pbooStateOUS == "true")
	{
		validatorEnabled(rfvSTATE_OUS, false);
		document.forms(0).txtSTATE_OUS.disabled = true;
	}

	switch(strCountry)
	{
	case "CA":
        document.forms(0).ddSTATE_CA.style.width = "80%";
		document.forms(0).ddSTATE_CA.selectedIndex = 0;
        
        document.forms(0).ddSTATE_OS.style.width = "0";
		document.forms(0).ddSTATE_OS.selectedIndex = 0;
        
        document.forms(0).ddSTATE_US.style.width = "0";
		document.forms(0).ddSTATE_US.selectedIndex = 0;
		
		if (pbooDealerSearch == "false")
		{
			document.all["rfvSTATE"].controltovalidate="ddSTATE_CA";
		}
		else
		{
			document.forms(0).ddSTATE.style.width = "0";
			document.forms(0).ddSTATE.selectedIndex = 0;
		}
		break;

	case "OS":
        document.forms(0).ddSTATE_CA.style.width = "0";
		document.forms(0).ddSTATE_CA.selectedIndex = 0;

        document.forms(0).ddSTATE_OS.style.width = "80%";
		document.forms(0).ddSTATE_OS.selectedIndex = 0;

        document.forms(0).ddSTATE_US.style.width = "0";
		document.forms(0).ddSTATE_US.selectedIndex = 0;
		
		if (pbooDealerSearch == "false")
		{
			document.all["rfvSTATE"].controltovalidate="ddSTATE_OS";
		}
		else
		{
			document.forms(0).ddSTATE.style.width = "0";
			document.forms(0).ddSTATE.selectedIndex = 0;
		}
		break;

	case "US":
        document.forms(0).ddSTATE_CA.style.width = "0";
		document.forms(0).ddSTATE_CA.selectedIndex = 0;

        document.forms(0).ddSTATE_OS.style.width = "0";
		document.forms(0).ddSTATE_OS.selectedIndex = 0;

        document.forms(0).ddSTATE_US.style.width = "80%";
		document.forms(0).ddSTATE_US.selectedIndex = 0;

		
		if (pbooDealerSearch == "false")
		{
			document.all["rfvSTATE"].controltovalidate="ddSTATE_US";
		}
		else
		{
			document.forms(0).ddSTATE.style.width = "0";
			document.forms(0).ddSTATE.selectedIndex = 0;
		}
		break;
	}
	
	if (pbooDealerSearch == "false")
	{
		validatorEnabled(rfvSTATE, true);
	}
}

function UpdateBirthdate()
{
    document.forms(0).txtBIRTH_DATE.value = document.forms(0).txtBIRTH_MONTH.value + "/" + document.forms(0).txtBIRTH_DAY.value + "/" +document.forms(0).txtBIRTH_YEAR.value;

	var sDate = new Date();
	var dteCurrentDate = String(Number(sDate.getMonth()) + 1) + "/" + sDate.getDate() + "/" + sDate.getFullYear();								
	if (parseFloat(Date.parse(dteCurrentDate)) < parseFloat(Date.parse(document.forms(0).txtBIRTH_DATE.value)) )
	{
		document.getElementById("lblError").innerText = "The Date of Birth should be less than today's date.";
		document.forms(0).txtBIRTH_DATE.value = "";
		document.forms(0).txtBIRTH_MONTH.value = "";
		document.forms(0).txtBIRTH_DAY.value = "";
		document.forms(0).txtBIRTH_YEAR.value = "";
		document.forms(0).txtBIRTH_MONTH.focus();
	}
	else
	{
		document.getElementById("lblError").innerText = "";
	}
}

function setReferralLabel_Old()
{
    var intIndex = document.forms(0).ddREFERRAL_TYPE.options.selectedIndex;
    var strReferral = document.forms(0).ddREFERRAL_TYPE.options(intIndex).text;
	if (intIndex <= 0)
	{
		document.getElementById("lblREFERRAL_NAME_Label").innerText = "";
		document.forms(0).txtREFERRAL_NAME.style.display = "none";
	}
	else
	{
		document.getElementById("lblREFERRAL_NAME_Label").innerText = "Which " + strReferral + "?";
		document.forms(0).txtREFERRAL_NAME.style.display = "block";
		document.forms(0).txtREFERRAL_NAME.focus();
	}
}

function setReferralLabel()
{
    var intIndex = document.forms(0).ddREFERRAL_TYPE.options.selectedIndex;
    var strReferral = document.forms(0).ddREFERRAL_TYPE.options(intIndex).text;
	var strUCReferral = strReferral.toUpperCase();
	
	if (intIndex <= 0)
	{
        document.forms(0).ddREFERRAL_ASSOCIATION.selectedIndex = 0;
		document.forms(0).ddREFERRAL_ASSOCIATION.style.display = "none";
        document.forms(0).ddTRADE_SHOW.selectedIndex = 0;
		document.forms(0).ddTRADE_SHOW.style.display = "none";
        document.forms(0).ddPRINT_AD.selectedIndex = 0;
		document.forms(0).ddPRINT_AD.style.display = "none";
		document.getElementById("lblREFERRAL_NAME_Label").innerText = "";
		document.forms(0).txtREFERRAL_NAME.style.display = "none";
	}
	else
	{
		if (strReferral == "Internet")
		{
			document.getElementById("lblREFERRAL_NAME_Label").innerText = "Which site?";
		}
		else
		{
			document.getElementById("lblREFERRAL_NAME_Label").innerText = "Which " + strReferral + "?";
		}
		document.forms(0).ddREFERRAL_ASSOCIATION.selectedIndex = 0;
		document.forms(0).ddTRADE_SHOW.selectedIndex = 0;
		document.forms(0).ddPRINT_AD.selectedIndex = 0;

		document.forms(0).ddREFERRAL_ASSOCIATION.style.display = "none";
		document.forms(0).ddTRADE_SHOW.style.display = "none";
		document.forms(0).ddPRINT_AD.style.display = "none";
		document.forms(0).txtREFERRAL_NAME.style.display = "block";

		switch(strUCReferral)
		{
		case "ASSOCIATION":
			document.forms(0).ddREFERRAL_ASSOCIATION.style.display = "block";
			document.forms(0).ddTRADE_SHOW.style.display = "none";
			document.forms(0).ddPRINT_AD.style.display = "none";
			document.forms(0).txtREFERRAL_NAME.style.display = "none";
			document.forms(0).ddREFERRAL_ASSOCIATION.style.width = "250px";
			break;

		case "TRADE SHOW":
			document.forms(0).ddREFERRAL_ASSOCIATION.style.display = "none";
			document.forms(0).ddTRADE_SHOW.style.display = "block";
			document.forms(0).ddPRINT_AD.style.display = "none";
			document.forms(0).txtREFERRAL_NAME.style.display = "none";
			document.forms(0).ddTRADE_SHOW.style.width = "250px";
			break;

		case "PRINT AD":
			document.forms(0).ddREFERRAL_ASSOCIATION.style.display = "none";
			document.forms(0).ddTRADE_SHOW.style.display = "none";
			document.forms(0).ddPRINT_AD.style.display = "block";
			document.forms(0).txtREFERRAL_NAME.style.display = "none";
			document.forms(0).ddPRINT_AD.style.width = "250px";
			break;

		default:
			document.forms(0).ddREFERRAL_ASSOCIATION.style.display = "none";
			document.forms(0).ddTRADE_SHOW.style.display = "none";
			document.forms(0).ddPRINT_AD.style.display = "none";
			document.forms(0).txtREFERRAL_NAME.style.display = "block";
			document.forms(0).txtREFERRAL_NAME.style.width = "95%";
			break;
		}
	}
}

function checkZipCode(strZip)
{
    var intIndex = document.forms(0).ddCOUNTRY.options.selectedIndex;
    var strCountry = document.forms(0).ddCOUNTRY.options(intIndex).value;

	switch(strCountry)
	{
	case "CA":
		ValidateCanadaZipCode(strZip);
		break;

	case "US":
		ValidateZip(strZip);
		break;
	}
}

function moveEntries(objFrom, objTo)
{
	var t = objTo.length
	for(var f = objFrom.length - 1; f > 0; f--)	{
		if (objFrom.options[f].selected == true) {
			objTo.options[t] = new Option(objFrom.options[f].text, objFrom.options[f].value);
			objFrom.options[f] = null;
			t += 1;
		}
	}
}

function setCustomerType()
{
    var intIndex = document.forms(0).ddCUSTOMER_TYPE.options.selectedIndex;
    var strCustomerType = document.forms(0).ddCUSTOMER_TYPE.options(intIndex).text;
	var strUCCustomerType = strCustomerType.toUpperCase();

	if (strUCCustomerType == "INDIVIDUAL")
	{
		document.getElementById("trNameOfOwnerPrincipal").style.display = "none";
		document.getElementById("trNameOfOwnerPrincipalBottom").style.display = "none";
		document.getElementById("trORGANIZATION_NAME").style.display = "none";
		document.getElementById("tcDATE_OF_BIRTH").innerHTML = "Date of Birth:<IMG height=9 src='images/mandatory.gif' width=9 border=0>";
	}
	else
	{
		document.getElementById("trNameOfOwnerPrincipal").style.display = "block";
		document.getElementById("trNameOfOwnerPrincipalBottom").style.display = "block";
		document.getElementById("trORGANIZATION_NAME").style.display = "block";
		document.getElementById("tcDATE_OF_BIRTH").innerHTML = "Business Start Date:<IMG height=9 src='images/mandatory.gif' width=9 border=0>";
	}
}

function copyInstrumentAddress()
{
	if (document.forms(0).chkCopyAddress.checked)
	{
		document.forms(0).txtADDRESS1.value = document.forms(0).txtMAIL_ADDRESS1.value;
		document.forms(0).txtADDRESS2.value = document.forms(0).txtMAIL_ADDRESS2.value;
		document.forms(0).txtCITY.value = document.forms(0).txtMAIL_CITY.value;
		document.forms(0).txtZIP.value = document.forms(0).txtMAIL_ZIP.value;
		document.forms(0).ddCOUNTRY.options.selectedIndex = document.forms(0).ddMAIL_COUNTRY.options.selectedIndex;
		document.forms(0).ddSTATE_CA.options.selectedIndex = document.forms(0).ddMAIL_STATE_CA.options.selectedIndex;
		document.forms(0).ddSTATE_OS.options.selectedIndex = document.forms(0).ddMAIL_STATE_OS.options.selectedIndex;
		document.forms(0).ddSTATE_US.options.selectedIndex = document.forms(0).ddMAIL_STATE_US.options.selectedIndex;
		document.forms(0).txtSTATE_OUS.value = document.forms(0).txtMAIL_STATE_OUS.value;
	}
	else
	{
		document.forms(0).txtADDRESS1.value = "";
		document.forms(0).txtADDRESS2.value = "";
		document.forms(0).txtCITY.value = "";
		document.forms(0).txtZIP.value = "";
		document.forms(0).ddCOUNTRY.options.selectedIndex = -1;
		document.forms(0).ddSTATE_CA.options.selectedIndex = -1;
		document.forms(0).ddSTATE_OS.options.selectedIndex = -1;
		document.forms(0).ddSTATE_US.options.selectedIndex = -1;
		document.forms(0).txtSTATE_OUS.value = "";
	}
}

function copyInstrumentAddress_Old()
{
	if (document.forms(0).chkCopyAddress.checked)
	{
		document.forms(0).txtMAIL_ADDRESS1.value = document.forms(0).txtADDRESS1.value;
		document.forms(0).txtMAIL_ADDRESS2.value = document.forms(0).txtADDRESS2.value;
		document.forms(0).txtMAIL_CITY.value = document.forms(0).txtCITY.value;
		document.forms(0).txtMAIL_ZIP.value = document.forms(0).txtZIP.value;
		document.forms(0).ddMAIL_COUNTRY.options.selectedIndex = document.forms(0).ddCOUNTRY.options.selectedIndex;
		document.forms(0).ddMAIL_STATE_CA.options.selectedIndex = document.forms(0).ddSTATE_CA.options.selectedIndex;
		document.forms(0).ddMAIL_STATE_OS.options.selectedIndex = document.forms(0).ddSTATE_OS.options.selectedIndex;
		document.forms(0).ddMAIL_STATE_US.options.selectedIndex = document.forms(0).ddSTATE_US.options.selectedIndex;
		document.forms(0).txtMAIL_STATE_OUS.value = document.forms(0).txtSTATE_OUS.value;
	}
	else
	{
		document.forms(0).txtMAIL_ADDRESS1.value = "";
		document.forms(0).txtMAIL_ADDRESS2.value = "";
		document.forms(0).txtMAIL_CITY.value = "";
		document.forms(0).txtMAIL_ZIP.value = "";
		document.forms(0).ddMAIL_COUNTRY.options.selectedIndex = -1;
		document.forms(0).ddMAIL_STATE_CA.options.selectedIndex = -1;
		document.forms(0).ddMAIL_STATE_OS.options.selectedIndex = -1;
		document.forms(0).ddMAIL_STATE_US.options.selectedIndex = -1;
		document.forms(0).txtMAIL_STATE_OUS.value = "";
	}
}

function confirmAction(strText, strOKAction, strCancelAction) 
{
	return confirm(strText + " \n\nClick  ''OK''  " + strOKAction + "\nClick  ''Cancel'' " + strCancelAction + ".\n");
}

function checkElectronicSignature()
{
	if (document.forms(0).rblELECTRONIC_SIGNATURE_0.checked) {
		document.forms(0).btnSubmit.disabled = false;
	}
	else {
		document.forms(0).btnSubmit.disabled = true;
	}
}

function attachFiles() 
{
	var booExists = false;
	for(var i = document.forms(0).lstAttachments.length - 1; i > -1; i--)	{
		if (document.forms(0).lstAttachments.options[i].text == document.forms(0).txtAttachmentFilePath.value) {
			booExists = true;
		}
	}

	if (booExists == false) {
		var l = document.forms(0).lstAttachments.length
		document.forms(0).lstAttachments.options[l] = new Option(document.forms(0).txtAttachmentFilePath.value, "");
	}
	else {
		alert("The file ''" + document.forms(0).txtAttachmentFilePath.value + "'' has already been attached.\nPlease choose another file to attach.");
	}
}

function enableAttach() 
{
	document.forms(0).btnAttach.disabled = false;
}

function unattachFiles() 
{
	for(var i = document.forms(0).lstAttachments.length - 1; i > -1; i--)	{
		if (document.forms(0).lstAttachments.options[i].selected == true) {
			document.forms(0).lstAttachments.options[i] = null;
		}
	}
}

function showModalConfirmation( pstrmessage )
{
	var MyArgs = window.showModalDialog("confirmationpopup.aspx?msg=pstrmessage","wndconfirmationpopup", "dialogHeight:220px;dialogWidth:300px");
}

function checkStateDropdown(control)
{
    var intIndex = control.options.selectedIndex;
    var strState = control.options(intIndex).value;
    var strStateName = control.options(intIndex).text;
    var strErrIndName = "lbl"+control.name+"_Err";
	if (strState == "INVALID")
	{
		document.getElementById("lblError").innerHTML = "'" + strStateName + "' is an invalid state selection.";
		document.getElementById(strErrIndName).innerHTML = "<IMG height=9 src='images/mandatory.gif' width=9 border=0>";
		control.options.focus();
	}
	else
	{
		document.getElementById("lblError").innerHTML = "";
		document.getElementById(strErrIndName).innerHTML = "";
	}
}
            
function validateInstrument(control) {
    // ASP.NET mangles the control names with different prefixes for each row
    // Use the ID from the <A> to get the prefix
    var ctl_id = control.id;
    ctl_id = ctl_id.replace("__",":_");
    ctl_id = ctl_id.substring(0, ctl_id.length - 20);

    var s = document.frmChangePersonalInformation.elements[ctl_id + ":ddInstruments"].options.selectedIndex;
    if (s == null || s.length == 0 || s == 0 || s == -1) {
        alert ("Please supply a Instrument.");
        return false;
    }

    var s = document.frmChangePersonalInformation.elements[ctl_id + ":txtSCHEDULE_DESC"].value;
    if (s == null || s.length == 0) {
        alert ("Please supply a Description.");
        return false;
    }

    var s = document.frmChangePersonalInformation.elements[ctl_id + ":txtSERIALNUMBER"].value;
    if (s == null || s.length == 0) {
        alert ("Please supply a Serial Number.");
        return false;
    }

    var s = document.frmChangePersonalInformation.elements[ctl_id + ":txtSCHEDULE_VALUE"].value;
    if (s == null || s.length == 0) {
        alert ("Please supply a value.");
        return false;
    }
    return true;

} 
            
function showConfirmationModalForm(strMessage, strHeader, strClose) {
	//var MyArgs = window.showModalDialog("popupsubmissionlist.aspx?custid=" + document.forms(0).txtCUSTOMER_ID.value, intSubmissionID, WinSettings);
	var MyArgs = window.showModalDialog("confirmationpopup.aspx?m=" + strMessage + "&h=" + strHeader + "&c=" + strClose,"confirmationpopup","dialogHeight:212px;dialogWidth:785px;center:yes;scrollbars:no;status:no;resizable:no")
} 

function formatDateField(txtbox, format) {
/**********************************************************************
Function: formatDate
Purpose:  Formats a date field with the format argument
**********************************************************************/
	if (txtbox.value == "")
	{
		return true;
	}
	if (isDate(txtbox, txtbox.value) == false)
	{
		return false;
	}
	var returnDate = getDateFromFormat(txtbox.value,"M/d/y");
	var expDate = new Date(returnDate);

	if (isDateFormat(txtbox.value,"M/d/y") == true)
	{
		txtbox.value = formatDate(expDate,format);
		return true;
	}
	else
	{
		alert("Please enter date as mm/dd/yyyy.");
		txtbox.value = "";
		txtbox.focus();
		return false;
	}
}

// ------------------------------------------------------------------
// isDateFormat( date_string, format_string )
// Returns true if date string matches format of format string and
// is a valid date. Else returns false.
// It is recommended that you trim whitespace around the value before
// passing it to this function, as whitespace is NOT ignored!
// ------------------------------------------------------------------
function isDateFormat(val,format) {
	var date=getDateFromFormat(val,format);
	if (date==0) { return false; }
	return true;
	}

// ------------------------------------------------------------------
// getDateFromFormat( date_string , format_string )
//
// This function takes a date string and a format string. It matches
// If the date string matches the format string, it returns the 
// getTime() of the date. If it does not match, it returns 0.
// ------------------------------------------------------------------
function getDateFromFormat(val,format) {
	val=val+"";
	format=format+"";
	var i_val=0;
	var i_format=0;
	var c="";
	var token="";
	var token2="";
	var x,y;
	var now=new Date();
	var year=now.getYear();
	var month=now.getMonth()+1;
	var date=1;
	var hh=now.getHours();
	var mm=now.getMinutes();
	var ss=now.getSeconds();
	var ampm="";
	
	while (i_format < format.length) {
		// Get next token from format string
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
			}
		// Extract contents of value based on format token
		if (token=="yyyy" || token=="yy" || token=="y") {
			if (token=="yyyy") { x=4;y=4; }
			if (token=="yy")   { x=2;y=2; }
			if (token=="y")    { x=2;y=4; }
			year=_getInt(val,i_val,x,y);
			if (year==null) { return 0; }
			i_val += year.length;
			if (year.length==2) {
				if (year > 70) { year=1900+(year-0); }
				else { year=2000+(year-0); }
				}
			}
		else if (token=="MMM"||token=="NNN"){
			month=0;
			for (var i=0; i<MONTH_NAMES.length; i++) {
				var month_name=MONTH_NAMES[i];
				if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {
					if (token=="MMM"||(token=="NNN"&&i>11)) {
						month=i+1;
						if (month>12) { month -= 12; }
						i_val += month_name.length;
						break;
						}
					}
				}
			if ((month < 1)||(month>12)){return 0;}
			}
		else if (token=="EE"||token=="E"){
			for (var i=0; i<DAY_NAMES.length; i++) {
				var day_name=DAY_NAMES[i];
				if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {
					i_val += day_name.length;
					break;
					}
				}
			}
		else if (token=="MM"||token=="M") {
			month=_getInt(val,i_val,token.length,2);
			if(month==null||(month<1)||(month>12)){return 0;}
			i_val+=month.length;}
		else if (token=="dd"||token=="d") {
			date=_getInt(val,i_val,token.length,2);
			if(date==null||(date<1)||(date>31)){return 0;}
			i_val+=date.length;}
		else if (token=="hh"||token=="h") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>12)){return 0;}
			i_val+=hh.length;}
		else if (token=="HH"||token=="H") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>23)){return 0;}
			i_val+=hh.length;}
		else if (token=="KK"||token=="K") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>11)){return 0;}
			i_val+=hh.length;}
		else if (token=="kk"||token=="k") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>24)){return 0;}
			i_val+=hh.length;hh--;}
		else if (token=="mm"||token=="m") {
			mm=_getInt(val,i_val,token.length,2);
			if(mm==null||(mm<0)||(mm>59)){return 0;}
			i_val+=mm.length;}
		else if (token=="ss"||token=="s") {
			ss=_getInt(val,i_val,token.length,2);
			if(ss==null||(ss<0)||(ss>59)){return 0;}
			i_val+=ss.length;}
		else if (token=="a") {
			if (val.substring(i_val,i_val+2).toLowerCase()=="am") {ampm="AM";}
			else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {ampm="PM";}
			else {return 0;}
			i_val+=2;}
		else {
			if (val.substring(i_val,i_val+token.length)!=token) {return 0;}
			else {i_val+=token.length;}
			}
		}
	// If there are any trailing characters left in the value, it doesn't match
	if (i_val != val.length) { return 0; }
	// Is date valid for month?
	if (month==2) {
		// Check for leap year
		if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year
			if (date > 29){ return 0; }
			}
		else { if (date > 28) { return 0; } }
		}
	if ((month==4)||(month==6)||(month==9)||(month==11)) {
		if (date > 30) { return 0; }
		}
	// Correct hours value
	if (hh<12 && ampm=="PM") { hh=hh-0+12; }
	else if (hh>11 && ampm=="AM") { hh-=12; }
	var newdate=new Date(year,month-1,date,hh,mm,ss);
	return newdate.getTime();
	}

function FormatUSPhoneNumber(control, value) {
    var FmtStr="";
    var index = 0;
    var LimitCheck;

    LimitCheck = value.length;
    
    if (LimitCheck == 0)
      {
	    return false;
      }

    while (index != LimitCheck)
      {
        if (isNaN(parseInt(value.charAt(index), 10)))
          { }
        else
          { FmtStr = FmtStr + value.charAt(index); }
        index = index + 1;
      }
    if (FmtStr.length == 10)
      {
        FmtStr = "(" + FmtStr.substring(0,3) + ") " + FmtStr.substring(3,6) + "-" + FmtStr.substring(6,10);
      }
    else
      {
        alert("United States phone numbers must have exactly ten digits.");
		control.focus();
	    return false;
      }
	control.value = FmtStr; 
	return true;
}

function SetEmailBody()
{
    var strEmailBody = "Please send information about the following:%0a%0a";
    var strEmailTO = document.forms(0).txtEmailTo.value;
	
	if (document.forms(0).chkCondo.checked)
	{
		strEmailBody = strEmailBody + "Condo Quote%0a"
	}
	
	if (document.forms(0).chkHomeowners.checked)
	{
		strEmailBody = strEmailBody + "Traditional Homeowners Quote%0a"
	}
	
	if (document.forms(0).chkRenters.checked)
	{
		strEmailBody = strEmailBody + "Renters Quote%0a"
	}
	
	strEmailBody = strEmailBody + "%0aMy completed Quick Quote questionnaire is attached.%0a"

    var strMailTo = "<A HREF='mailto:"+strEmailTO+"?subject=Homeowners Insurance Quote&amp;body="+strEmailBody+"'>Clarion Associates, Inc.</A>.";
	document.getElementById("tcContactHREF").innerHTML = "&nbsp;&nbsp;3.&nbsp;Email the Quick Quote questionnaire to us at "+strMailTo+".";
}

function loadGetAQuote()
{
	if (document.forms(0).chkSHOW_MAIL_ADDRESS.checked == false) 
	{
		validatorEnabled(rfvMAIL_ADDRESS1, false);
		validatorEnabled(rfvMAIL_CITY, false);
		validatorEnabled(rfvMAIL_STATE, false);
		validatorEnabled(rfvMAIL_ZIP, false);
		validatorEnabled(rfvMAIL_COUNTRY, false);
		validatorEnabled(rfvMAIL_STATE_OUS, false);
		document.getElementById("tblMailingAddress").style.display = "none"; 
	}
	else 
	{
		validatorEnabled(rfvMAIL_ADDRESS1, true);
		validatorEnabled(rfvMAIL_CITY, true);
		validatorEnabled(rfvMAIL_STATE, true);
		validatorEnabled(rfvMAIL_ZIP, true);
		validatorEnabled(rfvMAIL_COUNTRY, true);
		validatorEnabled(rfvMAIL_STATE_OUS, true);
		document.getElementById("tblMailingAddress").style.display = "block"; 
	}
}

function showhideGetAQuoteAddress()
{
	if (document.forms(0).chkSHOW_MAIL_ADDRESS.checked == true)
	{
		validatorEnabled(rfvMAIL_ADDRESS1, true);
		validatorEnabled(rfvMAIL_CITY, true);
		validatorEnabled(rfvMAIL_STATE, true);
		validatorEnabled(rfvMAIL_ZIP, true);
		validatorEnabled(rfvMAIL_COUNTRY, true);
		document.getElementById("tblMailingAddress").style.display = "block"; 
	}
	else
	{
		validatorEnabled(rfvMAIL_ADDRESS1, false);
		validatorEnabled(rfvMAIL_CITY, false);
		validatorEnabled(rfvMAIL_STATE, false);
		validatorEnabled(rfvMAIL_ZIP, false);
		validatorEnabled(rfvMAIL_COUNTRY, false);
		validatorEnabled(rfvMAIL_STATE_OUS, false);
		document.getElementById("tblMailingAddress").style.display = "none"; 
	}
}

function showhideLossPayee()
{
	if (document.forms(0).rblLOSS_PAYEE_0.checked == true)
	{
		validatorEnabled(rfvLP_NAME, true);
		validatorEnabled(rfvLP_ADDRESS1, true);
		validatorEnabled(rfvLP_CITY, true);
		validatorEnabled(rfvLP_STATE, true);
		validatorEnabled(rfvLP_ZIP, true);
		validatorEnabled(rfvLP_PHONE, true);
		validatorEnabled(rfvLP_Interest, true);
		document.getElementById("tblLossPayeeInfo").style.display = "block"; 
	}
	else
	{
		validatorEnabled(rfvLP_NAME, false);
		validatorEnabled(rfvLP_ADDRESS1, false);
		validatorEnabled(rfvLP_CITY, false);
		validatorEnabled(rfvLP_STATE, false);
		validatorEnabled(rfvLP_ZIP, false);
		validatorEnabled(rfvLP_PHONE, false);
		validatorEnabled(rfvLP_Interest, false);
		document.getElementById("tblLossPayeeInfo").style.display = "none"; 
	}
}
