// JavaScript Document
function onPageLoad()
{
	
}

 /* ------------------------------  function for post property requirement for home page form and property hunt form -------------------------------- */

function ValPostRequ()
 {

var value=false;
var want=document.postreq.txtwant.value;
var type=document.postreq.txttype.value;
var loc=document.postreq.txtlocation.value;
var name=document.postreq.txtname.value;
var contact=document.postreq.txtcontact.value;
var email=document.postreq.txtemail.value;


if(name==""){
alert("Please enter your Name..!!");
return false;}

if(contact==""){
alert("Please enter your Contact No.!!");
return false;
}
for(i=0;i<contact.length;i++)
{
	char=contact.charAt(i);
	if(isNaN(char))
	{  alert("enter numbers only for phone number");
		return false;}
}
 if (email==""){
 alert("Please enter your E-mail address.!!");
return false;
 }
 
 
 contact_re=new RegExp("^[\\d]+$");
contact_re1=new RegExp("^[\\d-]+$");
contact_re2=new RegExp("^[\\d-+]+$");
email_re=/^[^@]+@[^@]+.[a-z]{2,}$/i;
/* var what=document.forms[2].what.value;
var bhk=document.forms[2].bhk.value;
var location=document.forms[2].location.value;
var email=document.forms[2].elements[4].value;
contact_re=new RegExp("^[\\d]+$");
contact_re1=new RegExp("^[\\d-]+$");
contact_re2=new RegExp("^[\\d-+]+$");

email_re=/^[^@]+@[^@]+.[a-z]{2,}$/i;

	
 if(bhk == "Select") {
                    value=false;
                    alert("Please select BHK");
                   
                    return value;
                }
                */  
 if(loc == "Select") {
                    value=false;
                    alert("Please select Location..!!");
                    
                    return value;
                }
                
              
if(contact.length >= 8 )
{

if(contact.match(contact_re) && contact.length == 8)  {
                    value=true;
                }
                else if(contact.match(contact_re) && contact.length == 10)  {
                    value=true;
                }
                else if(contact.match(contact_re1) && contact.length == 9 && contact[0] == '-' || contact[1] == '-' || contact[2] == '-' || contact[3] == '-' || contact[4]=='-' || contact[5]=='-' || contact[6]=='-' || contact[7]=='-' || contact[8]=='-' )   {
                    value=true;
                }
                else if(contact.match(contact_re2) && contact.length > 7 && contact.length > 10)   {
                    value=true;
                }
                else
               {
                    value=false;
                    alert("Please enter valid Phone number!!!");
                    document.postreq.txtcontact.select();
                    return value;
                }

}
else
{
value=false;
alert("Please enter valid Phone number!!!");
document.postreq.txtcontact.select();
return value;
}



if(email.match(email_re))  {
                    value=true;
                }
                else  {
                    value=false;
                    alert("Please enter valid email address!!!");
                    document.postreq.txtemail.select();
                    return value;
                }
return true;
}









/*----------------function for movers& packers form------------------------*/

function ValMovPac()
 {


var value=false;
var from=document.movpac.txtfrom.value;
var to=document.movpac.txtto.value;
var name=document.movpac.txtname.value;
var contact=document.movpac.txtcontact.value;
var email=document.movpac.txtemail.value;


if(from==""){
alert("Please enter From ..!!");
return false;}

if(to==""){
alert("Please enter To..!!");
return false;}

if(name==""){
alert("Please enter your Name..!!");
return false;}

if(contact==""){
alert("Please enter your Contact No.!!");
return false;
}
for(i=0;i<contact.length;i++)
{
	char=contact.charAt(i);
	if(isNaN(char))
	{  alert("enter numbers only for phone number");
		return false;}
}

 if (email==""){
 alert("Please enter your E-mail address.!!");
return false;
 }
 
 
 contact_re=new RegExp("^[\\d]+$");
contact_re1=new RegExp("^[\\d-]+$");
contact_re2=new RegExp("^[\\d-+]+$");
email_re=/^[^@]+@[^@]+.[a-z]{2,}$/i;

              
if(contact.length >= 8 )
{

if(contact.match(contact_re) && contact.length == 8)  {
                    value=true;
                }
                else if(contact.match(contact_re) && contact.length == 10)  {
                    value=true;
                }
                else if(contact.match(contact_re1) && contact.length == 9 && contact[0] == '-' || contact[1] == '-' || contact[2] == '-' || contact[3] == '-' || contact[4]=='-' || contact[5]=='-' || contact[6]=='-' || contact[7]=='-' || contact[8]=='-' )   {
                    value=true;
                }
                else if(contact.match(contact_re2) && contact.length > 7 && contact.length > 10)   {
                    value=true;
                }
                else
               {
                    value=false;
                    alert("Please enter valid Phone number!!!");
                    document.movpac.txtcontact.select();
                    return value;
                }

}
else
{
value=false;
alert("Please enter valid Phone number!!!");
document.movpac.txtcontact.select();
return value;
}



if(email.match(email_re))  {
                    value=true;
                }
                else  {
                    value=false;
                    alert("Please enter valid email address!!!");
                    document.movpac.txtemail.select();
                    return value;
                }
return true;
}





/*----------------function for utility form------------------------*/

function ValUtility()
 {


var value=false;
var loc=document.utility.txtlocation.value;
var name=document.utility.txtname.value;
var contact=document.utility.txtcontact.value;
var email=document.utility.txtemail.value;


if(document.utility.ch1.checked == false && document.utility.ch2.checked == false && document.utility.ch3.checked == false ){
	value=false;
	alert("'You didn\'t choose any of the checkboxes!'");
	return value;
}



 if(loc == "Select") {
                    value=false;
                    alert("Please select Location..!!");
                    return value;
                }

if(name==""){
alert("Please enter your Name..!!");
return false;}

if(contact==""){
alert("Please enter your Contact No.!!");
return false;
}
for(i=0;i<contact.length;i++)
{
	char=contact.charAt(i);
	if(isNaN(char))
	{  alert("enter numbers only for phone number");
		return false;}
}
 if (email==""){
 alert("Please enter your E-mail address.!!");
return false;
 }
 
 
 contact_re=new RegExp("^[\\d]+$");
contact_re1=new RegExp("^[\\d-]+$");
contact_re2=new RegExp("^[\\d-+]+$");
email_re=/^[^@]+@[^@]+.[a-z]{2,}$/i;

              
if(contact.length >= 8 )
{

if(contact.match(contact_re) && contact.length == 8)  {
                    value=true;
                }
                else if(contact.match(contact_re) && contact.length == 10)  {
                    value=true;
                }
                else if(contact.match(contact_re1) && contact.length == 9 && contact[0] == '-' || contact[1] == '-' || contact[2] == '-' || contact[3] == '-' || contact[4]=='-' || contact[5]=='-' || contact[6]=='-' || contact[7]=='-' || contact[8]=='-' )   {
                    value=true;
                }
                else if(contact.match(contact_re2) && contact.length > 7 && contact.length > 10)   {
                    value=true;
                }
                else
               {
                    value=false;
                    alert("Please enter valid Phone number!!!");
                    document.utility.txtcontact.select();
                    return value;
                }

}
else
{
value=false;
alert("Please enter valid Phone number!!!");
document.utility.txtcontact.select();
return value;
}



if(email.match(email_re))  {
                    value=true;
                }
                else  {
                    value=false;
                    alert("Please enter valid email address!!!");
                    document.utility.txtemail.select();
                    return value;
                }
return true;
}

/*----------------function for House Hold form------------------------*/

function ValHouseHold()
 {


var value=false;
var loc=document.household.txtlocation.value;
var name=document.household.txtname.value;
var contact=document.household.txtcontact.value;
var email=document.household.txtemail.value;


if(document.household.chk1.checked == false && document.household.chk2.checked == false && document.household.chk3.checked == false && document.household.chk4.checked == false){
	value=false;
	alert("'You didn\'t choose any of the checkboxes!'");
	return value;
}



 if(loc == "Select") {
                    value=false;
                    alert("Please select Location..!!");
                    return value;
                }

if(name==""){
alert("Please enter your Name..!!");
return false;}

if(contact==""){
alert("Please enter your Contact No.!!");
return false;
}
for(i=0;i<contact.length;i++)
{
	char=contact.charAt(i);
	if(isNaN(char))
	{  alert("enter numbers only for phone number");
		return false;}
}
 if (email==""){
 alert("Please enter your E-mail address.!!");
return false;
 }
 
 
 contact_re=new RegExp("^[\\d]+$");
contact_re1=new RegExp("^[\\d-]+$");
contact_re2=new RegExp("^[\\d-+]+$");
email_re=/^[^@]+@[^@]+.[a-z]{2,}$/i;

              
if(contact.length >= 8 )
{

if(contact.match(contact_re) && contact.length == 8)  {
                    value=true;
                }
                else if(contact.match(contact_re) && contact.length == 10)  {
                    value=true;
                }
                else if(contact.match(contact_re1) && contact.length == 9 && contact[0] == '-' || contact[1] == '-' || contact[2] == '-' || contact[3] == '-' || contact[4]=='-' || contact[5]=='-' || contact[6]=='-' || contact[7]=='-' || contact[8]=='-' )   {
                    value=true;
                }
                else if(contact.match(contact_re2) && contact.length > 7 && contact.length > 10)   {
                    value=true;
                }
                else
               {
                    value=false;
                    alert("Please enter valid Phone number!!!");
                    document.household.txtcontact.select();
                    return value;
                }

}
else
{
value=false;
alert("Please enter valid Phone number!!!");
document.household.txtcontact.select();
return value;
}



if(email.match(email_re))  {
                    value=true;
                }
                else  {
                    value=false;
                    alert("Please enter valid email address!!!");
                    document.household.txtemail.select();
                    return value;
                }
return true;
}


/*----------------function for Property Search on main page------------------------*/

function ValProSearch()
 {

var value=false;
var loc=document.prosearch.type.value;
 if(loc == "select-property") {
                    value=false;
                    alert("Please select Property Type..!!");
                    return value;
                }
}

//------------------contact us-----------

function Validatee()
{
	var value=false;

var nam=document.Cont.name.value;
var contact=document.Cont.mobile.value;
var email=document.Cont.email.value;
var comm=document.Cont.comments.value;

if(nam.length<=2){
alert("Please enter your Name..!!");
return false;}

if(contact==""){
alert("Please enter your Contact No.!!");
return false;
}
for(i=0;i<contact.length;i++)
{
	char=contact.charAt(i);
	if(isNaN(char))
	{  alert("enter numbers only for phone number");
		return false;}
}
if(contact.length<8){
	alert("enter valid phone number");
	return false;
}


 

contact_re=new RegExp("^[\\d]+$");
contact_re1=new RegExp("^[\\d-]+$");
contact_re2=new RegExp("^[\\d-+]+$");
email_re=/^[^@]+@[^@]+.[a-z]{2,}$/i;

              
if(contact.length >= 8 )
{

if(contact.match(contact_re) && contact.length == 8)  {
                    value=true;
                }
                else if(contact.match(contact_re) && contact.length == 10)  {
                    value=true;
                }
                else if(contact.match(contact_re1) && contact.length == 9 && contact[0] == '-' || contact[1] == '-' || contact[2] == '-' || contact[3] == '-' || contact[4]=='-' || contact[5]=='-' || contact[6]=='-' || contact[7]=='-' || contact[8]=='-' )   {
                    value=true;
                }
                else if(contact.match(contact_re2) && contact.length > 7 && contact.length > 10)   {
                    value=true;
                }
                else
               {
                    value=false;
                    alert("Please enter valid Phone number!!!");
                    document.Cont.mobile.select();
                    return value;
                }

}
else
{
value=false;
alert("Please enter valid Phone number!!!");
document.Cont.mobile.select();
return value;
}
 if (email==""){
 alert("Please enter your E-mail address.!!");
return false;
 }



if(email.match(email_re))  {
                    value=true;
                }
                else  {
                    value=false;
                    alert("Please enter valid email address!!!");
                    document.Cont.email.select();
                    return value;
                }
if(comm==""){
alert("please enter comments !!");
return false;
}
return true;
}

 








