// JavaScript Document



// Popup for Terms Of Use

function termsofuse(){

window.open("TermsOfUse.php","","status=1,scrollbars=1,menubar=0,resizable=1,width=550,height=500");	

}

// Popup for Terms Of Use Ends



//Check the charaters for blog add comments

function checkChar(e){

	var unicode=e.charCode? e.charCode : e.keyCode;

	//alert(unicode);

		if (unicode==60 || unicode==62 || unicode==47){ //if not a number

		alert("You are not allowed to enter this charater");

		return false; //disable key press

		}



	return true;

}



function validateEnqForm1(){

var doc=document.frmEnqForm1;

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i; // Email validation	

var re = /^\s{1,}$/g; // For validating space || (doc.fname.value.search(re)) > -1

		if(doc.parent_name.value=="" || (doc.parent_name.value.search(re)) > -1){ //style="visibility:visible"

		document.getElementById('e_parent_name').style.display="block";

		doc.parent_name.focus();

		return false;

	}else{

		document.getElementById('e_parent_name').style.display="none";

	}

	if(doc.child_name.value=="" || (doc.child_name.value.search(re)) > -1){ //style="visibility:visible"

		document.getElementById('e_child_name').style.display="block";

		doc.child_name.focus();

		return false;

	}else{

		document.getElementById('e_child_name').style.display="none";

	}
	
	

	if(doc.child_address.value=="" || (doc.child_address.value.search(re)) > -1){ //style="visibility:visible"

		document.getElementById('e_child_address').style.display="block";

		doc.child_address.focus();

		return false;

	}else{

		document.getElementById('e_child_address').style.display="none";

	}	



	if(!emailfilter.test(doc.child_email.value)){

		document.getElementById('e_child_email').style.display="block";

		doc.child_email.focus();

		return false;

	}else{

		document.getElementById('e_child_email').style.display="none";

	}

	

	if(doc.child_contact_no.value=="" || (doc.child_contact_no.value.search(re)) > -1){ //style="visibility:visible"

		document.getElementById('e_child_contact_no').style.display="block";

		doc.child_contact_no.focus();

		return false;

	}else{

		document.getElementById('e_child_contact_no').style.display="none";

	}

	

	return true;	

}





function validateEnqForm2(){

var doc=document.frmEnqForm2;

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i; // Email validation	

var re = /^\s{1,}$/g; // For validating space || (doc.fname.value.search(re)) > -1



	if(!emailfilter.test(doc.child_email.value)){

		document.getElementById('e_child_email').style.display="block";

		doc.child_email.focus();

		return false;

	}else{

		document.getElementById('e_child_email').style.display="none";

	}

	

	if(doc.child_cmts.value=="" || (doc.child_cmts.value.search(re)) > -1){ //style="visibility:visible"

		document.getElementById('e_child_cmts').style.display="block";

		doc.child_cmts.focus();

		return false;

	}else{

		document.getElementById('e_child_cmts').style.display="none";

	}	

	

	return true;

}


function validateRecommend(){
var doc=document.frmRecommend;
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i; // Email validation	
var re = /^\s{1,}$/g; // For validating space || (doc.fname.value.search(re)) > -1


	if(doc.reco_their_name.value=="" || (doc.reco_their_name.value.search(re)) > -1){ //style="visibility:visible"
		document.getElementById('e_reco_their_name').style.display="block";
		doc.reco_their_name.focus();
		return false;
	}else{
		document.getElementById('e_reco_their_name').style.display="none";
	}
	if(!emailfilter.test(doc.reco_their_email.value)){
		document.getElementById('e_reco_their_email').style.display="block";
		doc.reco_their_email.focus();
		return false;
	}else{
		document.getElementById('e_reco_their_email').style.display="none";
	}
	
	if(doc.reco_your_name.value=="" || (doc.reco_your_name.value.search(re)) > -1){ //style="visibility:visible"
		document.getElementById('e_reco_your_name').style.display="block";
		doc.reco_your_name.focus();
		return false;
	}else{
		document.getElementById('e_reco_your_name').style.display="none";
	}
	if(!emailfilter.test(doc.reco_your_email.value)){
		document.getElementById('e_reco_your_email').style.display="block";
		doc.reco_your_email.focus();
		return false;
	}else{
		document.getElementById('e_reco_your_email').style.display="none";
	}	

	if(doc.reco_msg.value=="" || (doc.reco_msg.value.search(re)) > -1){ //style="visibility:visible"
		document.getElementById('e_reco_msg').style.display="block";
		doc.reco_msg.focus();
		return false;
	}else{
		document.getElementById('e_reco_msg').style.display="none";
	}	
	return true;

}