// JavaScript Document

function reset_value()
{
	document.contactus.name.value="Name *";
	document.contactus.mail.value="E-Mail *";
	document.contactus.phone.value="Phone *";
	document.contactus.designation.value="Designation";
	document.contactus.company.value="Company";
	//document.contactus.how_know.value="How did you know?";
	document.contactus.main_requirements.value="apple";
	document.contactus.specific_details.value="Mention specific details";
	document.getElementById('div_id1').style.display="none";
	document.getElementById('div_id2').style.display="none";
	document.getElementById('div_id3').style.display="none";
	//alert("SDfsdf");
	
}
	

function validate_contact(divid)
{
		
	var name=document.contactus.name.value; 
	var email=document.contactus.mail.value;
	var phone=document.contactus.phone.value;
	var designation=document.contactus.designation.value;	
	var company=document.contactus.company.value;
	//var how_know=document.contactus.how_know.value;
	var main_requirements=document.contactus.main_requirements.value;
	var specific_details=document.contactus.specific_details.value;		
	
	var query_str="name="+name+"&email="+email+"&phone="+phone;
	query_str=query_str+"&specific_details="+specific_details+"&main_requirements="+main_requirements;
	query_str=query_str+"&company="+company+"&designation="+designation+"&id="+Math.random();	 
	 
	var url="contact_us_customer.php"; 

	ajax_call(query_str,divid,url);
}

function reset_personal()
{
	document.personal_form.name.value="Name *";
	document.personal_form.mail.value="E-Mail *";
	document.personal_form.contact_no.value="Contact-No *";
	document.personal_form.address.value="Address *";
//	document.contactus.company.value="Company";
	//document.contactus.how_know.value="How did you know?";
	//document.contactus.main_requirements.value="apple";
	document.contactus.specific_details.value="Mention specific details";
	document.getElementById('div_id1').style.display="none";
	document.getElementById('div_id2').style.display="none";
	document.getElementById('div_id3').style.display="none";
	document.getElementById('div_id4').style.display="none";
	//alert("SDfsdf");*/
	
}
	

function validate_personal(divid)
{
	var qty=document.personal_form.qty.value; 
	var name=document.personal_form.name.value; 
	var email=document.personal_form.mail.value;
	var contact_no=document.personal_form.contact_no.value;
	var address=document.personal_form.address.value;	
	var flag = true;
	if(qty=="" || qty=="Quantity *") {
		document.getElementById('bullet1').src='images/wrong_active.gif';
		document.getElementById('div_id1').style.display="inline";
		flag = false;
	}
	else
	{
		document.getElementById('div_id1').style.display="none";
	}
	if(name=="" || name=="Name *") {
		document.getElementById('bullet2').src='images/wrong_active.gif';
		document.getElementById('div_id2').style.display="inline";
		flag = false;
	}
	else
	{
		document.getElementById('div_id2').style.display="none";
	}

	if(email=="" || email=="E-mail *") {
		document.getElementById('bullet3').src='images/wrong_active.gif';
		document.getElementById('div_id3').style.display="inline";
		flag = false;
	}       
	if(! (/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(email))) {
		document.getElementById('bullet3').src='images/wrong_active.gif';
		document.getElementById('div_id3').style.display="inline";
		flag = false;
    }
	else
	{
		document.getElementById('div_id3').style.display="none";
	}

	if(contact_no=="" || contact_no=="Contact-No *") {
		document.getElementById('bullet4').src='images/wrong_active.gif';
		document.getElementById('div_id4').style.display="inline";	
		flag = false;
	}
	else
	{
		document.getElementById('div_id4').style.display="none";
	}

	if(address=="" || address=="Address *") {
		document.getElementById('bullet5').src='images/wrong_active.gif';
		document.getElementById('div_id5').style.display="inline";
		flag = false;
	}
	else
	{
		document.getElementById('div_id5').style.display="none";
	}
	if(flag) {
		var query_str="qty="+qty+"&name="+name+"&email="+email+"&contact_no="+contact_no+"&address="+address;	
		//var url="process.php?"+query_str;
		var url="process.php";
		document.personal_form.action = url;
		document.personal_form.submit();
		//ajax_call(query_str,divid,url);
	}

}