// JavaScript Document





function validate()

{

	

var chkmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;





if(window.document.contact_form.name.value.length==0)

{

//alert("Please enter your name");

window.document.contact_form.name.focus();

/*window.document.contact_form.name.style.borderColor= '#FF4646';*/

window.document.contact_form.name.style.borderColor= '';

window.document.contact_form.name.style.background= '#EAEAEA';

return false;

}

else

{

window.document.contact_form.name.style.background= '';

}



if(window.document.contact_form.subject.value.length==0)

{

//alert("Please enter your name");

window.document.contact_form.subject.focus();

/*window.document.contact_form.name.style.borderColor= '#FF4646';*/

window.document.contact_form.subject.style.borderColor= '';

window.document.contact_form.subject.style.background= '#EAEAEA';

return false;

}

else

{

window.document.contact_form.subject.style.background= '';

}





if(window.document.contact_form.tel.value.length==0)

{

//alert("Please enter your contact number");

window.document.contact_form.tel.focus();

window.document.contact_form.tel.style.borderColor= '';

window.document.contact_form.tel.style.background= '#EAEAEA';

return false;

}

else if(isNaN(window.document.contact_form.tel.value))

{

alert("Enter a valid phone number");

window.document.contact_form.tel.focus();

window.document.contact_form.tel.style.borderColor= '';

window.document.contact_form.tel.style.background= '#EAEAEA';

return false;

}

else

{

window.document.contact_form.tel.style.background= '';

}





if(window.document.contact_form.email.value.length==0)

{

//alert("Please enter your mail id");

window.document.contact_form.email.focus();

window.document.contact_form.email.style.borderColor= '';

window.document.contact_form.email.style.background= '#EAEAEA';

return false;

}

else if(!chkmail.test(window.document.contact_form.email.value))

{

alert("Invalid email address format!");

window.document.contact_form.email.focus();

window.document.contact_form.email.style.borderColor= '';

window.document.contact_form.email.style.background= '#EAEAEA';

return false;

}

else

{

window.document.contact_form.email.style.background= '';

}









if(window.document.contact_form.remarks.value.length==0)

{

//alert("Please enter your remarks");

window.document.contact_form.remarks.focus();

window.document.contact_form.remarks.style.borderColor= '';

window.document.contact_form.remarks.style.background= '#EAEAEA';

return false;

}	

else

{

window.document.contact_form.remarks.style.background= '';

}

if(window.document.contact_form.captcha.value.length==0)

{

//alert("Please enter your captcha");

window.document.contact_form.captcha.focus();

window.document.contact_form.captcha.style.borderColor= '';

window.document.contact_form.captcha.style.background= '#EAEAEA';

return false;

}	

else

{

window.document.contact_form.captcha.style.background= '';

}	



	



 

}