var foundErr;var focusOn;function check_form(form){foundErr=false;focusOn=-1;if(document.propertyDesc.txtPropertyHeadline.value.length==1)
{alert("Headline should be more than a character");document.propertyDesc.txtPropertyHeadline.focus();return false;}
if(document.propertyDesc.txtSubHeadline.value.length==1)
{alert("Sub headline should be more than a character");document.propertyDesc.txtSubHeadline.focus();return false;}
if(document.propertyDesc.txtPropertyHeadline.value=="")
{alert("Please enter headline.");document.propertyDesc.txtPropertyHeadline.focus();return false;}
if(document.propertyDesc.txtSubHeadline.value=="")
{alert("Please enter sub-headline.");document.propertyDesc.txtSubHeadline.focus();return false;}
var head=form.txtPropertyHeadline.value;var subh=form.txtSubHeadline.value;if(head==subh)
{alert("Heading and sub-heading should be different");return false;}
if(document.propertyDesc.txtdescription.value=="")
{alert("Please enter property description.");document.propertyDesc.txtdescription.focus();return false;}
var string=document.propertyDesc.otherAct.value.replace(/(^\s+)(\s+$)/,"");var sp="^[a-z A-Z ,]+$";if(string.match(sp)||string==""){document.propertyDesc.submit();}
else
{alert("Other activities should contain only characters and commas");document.propertyDesc.otherAct.value.focus();return false;}}
function getObject(obj){var theObj;if(document.all){if(typeof obj=="string"){return document.all(obj);}else{return obj.style;}}
if(document.getElementById){if(typeof obj=="string"){return document.getElementById(obj);}else{return obj.style;}}
return null;}
function Contar(entrada,salida,texto,caracteres){var entradaObj=getObject(entrada);var salidaObj=getObject(salida);var longitud=caracteres-entradaObj.value.length;if(longitud<=0){longitud=0;texto='<span class="disable">&nbsp;'+texto+'&nbsp;</span>';entradaObj.value=entradaObj.value.substr(0,caracteres);}
salidaObj.innerHTML=texto.replace("{CHAR}",longitud);}
function KeepCounts(){var NewCount=0
if(document.propertyDesc.beach.checked)
{NewCount=NewCount+1}
if(document.propertyDesc.citycentre.checked)
{NewCount=NewCount+1}
if(document.propertyDesc.mountain.checked)
{NewCount=NewCount+1}
if(document.propertyDesc.sea.checked)
{NewCount=NewCount+1}
if(document.propertyDesc.resort.checked)
{NewCount=NewCount+1}
if(document.propertyDesc.rural.checked)
{NewCount=NewCount+1}
if(document.propertyDesc.town.checked)
{NewCount=NewCount+1}
if(document.propertyDesc.village.checked)
{NewCount=NewCount+1}
if(document.propertyDesc.waterfront.checked)
{NewCount=NewCount+1}
if(NewCount==5)
{alert('Choose any four')
document.propertyDesc;return false;}}
function KeepCounts_bath(){var NewCount=0
if(document.facilities.chkBath_with_shower.checked)
{NewCount=NewCount+1}
if(document.facilities.chkBath_no_shower.checked)
{NewCount=NewCount+1}
if(NewCount==2)
{alert('You can select bathroom with shower or without shower');return false;}}
function isNumerica(){var numericExpression=document.propertyDesc.Airkilo.value;numericExpression=/^\d*\.?\d*$/;if(document.propertyDesc.Airkilo.value.match(numericExpression)){var numOfDec=2;var decimal=1
for(i=1;i<=numOfDec;i++)
decimal=decimal*10
var myNum=document.propertyDesc.Airkilo.value;var myFormattedNum=(Math.round(myNum*decimal)/decimal).toFixed(numOfDec)
document.propertyDesc.Airkilo.value=myFormattedNum;return true;}else{alert("Please enter valid kilometer");document.propertyDesc.Airkilo.value="";document.propertyDesc.Airkilo.focus();return false;}}
function isNumericb(){var numericExpression=document.propertyDesc.NearBeachkil.value;numericExpression=/^\d*\.?\d*$/;if(document.propertyDesc.NearBeachkil.value.match(numericExpression)){var numOfDec=2;var decimal=1
for(i=1;i<=numOfDec;i++)
decimal=decimal*10
var myNum=document.propertyDesc.NearBeachkil.value;var myFormattedNum=(Math.round(myNum*decimal)/decimal).toFixed(numOfDec)
document.propertyDesc.NearBeachkil.value=myFormattedNum;return true;}else{alert("Please enter valid kilometer");document.propertyDesc.NearBeachkil.value="";document.propertyDesc.NearBeachkil.focus();return false;}}
function isNumericp(){var numericExpression=document.propertyDesc.NearPortkil.value;numericExpression=/^\d*\.?\d*$/;if(document.propertyDesc.NearPortkil.value.match(numericExpression)){var numOfDec=2;var decimal=1
for(i=1;i<=numOfDec;i++)
decimal=decimal*10
var myNum=document.propertyDesc.NearPortkil.value;var myFormattedNum=(Math.round(myNum*decimal)/decimal).toFixed(numOfDec)
document.propertyDesc.NearPortkil.value=myFormattedNum;return true;}else{alert("Please enter valid kilometer");document.propertyDesc.NearPortkil.value="";document.propertyDesc.NearPortkil.focus();return false;}}
function isNumericr(){var numericExpression=document.propertyDesc.NearRailkil.value;numericExpression=/^\d*\.?\d*$/;if(document.propertyDesc.NearRailkil.value.match(numericExpression)){var numOfDec=2;var decimal=1
for(i=1;i<=numOfDec;i++)
decimal=decimal*10
var myNum=document.propertyDesc.NearRailkil.value;var myFormattedNum=(Math.round(myNum*decimal)/decimal).toFixed(numOfDec)
document.propertyDesc.NearRailkil.value=myFormattedNum;return true;}else{alert("Please enter valid kilometer");document.propertyDesc.NearRailkil.value="";document.propertyDesc.NearRailkil.focus();return false;}}
function isNumericm(){var numericExpression=document.propertyDesc.NearMotorkil.value;numericExpression=/^\d*\.?\d*$/;if(document.propertyDesc.NearMotorkil.value.match(numericExpression)){var numOfDec=2;var decimal=1
for(i=1;i<=numOfDec;i++)
decimal=decimal*10
var myNum=document.propertyDesc.NearMotorkil.value;var myFormattedNum=(Math.round(myNum*decimal)/decimal).toFixed(numOfDec)
document.propertyDesc.NearMotorkil.value=myFormattedNum;return true;}else{alert("Please enter valid kilometer");document.propertyDesc.NearMotorkil.value="";document.propertyDesc.NearMotorkil.focus();return false;}}
function trim(str)
{return str.replace(/^\s+|\s+$/g,"");}
function echeck(str){var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if(str.indexOf(at)==-1){alert("Invalid e-mail id")
return false}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){alert("Invalid e-mail id")
return false}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){alert("Invalid e-mail id")
return false}
if(str.indexOf(at,(lat+1))!=-1){alert("Invalid e-mail id")
return false}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){alert("Invalid e-mail id")
return false}
if(str.indexOf(dot,(lat+2))==-1){alert("Invalid e-mail id")
return false}
if(str.indexOf(" ")!=-1){alert("Invalid e-mail id")
return false}
return true}
function echeck1(str){var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if(str.indexOf(at)==-1){document.getElementById('err_email').innerHTML="<img src='images/critical.gif'><font color='red'>Invalid e-mail id!!</font>";return false}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){document.getElementById('err_email').innerHTML="<img src='images/critical.gif'><font color='red'>Invalid e-mail id!!</font>";return false}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){document.getElementById('err_email').innerHTML="<img src='images/critical.gif'><font color='red'>Invalid e-mail id!!</font>";return false}
if(str.indexOf(at,(lat+1))!=-1){document.getElementById('err_email').innerHTML="<img src='images/critical.gif'><font color='red'>Invalid e-mail id!!</font>";return false}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){document.getElementById('err_email').innerHTML="<img src='images/critical.gif'><font color='red'>Invalid e-mail id!!</font>";return false}
if(str.indexOf(dot,(lat+2))==-1){document.getElementById('err_email').innerHTML="<img src='images/critical.gif'><font color='red'>Invalid e-mail id!!</font>";return false}
if(str.indexOf(" ")!=-1){document.getElementById('err_email').innerHTML="<img src='images/critical.gif'><font color='red'>Invalid e-mail id!!</font>";return false}
return true}
function checks(form)
{if(trim(document.details.unitname.value)=="")
{alert("Please enter  property name");document.details.unitname.focus();return false;}
if(document.details.unitname.value.length>100)
{alert("Property name too lenghty:enter only 100 characters");document.details.unitname.focus();return false;}
if(document.details.continent.value=="null")
{alert(" Please enter continent");document.details.continent.focus();return false;}
if(document.details.country.value=="null")
{alert(" Please enter country");document.details.country.focus();return false;}
if(document.details.region1.value=="null")
{alert("Please enter region1");document.details.region1.focus();return false;}
if(document.details.region2.value=="null")
{alert("Please enter region2");document.details.region2.focus();return false;}
if(document.details.region2.value=="other")
{if(document.details.r2.value=="")
{document.getElementById('other_error1').innerHTML="<font color='red'>*Please enter region2</font>";document.details.r2.focus();return false;}
else
document.getElementById('other_error1').innerHTML="";if(document.details.r3.value==""&&document.details.r4.value!=""||document.details.r5.value!="")
{document.getElementById('other_error2').innerHTML="<font color='red'>*Please enter region3</font>";document.details.r2.focus();return false;}
else
document.getElementById('other_error2').innerHTML="";if(document.details.r4.value==""&&document.details.r5.value!="")
{document.getElementById('other_error3').innerHTML="<font color='red'>*Please enter region3</font>";document.details.r2.focus();return false;}
else
document.getElementById('other_error3').innerHTML="";}
if(trim(document.details.getthere.value)=="")
{alert("Please enter details of how to get there");document.details.getthere.focus();return false;}
else
{document.details.submit();}}
function checkedit(form)
{if(trim(document.details.unitname.value)=="")
{alert("Please enter  property name");document.details.unitname.focus();return false;}
if(document.details.unitname.value.length>100)
{alert("Property name too lenghty:enter only 100 characters");document.details.unitname.focus();return false;}
if(document.details.region1.value=="")
{alert(" Please enter region1");document.details.region1.focus()
return false;}
if(document.details.region2.value=="")
{alert(" Please enter region2");document.details.region2.focus()
return false;}
if(trim(document.details.getthere.value)=="")
{alert("Please enter details of how to get there");document.details.getthere.focus();return false;}
else
{document.details.submit();}}
var check="/^\w{4,20}$/";function check1(form)
{if(trim(document.register.txtusername.value)=="")
{document.getElementById('err_user').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter username!!</font>";document.register.txtusername.focus();return false;}
else if(trim(document.register.txtusername.value)!="")
{document.getElementById('err_user').innerHTML="";}
if(document.register.txtusername.value.length>51)
{document.getElementById('err_user').innerHTML="<img src='images/critical.gif'><font color='red'>Username  must be within 50 characters!!</font>";document.register.txtusername.focus();return false;}
else
{document.getElementById('err_user').innerHTML="";}
if(document.register.txtPassword.value=="")
{document.getElementById('err_pass').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter password!!</font>";document.register.txtPassword.focus();return false;}
else
{document.getElementById('err_pass').innerHTML="";}
if((document.register.txtPassword.value.length<6)||(document.register.txtPassword.value.length>15))
{document.getElementById('err_pass').innerHTML="<img src='images/critical.gif'><font color='red'>Password length must be 6-15 characters!!</font>";document.register.txtPassword.focus();return false;}
else
{document.getElementById('err_pass').innerHTML="";}
if(document.register.txtConfirmPassword.value=="")
{document.getElementById('err_pass1').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter confirm password!!</font>";document.register.txtConfirmPassword.focus();return false;}
else
{document.getElementById('err_pass1').innerHTML="";}
if((document.register.txtPassword.value)!=(document.register.txtConfirmPassword.value))
{document.getElementById('err_pass').innerHTML="<img src='images/critical.gif'><font color='red'>Confirm password should be same as password!!</font>";document.register.txtPassword.value="";document.register.txtConfirmPassword.value="";document.register.txtPassword.focus();return false;}
else
{document.getElementById('err_pass').innerHTML="";}
if(trim(document.register.txtEmail.value)=="")
{document.getElementById('err_email').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter email Id!!</font>";document.register.txtEmail.focus();return false;}
else
{document.getElementById('err_email').innerHTML="";}
if(echeck1(document.register.txtEmail.value)==false)
{document.getElementById('err_email').innerHTML="<img src='images/critical.gif'><font color='red'>Please Enter Email Id!!</font>";document.register.txtEmail.focus();return false;}
else
{document.getElementById('err_email').innerHTML="";}
if(trim(document.register.txtFirstName.value)=="")
{document.getElementById('err_frstName').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter first name!!</font>";document.register.txtFirstName.focus();return false;}
else
{document.getElementById('err_frstName').innerHTML="";}
if(document.register.txtFirstName.value.length<"2")
{document.getElementById('err_frstName').innerHTML="<img src='images/critical.gif'><font color='red'>First name should be atleast two characters!!</font>";document.register.txtFirstName.focus();return false;}
else
{document.getElementById('err_frstName').innerHTML="";}
var strText=document.register.txtFirstName.value;var count=0;if(strText.length>0){for(var i=0;i<strText.length;i++)
{if(strText.charAt(i)==" ")
{count++;}}}
if(count>0){document.getElementById('err_frstName').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter valid first name!!</font>";document.register.txtFirstName.focus();return false;}
else
{document.getElementById('err_frstName').innerHTML="";}
if(trim(document.register.txtLastName.value)=="")
{document.getElementById('err_lstName').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter last name!!</font>";document.register.txtLastName.focus();return false;}
else
{document.getElementById('err_lstName').innerHTML="";}
if(trim(document.register.txtAddress.value)=="")
{document.getElementById('err_address').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter address!!</font>";document.register.txtAddress.focus();return false;}
else
{document.getElementById('err_address').innerHTML="";}
if(trim(document.register.txtCity.value)=="")
{document.getElementById('err_city').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter city!!</font>";document.register.txtCity.focus();return false;}
else
{document.getElementById('err_lstName').innerHTML="";}
if(!isNaN(document.register.txtCity.value))
{document.getElementById('err_city').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter a valid city!!</font>";document.register.txtCity.focus();return false;}
else
{document.getElementById('err_city').innerHTML="";}
var iChars="!@#$%^&*()+=-[]\';,./{}|\":<>?";for(var i=0;i<document.register.txtCity.value.length;i++)
{if(iChars.indexOf(document.register.txtCity.value.charAt(i))!=-1)
{document.getElementById('err_city').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter a valid city!!</font>";document.register.txtCity.focus();return false;}
else
{document.getElementById('err_city').innerHTML="";}}
if(document.register.txtZipCode.value!="")
{if(document.register.txtZipCode.value.length>10)
{document.getElementById('err_zip').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter a valid zip code!!</font>";document.register.txtZipCode.focus();return false;}
else
{document.getElementById('err_zip').innerHTML="";}}
if(trim(document.register.txtphone.value)=="")
{document.getElementById('err_phone').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter phone number!!</font>";document.register.txtphone.focus();return false;}
else
{document.getElementById('err_phone').innerHTML="";}
if(isNaN(document.register.txtphone.value))
{document.getElementById('err_phone').innerHTML="<img src='images/critical.gif'><font color='red'>Only number is accepted!!</font>";document.register.txtphone.focus();return false;}
else
{document.getElementById('err_phone').innerHTML="";}
if(document.register.txtMobile.value!="")
{if(isNaN(document.register.txtMobile.value))
{document.getElementById('err_mob').innerHTML="<img src='images/critical.gif'><font color='red'>Only number is accepted!!</font>";document.register.txtMobile.focus();return false;}
else
{document.getElementById('err_mob').innerHTML="";}}
if(document.register.liConutry.value=="**")
{document.getElementById('err_country').innerHTML="<img src='images/critical.gif'><font color='red'>Please select a country!!</font>";document.register.liConutry.focus();return false;}
else
{document.getElementById('err_country').innerHTML="";}
/*if(trim(document.register.txtState.value)=="")
{document.getElementById('err_state').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter state!!</font>";document.register.txtState.focus();return false;}
else
{document.getElementById('err_state').innerHTML="";}
if(!isNaN(document.register.txtState.value))
{document.getElementById('err_state').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter a valid state!!</font>";document.register.txtCity.focus();return false;}
else
{document.getElementById('err_state').innerHTML="";}
for(var i=0;i<document.register.txtState.value.length;i++)
{if(iChars.indexOf(document.register.txtState.value.charAt(i))!=-1)
{document.getElementById('err_state').innerHTML="<img src='images/critical.gif'><font color='red'>Please enter a valid state!!</font>";document.register.txtCity.focus();return false;}
else
{document.getElementById('err_state').innerHTML="";}}*/
if(trim(document.register.security_code.value)=="")
{document.register.security_code.focus();return false;}
var sp="^[a-z A-Z]+$";if(strText.match(sp)){document.register.submit();}
else
{document.getElementById('err_frstName').innerHTML="<img src='images/critical.gif'><font color='red'>First name should contain only chracters!!</font>";document.register.txtFirstName.value="";document.register.txtFirstName.focus();return false;}}
function captcha_valid()
{if(trim(document.register.security_code.value)!="")
{document.register.security_code.focus();return false;}}
function checkError()
{if(document.register.txtusername.value!="")
document.getElementById('err_user').innerHTML="";if(document.getElementById('txtPassword').value!='')
document.getElementById('err_pass').innerHTML="";if(document.getElementById('txtConfirmPassword').value!='')
document.getElementById('err_pass1').innerHTML="";if(document.getElementById('txtEmail').value!='')
document.getElementById('err_email').innerHTML="";if(document.getElementById('txtFirstName').value!='')
document.getElementById('err_frstName').innerHTML="";if(document.getElementById('txtLastName').value!='')
document.getElementById('err_lstName').innerHTML="";if(document.getElementById('txtAddress').value!='')
document.getElementById('err_address').innerHTML="";if(document.getElementById('txtCity').value!='')
document.getElementById('err_city').innerHTML="";if(document.getElementById('txtZipCode').value!='')
document.getElementById('err_zip').innerHTML="";if(document.getElementById('txtphone').value!='')
document.getElementById('err_phone').innerHTML="";if(document.getElementById('liConutry').value!='')
document.getElementById('err_country').innerHTML="";}
function check2(form)
{if(document.facilities.area.value!=""||document.facilities.unit.value!=" ")
{if(document.facilities.area.value==""&&document.facilities.unit.value!=" ")
{alert("Please select area");document.facilities.area.focus();return false;}
if(document.facilities.area.value!=" "&&document.facilities.unit.value==" ")
{alert("Please select a unit of the total floor area");document.facilities.area.focus();return false;}}
if(document.facilities.ptype1.value==" "&&document.facilities.ptype2.value!=" ")
{alert("Please select property type");document.facilities.ptype1.focus();return false;}
else
{document.facilities.submit();}}
function continent(id)
{var details=document.forms["details"];document.location='myPropertyAdd.php?continentid='+id;}
function country(id)
{var details=document.forms["details"];document.location='myPropertyAdd.php?countryid='+id;document.details.value=id;}
function region1(id)
{var details=document.forms["details"];document.location='myPropertyAdd.php?region1id='+id;}
function region2(id)
{var details=document.forms["details"];document.location='myPropertyAdd.php?region2id='+id;}
function region3(id)
{var details=document.forms["details"];document.location='myPropertyAdd.php?region3id='+id;}
function region4(id)
{var details=document.forms["details"];document.location='myPropertyAdd.php?region4id='+id;}
function numbersonly(myfield,e,dec){var key;var keychar;if(window.event)
key=window.event.keyCode;else if(e)
key=e.which;else
return true;keychar=String.fromCharCode(key);if((key==null)||(key==0)||(key==8)||(key==9)||(key==13)||(key==27))
return true;else if((("0123456789").indexOf(keychar)>-1))
return true;else if(dec&&(keychar==".")){myfield.form.elements[dec].focus();return false;}else
return false;}
function alphasonly(myfield,e,dec){var key;var keychar;if(window.event)
key=window.event.keyCode;else if(e)
key=e.which;else
return true;keychar=String.fromCharCode(key);if((key==null)||(key==0)||(key==8)||(key==9)||(key==13)||(key==27))
return true;else if((("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ").indexOf(keychar)>-1))
return true;else if(dec&&(keychar==".")){myfield.form.elements[dec].focus();return false;}else
return false;}
function isNumricWeek_rate(){var numericExpression=document.rentalRate.Weekly_rate.value;numericExpression=/^\d*\.?\d*$/;if(document.rentalRate.Weekly_rate.value.match(numericExpression)){var numOfDec=2;var decimal=1
for(i=1;i<=numOfDec;i++)
decimal=decimal*10
var myNum=document.rentalRate.Weekly_rate.value;var myFormattedNum=(Math.round(myNum*decimal)/decimal).toFixed(numOfDec)
document.rentalRate.Weekly_rate.value=myFormattedNum;return true;}else{alert("Please enter valid number");document.rentalRate.Weekly_rate.focus();document.rentalRate.Weekly_rate.value="";return false;}}
function isNumricWeek_nigt(){var numericExpression=document.rentalRate.Weekend_nightly_rate.value;numericExpression=/^\d*\.?\d*$/;if(document.rentalRate.Weekend_nightly_rate.value.match(numericExpression)){var numOfDec=2;var decimal=1
for(i=1;i<=numOfDec;i++)
decimal=decimal*10
var myNum=document.rentalRate.Weekend_nightly_rate.value;var myFormattedNum=(Math.round(myNum*decimal)/decimal).toFixed(numOfDec)
document.rentalRate.Weekend_nightly_rate.value=myFormattedNum;return true;}else{alert("Please enter valid number");document.rentalRate.Weekend_nightly_rate.focus();document.rentalRate.Weekend_nightly_rate.value="";return false;}}
function isNumricMid_nigt(){var numericExpression=document.rentalRate.Midweek_nightly_rate.value;numericExpression=/^\d*\.?\d*$/;if(document.rentalRate.Midweek_nightly_rate.value.match(numericExpression)){var numOfDec=2;var decimal=1
for(i=1;i<=numOfDec;i++)
decimal=decimal*10;var myNum=document.rentalRate.Midweek_nightly_rate.value;var myFormattedNum=(Math.round(myNum*decimal)/decimal).toFixed(numOfDec)
document.rentalRate.Midweek_nightly_rate.value=myFormattedNum;return true;}else{alert("Please enter valid number");document.rentalRate.Midweek_nightly_rate.focus();document.rentalRate.Midweek_nightly_rate.value="";return false;}}
function check3(form)
{var set="^[0-9 ( )]+$";
//if(isNaN(document.pcontact.cc4.value))
//{alert("Enter only numbers");document.pcontact.cc4.focus();return false;}
//if(isNaN(document.pcontact.n4.value))
//{alert("Enter only numbers");document.pcontact.n4.focus();return false;}
if(trim(document.pcontact.cname.value)=="")
{alert("Please enter name of contact");document.pcontact.cname.focus();return false;}
if((document.pcontact.cc1.value)=="")
{alert("Please enter country code");document.pcontact.cc1.focus();return false;}
if(isNaN(document.pcontact.cc1.value))
{alert("Enter only numbers");document.pcontact.cc1.focus();return false;}
if(document.pcontact.ac1.value=="")
{alert("Please enter area code");document.pcontact.ac1.focus();return false;}
if(isNaN(document.pcontact.ac1.value))
{alert("Enter only numbers");document.pcontact.ac1.focus();return false;}
if(document.pcontact.n1.value=="")
{alert("Please enter number");document.pcontact.n1.focus();return false;}
if(isNaN(document.pcontact.n1.value))
{alert("Enter only numbers");document.pcontact.n1.focus();return false;}
if(echeck(document.pcontact.mailid.value)==false)
{document.pcontact.mailid.focus();return false;}
if(trim(document.pcontact.mailid.value)=="")
{alert("Please enter your E-mail id");document.pcontact.mailid.focus();return false;}
if(echeck(document.pcontact.mailid.value)==false)
{document.pcontact.mailid.focus();return false;}

/*if(isNaN(document.pcontact.n1.value))
{alert("Enter only numbers");document.pcontact.n1.focus();return false;}
if(isNaN(document.pcontact.cc2.value))
{alert("Enter only numbers");document.pcontact.cc2.focus();return false;}
if(isNaN(document.pcontact.n2.value))
{alert("Enter only numbers");document.pcontact.n2.focus();return false;}
if(isNaN(document.pcontact.cc3.value))
{alert("Enter only numbers");document.pcontact.cc3.focus();return false;}
if(isNaN(document.pcontact.n3.value))
{alert("Enter only numbers");document.pcontact.n3.focus();return false;}
if(document.pcontact.mailid.value!="")
{if(echeck(document.pcontact.mailid.value)==false)
{document.pcontact.mailid.focus();return false;}}
if((document.pcontact.ac1.value)!="")
{var set1=document.pcontact.ac1.value;if(!(set1.match(set)))
{alert("Only numbers and small brackets are allowed");document.pcontact.ac1.focus();return false;}}
if((document.pcontact.ac2.value)!="")
{var set2=document.pcontact.ac2.value;if(!(set2.match(set)))
{alert("Only numbers and small brackets are allowed");document.pcontact.ac2.focus();return false;}}
if((document.pcontact.ac3.value)!="")
{var set3=document.pcontact.ac3.value;if(!(set3.match(set)))
{alert("Only numbers and small brackets are allowed");document.pcontact.ac3.focus();return false;}}
*/
else
{document.pcontact.submit();return true;}
}
function vale(form)
{if(trim(document.enqForm.txtFirstName.value)=="")
{alert("Please enter first name");document.getElementById("txtFirstName").style.border="1px solid red";document.getElementById("frstname").style.color="red";document.enqForm.txtFirstName.focus();return false;}
if(trim(document.enqForm.Email.value)=="")
{alert("Please enter your E-mail id");document.getElementById("txtEmail").style.border="1px solid red";document.getElementById("lblEmail").style.color="red";document.enqForm.Email.focus();return false;}
if(echeck(document.enqForm.Email.value)==false)
{document.getElementById("txtEmail").style.border="1px solid red";document.getElementById("lblEmail").style.color="red";document.enqForm.Email.focus();return false;}
if(isNaN(document.enqForm.txtCode.value))
{alert("Please enter correct country code");document.getElementById("txtCode").style.border="1px solid red";document.getElementById("lblCountry").style.color="red";document.getElementById("txtNumber").style.border="1px solid red";document.getElementById("lblNumber").style.color="red";document.enqForm.txtCode.focus();return false;}
if(isNaN(document.enqForm.txtNumber.value))
{alert("Please enter correct phone number(special character and space are not allow)");document.getElementById("txtNumber").style.border="1px solid red";document.getElementById("lblNumber").style.color="red";document.enqForm.txtNumber.focus();return false;}
if((document.enqForm.txtArrivalDate.value!="")&&(document.enqForm.txtDepartureDate.value==""))
{alert("Both arrival and departure date are required ");return false;}
if((document.enqForm.txtArrivalDate.value=="")&&(document.enqForm.txtDepartureDate.value!=""))
{alert("Both arrival and departure  date are required ");return false;}
var Sdate=document.getElementById("txtArrivalDate").value;var Edate=document.getElementById("txtDepartureDate").value;var dt1=parseInt(Sdate.substring(0,2),10);var mon1=parseInt(Sdate.substring(3,5),10);var yr1=parseInt(Sdate.substring(6,10),10);var dt2=parseInt(Edate.substring(0,2),10);var mon2=parseInt(Edate.substring(3,5),10);var yr2=parseInt(Edate.substring(6,10),10);var date1=new Date(yr1,mon1,dt1);var date2=new Date(yr2,mon2,dt2);if((yr1)<2008||(yr2)<2008)
{alert("Please enter valid year.");return false;}
if(date1>=date2){alert("Departure date must occur after the arrival date.");return false;}
if(trim(document.enqForm.txtMessage.value)=="")
{alert("Please enter your query");document.getElementById("txtMessage").style.border="1px solid red";document.getElementById("lblYour_Message").style.color="red";document.enqForm.txtMessage.focus();return false;}
if(isNaN(document.enqForm.txtTotal.value))
{alert("Intimate number of persons going to arrive");document.getElementById("txtTotal").style.border="1px solid red";document.getElementById("lblTotal_in_part").style.color="red";document.enqForm.txtTotal.focus();return false;}
if(isNaN(document.enqForm.txtChildren.value))
{alert("Specify number of kids going to arrive");document.getElementById("txtChildren").style.border="1px solid red";document.getElementById("lblChildren").style.color="red";document.enqForm.txtChildren.focus();return false;}

if(document.enqForm.security_code.value=='')
{alert('Please enter security code');document.enqForm.security_code.focus();return false;}

else
{
document.enqForm.submit();return true;
}
}
function getXMLHTTP()
{var xmlhttp=false;try{xmlhttp=new XMLHttpRequest();}
catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e1){xmlhttp=false;}}}
return xmlhttp;}
function captcha_check()
{var sec_code=document.getElementById('security_code').value;var strURL="enquery_capcha.php?security_code="+sec_code;var req=getXMLHTTP();if(req){req.onreadystatechange=function(){if(req.readyState==4){if(req.status==200){var inrval=document.getElementById('err_capcha').innerHTML=req.responseText;if(inrval=="false")
{document.getElementById("security_code").style.border="1px solid red";}}else{alert("There was a problem while using XMLHTTP:\n"+req.statusText);}}}
req.open("GET",strURL,true);req.send(null);}}








function dateValid()
{if(trim(document.searchForm1.txtArrivalDate.value)=="")
{alert("Please enter arrival date");document.searchForm1.txtArrivalDate.focus();return false;}
if(trim(document.searchForm1.txtDepartureDate.value)=="")
{alert("Please enter departure date");document.searchForm1.txtDepartureDate.focus();return false;}
if((document.searchForm1.txtArrivalDate.value!="")&&(document.searchForm1.txtDepartureDate.value==""))
{alert("Both arrival and departure date are required ");return false;}
if((document.searchForm1.txtArrivalDate.value=="")&&(document.searchForm1.txtDepartureDate.value!=""))
{alert("Both arrival and departure  date are required ");return false;}
var Sdate=document.getElementById("txtArrivalDate").value;var Edate=document.getElementById("txtDepartureDate").value;var dt1=parseInt(Sdate.substring(0,2),10);var mon1=parseInt(Sdate.substring(3,5),10);var yr1=parseInt(Sdate.substring(6,10),10);var dt2=parseInt(Edate.substring(0,2),10);var mon2=parseInt(Edate.substring(3,5),10);var yr2=parseInt(Edate.substring(6,10),10);var date1=new Date(yr1,mon1,dt1);var date2=new Date(yr2,mon2,dt2);if((yr1)<2008||(yr2)<2008)
{alert("Please enter valid year.");return false;}
if(date1>=date2){alert("Departure date must occur after the arrival date.");return false;}
else
{document.searchForm1.submit();}}
function chk()
{if(document.personal.txtFirstName.value=="")
{alert("First name field should not be empty");document.personal.txtFirstName.focus();return false;}
if(document.personal.txtLastName.value=="")
{alert("Last name field should not be empty");document.personal.txtLastName.focus();return false;}
if(document.personal.txtAddress.value=="")
{alert("Address field should not be empty");document.personal.txtAddress.focus();return false;}
if(document.personal.txtCity.value=="")
{alert("City field should not be empty");document.personal.txtCity.focus();return false;}
if(document.personal.txtphone.value=="")
{alert("Phone field should not be empty");document.personal.txtphone.focus();return false;}
if(document.personal.txtState.value=="")
{alert("State field should not be empty");document.personal.txtState.focus();return false;}
if(echeck(document.personal.txtEmail.value)==false)
{document.personal.txtEmail.focus();return false;}
else
{document.personal.submit();return true;}}
function checkdate(objName){var datefield=objName;if(chkdate(objName)==false){datefield.select();alert("Invalid date formate,Accepted format is dd-mm-yyyy.");datefield.focus();return false;}
else{return true;}}
function chkdate(objName)
{var strDatestyle="US";var strDate;var strDateArray;var strDay;var strMonth;var strYear;var intday;var intMonth;var intYear;var booFound=false;var datefield=objName;var strSeparatorArray=new Array("-"," ","/",".");var intElementNr;var err=0;var strMonthArray=new Array(12);strMonthArray[0]="01";strMonthArray[1]="02";strMonthArray[2]="03";strMonthArray[3]="04";strMonthArray[4]="05";strMonthArray[5]="06";strMonthArray[6]="07";strMonthArray[7]="08";strMonthArray[8]="09";strMonthArray[9]="10";strMonthArray[10]="11";strMonthArray[11]="12";strDate=datefield.value;if(strDate.length<1){return true;}
for(intElementNr=0;intElementNr<strSeparatorArray.length;intElementNr++){if(strDate.indexOf(strSeparatorArray[intElementNr])!=-1){strDateArray=strDate.split(strSeparatorArray[intElementNr]);if(strDateArray.length!=3){err=1;return false;}
else{strDay=strDateArray[0];strMonth=strDateArray[1];strYear=strDateArray[2];}
booFound=true;}}
if(booFound==false){if(strDate.length>5){strDay=strDate.substr(0,2);strMonth=strDate.substr(2,2);strYear=strDate.substr(4);}}
if(strYear.length==2){strYear='20'+strYear;}
intday=parseInt(strDay,10);if(isNaN(intday)){err=2;return false;}
intMonth=parseInt(strMonth,10);if(isNaN(intMonth)){for(i=0;i<12;i++){if(strMonth.toUpperCase()==strMonthArray[i].toUpperCase()){intMonth=i+1;strMonth=strMonthArray[i];i=12;}}
if(isNaN(intMonth)){err=3;return false;}}
intYear=parseInt(strYear,10);if(isNaN(intYear)){err=4;return false;}
if(intMonth>12||intMonth<1){err=5;return false;}
if((intMonth==1||intMonth==3||intMonth==5||intMonth==7||intMonth==8||intMonth==10||intMonth==12)&&(intday>31||intday<1)){err=6;return false;}
if((intMonth==4||intMonth==6||intMonth==9||intMonth==11)&&(intday>30||intday<1)){err=7;return false;}
if(intMonth==2){if(intday<1){err=8;return false;}
if(LeapYear(intYear)==true){if(intday>29){err=9;return false;}}
else{if(intday>28){err=10;return false;}}}
if(strDay.length==1)
{intday='0'+intday;}
else{intday=strDay;}
if(strDatestyle=="US"){datefield.value=intday+"-"+strMonthArray[intMonth-1]+"-"+strYear;}
else{datefield.value=intday+"-"+strMonthArray[intMonth-1]+"-"+strYear;}
return true;}
function LeapYear(intYear){if(intYear%100==0){if(intYear%400==0){return true;}}
else{if((intYear%4)==0){return true;}}
return false;}
function doDateCheck(){var Sdate=document.getElementById("start_day").value;var Edate=document.getElementById("end_day").value;var dt1=parseInt(Sdate.substring(0,2),10);var mon1=parseInt(Sdate.substring(3,5),10);var yr1=parseInt(Sdate.substring(6,10),10);var dt2=parseInt(Edate.substring(0,2),10);var mon2=parseInt(Edate.substring(3,5),10);var yr2=parseInt(Edate.substring(6,10),10);var date1=new Date(yr1,mon1,dt1);var date2=new Date(yr2,mon2,dt2);if((yr1)<2008||(yr2)<2008)
{alert("Please enter valid year.");return false;}
if(date1>=date2){alert("End date must occur after the starting date.");return false;}
if(document.rentalRate.start_day.value=="")
{alert("Starting date should not be empty.");return false;}
else if(document.rentalRate.end_day.value=="")
{alert("End date should not be empty.");return false;}
else if(document.rentalRate.rra_mst_id2.value=="")
{alert("Minimum stay should not be empty");document.rentalRate.rra_mst_id2.focus();return false;}
else{document.rentalRate.submit();return true;}}
function lookup(inputString){if(inputString.length==0){$('#suggestions').hide();}else{$.post("rpc2.php",{queryString:""+inputString+""},function(data){if(data.length>0){$('#suggestions').show();$('#autoSuggestionsList').html(data);}});}}
function fill(thisValue){$('#inputString').val(thisValue);setTimeout("$('#suggestions').hide();",200);}
function blnk()
{if(document.topSearchForm.txtPropertyNo.value=="")
{alert("property number required");document.topSearchForm.txtPropertyNo.focus();return false;}
else
{document.topSearchForm.submit();return true;}}
