// update by sachin chaudhari date 14 Nov2006  changes in validation messag and currection validation in city,state,pin code,tel no,,off phone, fax
// product feedback validation starts
	function chkdate(md, dd, yd)
	{
		var months = new Array(13);
   months[0]  = "January";
   months[1]  = "February";
   months[2]  = "March";
   months[3]  = "April";
   months[4]  = "May";
   months[5]  = "June";
   months[6]  = "July";
   months[7]  = "August";
   months[8]  = "September";
   months[9]  = "October";
   months[10] = "November";
   months[11] = "December";

		if (md < 1 || md > 12) { // check month range
		    alert("Month must be between 1 and 12.");
		    return 0;
		  }
		
		  if (dd < 1 || dd > 31) {
		    alert("Day must be between 1 and 31.");
		    return 0;
		  }
		
		  if ((md==4 || md==6 || md==9 || md==11) && dd==31) {
		    alert("Month " + month[md-1] + " doesn't have 31 days!")
		    return 0;
		  }
		
		  if (md == 2) { // check for february 29th
		    var isleap = (yd % 4 == 0 && (yd % 100 != 0 || yd % 400 == 0));
		    if (dd > 29 || (dd==29 && !isleap)) {
		      alert("February " + yd + " doesn't have " + dd + " days!");
		      return 0;
		    }
		  }
	}
	
	//char
function IsNumeric(sText)
	{
		var ValidChars = "0123456789.";
		var IsNumber=true;
		var Char;
			
		for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
			  Char = sText.charAt(i); 
			  if (ValidChars.indexOf(Char) != -1) 
				{
			        IsNumber = "false";
					alert ("Please enter characters only.");						
				}
		  }
	   return IsNumber;   
	}//character validation

	function IsChar(sText)
	{
		var ValidChars = "0123456789.";
		var IsNumber=true;
		var Char;
		
		for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
			  Char = sText.charAt(i); 
			  if (ValidChars.indexOf(Char) == -1) 
				 {
			        IsNumber = "false";
					alert ("Please enter numeric only.");						
				 }
		  }
	   return IsNumber;   
	}//number validation
	
	function IsChar1(sText)
	{
		var ValidChars = "0123456789+-. ";
		var IsNumber=true;
		var Char;
		
		for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
			  Char = sText.charAt(i); 
			  if (ValidChars.indexOf(Char) == -1) 
				 {
			        IsNumber = "false";
					alert ("Please enter in the given format only.");						
				 }
		  }
	   return IsNumber;   
	}//phone number validation
//dont change the above code

function hidden_pfeedback()
{
document.all.vac.style.visibility="hidden";
document.all.water.style.visibility="hidden";
//document.all.air.style.visibility="hidden";
//document.all.vacair.style.visibility="hidden";
document.all.vacwater.style.visibility="hidden";
//document.all.airwater.style.visibility="hidden";
//document.all.vacwaterair.style.visibility="hidden";
}

function validate_pfeedback()
{

if ((document.form.name.value==""))
{
alert ("Please enter your name")
document.form.name.focus()
return false
}
if ((document.form.lname.value==""))
{
alert ("Please enter your Last name")
document.form.lname.focus()
return false
}

if ((document.form.address.value == ""))
{
alert ("Please enter address")
document.form.address.focus()
return false
}

if ((document.form.country.value == "select"))
{
alert ("Please enter country")
document.form.country.focus()
return false
}

if ((document.form.city.value == ""))
{
alert ("Please enter city")
document.form.city.focus()
return false
}
else (document.form.city.value!="")
			{
				var mytext=document.form.city.value;
				var number=IsNumeric(mytext);
				if (number=="false")
				{
					document.form.city.value="";
	                document.form.city.focus();
	                return false;
				}
		}// city validation
		
var str7 = document.form.pin.value
	if (str7 == "") {
		alert("\nThe PINCODE field is blank.\n\nPlease fill the pincode field.")
	document.form.pin.focus();		
	return false;
	}
		for (var i = 0; i < str7.length; i++) {
		var ch = str7.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("\nThe pincode field only accepts integers.\n\nPlease re-enter your pincode.")
			document.form.pin.select();		
			document.form.pin.focus();		
			return false;
		}
	}

var str9 = document.form.telephone.value
	if (str9 == "") {
		alert("The phone field is blank.\n\nPlease fill the phone field.")
	document.form.telephone.focus();		
	return false;
	}

	if (str9.indexOf("+") != 0) 
	{
		alert("Value of phone field should be as shown in e.g.\n\nPlease re-enter the phone field.")
		document.form.telephone.focus();		
		return false;
	}
	if (str9.indexOf("-") == -1) 
	{
		alert("Value of phone field should be as shown in e.g.\n\nPlease re-enter the phone field.")
		document.form.telephone.focus();		
		return false;
	}
	

		for (var i = 0; i < str9.length; i++) {
		var ch = str9.substring(i, i + 1);
		if ( (ch == "+") || (ch == "-" ) || (ch == " " ))
		{
		}
		else if (ch < "0" || "9" < ch)  
		{
			alert("The phone field only accepts integers.\n\nPlease re-enter your phone no.")
			document.form.telephone.select();		
			document.form.telephone.focus();		
			return false;
		}
	}
	
	//mobile
	var str10 = document.form.mobile.value
	if (str10 !="") 
   {
		for (var i = 0; i < str10.length; i++) 
		{
			var ch = str10.substring(i, i + 1);
			if ( (ch == "+") || (ch == "-" ) || (ch == " " ))
			{
			}//if
			else if (ch < "0" || "9" < ch)  
			{
				alert("The mobile field only accepts integers.\n\nPlease re-enter your mobile no.")
				document.form.mobile.select();		
				document.form.mobile.focus();		
				return false;
			}//else if
		}
	}	// mobile
	
	//pager
	var str11 = document.form.pager.value
	if (str11 !="") 
   {
		for (var i = 0; i < str11.length; i++) 
		{
			var ch = str11.substring(i, i + 1);
			if ( (ch == "+") || (ch == "-" ) || (ch == " " ))
			{
			}//if
			else if (ch < "0" || "9" < ch)  
			{
				alert("The pager field only accepts integers.\n\nPlease re-enter your pager no.")
				document.form.pager.select();		
				document.form.pager.focus();		
				return false;
			}//else if
		}
	}	// pager
	
if ((document.form.email.value==""))
{
alert ("Please enter your email address")
document.form.email.focus()
return false
}
	
var string1=document.form.email.value
if ((string1.indexOf("@")==-1)||
(string1.indexOf(".")==-1))
{
alert("Please input a valid email address")
document.form.email.focus()
return false;
}
 
if(document.form.product.value=="VacuumCleaner"){
	if(document.form.vacuum1.value=="select"){
		alert("Please select Appearance of the Vacuum Cleaner");
		document.form.vacuum1.focus();
		return false;
	}
	if(document.form.vacuum2.value=="select"){
		alert("Please select Ease of assembling the machine");
		document.form.vacuum2.focus();
		return false;
	}
	if(document.form.vacuum3.value=="select"){
		alert("Please select Ease of operating and handling the vacuum cleaner");
		document.form.vacuum3.focus();
		return false;
	}
	if(document.form.vacuum4.value=="select"){
		alert("Please select Suitability for cleaning needs");
		document.form.vacuum4.focus();
		return false;
	}
	if(document.form.vacuum5.value=="select"){
		alert("Please select Efficacy in cleaning");
		document.form.vacuum5.focus();
		return false;
	}
	if(document.form.vacuum6.value=="select"){
		alert("Please select Noise level of the vacuum cleaner");
		document.form.vacuum6.focus();
		return false;
	}
	if(document.form.vacuum7.value=="select"){
		alert("Please select Ease of storage");
		document.form.vacuum7.focus();
		return false;
	}

}


if(document.form.product.value=="WaterPurifier"){
	if(document.form.water1.value=="select"){
		alert("Please select Efficacy in providing pure water");
		document.form.water1.focus();
		return false;
	}
	if(document.form.water2.value=="select"){
		alert("Please select Ease of operation");
		document.form.water2.focus();
		return false;
	}
	if(document.form.water3.value=="select"){
		alert("Please select Time taken to get pure water");
		document.form.water3.focus();
		return false;
	}
	if(document.form.water4.value=="select"){
		alert("Please select Ease of maintenance");
		document.form.water4.focus();
		return false;
	}
	if(document.form.water5.value=="select"){
		alert("Please select Appearance");
		document.form.water5.focus();
		return false;
	}
}

  if(document.form.product.value=="select")
   {
   		if(document.form.vacwater1.value=="select"){
		alert("Please select Appearance of the Vacuum Cleaner");
		document.form.vacwater1.focus();
		return false;
	}
	if(document.form.vacwater2.value=="select"){
		alert("Please select Ease of assembling the machine");
		document.form.vacwater2.focus();
		return false;
	}
	if(document.form.vacwater3.value=="select"){
		alert("Please select Ease of operating and handling the vacuum cleaner");
		document.form.vacwater3.focus();
		return false;
	}
	if(document.form.vacwater4.value=="select"){
		alert("Please select Suitability for cleaning needs");
		document.form.vacwater4.focus();
		return false;
	}
	if(document.form.vacwater5.value=="select"){
		alert("Please select Efficacy in cleaning");
		document.form.vacwater5.focus();
		return false;
	}
	if(document.form.vacwater6.value=="select"){
		alert("Please select Noise level of the vacuum cleaner");
		document.form.vacwater6.focus();
		return false;
	}
	if(document.form.vacwater7.value=="select"){
		alert("Please select Ease of storage");
		document.form.vacwater7.focus();
		return false;
	}
	if(document.form.vacwater11.value=="select"){
		alert("Please select Efficacy in providing pure water");
		document.form.vacwater11.focus();
		return false;
	}
	if(document.form.vacwater22.value=="select"){
		alert("Please select Ease of operation");
		document.form.vacwater22.focus();
		return false;
	}
	if(document.form.vacwater33.value=="select"){
		alert("Please select Time taken to get pure water");
		document.form.vacwater33.focus();
		return false;
	}
	if(document.form.vacwater44.value=="select"){
		alert("Please select Ease of maintenance");
		document.form.vacwater44.focus();
		return false;
	}
	if(document.form.vacwater55.value=="select"){
		alert("Please select Appearance");
		document.form.vacwater55.focus();
		return false;
	}
   }

	
}


function validateproduct(){
if (document.form.product.selectedIndex >-1) {
   var t="";
   for (var i=document.form.product.selectedIndex;i<document.form.product.options.length;i++) {
      if (document.form.product.options[i].selected){ t += document.form.product.options[i].value + "" ;}
      //alert(t);
   }
   if(t=="VacuumCleaner"){
   		//document.all.vac.style.visibility="visible";
        //alert(t);
		vac.innerHTML="<table cellpadding='4' cellspacing='0' border='0' align='center' class='data' width='430'>"+
										"<tr align='left'>"+
										"<td class='tabnorm' width='250'>Appearance of the High End Vaccum Cleaners<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most attractive)</font></td>"+
										"<td><select name='vacuum1' class='textbox'>"+
										"<option value='select'>Select"+
										"<option value='1'>1"+
										"<option value='2'>2"+
										"<option value='3'>3"+
										"<option value='4'>4"+
										"<option value='5'>5"+
										"<option value='6'>6"+
										"<option value='7'>7"+
										"<option value='8'>8"+
										"<option value='9'>9"+
										"<option value='10'>10"+
										"</select></td>"+
										"</tr>"+
										"<tr align='left'>"+
										"<td class='tabnorm' width='250'>Ease of assembling the machine<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very user friendly)</font></td>"+
										"<td><select name='vacuum2' class='textbox'>"+
										"<option value='select'>Select"+
										"<option value='1'>1"+
										"<option value='2'>2"+
										"<option value='3'>3"+
										"<option value='4'>4"+
										"<option value='5'>5"+
										"<option value='6'>6"+
										"<option value='7'>7"+
										"<option value='8'>8"+
										"<option value='9'>9"+
										"<option value='10'>10"+
										"</select></td>"+
										"</tr>"+
										"<tr align='left'>"+
										"<td class='tabnorm' >Ease of operating and handling<br>the High End Vaccum Cleaners<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very easy)</font></td>"+
										"<td><select name='vacuum3' class='textbox'>"+
										"<option value='select'>Select"+
										"<option value='1'>1"+
										"<option value='2'>2"+
										"<option value='3'>3"+
										"<option value='4'>4"+
										"<option value='5'>5"+
										"<option value='6'>6"+
										"<option value='7'>7"+
										"<option value='8'>8"+
										"<option value='9'>9"+
										"<option value='10'>10"+
										"</select></td>"+
										"</tr>"+
										"<tr align='left'>"+
										"<td class='tabnorm'>Suitability for cleaning needs<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most suitable)</font></td>"+
										"<td><select  class='textbox' name='vacuum4'>"+
										"<option value='select'>Select<option value='1'>1<option  value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td>"+
										"</tr>"+
										"<tr align='left'>"+
										"<td class='tabnorm' width='250'>Efficacy in cleaning<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most effective)</font></td>"+
										"<td><select name='vacuum5' class='textbox'>"+
										"<option value='select'>Select"+
										"<option value='1'>1"+
										"<option value='2'>2"+
										"<option value='3'>3"+
										"<option value='4'>4"+
										"<option value='5'>5"+
										"<option value='6'>6"+
										"<option value='7'>7"+
										"<option value='8'>8"+
										"<option value='9'>9"+
										"<option value='10'>10"+
										"</select></td>"+
										"</tr>"+
										"<tr align='left'>"+
										"<td class='tabnorm' width='250'>Noise level of the High End Vaccum Cleaners<br><font size='-4' face='Verdana' color='red'>(where 10 indicates least noise)</font></td>"+
										"<td><select name='vacuum6' class='textbox'>"+
										"<option value='select'>Select"+
										"<option value='1'>1"+
										"<option value='2'>2"+
										"<option value='3'>3"+
										"<option value='4'>4"+
                                        "<option value='5'>5"+
										"<option value='6'>6"+
										"<option value='7'>7"+
										"<option value='8'>8"+
										"<option value='9'>9"+
										"<option value='10'>10"+
										"</select></td>"+
										"</tr>"+
										"<tr align='left'>"+
										"<td class='tabnorm' width='250'>Ease of storage<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very easy)</font></td>"+
										"<td><select name='vacuum7' class='textbox'>"+
										"<option value='select'>Select"+
										"<option value='1'>1"+
										"<option value='2'>2"+
										"<option value='3'>3"+
										"<option value='4'>4"+
										"<option value='5'>5"+
										"<option value='6'>6"+
										"<option value='7'>7"+
										"<option value='8'>8"+
										"<option value='9'>9"+
										"<option value='10'>10"+
										"</select></td>"+
										"</tr>"+
										"<tr><td colspan=2 align=center>"+
										"<table border='0' class='data' width='200' >"+
										"<tr><td align='center'>We appreciate your feedback.</td></tr>"+
										"<tr><td align='center' colspan='2' class='sub'><input type='image' src='../../images/common/submit-but.gif' alt='Submit' align='absmiddle'>&nbsp;&nbsp;&nbsp;<img src='../../images/common/reset-but.gif' type='reset' alt='Reset' border='0' onclick='reset();' style='cursor:hand'  align='absmiddle'></td></tr></table> "+
										"</td></tr>"+
									"</table>";
   }
   else{
   		vac.innerHTML="";
        //document.all.vac.style.visibility="hidden";
   }
   if(t=="WaterPurifier"){
		//document.all.water.style.visibility="visible";
        //alert(t);
       		water.innerHTML="<table cellpadding='4' cellspacing='0' align='center' class='data' border=0 width='430'>"+
									"<tr><td class='tabnorm' colspan='2' align='center'><font color='Red'>All the fields are compulsory</font></td></tr>"+
									"<tr><td class='tabnorm' width='250'>Efficacy in providing pure water<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most effective)</font></td>"+
                                    "<td><select name='water1' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									"<tr><td class='tabnorm' width='250'>Ease of operation<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very easy)</font></td>"+
									"<td><select name='water2' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									"<tr><td class='tabnorm' width='250'>Time taken to get pure water<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very less)</font></td>"+
									"<td><select name='water3' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
                                    "<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									
									"<tr><td class='tabnorm' width='250'>Ease of maintenance<br><font size='-4' face='Verdana' color='red'>(where 10 indicates maintenance free)</font></td>"+
									"<td><select name='water4' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									"<tr><td class='tabnorm' width='250'>Appearance<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most attractive)</font></td>"+
									"<td><select name='water5' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
                                    "<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									"<tr><td colspan=2 align=center><table border='0' class='data' width='200' ><tr><td align='center'>We appreciate your feedback.</td></tr><tr><td align='center' colspan='2' class='sub'><input type='image' src='../../images/common/submit-but.gif' alt='Submit' align='absmiddle'>&nbsp;&nbsp;&nbsp;<img src='../../images/common/reset-but.gif' type='reset' alt='Reset' border='0' onclick='reset();' style='cursor:hand'  align='absmiddle'></td></tr></table></td></tr></table>";
	}
   else{
		//document.all.water.style.visibility="hidden";   
        water.innerHTML="";
   }

   if(t=="VacuumCleanerWaterPurifier"){
   		//ocument.all.vacwater.style.visibility='visible';
        //alert(t);
        vacwater.innerHTML="<table cellpadding='4' cellspacing='0' border='0' align='center' width='430' class='data'><tr><td class='tabnorm' colspan='2' align='center'><font color='Red'>All the fields are compulsory</font></td></tr>"+
									"<tr><td colspan='2' align='left' class='tabnorm'><b>High End Vaccum Cleaners</b></td></tr>"+
									"<tr align='left'><td class='tabnorm' width='250'>Appearance of the High End Vaccum Cleaners<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most attractive)</font></td>"+
									"<td><select name='vacwater1' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									
									"<tr align='left'>"+
									"<td class='tabnorm' width='250'>Ease of assembling the machine<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very user friendly)</font></td>"+
									"<td><select name='vacwater2' class='textbox'><option value='select'>Select<option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									
									"<tr align='left'>"+
									"<td class='tabnorm' width='250'>Ease of operating and handling the vacuum cleaner<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very easy)</font></td>"+
									"<td><select name='vacwater3' class='textbox'><option value='select'>Select<option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									
									"<tr align='left'>"+
									"<td class='tabnorm' width='250'>Suitability for cleaning needs<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most suitable)</font></td>"+
									"<td><select name='vacwater4' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									
									"<tr align='left'>"+
									"<td class='tabnorm' width='250'>Efficacy in cleaning<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most effective)</font></td>"+
									"<td><select name='vacwater5' class='textbox'><option value='select'>Select<option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
                                    									
									"<tr align='left'><td class='tabnorm' width='250'>Noise level of the High End Vaccum Cleaners<br><font size='-4' face='Verdana' color='red'>(where 10 indicates least noise)</font></td>"+
									"<td><select name='vacwater6' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									
									"<tr align='left'><td class='tabnorm' width='250'>Ease of storage<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very easy)</font></td>"+
									"<td><select name='vacwater7' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
                                    
									"<tr><td colspan='2' align='left' class='tabnorm'><br><b>Water Purification Systems</b></td></tr>"+
									"<tr><td class='tabnorm' width='250'>Efficacy in providing pure water<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most effective)</font></td>"+
									"<td><select name='vacwater11' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
                                    									
									"<tr><td class='tabnorm' width='250'>Ease of operation<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very easy)</font></td>"+
									"<td><select name='vacwater22' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									
									"<tr><td class='tabnorm' width='250'>Time taken to get pure water<br><font size='-4' face='Verdana' color='red'>(where 10 indicates very less)</font></td>"+
									"<td><select name='vacwater33' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									
									"<tr><td class='tabnorm' width='250'>Ease of maintenance<br><font size='-4' face='Verdana' color='red'>(where 10 indicates maintenance free)</font></td>"+
									"<td><select name='vacwater44' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
									
									"<tr><td class='tabnorm' width='250'>Appearance<br><font size='-4' face='Verdana' color='red'>(where 10 indicates most attractive)</font></td>"+
									"<td><select name='vacwater55' class='textbox'><option value='select'>Select<option value='1'>1<option value='2'>2<option value='3'>3<option value='4'>4<option value='5'>5<option value='6'>6"+
									"<option value='7'>7<option value='8'>8<option value='9'>9<option value='10'>10</select></td></tr>"+
                                    
									"<tr><td align=center colspan=2><table border='0' class='data' width='200' ><tr><td align='center'>We appreciate your feedback.</td></tr>"+
									"<tr><td align='center' colspan='2' class='sub'><input type='image' src='../../images/common/submit-but.gif' alt='Submit' align='absmiddle'>&nbsp;&nbsp;&nbsp;<img src='../../images/common/reset-but.gif' type='reset' alt='Reset' border='0' onclick='reset();' style='cursor:hand'  align='absmiddle'></td></tr></table></td></tr></table>";
	}
   else{
   		//document.all.vacwater.style.visibility="hidden";
   vacwater.innerHTML="";
   }

}
document.form.hidproduct.value=t
return t;

}

// product feedback validation ends


/*
// service feedback validation starts
function hidden_sfeedback()
{
document.all.less1.style.visibility="hidden";
document.all.more1.style.visibility="hidden";
document.all.contractyes.style.visibility="hidden";
document.all.contractno.style.visibility="hidden";
document.all.conbefoyes.style.visibility="hidden";
document.all.conbefono.style.visibility="hidden";
}

function validate_sfeedback(){
if ((document.formless1.name.value==""))
{
alert ("Please enter your name!")
document.formless1.name.focus()
return false
}
if ((document.formless1.lname.value==""))
{
alert ("Please enter your Last name!")
document.formless1.lname.focus()
return false
}

var str7 = document.formless1.pin.value
	if (str7 == "") {
		alert("\nThe PINCODE field is blank.\n\nPlease fill the pincode field.")
	document.formless1.pin.focus();		
	return false;
	}
		for (var i = 0; i < str7.length; i++) {
		var ch = str7.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("\nThe pincode field only accepts integers.\n\nPlease re-enter your pincode.")
			document.formless1.pin.select();		
			document.formless1.pin.focus();		
			return false;
		}
	}

var str9 = document.formless1.telephone.value
	if (str9 == "") {
		alert("The phone field is blank.\n\nPlease fill the phone field.")
	document.formless1.telephone.focus();		
	return false;
	}
		for (var i = 0; i < str9.length; i++) {
		var ch = str9.substring(i, i + 1);
		
		if (ch < 0 || 9 < ch ) 
		{
			alert("The phone field only accepts integers.\n\nPlease re-enter your phone no.")
			document.formless1.telephone.select();		
			document.formless1.telephone.focus();		
			return false;
		}
	}
if ((document.formless1.email.value==""))
{
alert ("Please enter your email address!")
document.formless1.email.focus()
return false
}
	
var string1=document.formless1.email.value
if ((string1.indexOf("@")==-1)||(string1.indexOf(".")==-1))
{
alert("Please input a valid email address!")
document.formless1.email.focus()
return false;
}

	if(document.formless1.year.value=="select"){
		alert("Please select valid value of year");
		document.formless1.year.focus();
		return false;
	}
if(document.all.less1.style.visibility=="visible"){
	if(document.formless1.frequency.value=="select"){
		alert("Please select Frequency of visit");
		document.formless1.frequency.focus();
		return false;
	}
	if(document.formless1.visits.value=="select"){
		alert("Please select Timeliness of visits");
		document.formless1.visits.focus();
		return false;
	}
	if(document.formless1.checks.value=="select"){
		alert("Please select Thoroughness of the checks");
		document.formless1.checks.focus();
		return false;
	}
	if(document.formless1.competence.value=="select"){
		alert("Please select Competence of the service personnel");
		document.formless1.competence.focus();
		return false;
	}
	if(document.formless1.convenience.value=="select"){
		alert("Please select Convenience in terms of fixing appointment");
		document.formless1.convenience.focus();
		return false;
	}
}	


if(document.all.more1.style.visibility=="visible"){
	if(document.formless1.contract1.value=="select"){
		alert("Please select valid answer");
		document.formless1.contract1.focus();
		return false;
	}
}


if(document.all.contractyes.style.visibility=="visible"){
	if(document.formless1.frequency1.value=="" || document.formless1.frequency1.value==" "){
		alert("Please enter Frequency of visit");
		document.formless1.frequency1.focus();
		return false;
	}
	else if(isNaN(document.formless1.frequency1.value)){
		alert("Please enter valid value for Frequency of visit");
		document.formless1.frequency1.select();
		return false;
	}
	if(document.formless1.visits1.value=="select"){
		alert("Please select Timeliness of visits");
		document.formless1.visits1.focus();
		return false;
	}
	if(document.formless1.checks1.value=="select"){
		alert("Please select Thoroughness of the checks");
		document.formless1.checks1.focus();
		return false;
	}
	if(document.formless1.competence1.value=="select"){
		alert("Please select Competence of the service personnel");
		document.formless1.competence1.focus();
		return false;
	}
	if(document.formless1.convenience1.value=="select"){
		alert("Please select Convenience in terms of fixing appointment");
		document.formless1.convenience1.focus();
		return false;
	}
	if(document.formless1.price1.value=="select"){
		alert("Please select Price of the Service contract");
		document.formless1.price1.focus();
		return false;
	}
}

if(document.all.contractno.style.visibility=="visible"){
	if(document.formless1.contract2.value=="select"){
		alert("Please select valid answer");
		document.formless1.contract2.focus();
		return false;
	}
}

if(document.all.conbefoyes.style.visibility=="visible"){
	if(document.formless1.frequency2.value=="" || document.formless1.frequency2.value==" "){
		alert("Please enter Frequency of visit");
		document.formless1.frequency2.focus();
		return false;
	}
	else if(isNaN(document.formless1.frequency2.value)){
		alert("Please enter valid value for Frequency of visit");
		document.formless1.frequency2.select();
		return false;
	}
	if(document.formless1.visits2.value=="select"){
		alert("Please select Timeliness of visits");
		document.formless1.visits2.focus();
		return false;
	}
	if(document.formless1.checks2.value=="select"){
		alert("Please select Thoroughness of the checks");
		document.formless1.checks2.focus();
		return false;
	}
	if(document.formless1.competence2.value=="select"){
		alert("Please select Competence of the service personnel");
		document.formless1.competence2.focus();
		return false;
	}
	if(document.formless1.convenience2.value=="select"){
		alert("Please select Convenience in terms of fixing appointment");
		document.formless1.convenience2.focus();
		return false;
	}
}
}

function validateconbefono(){
if(document.all.conbefono.style.visibility=="visible"){
	if(document.formless1.reasons.value=="" || document.formless1.reasons.value==" "){
		alert("Please enter Reasons for not taking a contract");
		document.formless1.reasons.focus();
		return false;
	}
	if(document.formless1.contract3.value==""){
		alert("Please select valid answer");
		document.formless1.contract3.focus();
		return false;
	}
}

}*/
// service feedback validation ends


// website feedback validation starts
function validate_wfeedback()
{


if ((document.cont.name.value==""))
{
alert ("Please enter your name111")
document.cont.name.focus()
return false
}
if ((document.cont.lname.value==""))
{
alert ("Please enter your Last name")
document.cont.lname.focus()
return false
}

var str7 = document.cont.pin.value
	if (str7 == "") {
		alert("\nThe PINCODE field is blank.\n\nPlease fill the pincode field.")
	document.cont.pin.focus();		
	return false;
	}
		for (var i = 0; i < str7.length; i++) {
		var ch = str7.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("\nThe pincode field only accepts integers.\n\nPlease re-enter your pincode.")
			document.cont.pin.select();		
			document.cont.pin.focus();		
			return false;
		}
	}

var str9 = document.cont.telephone.value
	if (str9 == "") {
		alert("The phone field is blank.\n\nPlease fill the phone field.")
	document.cont.telephone.focus();		
	return false;
	}
		for (var i = 0; i < str9.length; i++) {
		var ch = str9.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("The phone field only accepts integers.\n\nPlease re-enter your phone no.")
			document.cont.telephone.select();		
			document.cont.telephone.focus();		
			return false;
		}
	}
if ((document.cont.email.value==""))
{
alert ("Please enter your email address")
document.cont.email.focus()
return false
}
	
var string1=document.cont.email.value
if ((string1.indexOf("@")==-1)||
(string1.indexOf(".")==-1))
{
alert("Please input a valid email address")
document.cont.email.focus()
return false;
}

if (document.cont.look.options[document.cont.look.selectedIndex].value=="select")
{
  alert("Please rate our Design")  
  document.cont.look.focus();
  return false;
  		}
		if (document.cont.navigation.options[document.cont.navigation.selectedIndex].value=="select"){
  alert("Please rate our Navigation")  
  document.cont.navigation.focus();
  return false;
  		}
		if (document.cont.content.options[document.cont.content.selectedIndex].value=="select")
{
  alert("Please rate our Content")  
  document.cont.content.focus();
  return false;
  		}
if (document.cont.user.options[document.cont.user.selectedIndex].value=="select"){
  alert("Please rate our Loading Time")  
  document.cont.user.focus();
  return false;
  		}
	return true;
}
// website feedback validation ends


// request a demo validation starts
function validate_demo()
{
if (document.cont.DemoDate.options[document.cont.DemoDate.selectedIndex].value=="select"){
  alert("Please Select Date ")  
  document.cont.DemoDate.focus();
  return false;
  		}
		if (document.cont.DemoMonth.options[document.cont.DemoMonth.selectedIndex].value=="select"){
  alert("Please Select Month ")  
 document.cont.DemoMonth.focus();
  return false;
  		}
if (document.cont.DemoYear.options[document.cont.DemoYear.selectedIndex].value=="select"){
  alert("Please Select Year")  
  document.cont.DemoYear.focus();
  return false;
  		}
if (document.cont.DemoTime.value=="")
{
alert ("Please enter your Demo Time")
document.cont.DemoTime.focus()
return false
}
if ((document.cont.name.value==""))
{
alert ("Please enter your name")
document.cont.name.focus()
return false
}
if ((document.cont.address.value==""))
{
alert ("Please enter your Address")
document.cont.address.focus()
return false
}
		if (document.cont.state.options[document.cont.state.selectedIndex].value=="select"){
  alert("Please Select State")  
  document.cont.state.focus();
  return false;
  		}
if (document.cont.city.options[document.cont.city.selectedIndex].value=="select"){
  alert("Please Select City")  
  document.cont.city.focus();
  return false;
  		}

if(document.cont.pincode.value=="")
{
alert("Please enter pincode")	
document.cont.pincode.focus()
return false
}
var str9 = document.cont.telephone.value
	if (str9 == "") {
		alert("The phone field is blank.\n\nPlease fill the phone field.")
	document.cont.telephone.focus();		
	return false;
	}
		for (var i = 0; i < str9.length; i++) {
		var ch = str9.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("The phone field only accepts integers.\n\nPlease re-enter your phone no.")
			document.cont.telephone.select();		
			document.cont.telephone.focus();		
			return false;
		}
	}
if ((document.cont.email.value==""))
{
alert ("Please enter your email address")
document.cont.email.focus()
return false
}
var string1=document.cont.email.value
if ((string1.indexOf("@")==-1)||
(string1.indexOf(".")==-1))
{
alert("Please input a valid email address")
document.cont.email.focus()
return false;
}
return true;
}

function SubmitForm()
{
var flag=0;
if(document.cont.crcid.length > 1){
	for(var i=0;i<document.cont.crcid.length;i++){
		if(document.cont.crcid[i].checked){
			flag=1;
		}
	}
	if(flag==0)
	{
		alert("Please select nearest crc.")
		document.cont.crcid[0].focus()
		return false
	}
}
else{
	if(!document.cont.crcid.checked){
		alert("Please select nearest crc.")
		document.cont.crcid.focus()
		return false
	}
}

//checking for availability of products starts
if(document.cont.counter.value == "y"){
if((document.cont.vacuum.options[document.cont.vacuum.selectedIndex].value=="") && (document.cont.water.options[document.cont.water.selectedIndex].value=="") && (document.cont.AirPurifier.options[document.cont.AirPurifier.selectedIndex].value==""))
{
alert ("Please select atleast one product.")
return false;
}


	
document.cont.vac.value=""
document.cont.wat.value=""
document.cont.air.value=""

	var i
	for(i=0;i<document.cont.vacuum.length;i++){
		if(document.cont.vacuum.options[i].selected){
			if(document.cont.vacuum.options[i].value!=""){
			if(document.cont.vac.value==""){
	document.cont.vac.value=document.cont.vacuum.options[i].value
			}
			else{
	document.cont.vac.value+=","+document.cont.vacuum.options[i].value
			}
			}
		}
	}
	
	for(i=0;i<document.cont.water.length;i++){
		if(document.cont.water.options[i].selected){
			if(document.cont.water.options[i].value!=""){
			if(document.cont.wat.value=="" && document.cont.vac.value==""){
	document.cont.wat.value=document.cont.water.options[i].value
			}
			else{
	document.cont.wat.value+=","+document.cont.water.options[i].value
			}
			}
		}
	}
	
/*	if(document.cont.AirPurifier.options[document.cont.AirPurifier.selectedIndex].value!=""){
		if(document.cont.wat.value=="" && document.cont.vac.value==""){
	document.cont.air.value=document.cont.AirPurifier.options[document.cont.AirPurifier.selectedIndex].value
		}
		else{
	document.cont.air.value=","+document.cont.AirPurifier.options[document.cont.AirPurifier.selectedIndex].value
		}
	}
*/
//alert(document.cont.vac.value+"\n"+document.cont.wat.value+"\n"+document.cont.air.value);
}
//checking for availability of products ends
}

// request a demo validation ends


// dealers validation ends
function validate_export()
{
if ((document.cont.compname.value==""))
{
alert ("Please enter company name")
document.cont.compname.focus()
return false
}
if ((document.cont.address.value==""))
{
alert ("Please enter address")
document.cont.address.focus()
return false
}
if ((document.cont.city.value==""))
{
alert ("Please enter city")
document.cont.city.focus()
return false
}
if ((document.cont.country.value==""))
{
alert ("Please enter country")
document.cont.country.focus()
return false
}	
		
var str9 = document.cont.phone.value
	if (str9 == "") {
		alert("The phone field is blank.\n\nPlease fill the phone field.")
	document.cont.phone.focus();		
	return false;
	}
		for (var i = 0; i < str9.length; i++) {
		var ch = str9.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("The phone field accepts only integers.\n\nPlease re-enter your phone no.")
			document.cont.phone.select();		
			document.cont.phone.focus();		
			return false;
		}
	}
	
if ((document.cont.fax.value==""))
{
alert ("Please enter fax")
document.cont.fax.focus()
return false
}
else
{
str1=document.cont.fax.value
for (var i = 0; i < str1.length; i++) {
		var ch = str1.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("The fax field accepts only integers.\n\nPlease re-enter your fax no.")
			document.cont.fax.select();		
			document.cont.fax.focus();		
			return false;
		}
	}

}	
if ((document.cont.email.value==""))
{
alert ("Please enter your email address")
document.cont.email.focus()
return false
}
	
var string1=document.cont.email.value
if ((string1.indexOf("@")==-1)||
(string1.indexOf(".")==-1))
{
alert("Please input a valid email address")
document.cont.email.focus()
return false;
}
if ((document.cont.orgprofile.value==""))
{
alert ("Please enter organisation profile")
document.cont.orgprofile.focus()
return false
}
if((document.cont.int1.checked==false) && (document.cont.int2.checked==false) && (document.cont.int3.checked==false))
{
alert ("Please select atleast one product")
document.cont.int1.focus()
return false

}
return true;
}
// business exports
function validate_dealers()
{
if ((document.cont.name.value==""))
{
alert ("Please enter your name")
document.cont.name.focus()
return false
}
if ((document.cont.secondname.value==""))
{
alert ("Please enter your Last name")
document.cont.secondname.focus()
return false
}
		
var str9 = document.cont.residence.value
	if (str9 == "") {
		alert("The phone field is blank.\n\nPlease fill the phone field.")
	document.cont.residence.focus();		
	return false;
	}
		for (var i = 0; i < str9.length; i++) {
		var ch = str9.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("The phone field only accepts integers.\n\nPlease re-enter your phone no.")
			document.cont.residence.select();		
			document.cont.residence.focus();		
			return false;
		}
	}
if ((document.cont.email.value==""))
{
alert ("Please enter your email address")
document.cont.email.focus()
return false
}
	
var string1=document.cont.email.value
if ((string1.indexOf("@")==-1)||
(string1.indexOf(".")==-1))
{
alert("Please input a valid email address")
document.cont.email.focus()
return false;
}
	return true;
}
// dealers validation ends
// franchisee validation ends
function validate_fran()
{
if ((document.cont.name.value==""))
{
alert ("Please enter your name")
document.cont.name.focus()
return false
}
if ((document.cont.secondname.value==""))
{
alert ("Please enter your last name")
document.cont.secondname.focus()
return false
}

	var str9 = document.cont.residence1.value
	if (str9 == "") {
		alert("The residence phone field is blank.\n\nPlease fill the phone field.")
	document.cont.residence1.focus();		
	return false;
	}
	for (var i = 0; i < str9.length; i++) {
		var ch = str9.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("The residence phone field only accepts integers.\n\nPlease re-enter your residence phone no.")
			document.cont.residence1.select();		
			document.cont.residence1.focus();		
			return false;
		}
	}

var str10 = document.cont.office.value
	if (str10 == "") {
		alert("The office phone field is blank.\n\nPlease fill the phone field.")
	document.cont.office.focus();		
	return false;
	}
		for (var i = 0; i < str10.length; i++) {
		var ch = str10.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("The office phone field only accepts integers.\n\nPlease re-enter your office phone no.")
			document.cont.office.select();		
			document.cont.office.focus();		
			return false;
		}
		}

if ((document.cont.email.value==""))
{
alert ("Please enter your email address")
document.cont.email.focus()
return false
}
	
var string1=document.cont.email.value
if ((string1.indexOf("@")==-1)||
(string1.indexOf(".")==-1))
{
alert("Please enter a valid email address")
document.cont.email.focus()
return false;
}
return true;
}
// franchisee validation ends


// service validation starts
function validate_service(x)
{
if(x==0){
if (document.cont.region4.options[document.cont.region4.selectedIndex].value=="select")
{
  alert("Please Select Category ")  
  document.cont.region4.focus();
  return false;
}
if (document.cont.country4.options[document.cont.country4.selectedIndex].value=="")
{
  alert("Please Select Product ")  
  document.cont.country4.focus();
  return false;
}
}
if ((document.cont.name4.value==""))
{
alert ("Please enter your name")
document.cont.name4.focus()
return false
}
if ((document.cont.address4.value==""))
{
alert ("Please enter your Address!")
document.cont.address4.focus()
return false
}
if (document.cont.city24.options[document.cont.city24.selectedIndex].value=="select")
{
  alert("\n Please Select City ")  
  document.cont.city24.focus();
  return false;
  		}
if(document.cont.pin4.value=="")
{
alert("Please fill the pin code")
document.cont.pin4.focus()
return false
}
var strr = document.cont.pin4.value
for (var i = 0; i < strr.length; i++) {
		var ch = strr.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("The Pin field only accepts integers.\n\nPlease re-enter your Pin no.")
			document.cont.pin4.select();		
			document.cont.pin4.focus();		
			return false;
		}
	}
var str9 = document.cont.phone4.value
	if (str9 == "") {
		alert("The phone field is blank.\n\nPlease fill the phone field.")
	document.cont.phone4.focus();		
	return false;
	}
		for (var i = 0; i < str9.length; i++) {
		var ch = str9.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
			alert("The phone field only accepts integers.\n\nPlease re-enter your phone no.")
			document.cont.phone4.select();		
			document.cont.phone4.focus();		
			return false;
		}
	}
if ((document.cont.email4.value==""))
{
alert ("Please enter your email address")
document.cont.email4.focus()
return false
}
	
var string1=document.cont.email4.value
if ((string1.indexOf("@")==-1)||
(string1.indexOf(".")==-1))
{
alert("Please input a valid email address")
document.cont.email4.focus()
return false;
}
		if (document.cont.date4.options[document.cont.date4.selectedIndex].value=="select"){
  alert("Please Select Date ")  
  document.cont.date4.focus();
  return false;
  		}
		if (document.cont.month4.options[document.cont.month4.selectedIndex].value=="select")
{
  alert("Please Select Month ")  
  document.cont.month4.focus();
  return false;
  		}
if (document.cont.year4.options[document.cont.year4.selectedIndex].value=="select"){
  alert("Please Select Year ")  
  document.cont.year4.focus();
  return false;
  		}

	return true;
} 

var waterpurifierArray =  new Array("('Select Model','',true,true)",
"('Forbes Aquaflo Designa')",
"('Aquaguard i-Nova')",
"('Aquaguard Classic')",
"('Aquaguard Compact Cartridge')",
"('Aquaguard Nova')",
"('Aquaguard Royale')",
"('Aquaguard Pump Model')",
"('Aquaguard Hi-Flo')",
"('Forbes Aquaflo')",
"('Aquaguard Reviva')",
"('Aquapower')",
"('Forbes 3 in 1')");

var vacuumcleanerArray =  new Array("('Select Model','',true,true)",
"('Euroclean Bullet')",
"('Euroclean Jet')",
"('Euroclean WD')",
"('Euroclean Swift')",
"('Tornado Trendy')",
"('Tornado All Around')",
"('Tornado Handee')",
"('Tornado Ezee')",
"('Tornado Compacta')");
var airpurifierArray =  new Array("('Select Model','',true,true)",
"('Euroair')");

function populateCountry(inForm,selected) {
var selectedArray = eval(selected + "Array");
while (selectedArray.length < inForm.country4.options.length) {
inForm.country4.options[(inForm.country4.options.length - 1)] = null;
}
for (var i=0; i < selectedArray.length; i++) {
eval("inForm.country4.options[i]=" + "new Option" + selectedArray[i]);
}
if (inForm.region4.options[0].value == '') {
inForm.region4.options[0]= null;
if ( navigator.appName == 'Netscape') {
if (parseInt(navigator.appVersion) < 4) {
window.history.go(0);
}
else {   	
if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
window.history.go(0);
            }
         }
      }
   }
}

function validate_service1()
{
var flag=0;
if(document.cont.name44.length > 1){
	for(var i=0;i<document.cont.name44.length;i++){
		if(document.cont.name44[i].checked){
			flag=1;
		}
	}
	if(flag==0)
	{
		alert("Please select nearest crc.")
		document.cont.name44[0].focus()
		return false
	}
}
else{
	if(!document.cont.name44.checked){
		alert("Please select nearest crc.")
		document.cont.name44.focus()
		return false
	}
}
return true;
}	

// service validation ends


// search function starts
function frmsearch(){
	document.frm.action="../search/search.php";
	document.frm.submit();
}
function frmsearch1(){
	document.frm1.action="../search/search.php";
	document.frm1.submit();
}
function frmsearchfromhome(){
	document.frm.action="search/search.php";
	document.frm.submit();
}
// search function ends

// faq-meraeureka functions start
	function win1()
	{
	window.open("air_pollu.htm","Eureka","height=300,width=550,scrollbars=yes")
	}
		function win2()
	{
	window.open("dust.htm","Eureka","height=400,width=550,scrollbars=yes")
	}

		function win3()
	{
	window.open("services.htm","Eureka","height=300,width=550,scrollbars=yes")
	}
function win4()
	{
	window.open("water.htm","Eureka","height=400,width=550,scrollbars=yes")
	}
// faq-meraeureka functions end

//mera eureka function starts
function meraeureka(){
	if(document.cont.fname.value==""){
		alert("Please enter your first name")
		document.cont.fname.focus()
		return false
	}
/*	if(document.cont.lname.value==""){
		alert("Please enter your last name")
		document.cont.lname.focus()
		return false
	}*/
	if(document.cont.add1.value==""){
		alert("Please enter address line 1")
		document.cont.add1.focus()
		return false
	}
	if(document.cont.city.value==""){
		alert("Please enter city name")
		document.cont.city.focus()
		return false
	}
	
	if(document.cont.state.value==""){
		alert("Please enter state name")
		document.cont.state.focus()
		return false
	}
	if(document.cont.phone.value==""){
		alert("Please enter phone no.")
		document.cont.phone.focus()
		return false
	}
	
	if(document.cont.uname.value.length < 4){
		alert("Username should be at least 4 characters long")
		document.cont.uname.focus()
		return false
	}
	if(document.cont.pass.value==""){
		alert("Please enter password")
		document.cont.pass.focus()
		return false
	}
	if(document.cont.pass.value.length < 4){
		alert("Password should be at least 4 characters long")
		document.cont.pass.focus()
		return false
	}
	if(document.cont.conpass.value==""){
		alert("Please enter confirm password")
		document.cont.conpass.focus()
		return false
	}
	if(document.cont.pass.value != document.cont.conpass.value){
		alert("Your password does not match confirm password")
		document.cont.conpass.value=""
		document.cont.conpass.focus()
		return false
	}
	if(document.cont.s_question[document.cont.s_question.selectedIndex].value==""){
		alert("Please select hint question")
		document.cont.s_question.focus()
		return false
	}
	if(document.cont.hinta.value==""){
		alert("Please enter hint answer")
		document.cont.hinta.focus()
		return false
	}
	if(document.cont.region4.options[document.cont.region4.selectedIndex].value=="select")
	{
		alert("Please select Product!")  
		document.cont.region4.focus();
		return false;
	}
	if(document.cont.modelname.value=="")
	{
		alert("Please select model ")  
		document.cont.modelname.focus();
		return false;
	}
	if(document.cont.email.value=="")
	{
		alert("Please enter email id ")  
		document.cont.email.focus();
		return false;
	}
	if(document.cont.email.value.indexOf("@")==-1 || document.cont.email.value.indexOf(".")==-1){
		alert("Please enter valid email id")
		document.cont.email.focus();
		return false;
	}
	if(document.cont.office[document.cont.office.selectedIndex].value=="0"){
		alert("Please select state")
		document.cont.office.focus()
		return false
	}
	
	
		
	if(document.cont.crchidden.value =="0"){
		return true;
		}
	else if((document.cont.office.selectedIndex.value !="") &&(document.cont.crchidden.value =="0") ){
	return true;
	}
	
	else if((document.cont.office.selectedIndex.value !="") &&(document.cont.crc.value !="0") ){
	return true;
	}
			
	else{
	alert("Please select city");
	document.cont.crc.focus();
	return false;
	}
	
}
//mera eureka function ends

//mera eureka popup function starts
function popup(){
wstr = "popup.php?uname=" 
      + document.cont["uname"].value;

 w = window.open(wstr, "myWin",
   "top=100,left=100,width=400,height=100");

}
//mera eureka popup function ends

//welcome.php validation starts
function welcome(){
//alert("hello")

if(document.wel.uname.value == ""){
	alert("Please enter username")
	document.wel.uname.focus()
	return false
}

if(document.wel.pass.value == ""){
	alert("Please enter password")
	document.wel.pass.focus()
	return false
}

document.wel.action="welcome.php?login=y"
} 

/*<a href="projects.htm" target="Console" onclick="if (window.open) {Console=window.open(this.href,this.target,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=300'); return false;} else { return true;}">Projects</a> */
//welcome.php validation ends

//product - model dropdown starts
function selectproduct(i){
	if(i==0){
	document.cont.catid.value=document.cont.region4.options[document.cont.region4.selectedIndex].value
	//alert(document.cont.catid.value)
	document.cont.action="service.php"
	document.cont.submit()
	}
}
//product - model dropdown ends

//popup - register function starts
function register(){
	document.cont.catid.value=document.cont.region4.options[document.cont.region4.selectedIndex].value
	document.cont.rfname.value = document.cont.fname.value
	//document.cont.rlname.value = document.cont.lname.value
	if(document.cont.sex[0].checked){
		document.cont.rsex.value = "male"
	}
	else if(document.cont.sex[1].checked){
		document.cont.rsex.value = "female"
	}
	document.cont.runame.value = document.cont.uname.value
	document.cont.rpass.value = document.cont.pass.value
	document.cont.rconpass.value = document.cont.conpass.value
	document.cont.rhintq.value = document.cont.s_question.value
	document.cont.rhinta.value = document.cont.hinta.value
	//alert(document.cont.catid.value)
	//alert(document.cont.rsex.value)
	document.cont.action="register.php"
	document.cont.submit()
	
}

function ownproduct1()
{
flag=false
for(i=0;i<=6;i++){
	if(document.cont.own[i].checked==true){
		flag = true
	}
}
if(flag == false){
	alert("Please select at least one product.")
	return false
}
if(document.cont.own[3].checked==true)
{
document.cont.action="register.php"
}
else if(document.cont.own[4].checked==true)
{
document.cont.action="register.php"
}
else if(document.cont.own[5].checked==true)
{
document.cont.action="register.php"
}
else
{
document.cont.action="custcode.php"
}

}

function ownproduct()
{
flag=false
for(i=0;i<=6;i++){
	if(document.cont.own[i].checked==true){
		flag = true
	}
}
if(flag == false){
	alert("Please select at least one product.")
	return false
}
if(document.cont.own[3].checked==true)
{
document.cont.action="addnewproduct.php"
}
else if(document.cont.own[4].checked==true)
{
document.cont.action="addnewproduct.php"
}
else if(document.cont.own[5].checked==true)
{
document.cont.action="addnewproduct.php"
}
else
{
document.cont.action="custcode.php"
}

}


function selproduct()
{
if(document.cont.region4.value=="select")
	{
	alert("Please select product!")
	document.cont.region4.focus()
	}
else
	{
	window.open("selproduct.php?catid="+document.cont.region4.value,"","top=10,left=200,scrollbars=1,status=1,resizable=1,width=400,height=400")
	}
}

function newproduct()
{
if(document.cont.product.value=="select")
	{
	alert("Please select product!")
	document.cont.product.focus()
	}
else
	{
	window.open("registration/selproduct.php?catid="+document.cont.product.value,"","top=10,left=200,scrollbars=1,status=1,resizable=1,width=400,height=400")
	}
}

//popup - register function ends

//Add new product validation starts
function validatenewpro(){
	if(document.cont.product.options[document.cont.product.selectedIndex].value=="select"){
		alert("Please select product")
		document.cont.product.focus();
		return false
	}
	if(document.cont.modelname.value==""){
		alert("Please select model")
		return false
	}
	if(document.cont.ccode.value!=""){
	if(isNaN(document.cont.ccode.value)){
		alert("Please enter valid customer code")
		document.cont.ccode.select();
		return false
	}
	if(document.cont.office.options[document.cont.office.selectedIndex].value=="0"){
		alert("Please select state")
		document.cont.office.focus();
		return false
	}
	if(document.cont.crc.options[document.cont.crc.selectedIndex].value=="0"){
		alert("Please select customer response center")
		document.cont.crc.focus();
		return false
	}
	}
}
//Add new product validation ends

//deleting product function starts
function delpro(x,y,z,cp){
	if(confirm("Are you sure you want to remove this product?")){
		if((x==0) && (cp==1)) {
			//alert(cp);
			document.frm.hidid.value=y;
			document.frm.hidpid.value=z;
			//alert(document.frm.hidid.value);
			//alert(document.frm.hidpid.value);
			document.frm.action="myeureka1.php";
			document.frm.submit();
		}
		
		else if((x==0) && (cp==2)){
			//alert(cp);
			document.frm.hidid.value=y
			document.frm.hidpid.value=z
			//alert(document.frm.hidid.value)
			//alert(document.frm.hidpid.value)
			document.frm.action="myeureka2.php";
			document.frm.submit();
		}
		
		else if((x==0) && (cp==3)){
			//alert(cp);
			document.frm.hidid.value=y
			document.frm.hidpid.value=z
			//alert(document.frm.hidid.value)
			//alert(document.frm.hidpid.value)
			document.frm.action="myeureka3.php";
			document.frm.submit();
		}
		
		else if((x==0) && (cp==4)){
			//alert(cp);
			document.frm.hidid.value=y
			document.frm.hidpid.value=z
			//alert(document.frm.hidid.value)
			//alert(document.frm.hidpid.value)
			document.frm.action="myeureka4.php";
			document.frm.submit();
		}
		else if((x==0) && (cp==5)){
			//alert(cp);
			document.frm.hidid.value=y
			document.frm.hidpid.value=z
			//alert(document.frm.hidid.value)
			//alert(document.frm.hidpid.value)
			document.frm.action="myeureka5.php";
			document.frm.submit();
		}
	}
	else{
		
		return false
	}
}
//deleting product function ends

//meraeureka registration - product selection function starts
function checkrad(){
	var flag1 = 0;
		for(i=0;i<document.f1.rad.length;i++){
			if(document.f1.rad[i].checked){
				flag1=1;
			}
		}
		if(flag1==0){
		//	alert("Please select one of the options");
		//	return false;
		}
		//alert(flag)

		if (document.f1.curtelno.value=="")
		{
		alert("Please enter your current telephone no.")
		document.f1.curtelno.focus()
		return false
		}
}
//meraeureka registration - product selection function ends

//tell a friend validation starts
function friend(){
	if(document.frm.uname.value=="")
	{
		alert("Please enter your name")  
		document.frm.uname.focus();
		return false;
	}
	if(document.frm.uemail.value=="")
	{
		alert("Please enter your email")  
		document.frm.uemail.focus();
		return false;
	}
	var email =/[-a-zA-Z0-9_\.]+@[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+/;
	var eflag = document.frm.uemail.value.match(email);
	if(eflag!=document.frm.uemail.value){
		alert("Please enter a valid Email")
		document.frm.uemail.focus();
		document.frm.uemail.select();
		return false;
	}
	if(document.frm.fname.value=="")
	{
		alert("Please enter your friend's name")  
		document.frm.fname.focus();
		return false;
	}
	if(document.frm.femail.value=="")
	{
		alert("Please enter your friend's email")  
		document.frm.femail.focus();
		return false;
	}
	var eflag = document.frm.femail.value.match(email);
	if(eflag!=document.frm.femail.value){
		alert("Please enter a valid Email")
		document.frm.femail.focus();
		document.frm.femail.select();
		return false;
	}
}
//tell a friend validation ends

//forget a password validation starts
function forgetpass(){
	if(document.f1.uid.value == ""){
		alert("Please enter your userid")
		document.f1.uid.focus()
		return false
	}
	if(document.f1.s_question.options[document.f1.s_question.selectedIndex].value==""){
		alert("Please select secret question")
		document.f1.s_question.focus()
		return false
	}
	if(document.f1.answer.value == ""){
		alert("Please enter secret answer")
		document.f1.answer.focus()
		return false
	}
}
//forget a password validation ends

//pollution watch popup window function starts
function pollution(){
	var pcity;
	pcity = document.frm1.city.options[document.frm1.city.selectedIndex].value
	//alert(pcity);
	//return false;
	if(pcity!=""){
	window.open('../community/graph.php?city='+pcity,'','top=0,left=0,width=650,height=400,scrollbars=1,resizable=1')
	}
}
//pollution watch popup window function ends

function selectcity()
{
cityname=document.frmnew.city.options[document.frmnew.city.selectedIndex].value
if (cityname=="Any")
{
alert("Please select the city")
document.frmnew.city.focus();
}
else
{
window.open('franchisee1.php?city='+cityname,'','width=665,height=375,top=120,left=65,scrollbars=yes')
}
}

function selectstate()
{
cityname=document.frm1.city.options[document.frm1.city.selectedIndex].value
statename=document.frm1.state.options[document.frm1.state.selectedIndex].value

if (statename=="#")
{
alert("Please select the state")
document.frm1.state.focus();
}
else if (cityname=="Any")
{
alert("Please select the city")
document.frm1.city.focus();
}
else
{
window.open('crc_locator1.php?state1='+statename+'&city='+cityname,'','width=665,height=375,top=120,left=65,scrollbars=yes')
}
}


function selecttown()
{
townname=document.frm1.smalltown.options[document.frm1.smalltown.selectedIndex].value
if (townname=="Any")
{
alert("Please select the town")
document.frm1.smalltown.focus();
}
else
{
window.open('fdo_town.php?town='+townname,'','width=665,height=375,top=120,left=65,scrollbars=yes')
}
}


function selecttown1()
{
townname=document.frm1.smalltown.options[document.frm1.smalltown.selectedIndex].value
if (townname=="Any")
{
alert("Please select the town")
document.frm1.smalltown.focus();
}
else
{
document.frm1.action="fdo_town1.php?town="+townname;
document.frm1.submit();
}
}

function vali_poll_mail()
{
if (document.frm1.emailadd.value=="")
{
alert ("Please enter your email address!")
document.frm1.emailadd.focus()
return false
}
var string1=document.frm1.emailadd.value
if ((string1.indexOf("@")==-1)||(string1.indexOf(".")==-1))
{
alert("Please input a valid email address!")
document.frm1.emailadd.focus()
return false;
}
}


function crc_validate()
{
if (document.frm1.state.options[document.frm1.state.selectedIndex].value=="#")
{
alert("Please select the state")
document.frm1.state.focus();
}
else if (document.frm1.city.options[document.frm1.city.selectedIndex].value=="Any")
{
alert("Please select the city")
document.frm1.city.focus();
}
else
{
document.frm1.action="locate_crc1.php?state1=$state1";
document.frm1.submit();
}
}

function franc_validate()
{
if (document.frmnew.city.options[document.frmnew.city.selectedIndex].value=="Any")
{
alert("Please select the city")
document.frmnew.city.focus();
}
else
{
document.frmnew.action="locate_franchisee1.php?state1=$state1";
document.frmnew.submit();
}
}

function complain_validate()
{
if (document.frm1.state.options[document.frm1.state.selectedIndex].value=="")
{
alert("Please select the state")
document.frm1.state.focus();
}
else if (document.frm1.city.options[document.frm1.city.selectedIndex].value=="Any")
{
alert("Please select the city")
document.frm1.city.focus();
}
else
{
document.frm1.action="euro_complain2.php?pn=$pn&state=$state";
document.frm1.submit();
}
}


function complain_validate1()
{
if (document.frm1.state.options[document.frm1.state.selectedIndex].value=="")
{
alert("Please select the state")
document.frm1.state.focus();
}
else if (document.frm1.city.options[document.frm1.city.selectedIndex].value=="Any")
{
alert("Please select the city")
document.frm1.city.focus();
}
else
{
document.frm1.action="service2.php?pn=$pn&state=$state";
document.frm1.submit();
}
}

function demo_validate()
{
if (document.frm1.state1.options[document.frm1.state1.selectedIndex].value=="")
{
alert("Please select the state")
document.frm1.state1.focus();
}
else if (document.frm1.city1.options[document.frm1.city1.selectedIndex].value=="Any")
{
alert("Please select the city")
document.frm1.city1.focus();
}
else
{
document.frm1.action="req_demo2.php?state1=$state1";
document.frm1.submit();
}
}


function requestdemo_validate()
{
if (document.frm1.state1.options[document.frm1.state1.selectedIndex].value=="")
{
alert("Please select the state")
document.frm1.state1.focus();
}
else if (document.frm1.city1.options[document.frm1.city1.selectedIndex].value=="Any")
{
alert("Please select the city")
document.frm1.city1.focus();
}
else
{
document.frm1.action="requestdemo2.php?state1=$state1";
document.frm1.submit();
}
}

function requestnewwell_validate()
{
if (document.frm1.state1.options[document.frm1.state1.selectedIndex].value=="")
{
alert("Please select the state")
document.frm1.state1.focus();
}
else if (document.frm1.city1.options[document.frm1.city1.selectedIndex].value=="Any")
{
alert("Please select the city")
document.frm1.city1.focus();
}
else
{
document.frm1.action="requestdemo2_newwell.php?state1=$state1";
document.frm1.submit();
}
}

//function for meraeureka - registration starts
function regicustcode()
{
	if(document.cont.ccode.value != ""){
		if(document.cont.phone.value == ""){
			//alert("Please enter phone no.")
			//document.cont.phone.focus()
			//return false
		}
	}
	if(document.cont.phone.value != ""){
		if(document.cont.ccode.value == ""){
			alert("Please enter customer code")
			document.cont.ccode.focus()
			return false
		}
	}
	if(isNaN(document.cont.ccode.value)){
		alert("Please enter valid customer code")
		document.cont.ccode.focus()
		document.cont.ccode.focus()
		return false
	}
	if(isNaN(document.cont.phone.value)){
		alert("Please enter valid phone no.")
		document.cont.phone.focus()
		document.cont.phone.focus()
		return false
	}
}
//function for meraeureka - registration ends

//product page script starts
function winopen(url)
{
	ref=window.open(url,'ref','scrollbars=0,menubar=0,status=0,left=0,top=0,width=429,height=355,resizable=1')
}
function winopen1(url)
{
	ref=window.open(url,'ref','scrollbars=1,menubar=0,status=0,left=0,top=0,width=550,height=150,resizable=0')
}
function winopen2(url)
{
	ref=window.open(url,'ref','scrollbars=1,menubar=0,status=0,left=0,top=0,width=500,height=350,resizable=1')
}
//product page script ends

//product page popup certificates starts
function certificate(url,width,height){
	window.open(url,'','top=0,left=0,width='+width+',height='+height+',scrollbars=yes')
}
//}

