

$(document).ready(function () {
							
	
	$('#accordion-1').easyAccordion({ 
			autoStart: true, 
			slideInterval: 10000
	});
	
	/*$('#accordion-2').easyAccordion({ 
			autoStart: false	
	});
	
	$('#accordion-3').easyAccordion({ 
			autoStart: true,
			slideInterval: 5000,
			slideNum:false	
	}); 
	
	$('#accordion-4').easyAccordion({ 
			autoStart: false,
			slideInterval: 5000
	}); */
		

});


function validate(formName){
	if(IsEmpty(formName.fname,'fNameDis','fNameDisNum','fNameDisCount') && IsEmpty(formName.lname,'lNameDis','lNameDisNum','lNameDisCount') && IsNumeric(formName.zip,'zipDis','zip1Dis') && IsNumeric(formName.phone, 'phoneDis', 'phone1Dis') && checkEmail(formName.email)){
				return true;																				
		}
	else{	
				return false;
		}
		return true;
	}
/* Check empty fields */
function IsEmpty(aTextField, id, id1, id2) 
{
var count = aTextField.value.length;
var textValue = aTextField.value;
var i = new Array();
	
	if ((aTextField.value=="") ||  (aTextField.value==null))   
	{
		document.getElementById(id).style.display='inline';
		//alert("Please Enter "+msg);
		aTextField.value="";
		aTextField.focus();
		return false;
	}
	else
	{
		document.getElementById(id).style.display='none';
		for(i=0; i<=count; i++)
		{
			
			textValue[i];
			
			if(textValue[i] != " ")
			{
				if(isNaN(textValue[i]))
				{
					//alert(textValue[i]);
					document.getElementById(id1).style.display='none';
					//return false;
				}
				//else if(!isNaN(textValue[i]))
				else
				{
					//alert(textValue[i]);
					document.getElementById(id1).style.display='inline';
					document.getElementById(id2).style.display='none';
					return true;
				}
			}
		}
		if(count>=25)
		{
			document.getElementById(id2).style.display='inline';
			
		}
		else
		{
			document.getElementById(id2).style.display='none';
		}
		return true; 
	}
	
}	


/* Check  for valid email  */
	function checkEmail(aTextField){
			
			var emailValue = aTextField.value;
			var e = new Array();
			
			if ((aTextField.value=="") ||  (aTextField.value==null))   
  			{
	   		  document.getElementById('email1Dis').style.display='none';
			  document.getElementById('emailDis').style.display='inline';
			  //alert("Please Enter Email");
		   	  aTextField.value="";
			  aTextField.focus();
	   		  return false;
   		        }
			//else
//			{
//				for(e=0; e<=aTextField.value.length; e++)
//				{
//			
//					emailValue[e];
//					
//					if()
//					{
//							alert('erroer');
//							document.getElementById('emailDis').style.display='none';
//							document.getElementById('email1Dis').style.display='block';
//							//alert( "Please enter valid Email Address" );
//							aTextField.value="";
//							aTextField.focus();
//							return false	
//					}
//				}
//			}


			else if ( (!isNaN(aTextField.value.charAt(0))) || (aTextField.value.search("@") <= 0 ) || (aTextField.value.search("[.*]" ) <= 3 ) || (aTextField.value.search("[.]") == (aTextField.value.search("@")+1)) ) 
				{
					//alert('erroer');
					document.getElementById('emailDis').style.display='none';
					document.getElementById('email1Dis').style.display='inline';
					//alert( "Please enter valid Email Address" );
					aTextField.value="";
					aTextField.focus();
					return false
				} 
			else 
				{
					document.getElementById('email1Dis').style.display='none';
					document.getElementById('emailDis').style.display='none';
					return true;
					
				}
		}
		
/* Check  for Numeric  */
function IsNumeric(aTextField, id, id1)
	   {
			if ((aTextField.value=="") ||   (aTextField.value==null))   
  			{
	   		  document.getElementById(id).style.display='inline';
			  document.getElementById(id1).style.display='none';
			 //alret("Please Enter Phone Number");
		   	  aTextField.value="";
			  aTextField.focus();
	   		  return false;
   		        }
			else if(isNaN(aTextField.value)) 
		   { 
			 document.getElementById(id1).style.display='inline';
			 document.getElementById(id).style.display='none';
			 //print("Only numbers are allowed."); 
			  aTextField.value="";
			  aTextField.focus();
			 return false; 
		   } 
		   document.getElementById(id1).style.display='none';
		   document.getElementById(id).style.display='none';
		   	return true;
	   }


