function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}




function submitPropertyRegisteredUserFormValidation()
{

for(i=0;i<agentPropertyRegistration.length;i++)
{

if(document.agentPropertyRegistration.elements[i].value=="")
{
alert("One of the fields Is Empty")
agentPropertyRegistration.elements[i].focus()
agentPropertyRegistration.elements[i].select()
return false;
break;
}

strLength=document.agentPropertyRegistration.elements[i].value

if(strLength.length>248)
{
alert("too many Characrters maximum allowed is 250")
agentPropertyRegistration.elements[i].focus()
agentPropertyRegistration.elements[i].select()
return false;
break;
}

}
}





function DisplayElement(elt, displayValue)
{
	if ( typeof elt == "string" )
	elt = document.getElementById( elt );
	if ( elt == null ) return;
	elt.style.display = displayValue;
}

















function formSubmit()
{
len = document.frm1.tx1.length
for (i = 0; i<len; i++) 
{
if(document.frm1.tx1[i].checked) 
tx1 = document.frm1.tx1[i].value
}

tx2=document.frm1.tx2.value
tx3=document.frm1.tx3.value
tx4=document.frm1.tx4.value

if(tx1=='sell')
{
document.location.href="advertise-Property.asp"
}
else
{
document.location.href="searchPageProperty.asp?tx1="+tx1+"&tx2="+tx2+"&tx3="+tx3+"&tx4="+tx4+""
}

}




function sellOption()
{
document.location.href="advertise-Property.asp"
}




function contactAgent(agent,email,propertyId,PropertyDescription)
{
window.open('mail.asp?agent='+agent+'&emailAddress='+email+'&PropertyID='+propertyId+'&PropertyDescription='+PropertyDescription+'','','left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=500, height=500')
}



function openMap(cityValue)
{
window.open('\\maps\\123yards_Location_maps.asp?cityValue='+cityValue+'','','left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=500')
}



function sorter_Agent()
{
sorted = document.getElementById("sortBy1");

sorted=sorted.value
document.location.href="searchPageAgent.asp?passValue=agent&sorted="+sorted+""
}



var resourceValue
function sorter_Resource(passValue,findCompanyName,findCompanyType)
{
sorted = document.getElementById("sortBy1");
sorted=sorted.value
document.location.href="searchPageResource.asp?passValue="+passValue+"&findCompanyName="+findCompanyName+"&findCompanyType="+findCompanyType+"&sorted="+sorted+""
}



function sorter_PayingGuest()
{
sorted = document.getElementById("sortBy1");
sorted=sorted.value
document.location.href="search-Page-Paying-Guest.asp?passValue=payingGuest&sorted="+sorted+""

}

var sort_Prop_passValue,sort_Prop_tx1,tx2,tx3,tx4
function sorter_Property(sort_Prop_passValue,sort_Prop_tx1,sort_Prop_tx2,sort_Prop_tx3,sort_Prop_tx4)
{
sorted = document.getElementById("sortBy1");
sorted=sorted.value
document.location.href="searchPageProperty.asp?passValue="+sort_Prop_passValue+"&sorted="+sorted+"&tx1="+sort_Prop_tx1+"&tx2="+sort_Prop_tx2+"&tx3="+sort_Prop_tx3+"&tx4="+sort_Prop_tx4+""

}



var DevelopmentBedroom,DevelopmentCity

function sorter_Development(DevelopmentBedroom,DevelopmentCity)
{
sorted = document.getElementById("sortBy1");
sorted=sorted.value
document.location.href="search-Page-Development.asp?DevelopmentBedroom="+DevelopmentBedroom+"&sorted="+sorted+"&DevelopmentCity="+DevelopmentCity+""
}


var featuredDeveloperId
function featuredDevelopers(featuredDeveloperId)
{

switch(featuredDeveloperId)
{
case 1:
window.open('http://www.pinehomeusestates.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 2:
window.open('http://springdaletowers.net/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 3:
window.open('http://www.regaliatowers.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 4:
window.open('http://www.sandwoods.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 5:
//window.open('http://www.pinehomeusestates.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 6:
window.open('http://www.hanumantbuilders.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 7:
window.open('http://www.divineindia.in/divine-solitaire.html','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;
case 8:
window.open('http://www.pearlsinfrastructure.com/nirmal_chhaya_towers.html','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 9:
//window.open('http://www.operaccpl.com /','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;
case 10:
window.open('http://www.emaarmgf.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 11:
window.open('http://www.parsvnath.com/index.asp','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 12:
window.open('http://www.ansalapi.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 13:
window.open('http://www.ansals.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 14:
window.open('http://www.omaxe.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

case 15:
window.open('http://www.operaccpl.com/','',"left=350,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=700, height=650")
break;

}
}




var newsId
function news(newsId)
{

switch(newsId)
{
case 1:
window.open('http://huda.nic.in/RATES2K7letter%20main.pdf','',"left=250,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=900, height=650")
break;

case 2:
window.open('http://huda.nic.in/hotel.pdf','',"left=250,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=900, height=650")
break;

case 3:
window.open('http://puda.nic.in/mega-projects.htm','',"left=250,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=900, height=650")
break;

case 4:
window.open('http://puda.nic.in/Guidlines_mega.htm','',"left=250,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=900, height=650")
break;

}
}


var reportId
function allIndiaReports(reportId)
{
switch(reportId)
{
case 1:
window.open('http://www.colliers.com/Content/Repositories/Base/Markets/India/English/Market_Report/PDFs/IPMO.pdf','',"left=250,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=900, height=650")
break;

case 2:
window.open('http://www.cushwake.com/cwglobal/jsp/publication.jsp?Country=Asia&Language=EN','',"left=250,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=900, height=650")
break;

case 3:
window.open('http://property.magicbricks.com/newproperty/img/MallMgt-low.pdf?Country=Asia&Language=EN','',"left=250,top=100,  directories=no, scrollbars=yes status=no, resizable=yes, width=900, height=650")
break;

}
}




function findAnAgent()
{
findCompanyType=document.findAnAgentForm.elements[0].value
findCompanyName=document.findAnAgentForm.elements[1].value

if(findCompanyName=="")
{

alert("Please fill in company name")
return false
}

else
{
if(findCompanyType=='agent')
{
//return false
document.findAnAgentForm.action="searchPageAgent.asp?findCompanyName="+findCompanyName+""
document.findAnAgentForm.submit()

}
else
{
//return false

document.findAnAgentForm.action="searchPageResource.asp?findCompanyType="+findCompanyType+"&findCompanyName="+findCompanyName+""
document.findAnAgentForm.submit()

}
}

}



function getValidateFormPropertyParameters()
{
var winTx1=document.getElementById("winTx1");
var winTx2=document.getElementById("winTx2");
var winTx3=document.getElementById("winTx3");
var winTx4=document.getElementById("winTx4");
var winTx5=document.getElementById("winTx5");
var winTx6=document.getElementById("winTx6");
var winTx7=document.getElementById("winTx7");



if(winTx3!=null)
 {
if(winTx3.value=="")
{
alert("Please enter value for area.")
return false
}
}


if(winTx6!=null) 
{
if(winTx6.value=="")
{
alert("Please enter value for phone.")
return false
}
}

/*
if((winTx3.value!="")&&(winTx6.value!=""))
{
propertyEvaluationWindow=window.open('','',"left=450,top=100,  directories=no, status=no, resizable=no, width=500, height=450")
propertyEvaluationWindow.document.location.href="Property_Evaluation.asp?winTx1="+winTx1.value+"&winTx2="+winTx2.value+"&winTx3="+winTx3.value+"&winTx4="+winTx4.value+"&winTx5="+winTx5.value+"&winTx6"+winTx6.value+"&winTx7="+winTx7.value+""
}
*/

}







function submitPropertyFormValidation()
{

for(i=0;i<agentRegistration.length;i++)
{

if(document.agentRegistration.elements[i].value=="")
{
alert("One of the fields Is Empty")
agentRegistration.elements[i].focus()
agentRegistration.elements[i].select()
return false;
break;
}

}


}





function checkMailForm()
{
if (document.mailform.FromField.value == "")
{
alert("You Have Missed Filling up Your Email Information.")
return false;
}

if (document.mailform.SubjectField.value == "")
{
alert("You Have Missed Filling up the Phone Information.")
return false;
}

/*if (document.mailform.ToField.value == "")
{
 if (document.mailform.CcField.value == "")
{
if (document.mailform.BccField.value == "")
{
alert("Sender and at least one recipient must be specified.")
return false;
}
}

return false;

}
*/
//window.close()
//return true;

}




function checkPropertyInfoQuery()
{
Name=document.propertyInfo.Name.value
FromField=document.propertyInfo.FromField.value
SubjectField=document.propertyInfo.SubjectField.value
BodyField=document.propertyInfo.BodyField.value 
if (document.propertyInfo.Name.value == "")
{
alert("You Have Missed Filling up Your Name Information.")
return false;
}

if (document.propertyInfo.FromField.value == "")
{
alert("You Have Missed Filling up Your Email Information.")
return false;
}

if (document.propertyInfo.SubjectField.value == "")
{
alert("You Have Missed Filling up the Phone Information.")
return false;
}

if (document.propertyInfo.BodyField.value == "")
{
alert("You Have Missed Filling up the message Information.")
return false;
}

if(document.propertyInfo.name.value != "" && document.propertyInfo.FromField.value != "" && document.propertyInfo.SubjectField.value != "" && document.propertyInfo.SubjectField.value != "")
{
window.open('Property_Info_Query.asp?Name='+Name+'&FromField='+FromField+'&SubjectField='+SubjectField+'&BodyField='+BodyField+'','',"left=450,top=100,  directories=no, status=no, resizable=no, width=500, height=300")
}
}


function checkExpertAdviceInfoQuery()
{
Name=document.propertyInfo.Name.value
FromField=document.propertyInfo.FromField.value
SubjectField=document.propertyInfo.SubjectField.value
BodyField=document.propertyInfo.BodyField.value 
if (document.propertyInfo.Name.value == "")
{
alert("You Have Missed Filling up Your Name Information.")
return false;
}

if (document.propertyInfo.FromField.value == "")
{
alert("You Have Missed Filling up Your Email Information.")
return false;
}

if (document.propertyInfo.SubjectField.value == "")
{
alert("You Have Missed Filling up the Phone Information.")
return false;
}

if (document.propertyInfo.BodyField.value == "")
{
alert("You Have Missed Filling up the message Information.")
return false;
}

/*
if(document.propertyInfo.name.value != "" && document.propertyInfo.FromField.value != "" && document.propertyInfo.SubjectField.value != "" && document.propertyInfo.SubjectField.value != "")
{
window.open('Property_Info_Query.asp?Name='+Name+'&FromField='+FromField+'&SubjectField='+SubjectField+'&BodyField=Expert Info '+BodyField+'','',"left=450,top=100,  directories=no, status=no, resizable=no, width=500, height=300")
}
*/
}



function calculate_Area_Window()
{
window.open('area_calculator.html','',"left=450,top=100,  directories=no, status=no, resizable=no, width=365, height=440")

}

function calculate_EMI_Window()
{
window.open('EMI_calculator.html','',"left=450,top=100,  directories=no, status=no, resizable=no, width=665, height=340")

}


function calculate_Property_Rates_Window()
{
window.open('Property-Rates.html','',"left=450,top=100,  directories=no, status=no, resizable=yes, scrollbars=yes, width=665, height=340")

}


function propertyAlert()
{
tx1=document.propertyAlertForm.tx1.value
tx2=document.propertyAlertForm.tx2.value
tx3=document.propertyAlertForm.tx3.value
tx4=document.propertyAlertForm.tx4.value
tx5=document.propertyAlertForm.tx5.value
tx6=document.propertyAlertForm.tx6.value
tx7=document.propertyAlertForm.tx7.value
tx8=document.propertyAlertForm.tx8.value
tx9=document.propertyAlertForm.tx9.value
tx10=document.propertyAlertForm.tx10.value
tx11=document.propertyAlertForm.tx11.value

if(document.propertyAlertForm.tx7.value=='' || document.propertyAlertForm.tx10.value=='')
{
if(document.propertyAlertForm.tx7.value=='')
{
alert("you havent specified your name")
return false;
}
if(document.propertyAlertForm.tx10.value=='')
{
alert("you havent specified your mobile number")
return false;
}
}
/*
else
{
alertWindow=window.open('','',"left=450,top=100,  directories=no, status=no, resizable=no, width=665, height=340")

alertWindow.document.location.href="propertyAlert.asp?tx1="+tx1+"&tx2="+tx2+"&tx3="+tx3+"&tx4="+tx4+"&tx5="+tx5+"&tx6="+tx6+"&tx7="+tx7+"&tx8="+tx8+"&tx9="+tx9+"&tx10="+tx10+"&tx11="+tx11+""
}
*/
}



function propertyloan()
{
tx1=document.loan_form.tx1.value
tx2=document.loan_form.tx2.value
tx3=document.loan_form.tx3.value
tx4=document.loan_form.tx4.value
tx5=document.loan_form.tx5.value
tx6=document.loan_form.tx6.value
tx7=document.loan_form.tx7.value
tx8=document.loan_form.tx8.value

if(document.loan_form.tx4.value=='' || document.loan_form.tx7.value=='')
{
if(document.loan_form.tx4.value=='')
{
alert("you havent specified your name")
return false;
}
if(document.loan_form.tx7.value=='')
{
alert("you havent specified your mobile number")
return false;
}
}
/*
else
{
loanWindow=window.open('','',"left=450,top=100,  directories=no, status=no, resizable=no, width=665, height=340")

loanWindow.document.location.href="propertyLoan.asp?tx1="+tx1+"&tx2="+tx2+"&tx3="+tx3+"&tx4="+tx4+"&tx5="+tx5+"&tx6="+tx6+"&tx7="+tx7+"&tx8="+tx8+""
}
*/
}





function sendDevelopmentFormValues()
{
DevelopmentCity=document.featuredDevelopmentForm.DevelopmentCity.value
DevelopmentBedroom=document.featuredDevelopmentForm.DevelopmentBedroom.value
//if(DevelopmentCity!=''||DevelopmentBedroom!='')
//{
document.location.href="search-Page-Development.asp?DevelopmentCity="+DevelopmentCity+"&DevelopmentBedroom="+DevelopmentBedroom+""
//}
}

/*
function check_property_Poll_values()
{
len = document.propertyPoll.tx1.length
for (i = 0; i<len; i++) 
{
if(document.propertyPoll.tx1[i].checked) 
{
tx1 = document.propertyPoll.tx1[i].value
}
}
if(tx1!='') 
{
return true
}
else
{
alert("you have to select atleast one city");
return false;
}

}
*/
function check_property_Poll_values()
{
len = document.propertyPoll.length
var tx1
for (i = 0; i<len; i++) 
{
if(document.propertyPoll.elements[i].checked) 
{
tx1 = document.propertyPoll.elements[i].value
}
}

if(tx1==undefined)
{
alert("Select atleast one city for property polling")
//return false;
}
else
{
pollWindow=window.open('','',"left=450,top=100,  directories=no, status=no, resizable=no, width=665, height=340")

pollWindow.document.location.href="property_poll.asp?tx1="+tx1+""

//return true
}

}







//AJAX function 

var xmlHttp

function showCustomer(str,PropertyID)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="getProperties.asp";
url=url+"?q="+str;
url=url+"&PropertyID="+PropertyID;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


