
<!-- 
function toggleAnswer(id) {
elem = document.getElementById(id);
elem.style.display = (elem.style.display == 'none')? '' : 'none';
}
 // -->
		function ValidateForm(theform)
		{
			//Start - Checking for Blank values - Name
			if( isBlank(document.CustomerServiceForm.txtname.value)  ) 
				{
					alert("Please enter your Name");
					document.CustomerServiceForm.txtname.focus();
					return (false);
				}
			//End - Checking for Blank values - Name
			
			//Start - Checking for Blank values - Address
			if( isBlank(document.CustomerServiceForm.txtAddress.value)  ) 
				{
					alert("Please enter the Address");
					document.CustomerServiceForm.txtAddress.focus();
					return (false);
				}
			//End - Checking for Blank values - Address
			
			//Start - Checking for Blank values - City
			if( isBlank(document.CustomerServiceForm.txtCity.value)  ) 
				{
					alert("Please enter the City");
					document.CustomerServiceForm.txtCity.focus();
					return (false);
				}
			//End - Checking for Blank values - City			
			
			//Start - Checking for Blank values - State
			if( isBlank(document.CustomerServiceForm.txtState.value)  ) 
				{
					alert("Please enter the State");
					document.CustomerServiceForm.txtState.focus();
					return (false);
				}
			//End - Checking for Blank values - State			
			
			//Start - Checking for Blank values - Zip
			if( isBlank(document.CustomerServiceForm.txtZip.value)  ) 
				{
					alert("Please enter the ZipCode");
					document.CustomerServiceForm.txtZip.focus();
					return (false);
				}
			//End - Checking for Blank values - Zip		
			
			//Start - Checking for numeric values - Zip
			if (!checkchar(document.CustomerServiceForm.txtZip.value))                 
			{                
				alert('ZipCode should be numeric');                
				theform.txtZip.focus();                
				return(false);    
			}
			//End - Checking for numeric values - Zip
			
			//Start - Checking for Blank values - Home Phone No.
			if( isBlank(document.CustomerServiceForm.txtHomePhone.value)  ) 
				{
					alert("Please enter your phone no.");
					document.CustomerServiceForm.txtHomePhone.focus();
					return (false);
				}
			//End - Checking for Blank values - Home Phone No.
			
			//Start - Checking for numeric values - Home Telephone
			if (!checkchar(document.CustomerServiceForm.txtHomePhone.value))                 
			{                
				alert('Telephone Number should be numeric');                
				theform.txtHomePhone.focus();                
				return(false);    
			}
			//End - Checking for numeric values - Home Telephone
			
			
			
			//Start - Checking for Blank values - Mobile No.
			if( isBlank(document.CustomerServiceForm.txtMobilePhone.value)  ) 
				{
					alert("Please enter your Mobile no.");
					document.CustomerServiceForm.txtMobilePhone.focus();
					return (false);
				}
			//End - Checking for Blank values - Mobile No.
			
			//Start - Checking for numeric values - Mobile
			if (!checkchar(document.CustomerServiceForm.txtMobilePhone.value))                 
			{                
				alert('Mobile Number should be numeric');                
				theform.txtMobilePhone.focus();                
				return(false);    
			}
			//End - Checking for numeric values - Mobile		



			//Start - Checking for Blank values - Business Phone No.
			if( isBlank(document.CustomerServiceForm.txtBusPhone.value)  ) 
				{
					alert("Please enter your phone no.");
					document.CustomerServiceForm.txtBusPhone.focus();
					return (false);
				}
			//End - Checking for Blank values - Business Phone No.
			
			//Start - Checking for Blank values - Business Telephone
			if (isBlank(document.CustomerServiceForm.txtBusPhone.value))
			{
				alert("Telephone is a required field");
				theform.txtBusPhone.focus();
				return(false);
			}
			//End - Checking for Blank values - Business Telephone
			
			
			//Start - Checking for numeric values - Business Telephone
			if (!checkchar(document.CustomerServiceForm.txtBusPhone.value))                 
			{                
				alert('Telephone Number should be numeric');                
				theform.txtBusPhone.focus();                
				return(false);    
			}
			//End - Checking for numeric values - Business Telephone
			
			//Start - Checking for prpoer format values - Business Telephone
			if (!ValidatePhone(document.CustomerServiceForm.txtBusPhone.value))
			{
				theform.txtBusPhone.focus();
				return false;
			}		
			
			if (!isBlank(document.CustomerServiceForm.txtBusPhone.value=="   -   -    "))
			{
				alert("Please enter a proper telephone no.");
				theform.txtBusPhone.focus();
				return(false);
			}	
			//End - Checking for proper format - Business Telephone
			
			//Start - Checking for Blank values - Email 
			if (isBlank(document.CustomerServiceForm.mailfrom.value))
			{
				alert("Email is a required field");
				theform.mailfrom.focus();
				return(false);
			}	
			//End - Checking for Blank values - Email
			
			//Start - Checking for invalid email address - Email
			if (!validEmail(document.CustomerServiceForm.mailfrom.value)) 
			{
            	alert("Invalid email address")
                document.CustomerServiceForm.mailfrom.focus()
                return false
             }
			//End - Checking for invalid email address - Email
			
			//Start - Checking for blank values - Form entered by
			if (isBlank(document.CustomerServiceForm.txtformentered.value))
			{
				alert("Form entered by is a required field");
				theform.txtformentered.focus();
				return(false);
			}	
			//End - Checking for blank values - Form entered by 
			
			//Start - Checking for blank values - Comments
			if (isBlank(document.CustomerServiceForm.txtComments.value))
			{
				alert("Paste your Resume from word document");
				document.CustomerServiceForm.txtComments.focus();
				return(false);
			}  
			//End - Checking for blank values - Comments
			
        return(true);
		}

function isBlank(s)
{
	var len=s.length;
	var i;
	for (i=0;i<len;i++)
		{
		 if (s.charAt(i)!=" ") 
		{	
		return (false);
		}
		}
	return (true);
}

// Validate phone start

	function ValidatePhone(fieldval)
	{
		var formatok;
//format 1 -----1234567890
		formatok=validateformat1(fieldval);

					
		if (formatok==false)
			{
//format 2 -----(123)-456-7890			
			formatok=validateformat2(fieldval);
			}

		if (formatok==false)
			{
//format 3 -----123-456-7890			
			formatok=validateformat3(fieldval);
			}

		
		if (formatok==false)
			{
//format 4 -----(123)456-7890			
			formatok=validateformat4(fieldval);
			}
	
		
		if (formatok==false)
			{
//format 5 -----(123) 456-7890			
			formatok=validateformat5(fieldval);
			}
		if (formatok==false)
			{
//format 6 -----(123) 456 7890			
			formatok=validateformat6(fieldval);
			}


		if (formatok==false)
			{
			alert("Telephone number is not in proper format");
			return false;
			} 
	return true;
	}	


function validateformat1(fieldval)	
{
		if ((fieldval.length > 10) || (fieldval.length < 10))
		{
			return false;
		}
		if (isNaN(fieldval))
		{
		return false;
		}
	return true;
}


function validateformat2(fieldval)	
{
		if ((fieldval.length > 14) || (fieldval.length < 14))
		{
			return false;
		}

		if ((fieldval.substring(0,1) != "(") || (fieldval.substring(4,5) != ")") || (fieldval.substring(5,6) != "-") || (fieldval.substring(9,10) != "-"))
		{
			return false;
		}
	return true;		
}


function validateformat3(fieldval)	
{
		if ((fieldval.length > 12) || (fieldval.length < 12))
		{
			return false;
		}

		if ((fieldval.substring(3,4) != "-") || (fieldval.substring(7,8) != "-"))
		{
			return false;
		}
	return true;		
}


function validateformat4(fieldval)	
{
		
		if ((fieldval.length > 13) || (fieldval.length < 13))
		{
			return false;
		}

		if ((fieldval.substring(0,1) != "(") || (fieldval.substring(4,5) != ")") || (fieldval.substring(8,9) != "-"))
		{
			return false;
		}
	return true;		
}


function validateformat5(fieldval)	
{
		
		if ((fieldval.length > 14) || (fieldval.length < 14))
		{
			return false;
		}

		if ((fieldval.substring(0,1) != "(") || (fieldval.substring(4,5) != ")") ||(fieldval.substring(5,6) != " ") ||(fieldval.substring(9,10) != "-"))
		{
			return false;
		}
	return true;		
}

function validateformat6(fieldval)	
{
		
		if ((fieldval.length > 14) || (fieldval.length < 14))
		{
			return false;
		}

		if ((fieldval.substring(0,1) != "(") || (fieldval.substring(4,5) != ")") ||(fieldval.substring(5,6) != " ") ||(fieldval.substring(9,10) != " "))
		{
			return false;
		}
	return true;		
}
// Telephone validation over

    
function checkchar(tocheck)                 
{                
	var isNum=false;                
	                
	for (j=0; j< tocheck.length; j++)                 
	        {                
	        if ((tocheck.substring(j,j+1) == "0") ||                
	            (tocheck.substring(j,j+1) == "1") ||                
	            (tocheck.substring(j,j+1) == "2") ||                
   		    	(tocheck.substring(j,j+1) == "3") ||                
	            (tocheck.substring(j,j+1) == "4") ||                
	            (tocheck.substring(j,j+1) == "5") ||                
	            (tocheck.substring(j,j+1) == "6") ||                
	            (tocheck.substring(j,j+1) == "7") ||                
	            (tocheck.substring(j,j+1) == "8") ||                
	            (tocheck.substring(j,j+1) == "9") )                              
	            {                
	            isNum = true;                
	            }            
}                
return isNum;                
}                

function validEmail(email) 
{
	invalidChars = " /:,;"
    	//if (email == "") {
       // return false
		//}
        	for (i=0; i<invalidChars.length; i++) 
			{
            	badChar = invalidChars.charAt(i)
            		if (email.indexOf(badChar,0) > -1) 
				{
                    return false
                }
              }
              atPos = email.indexOf("@",1)
              	if (atPos == -1) 
				{
                	return false
                }
                if (email.indexOf("@",atPos+1) > -1) 
				{
                	return false
                }
				periodPos = email.indexOf(".",atPos)
                if (periodPos == -1) {
                return false
                }
                if (periodPos+3 > email.length) {
                	return false
                }
                	return true
                }

function CallReset()
{
answer = confirm("Do you want to reset?")
if (answer)
{
	document.CustomerServiceForm.reset();
}
}

