// js function for frontend (Thirdeye Travel)
// Created by Rayckin Shrestha

	function doPosition(target,frm,key) {
		if(frm.value==key) frm.value=''
		eletgt.style.display="block";
	}

	function isInteger(s)
	{   var i;
		for (i = 0; i < s.length; i++)
		{   
			// Check that current character is number.
			var c = s.charAt(i);
			if (((c < "0") || (c > "9"))) return false;
		}
		// All characters are numbers.
		return true;
	}

	function validatelogin(frm)				
	{
		var goodEmail =frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		var incorrect = new Array();
	var no = 0;
	
		if(frm.fname.value == "") {
			incorrect[no] = "1";
			frm.fname.value="";
			no++;
		}
		if(frm.lname.value == "") {
			incorrect[no] = "2";
			frm.lname.value = "";
			no++;
		}
		if(frm.state.value == "") {
			incorrect[no] = "5";
			frm.state.value = "";
			no++;
		}
		if(frm.city.value == "") {
			incorrect[no] = "6";
			frm.city.value = "";
			no++;
		}
		if(frm.zip.value == "") {
			incorrect[no] = "7";
			frm.zip.value = "";
			no++;
		}
		if(frm.email.value == ""){
			incorrect[no] = "3";
			frm.email.value = "";
			no++;
		}
		if((!goodEmail) && frm.email.value!="") {
			incorrect[no] = "3";
			frm.email.value = "";
			no++;
		}
		
		if(frm.txtCaptcha.value == "") {
			incorrect[no] = "10";
			frm.txtCaptcha.value = "";
			no++;
		}
	
		for(i=1;i<10;i++) {
			document.getElementById("bro"+i).style.color="#000000";
		}
		
		for(j=0;j<no;j++) { 
			document.getElementById("bro"+incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
			document.getElementById("plogin").innerHTML = "<span class=\"plogin\">Please fill in the fields with Red color.</span><br    />";
			return false;
		}
		
	}
	
	function validate_privatetrips(frm)				
	{
	
		var goodEmail =frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		var incorrect = new Array();
		var no = 0;
	
		if(frm.fname.value == "") {
			incorrect[no] = "3";
			frm.fname.value="";
			no++;
		}
		if(frm.lname.value == "") {
			incorrect[no] = "4";
			frm.lname.value = "";
			no++;
		}
		if(frm.state.value == "") {
			incorrect[no] = "6";
			frm.state.value = "";
			no++;
		}
		if(frm.city.value == "") {
			incorrect[no] = "5";
			frm.city.value = "";
			no++;
		}
		if(frm.zip.value == "") {
			incorrect[no] = "7";
			frm.zip.value = "";
			no++;
		}
		if(frm.email.value ==""){
			incorrect[no] = "9";
			frm.email.value = "";
			no++;
		}
		if((!goodEmail) && frm.email.value!="") {
			incorrect[no] = "9";
			frm.email.value = "";
			no++;
		}
		if(frm.adult_no.value == "") {
			incorrect[no] = "2";
			frm.adult_no.value = "";
			no++;
		}
		
		
		if(frm.txtCaptcha.value == "") {
			incorrect[no] = "8";
			frm.txtCaptcha.value = "";
			no++;
		}
	
		for(i=1;i<10;i++) {
			document.getElementById(i).style.color="#000000";
		}
		
		for(j=0;j<no;j++) { 
			//alert(incorrect[j]);
			document.getElementById(incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
			document.getElementById("private").innerHTML = "<span class=\"plogin\">Please fill in the fields with Red color.</span><br    />";
			return false;
		}
		
	}
	
	function validate_domestic(frm)				
	{
		
		var goodEmail =frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		var incorrect = new Array();
		var no = 0;
	
		
		if(frm.fname.value == "") {
			incorrect[no] = "1";
			frm.fname.value="";
			no++;
		}
		/*if(frm.address.value == "") {
			incorrect[no] = "4";
			frm.address.value="";
			no++;
		}*/
		if(frm.a_city.value == "") {
			incorrect[no] = "7";
			frm.a_city.value="";
			no++;
		}
		if(frm.phone.value == "") {
			incorrect[no] = "20";
			frm.phone.value="";
			no++;
		}
		if(frm.email.value == "") {
			incorrect[no] = "3";
			frm.email.value = "";
			no++;
		}
		if((!goodEmail) && frm.email.value!="") {
			incorrect[no] = "3";
			frm.email.value = "";
			no++;
		}
		if(frm.lname.value == "") {
			incorrect[no] = "2";
			frm.lname.value = "";
			no++;
		}
		/*if(frm.apartment.value == "") {
			incorrect[no] = "13";
			frm.apartment.value = "";
			no++;
		}*/
		/*if(frm.city.value == "") {
			incorrect[no] = "14";
			frm.city.value = "";
			no++;
		}*/
		/*if(frm.state.value == "") {
			incorrect[no] = "15";
			frm.state.value = "";
			no++;
		}*/
		/*if(frm.zip.value == "") {
			incorrect[no] = "16";
			frm.zip.value = "";
			no++;
		}*/
		
		if(frm.d_city.value == "") {
			incorrect[no] = "6";
			frm.d_city.value = "";
			no++;
		}
		if(frm.ADate.value == "") {
			incorrect[no] = "8";
			frm.ADate.value = "";
			no++;
		}
		if(frm.BDate.value == "" && frm.travel_type.value!="One Way Flight") {
			incorrect[no] = "9";
			frm.BDate.value = "";
			no++;
		}
		if(frm.adult.value == "") {
			incorrect[no] = "10";
			frm.adult.value = "";
			no++;
		}
		if(!isInteger(frm.adult.value)) {
			incorrect[no] = "10";
			frm.adult.value = "";
			no++;
		}
		if(!isInteger(frm.child.value)) {
			incorrect[no] = "11";
			frm.child.value = "";
			no++;
		}
		if(frm.txtCaptcha.value == "") {
			incorrect[no] = "11";
			frm.txtCaptcha.value = "";
			no++;
		}
	
		for(i=1;i<13;i++) {
			document.getElementById(i).style.color="#000000";
		}
			
		for(j=0;j<no;j++) { 
			document.getElementById(incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
			document.getElementById("plogin").innerHTML = "<span class=\"plogin\">Please fill in the fields with Red color.</span><br    />";
			return false;
		}
	 }
	 
	 function validate_cheap_fares(frm)				
	{
		
		var goodEmail =frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		var incorrect = new Array();
		var no = 0;
	
		if(frm.fname.value == "") {
			incorrect[no] = "7";
			frm.fname.value="";
			no++;
		}
		
		if(frm.phone.value == "") {
			incorrect[no] = "10";
			frm.phone.value="";
			no++;
		}
		if(frm.email.value == "") {
			incorrect[no] = "9";
			frm.email.value = "";
			no++;
		}
		if((!goodEmail) && frm.email.value!="") {
			incorrect[no] = "3";
			frm.email.value = "";
			no++;
		}
		if(frm.lname.value == "") {
			incorrect[no] = "8";
			frm.lname.value = "";
			no++;
		}
		if(frm.a_city.value == "") {
			incorrect[no] = "1";
			frm.a_city.value="";
			no++;
		}
		
		if(frm.d_city.value == "") {
			incorrect[no] = "2";
			frm.d_city.value = "";
			no++;
		}
		if(frm.ADate.value == "") {
			incorrect[no] = "3";
			frm.ADate.value = "";
			no++;
		}
		if(frm.BDate.value == "" && frm.travel_type.value == "Round Trip Flight") {
			incorrect[no] = "4";
			frm.BDate.value = "";
			no++;
		}
		if(frm.tickets.value == "") {
			incorrect[no] = "5";
			frm.tickets.value = "";
			no++;
		}
		if(!isInteger(frm.tickets.value)) {
			incorrect[no] = "5";
			frm.tickets.value = "";
			no++;
		}
		if(frm.txtCaptcha.value == "") {
			incorrect[no] = "11";
			frm.txtCaptcha.value = "";
			no++;
		}
		for(i=1;i<12;i++) {
			document.getElementById(i).style.color="#000000";
		}
			
		for(j=0;j<no;j++) { 
			document.getElementById(incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
			document.getElementById("plogin").innerHTML = "<span class=\"plogin\">Please fill in the fields with Red color.</span><br    />";
			return false;
		}
	 }
	 
	 
	 
	 
	function validate_newsletter_sub(frm)				
	{
		
		var goodEmail = frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		var incorrect = new Array();
		var no = 0;
		
			if(frm.fname.value == "") {
				incorrect[no] = "1";
				frm.fname.value="";
				no++;
			}
			
			if(frm.email.value == "") {
				incorrect[no] = "2";
				frm.email.value = "";
				no++;
			}
			if(!goodEmail) {
				incorrect[no] = "2";
				frm.email.value = "";
				no++;
			}
			
			if(frm.txtCaptcha.value == "") {
				incorrect[no] = "3";
				frm.txtCaptcha.value = "";
				no++;
			}
		
		for(i=1;i<4;i++) {
			
			document.getElementById("nl"+i).style.color="#000000";
		}
		for(j=0;j<no;j++) { 
			document.getElementById("nl"+incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
			document.getElementById("plogin").innerHTML = "Please check fields with red color ";
			return false;
		}
	}
	
	function validate_customize_trip(frm)				
	{
		
		var goodEmail = frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		var incorrect = new Array();
		var no = 0;
		
			if(frm.fname.value == "") {
				incorrect[no] = "1";
				frm.fname.value="";
				no++;
			}
			if(frm.lname.value == "") {
				incorrect[no] = "2";
				frm.lname.value="";
				no++;
			}
			if(frm.email.value != "") {
				if(!goodEmail) {
					incorrect[no] = "3";
					frm.email.value = "";
					no++;
				}
			}
			
			if(frm.state.value == "") {
				incorrect[no] = "8";
				frm.state.value = "";
				no++;
			}
			if(frm.city.value == "") {
				incorrect[no] = "7";
				frm.state.value = "";
				no++;
			}
			if(frm.zip.value == "") {
				incorrect[no] = "9";
				frm.city.value = "";
				no++;
			}
			if(isNaN(frm.zip.value)) {
				incorrect[no] = "9";
				frm.zip.value = "";
				no++;
			}
			if(frm.txtCaptcha.value == "") {
				incorrect[no] = "13";
				frm.txtCaptcha.value = "";
				no++;
			}
		
		for(i=1;i<10;i++) {
			
			document.getElementById(i).style.color="#000000";
		}
		for(j=0;j<no;j++) { 
			document.getElementById(incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
			document.getElementById("plogin").innerHTML = "Please check fields with red color ";
			return false;
		}
	}


		 function validate_basic_search(frm)				
		{
			var incorrect = new Array();
			var no = 0;
			if(frm.keywords.value< 1) {
			incorrect[no] = "1";
			frm.keywords.value=" ";
			no++;
			}
			for(i=1;i<2;i++) {
				document.getElementById("search"+i).style.color="#000000";
			}
			for(j=0;j<no;j++) { 
				document.getElementById("search"+incorrect[j]).style.color="#FF0000";
			}
			if(no > 0) {
			document.getElementById("b_search").innerHTML = "Please check field with red color ";
			return false;
			}
		}
		
		function validate_def_search(frm)				
		{
			var incorrect = new Array();
			var no = 0;
			if(frm.destination.value< 1) {
			incorrect[no] = "1";
			frm.destination.value=" ";
			no++;
			}
			if(!isInteger(frm.day1.value)) {
			incorrect[no] = "2";
			frm.day1.value = "";
			no++;
			}
			if(!isInteger(frm.day2.value)) {
			incorrect[no] = "2";
			frm.day2.value = "";
			no++;
			}
			if(!isInteger(frm.price1.value)) {
			incorrect[no] = "3";
			frm.price1.value = "";
			no++;
			}
			if(!isInteger(frm.price2.value)) {
			incorrect[no] = "3";
			frm.price2.value = "";
			no++;
			}
			for(i=1;i<4;i++) {
				document.getElementById("d_search"+i).style.color="#FFF";
			}
			for(j=0;j<no;j++) { 
				document.getElementById("d_search"+incorrect[j]).style.color="#FF0000";
			}
			if(no > 0) {
			document.getElementById("b_search").innerHTML = "Please check fields with red color ";
			return false;
			}
		}
		
		function validate_customize(frm)				
	{
	var goodEmail =frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	var incorrect = new Array();
	var no = 0;
	
		if(frm.fname.value< 1) {
		incorrect[no] = "1";
		frm.fname.value=" ";
		no++;
		}
		if(frm.lname.value< 1) {
		incorrect[no] = "2";
		frm.lname.value = "";
		no++;
		}
		if(frm.email.value< 1) {
		incorrect[no] = "3";
		frm.email.value = "";
		no++;
		}
		if(!goodEmail) {
		incorrect[no] = "3";
		frm.email.value = "";
		no++;
		}
		if(frm.d_city.value< 1) {
		incorrect[no] = "6";
		frm.d_city.value = "";
		no++;
		}
		if(frm.a_city.value< 1) {
		incorrect[no] = "7";
		frm.a_city.value = "";
		no++;
		}
		if(frm.ADate.value< 1) {
		incorrect[no] = "8";
		frm.ADate.value = "";
		no++;
		}
		if(frm.BDate.value< 1) {
		incorrect[no] = "9";
		frm.BDate.value = "";
		no++;
		}
		if(frm.adult.value< 1) {
		incorrect[no] = "10";
		frm.adult.value = "";
		no++;
		}
		if(!isInteger(frm.adult.value)) {
		incorrect[no] = "10";
		frm.adult.value = "";
		no++;
		}
		if(!isInteger(frm.child.value)) {
		incorrect[no] = "11";
		frm.child.value = "";
		no++;
		}
		if(frm.details.value< 1) {
		incorrect[no] = "12";
		frm.details.value = "";
		no++;
		}
		if(frm.txtCaptcha.value< 1) {
		incorrect[no] = "13";
		frm.txtCaptcha.value = "";
		no++;
		}
	
		for(i=1;i<14;i++) {
			document.getElementById(i).style.color="#000000";
		}
			
		for(j=0;j<no;j++) { 
			document.getElementById(incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
		document.getElementById("plogin").innerHTML = "<font color='red' >Please fill in the fields with Red color.</font><br    />";
		return false;
		}
	 }
	 
	function validate_contact(frm)				
	{
	//var goodEmail =frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	var incorrect = new Array();
	var no = 0;
	
		if(frm.fname.value == "") {
			incorrect[no] = "1";
			frm.fname.value="";
			no++;
		}
		if(frm.lname.value == "") {
			incorrect[no] = "2";
			frm.lname.value="";
			no++;
		}
		
		if(frm.city.value == "") {
			incorrect[no] = "6";
			frm.city.value="";
			no++;
		}
		if(frm.state.value == "") {
			incorrect[no] = "7";
			frm.state.value="";
			no++;
		}
		if(frm.zip.value == "") {
			incorrect[no] = "8";
			frm.zip.value="";
			no++;
		}
		
		
		if(frm.message.value == "") {
			incorrect[no] = "10";
			frm.message.value = "";
			no++;
		}
		if(frm.txtCaptcha.value == "") {
			incorrect[no] = "11";
			frm.txtCaptcha.value = "";
			no++;
		}
		for(i=1;i<6;i++) {
				document.getElementById("contact"+i).style.color="#000000";
		}
		for(j=0;j<no;j++) { 
			document.getElementById("contact"+incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
			document.getElementById("contact").innerHTML = "Please check fields with red color ";
			return false;
		}
	}
	
	function validate_com_register(frm)				
	{
		var goodEmail =frm.username.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	var incorrect = new Array();
	var no = 0;
	var msgpwd = "";
	
		if(frm.fname.value == "") {
			incorrect[no] = "4";
			frm.fname.value="";
			no++;
		}
		if(frm.lname.value == "") {
			incorrect[no] = "5";
			frm.lname.value="";
			no++;
		}
		if(frm.username.value == "") {
			incorrect[no] = "1";
			frm.username.value = "";
			no++;
		}
		if(!goodEmail) {
			incorrect[no] = "1";
			frm.username.value = "";
			no++;
		}
		if(frm.password1.value == "") {
			incorrect[no] = "2";
			frm.password1.value = "";
			no++;
		}
		if(frm.password2.value == "") {
			incorrect[no] = "3";
			frm.password2.value = "";
			no++;
		}
		if(frm.password1.value != frm.password2.value) {
			msgpwd = "Passwod doesn't match with each other.";
		}
		
		/*if(frm.city.value == "") {
			incorrect[no] = "8";
			frm.city.value="";
			no++;
		}*/
	/*	if(frm.state.value == "") {
			incorrect[no] = "9";
			frm.state.value="";
			no++;
		}*/
		/*if(frm.zip.value == "") {
			incorrect[no] = "10";
			frm.zip.value="";
			no++;
		}*/
		
		if(frm.txtCaptcha.value == "") {
			incorrect[no] = "11";
			frm.txtCaptcha.value = "";
			no++;
		}
		for(i=1;i<11;i++) {
				document.getElementById(i).style.color="#000000";
		}
		for(j=0;j<no;j++) { 
			
			document.getElementById(incorrect[j]).style.color="#FF0000";
		}
		if(no > 0 && msgpwd == "") {
			document.getElementById("contact").innerHTML = "Please check fields with red color ";
			return false;
		}
		else if(no>0 && msgpwd != "") {
			document.getElementById("contact").innerHTML = msgpwd;
			return false;
		}
	}
	
	
		function validate_forgot_pass(frm)				
	{
		var goodEmail =frm.user_email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	var incorrect = new Array();
	var no = 0;
	var msgpwd = "";
	
		if(frm.user_email.value == "") {
			incorrect[no] = "1";
			frm.user_email.value="";
			no++;
		}
		if(frm.user_pass.value == "") {
			incorrect[no] = "2";
			frm.user_pass.value="";
			no++;
		}
		if(frm.user_pass1.value == "") {
			incorrect[no] = "3";
			frm.user_pass1.value = "";
			no++;
		}
		if(!goodEmail) {
			incorrect[no] = "1";
			frm.user_email.value = "";
			no++;
		}
		if(frm.user_pass.value != frm.user_pass1.value) {
			msgpwd = "Passwod doesn't match with each other.";
		}
		
	
		for(i=1;i<3;i++) {
				document.getElementById(i).style.color="#000000";
		}
		for(j=0;j<no;j++) { 
			
			document.getElementById(incorrect[j]).style.color="#FF0000";
		}
		if(no > 0 && msgpwd == "") {
			document.getElementById("forgot").innerHTML = "Please check fields with red color ";
			return false;
		}
		else if(no>0 && msgpwd != "") {
			document.getElementById("forgot").innerHTML = msgpwd;
			return false;
		}
	}
	
	
	function validate_change_pass(frm)				
	{
		var incorrect = new Array();
		var no = 0;
		var msgpwd = "";
	
		if(frm.old_pass.value == "") {
			incorrect[no] = "1";
			frm.old_pass.value="";
			no++;
		}
		if(frm.pass1.value == "") {
			incorrect[no] = "2";
			frm.pass1.value="";
			no++;
		}
		if(frm.pass2.value == "") {
			incorrect[no] = "3";
			frm.pass2.value = "";
			no++;
		}
		
		if(frm.pass1.value != frm.pass2.value) {
			msgpwd = "Passwod doesn't match with each other.";
		}
		
	
		for(i=1;i<3;i++) {
				document.getElementById(i).style.color="#000000";
		}
		for(j=0;j<no;j++) { 
			document.getElementById(incorrect[j]).style.color="#FF0000";
		}
		if(no > 0 && msgpwd == "") {
			document.getElementById("change").innerHTML = "Please check fields with red color ";
			return false;
		}
		else if(no>0 && msgpwd != "") {
			document.getElementById("change").innerHTML = msgpwd;
			return false;
		}
	}
	
	
	
	function validate_ref(frm)				
	{
	
	var goodEmail =frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	var incorrect = new Array();
	var no = 0;
	
		if(frm.fname.value == "") {
			incorrect[no] = "1";
			frm.fname.value="";
			no++;
		}
		if(frm.lname.value == "") {
			incorrect[no] = "2";
			frm.lname.value="";
			no++;
		}
		if(!goodEmail) {
			incorrect[no] = "3";
			frm.email.value = "";
			no++;
		}
		/*if(frm.city.value == "") {
			incorrect[no] = "3";
			frm.city.value="";
			no++;
		}
		if(frm.state.value == "") {
			incorrect[no] = "4";
			frm.state.value="";
			no++;
		}
		if(frm.notrip.value == "") {
			incorrect[no] = "5";
			frm.notrip.value="";
			no++;
		}
		if(frm.month.value == "") {
			incorrect[no] = "6";
			frm.month.value="";
			no++;
		}
		if(frm.year.value == "") {
			incorrect[no] = "7";
			frm.year.value="";
			no++;
		}*/
		
		
		/*if(frm.message.value< 1) {
			incorrect[no] = "8";
			frm.message.value = "";
			no++;
		}*/
		if(frm.txtCaptcha.value< 1) {
			incorrect[no] = "11";
			frm.txtCaptcha.value = "";
			no++;
		}
		for(i=1;i<6;i++) {
				document.getElementById("ref"+i).style.color="#000000";
		}
		for(j=0;j<no;j++) { 
			document.getElementById("ref"+incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
			document.getElementById("ref").innerHTML = "Please check fields with red color ";
			return false;
		}
	}
	
	function validate_p_trip(frm)				
	{
		var goodEmail =frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		var incorrect = new Array();
		var no = 0;
	
		if(frm.no.value< 1) {
		incorrect[no] = "1";
		frm.no.value=" ";
		no++;
		}
		if(!isInteger(frm.no.value)) {
		incorrect[no] = "1";
		frm.no.value = "";
		no++;
		}
		if(frm.fname.value< 1) {
		incorrect[no] = "2";
		frm.fname.value=" ";
		no++;
		}
		if(frm.lname.value< 1) {
		incorrect[no] = "3";
		frm.lname.value = "";
		no++;
		}
		if(!goodEmail) {
		incorrect[no] = "4";
		frm.email.value = "";
		no++;
		}
		if(frm.email.value< 1) {
		incorrect[no] = "4";
		frm.email.value = "";
		no++;
		}
		if(frm.address.value< 1) {
		incorrect[no] = "5";
		frm.address.value = "";
		no++;
		}
		if(frm.city.value< 1) {
		incorrect[no] = "6";
		frm.city.value = "";
		no++;
		}
		if(frm.state.value< 1) {
		incorrect[no] = "7";
		frm.state.value = "";
		no++;
		}
		if(frm.zip.value< 1) {
		incorrect[no] = "8";
		frm.zip.value = "";
		no++;
		}
		if(!isInteger(frm.zip.value)) {
		incorrect[no] = "8";
		frm.zip.value = "";
		no++;
		}
		if(frm.d_city.value< 1) {
		incorrect[no] = "11";
		frm.d_city.value = "";
		no++;
		}
		if(frm.travel_time.value< 1) {
		incorrect[no] = "12";
		frm.travel_time.value = "";
		no++;
		}
		if(!isInteger(frm.travel_time.value)) {
		incorrect[no] = "12";
		frm.travel_time.value = "";
		no++;
		}
		if(frm.country_list.value< 1) {
		incorrect[no] = "13";
		frm.country_list.value = "";
		no++;
		}
		if(frm.details.value< 1) {
		incorrect[no] = "14";
		frm.details.value = "";
		no++;
		}
		
		if(frm.txtCaptcha.value< 1) {
		incorrect[no] = "15";
		frm.txtCaptcha.value = "";
		no++;
		}
		for(i=1;i<16;i++) {
				document.getElementById("private"+i).style.color="#000000";
			}
			for(j=0;j<no;j++) { 
				document.getElementById("private"+incorrect[j]).style.color="#FF0000";
			}
			if(no > 0) {
			document.getElementById("private").innerHTML = "Please check fields with red color ";
			return false;
			}
	}
	
	function validate_book(frm)				
	{
	var goodEmail =frm.email.value.match(/\b(^(\S+@).+((\.com)|(\.coop)|(\.name)|(\.aero)|(\.museum)|(\.pro)|(\.net)|(\.info)| (\.edu)|(\.biz)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	var incorrect = new Array();
	var no = 0;
	
		if(frm.name.value< 1) {
		incorrect[no] = "1";
		frm.name.value="";
		no++;
		}
		if(frm.email.value< 1) {
		incorrect[no] = "2";
		frm.email.value = "";
		no++;
		}
		if(!goodEmail) {
		incorrect[no] = "2";
		frm.email.value = "";
		no++;
		}
		if(frm.phone.value< 1) {
		incorrect[no] = "4";
		frm.phone.value = "";
		no++;
		}
		if(frm.d_city.value< 1) {
		incorrect[no] = "5";
		frm.d_city.value = "";
		no++;
		}
		if(frm.ADate.value< 1) {
		incorrect[no] = "6";
		frm.ADate.value = "";
		no++;
		}
		if(frm.adult.value< 1) {
		incorrect[no] = "7";
		frm.adult.value = "";
		no++;
		}
		if(!isInteger(frm.adult.value)) {
		incorrect[no] = "7";
		frm.adult.value = "";
		no++;
		}
		if(frm.txtCaptcha.value< 1) {
		incorrect[no] = "8";
		frm.txtCaptcha.value = " ";
		no++;
		}
	
		for(i=1;i<9;i++) {
			document.getElementById(i).style.color="#000000";
		}
			
		for(j=0;j<no;j++) { 
			document.getElementById(incorrect[j]).style.color="#FF0000";
		}
		if(no > 0) {
		document.getElementById("plogin").innerHTML = "<font color='red' >Please fill in the fields with Red color.</font><br    />";
		return false;
		}
	 }