// JavaScript Document

function GetXmlHttpObject()

{

	var xmlHttp=null;

	try

	{

		xmlHttp=new XMLHttpRequest();

	}

	catch(e)

	{

		try

		{

			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

		}

		catch(e)

		{

			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

		}

	}

	return xmlHttp;

}

function showpininfo()

{

    xmlHttp=GetXmlHttpObject()

    if(xmlHttp==null)

    {

    alert("Browser does not support HTTP Request")

    return

    }

    var url="popupwindow.php"

    xmlHttp.onreadystatechange=stateChangedshowpininfo

    xmlHttp.open("GET",url,true)

    xmlHttp.send(null)

}

function checkemail1(str)

    {

        var testresults;

        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

        if (filter.test(str))

        testresults=true

        else{

        testresults=false

        }

        return (testresults)

    }

function ProcessLoader()

{

    document.getElementById('dvprocessing').style.display = '';

}

function ProcessLoader1()

{

    document.getElementById('dvprocessing').innerHTML = "<img src='images/question entry loading page.jpg' width=300px; hieght=50px;>";

    document.getElementById('dvprocessing').style.display = '';

    document.getElementById('dvprocessing').style.width = '';

    document.getElementById('dvprocessing').style.height = '';

    document.getElementById('dvprocessing').style.top = CalculateTop('32')+ "px";

    document.getElementById('dvprocessing').style.left = CalculateLeft('32')+ "px";

    document.getElementById('dvprocessing').style.backgroundColor = 'white';

}

function stateChangedshowpininfo()

{

    SetBackground();

    if(xmlHttp.readyState==1)

    {

    ProcessLoader();

    }

    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

    {

           document.getElementById('dvprocessing').style.display='none';

           document.getElementById('dvregisterfrm').style.width = '355';

           document.getElementById('dvregisterfrm').style.height = '382';

           document.getElementById('dvregisterfrm').style.top = CalculateTop('382') + "px";

           document.getElementById('dvregisterfrm').style.left = CalculateLeft('355')+ "px";

           document.getElementById('dvregisterfrm').style.display='';

           document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

           unhideIframe();

    }

}

function trim(str, chars) {

return ltrim(rtrim(str, chars), chars);

}

function ltrim(str, chars) {

chars = chars || "\\s";

return str.replace(new RegExp("^[" + chars + "]+", "g"), "");

}

function rtrim(str, chars) {

chars = chars || "\\s";

return str.replace(new RegExp("[" + chars + "]+$", "g"), "");

}

function body_onkeydown(evt)

{

var key=(window.Event)?evt.which:evt.keyCode;

if(key==27)

{

styledPopupClose();

	}

}

function CalculateTop(Height)

{var ScrollTop=document.body.scrollTop;if(ScrollTop==0)

{if(window.pageYOffset)

ScrollTop=window.pageYOffset;else

ScrollTop=(document.body.parentElement)?document.body.parentElement.scrollTop:0;}

var BodyHeight=document.body.clientHeight;if(BodyHeight==0)

{BodyHeight=window.innerHeight;}

if(BodyHeight==0)

{BodyHeight=document.documentElement.clientHeight}

var myWidth = 0, myHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) {

    //Non-IE

    myWidth = window.innerWidth;

    myHeight = window.innerHeight;

  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

    //IE 6+ in 'standards compliant mode'

    myWidth = document.documentElement.clientWidth;

    myHeight = document.documentElement.clientHeight;

  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {

    //IE 4 compatible

    myWidth = document.body.clientWidth;

    myHeight = document.body.clientHeight;

  }

var FinalTop=((myHeight-Height)/2)+ScrollTop;return FinalTop;}

function CalculateLeft(Weight)

{var ScrollLeft=document.body.scrollLeft;if(ScrollLeft==0)

{if(window.pageXOffset)

ScrollLeft=window.pageXOffset;else

ScrollLeft=(document.body.parentElement)?document.body.parentElement.scrollLeft:0;}

var BodyWeight=document.documentElement.clientWidth;if(BodyWeight==0)

{BodyWeight=document.body.clientWidth;}

var FinalLeft=(BodyWeight+ScrollLeft-Weight)/2;return FinalLeft;}

function SetBackground()

{

document.getElementById('dimmer').style.width=GetBodyWidth();

document.getElementById('dimmer').style.height=GetBodyHeight();
/*document.getElementById('dimmer').style.opacity = 0.7;*/
document.getElementById('dimmer').style.visibility="visible";

}


function init()

{

isMozilla=(document.all)?0:1;

if(isMozilla)

{

document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);

}

}

init();

function hideIframe()

{

if(ie)

{

var theIframe=document.getElementById("fadeboxiframe")

	if(theIframe!=null)
	{

	theIframe.style.display="none";
	}

}

}

function unhideIframe()
{

	if(ie)

	{

		var theIframe=document.getElementById("fadeboxiframe")

		if(theIframe != null)
		{
		var theDiv=document.getElementById("dvregisterfrm");

		theIframe.style.width=theDiv.offsetWidth+'px';

		theIframe.style.height=theDiv.offsetHeight+'px';

		theIframe.style.top=theDiv.offsetTop+'px';

		theIframe.style.left=theDiv.offsetLeft+'px';

		theIframe.style.display='';
		}

	}

}

function GetBodyWidth()

{

var theWidth=0;

if(document.body)

{

	theWidth=document.body.clientWidth;

}

else if(document.documentElement&&document.documentElement.clientWidth)

{

	theWidth=document.documentElement.clientWidth;

}

else if(window.innerWidth)

{

	theWidth=window.innerWidth;

}

	theWidth=theWidth-85;

return theWidth+ "px";

}

function GetBodyHeight()

{

var theHeight1=0;

var theHeight2=0;

var theHeight3=0;

if(window.innerHeight)

{

theHeight1=window.innerHeight;

}

if(document.documentElement&&document.documentElement.clientHeight)

{

theHeight2=document.documentElement.clientHeight;

}

if(document.body)

{

theHeight3=document.body.clientHeight;

if(isMozilla)

{

theHeight4=0;

}

else

{

theHeight4=document.body.scrollHeight;

}

}

FinalHeight=Math.max(theHeight1,theHeight2,theHeight3,theHeight4);

FinalHeight=FinalHeight-85;

FinalHeight = FinalHeight + 5;

return FinalHeight+ "px";

}

function KeycheckOnlyNumeric(e)

{

   var _dom = 0;

    _dom=document.all?3:(document.getElementById?1:(document.layers?2:0));

    if(document.all) e=window.event; // for IE

    var ch='';

    var KeyID = '';

    //alert(_dom);

    if(_dom==2){                     // for NN4

        //alert(e.which);

        if(e.which>0) ch='('+String.fromCharCode(e.which)+')';

        KeyID=e.which;

    }

    else

    {

        if(_dom==3){                   // for IE

            KeyID = (window.event) ? event.keyCode : e.which;

        }

        else {                       // for Mozilla

            //alert('Mozilla:' + e.charCode);

            if(e.charCode>0) ch='('+String.fromCharCode(e.charCode)+')';

            KeyID=e.charCode;

        }

    }

    if((KeyID >= 65 && KeyID <= 90) || (KeyID >= 97 && KeyID <= 122) || (KeyID >= 33 && KeyID <= 47) || (KeyID >= 58 && KeyID <= 64) || (KeyID >= 91 && KeyID <= 96) || (KeyID >= 123 && KeyID <= 126))	

    {

        return false;

    }

    return true;

}

function showaddpropertyform(userdo,id)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="addproperty.php?userdo="+userdo+"&pid="+id;

	xmlHttp.onreadystatechange= stateChangeaddproperty;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function stateChangeaddproperty()

{

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

	{

		 var str = trim(xmlHttp.responseText, ' ');

	 	var strlengthcount = str.length;

		document.getElementById("divproperty").style.display='none';

		document.getElementById("divaddproperty").innerHTML=xmlHttp.responseText;

		document.getElementById("divaddproperty").style.display='';

		if(document.getElementById('fk_typeglcode').value==159 || document.getElementById('fk_typeglcode').value==160) 

			{

				document.getElementById('trland').style.display='';

				document.getElementById('trland1').style.display='';

				

				document.getElementById('showbnt').style.display='none';

				document.getElementById('showbntland').style.display='';

			}

			else

			{

				document.getElementById('trland').style.display='none';

				document.getElementById('trland1').style.display='none';

				

				document.getElementById('showbnt').style.display='';

				document.getElementById('showbntland').style.display='none';

			}

		if(document.getElementById('fk_typeglcode').value==120) 

			{

				document.getElementById('tdsmcap').style.display='';

				document.getElementById('tdsmtext').style.display='';

			}

		else

			{

				document.getElementById('tdsmcap').style.display='none';

				document.getElementById('tdsmtext').style.display='none';

			}

	}

}

function disoldpric()	

{

	if(document.getElementById('chkold').checked==true)

	{

		document.getElementById('trold').style.display='';

	}

	else if(document.getElementById('chkold').checked==false)

	{

		document.getElementById('trold').style.display='none';

	}

}

function chgType(strid,strval)

{
 
	if(strval==159 || strval==160)

	{

		document.getElementById('trland').style.display='';

		document.getElementById('trland1').style.display='';

		document.getElementById('showbnt').style.display='none';

		document.getElementById('showbntland').style.display='';

	}

	else

	{

		document.getElementById('trland').style.display='none';

		document.getElementById('trland1').style.display='none';

		document.getElementById('showbnt').style.display='';

		document.getElementById('showbntland').style.display='none';

	}

}

function funpropertydetail()

{

	var x=validationaddproperty();

	if(x==false)

	{

		return false;

	}

	document.getElementById('divinneraddproperty').style.display='none';

	document.getElementById('divaddpropertydetail').style.display='';

}

function validationaddproperty()

{

	var vartype=document.getElementById('fk_typeglcode').value;

	if(document.getElementById('fk_agentid').value == "0")

        {

            alert("Please Select Agent");

			document.getElementById('fk_agentid').focus();

			return false;

        }

   else if(document.getElementById('fk_typeglcode').value == "PleaseSelect")

        {

            alert("Please Select Type");

            document.getElementById('fk_typeglcode').focus();

            return false;

        }

	 else if(document.getElementById('varmls').value == "")

        {

            alert("Please enter MLS # Value");

			document.getElementById('varmls').focus();

			return false;

        }

    else if(document.getElementById('vartitle').value == "")

        {

            alert("Please enter the Title");

			document.getElementById('vartitle').focus();

			return false;

        }

    else if(document.getElementById('fk_status').value == "PleaseSelect")

        {

            alert("Please Select Status ");

            document.getElementById('fk_status').focus();

            return false;

        }

    else if(document.getElementById('fk_districtglcode').value == "PleaseSelect")

        {

            alert("Please Select District");

             document.getElementById('fk_districtglcode').focus();

            return false;

        }

		 else if(document.getElementById('fk_Sector').value == "PleaseSelect")

        {

            alert("Please Select Sector");

            document.getElementById('fk_Sector').focus();

            return false;

        }

		 else if(document.getElementById('fk_Zoning').value == "PleaseSelect")

        {

            alert("Please Select Zoning");

            document.getElementById('fk_Zoning').focus();

            return false;

        }

		else if(document.getElementById('fk_Currency').value == "PleaseSelect")

		{

			alert("Please Select Currency");

            document.getElementById('fk_Currency').focus();

            return false;

		}

		else if(trim(document.getElementById('decprice').value) == "")

		{

			alert("Please Enter Price");

            document.getElementById('decprice').focus();

            return false;

		}

		else if(document.getElementById('fk_Views').value == "PleaseSelect")

		{

			alert("Please Select Views");

            document.getElementById('fk_Views').focus();

            return false;

		}

	else if(trim(document.getElementById('varwidth').value) == "" && (vartype==159 || vartype==160))

		{

			alert("Please Enter Width");

            document.getElementById('varwidth').focus();

            return false;

		}

		else if(trim(document.getElementById('vardepth').value) == "" && (vartype==159 || vartype==160))

		{

			alert("Please Enter Depth");

            document.getElementById('vardepth').focus();

            return false;

		}

		else if(trim(document.getElementById('decacreage').value) == "" && (vartype==159 || vartype==160))

		{

			alert("Please Enter Acreage");

            document.getElementById('decacreage').focus();

            return false;

		}

	else if(document.getElementById('fk_Soil').value == "PleaseSelect" && (vartype==159 || vartype==160))

		{

			alert("Please Select Soil");

            document.getElementById('fk_Soil').focus();

            return false;

		}

}

function chkprice(e)

{

   var _dom = 0;

    _dom=document.all?3:(document.getElementById?1:(document.layers?2:0));

    if(document.all) e=window.event; // for IE

    var ch='';

    var KeyID = '';

    //alert(_dom);

    if(_dom==2){                     // for NN4

        //alert(e.which);

        if(e.which>0) ch='('+String.fromCharCode(e.which)+')';

        KeyID=e.which;

    }

    else

    {

        if(_dom==3){                   // for IE

            KeyID = (window.event) ? event.keyCode : e.which;

        }

        else {                       // for Mozilla

            //alert('Mozilla:' + e.charCode);

            if(e.charCode>0) ch='('+String.fromCharCode(e.charCode)+')';

            KeyID=e.charCode;

        }

    }

    if(KeyID==46)

        {

            return true;

        }

    else if((KeyID >= 65 && KeyID <= 90) || (KeyID >= 97 && KeyID <= 122) || (KeyID >= 33 && KeyID <= 47) || (KeyID >= 58 && KeyID <= 64) || (KeyID >= 91 && KeyID <= 96) || (KeyID >= 123 && KeyID <= 126))

    {

        //alert("hello");

        return false;

    }

    return true;

}

function showregistrationform(chkproid,protype)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

    chkproid=typeof(chkproid) != 'undefined' ? chkproid : 'NotFail';

	chkproid="?chkproid="+chkproid;

	protype=typeof(protype) != 'undefined' ? protype : 'NotFail';

	protype="&protype="+protype;

	var url="registration.php"+chkproid+protype;

    //alert(url);

	xmlHttp.onreadystatechange= stateChangeregister;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function stateChangeregister()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 200;

var popupw = 360;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		//winW = window.innerWidth;

		//winH = window.innerHeight;

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";

document.getElementById('dvregisterfrm').style.left= leftf + "px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

unhideIframe();

}

}

function funpopuplogin(chkproid,protype)

{

    //alert("in");

    xmlHttp=GetXmlHttpObject()

    if(xmlHttp==null)

    {

    alert("Browser does not support HTTP Request")

    return

    }

	

	chkproid=typeof(chkproid) != 'undefined' ? chkproid : 'NotFail';

	chkproid="?chkproid="+chkproid;

	protype=typeof(protype) != 'undefined' ? protype : 'NotFail';

	protype="&protype="+protype;

	

    var url="loginmodel.php"+chkproid+protype;

//    alert(url);

    xmlHttp.onreadystatechange= stateChangeloginpopup

    xmlHttp.open("GET",url,true)

    xmlHttp.send(null)

}

function stateChangeloginpopup()

{

    SetBackground();

    if(xmlHttp.readyState==1)

    {

		ProcessLoader();

    }

    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

    {

		var popuph = 316;

		var popupw = 360;

		var popuph2 = popuph/2;

		var popupw2 = popupw/2;

		var winW = screen.width;

		var winH = screen.height;

		if (parseInt(navigator.appVersion)>3) {

			if (navigator.appName=="Netscape") {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

			if (navigator.appName.indexOf("Microsoft")!=-1) {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

		}

		var sh = winH;

		var sw = winW;

		var sh2 = sh/2;

		var sw2 = sw/2;

		var topf1 = sh2 - popuph;

		var leftf1 = sw2 - popupw2;

    document.getElementById('dvprocessing').style.display='none';

    document.getElementById('dvregisterfrm').style.display='';

	document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";

    document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
    //alert(xmlHttp.responseText);
    unhideIframe();

    }

}

function showrforgetpass()

{

xmlHttp=GetXmlHttpObject()

if(xmlHttp==null)

{

alert("Browser does not support HTTP Request")

return

}

var url="forgotpass.php";

xmlHttp.onreadystatechange= stateChangeforgetpass

xmlHttp.open("GET",url,true)

xmlHttp.send(null)

}

function stateChangeforgetpass()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 316;

var popupw = 360;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";

document.getElementById('dvregisterfrm').style.left= leftf + "px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

unhideIframe();

}

}

function showchangeprofileform()

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="changeprofile.php";

	//alert(url);

	xmlHttp.onreadystatechange= stateChangechangeprofile;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function showappointmentformold()

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="appointment.php";

	xmlHttp.onreadystatechange= stateChangeappointment;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function showappointmentform(propertyid)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	//alert(propertyid);

	var url="appointment.php?propertyid="+propertyid;

	//alert(propertyid);

	xmlHttp.onreadystatechange= stateChangeappointment;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function showinquiryform()

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="inquiry.php";

	xmlHttp.onreadystatechange= stateChangeappointment;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function stateChangeappointment()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 200;

var popupw = 360;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";

document.getElementById('dvregisterfrm').style.left= leftf + "px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
//alert(xmlHttp.responseText);
unhideIframe();

}

}

function form_submit_quick_appointment()

 {

		 if(document.getElementById('varfname').value == "")

        {

            alert("Please enter the first name");

			document.getElementById('varfname').focus();

			return false;

        }

    else if(document.getElementById('varlname').value == "")

        {

            alert("Please enter the last name");

			document.getElementById('varlname').focus();

			return false;

        }

	 else if(! checkemail1(document.getElementById('varemail').value))

        {

            alert("Please enter a valid email address");

			document.getElementById('varemail').focus();

			return false;

        }

	 else if(document.getElementById('varphone').value=="")

        {

            alert("Please enter Phone No");

            document.getElementById('varphone').focus();

            return false;

        }

		else if(document.getElementById('vardate').value=='')

		{

			alert("Please enter Date");

            document.getElementById('vardate').focus();

            return false;

		}

		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		 var contact;

		 if(document.getElementById('contact1').checked==true)

		 {  contact = document.getElementById('contact1').value; }

		 else { contact = document.getElementById('contact').value; }

		 var time;

		 if(document.getElementById('time2').checked==true)

		 {  time = document.getElementById('time2').value; }

		 else if(document.getElementById('time3').checked==true)

		 {  time = document.getElementById('time3').value; }

		 else if(document.getElementById('time4').checked==true)

		 {  time = document.getElementById('time4').value; }

		 else { time = document.getElementById('time1').value; }

		var url="appointment.php?QT=1";

		var params = "&varfname="+document.getElementById('varfname').value;

		params=params+ "&varlname="+document.getElementById('varlname').value; 

		params=params+"&varemail="+document.getElementById('varemail').value;

		params=params+"&contact="+contact;

		params=params+"&varphone="+document.getElementById('varphone').value;

		params=params+"&vardate="+document.getElementById('vardate').value;

		params=params+"&time="+time;

		params=params+"&varmessage="+document.getElementById('varmessage').value;

		params=params+"&propertyid="+document.getElementById('propertyid').value;

        params=params+"&templnk123="+document.getElementById('hdlink').value;

		xmlHttp.open("GET",url+params ,true)

		xmlHttp.onreadystatechange=stateChangedappointmentPopup 

		xmlHttp.send(null)

}

function form_submit_quick_inquiry()

 {

	 if(! checkemail1(document.getElementById('varemail_fromkleftinq').value))

        {

            alert("Please enter a valid email address");

			document.getElementById('varemail').focus();

			return false;

        }

	 else if(document.getElementById('varquestion').value=="")

        {

            alert("Please enter your question");

            document.getElementById('varquestion').focus();

            return false;

        }

		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="inquiry.php?QT=1";

		var params = "&varemail="+document.getElementById('varemail_fromkleftinq').value;

		params=params+"&varquestion="+document.getElementById('varquestion').value;

		params=params+"&varcategory="+document.getElementById('varcategory').value;

        params=params+"&currentlink123="+document.getElementById('currentlink123').value;

		xmlHttp.open("GET",url+params ,true)

		xmlHttp.onreadystatechange=stateChangedinquryPopup 

		xmlHttp.send(null)

}

function stateChangedinquryPopup()

{

if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

	 var str = trim(xmlHttp.responseText, ' ');

	 var strlengthcount = str.length;

	 var array=str.split("$");

     document.getElementById('faqdiv').innerHTML=array[1];

	document.getElementById('dvprocessing').style.display='none';

	} 

}

function stateChangedappointmentPopup()

{

SetBackground();

if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

    alert(xmlHttp.responseText);

	 document.getElementById('dvprocessing').style.display = 'none';

	 var name=document.getElementById('varfname').value+" "+document.getElementById('varlname').value;//alert(name);

	 var str = trim(xmlHttp.responseText, ' ');

	 var strlengthcount = str.length;

	 if(strlengthcount > 3300)

	 {

	   var popuph = 316;

			var popupw = 360;

			var popuph2 = popuph/2;

			var popupw2 = popupw/2;

			var winW = screen.width;

			var winH = screen.height;

			if (parseInt(navigator.appVersion)>3) {

				if (navigator.appName=="Netscape") {

					

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

				if (navigator.appName.indexOf("Microsoft")!=-1) {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

			}

			var sh = winH;

			var sw = winW;

			var sh2 = sh/2;

			var sw2 = sw/2;

			var topf1 = sh2 - popuph;

			var leftf1 = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.top=CalculateTop('470')+ "px";

		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	 }

	 else

	 {

		 if(document.getElementById('hdfilename').value=="property_listing.php")

		 {

		 	document.frmpage1.submit();

		 }

		 else

		 {

			window.location.href=document.getElementById('hdfilename').value;

		 }

	 }

 } 

}

function stateChangechangeprofile()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 316;

var popupw = 360;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('470')+ "px";

document.getElementById('dvregisterfrm').style.left= leftf + "px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

unhideIframe();

}

}

function form_submit_quick_register()

 {

		 if(document.getElementById('varfname').value == "")

        {

            alert("Please enter the first name");

			document.getElementById('varfname').focus();

			return false;

        }

    else if(document.getElementById('varlname').value == "")

        {

            alert("Please enter the last name");

			document.getElementById('varlname').focus();

			return false;

        }

	 else if(! checkemail1(document.getElementById('varemail').value))

        {

            alert("Please enter a valid email address");

			document.getElementById('varemail').focus();

			return false;

        }

    else if(document.getElementById('varpassword').value.length < 6)

        {

            alert("Please enter the password (6 Characters minimum)");

            document.getElementById('varpassword').focus();

            return false;

        }

    else if(document.getElementById('varvpass').value=="")

        {

            alert("Please enter Verify Password ");

            document.getElementById('varvpass').focus();

            return false;

        }

    else if(document.getElementById('varpassword').value != document.getElementById('varvpass').value)

        {

            alert("Both Password Not Matched");

             document.getElementById('varvpass').focus();

            return false;

        }

	 else if(document.getElementById('varphone').value=="")

        {

            alert("Please enter Phone No");

            document.getElementById('varphone').focus();

            return false;

        }

		else if(document.getElementById('chkaggry').checked==false)

		{

			alert("Please Accept Terms & Conditions");

            document.getElementById('chkaggry').focus();

            return false;

		}

		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="registration.php?QT=1";

		var params = "&varfname="+document.getElementById('varfname').value;

		params=params+ "&varlname="+document.getElementById('varlname').value; 

		params=params+"&varemail="+document.getElementById('varemail').value;

		params=params+"&varpassword="+document.getElementById('varpassword').value;

		params=params+"&varphone="+document.getElementById('varphone').value;

        params=params+ "&chkproid="+document.getElementById('chkproid').value;

        params=params+ "&protype="+document.getElementById('protype').value;

		xmlHttp.open("GET",url+params ,true)

		xmlHttp.onreadystatechange=stateChangedRegisterPopup 

		xmlHttp.send(null)

}

function stateChangedRegisterPopup()

{

SetBackground();

if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

	 document.getElementById('dvprocessing').style.display = 'none';

	 

	 var name=document.getElementById('varfname').value+" "+document.getElementById('varlname').value;//alert(name);

	 var str = trim(xmlHttp.responseText, ' ');

	 var strlengthcount = str.length;

	 if(strlengthcount > 3300)

	 {

	   var popuph = 316;

			var popupw = 360;

			var popuph2 = popuph/2;

			var popupw2 = popupw/2;

			var winW = screen.width;

			var winH = screen.height;

			if (parseInt(navigator.appVersion)>3) {

				if (navigator.appName=="Netscape") {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

				if (navigator.appName.indexOf("Microsoft")!=-1) {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

				

			}

			var sh = winH;

			var sw = winW;

			var sh2 = sh/2;

			var sw2 = sw/2;

			var topf1 = sh2 - popuph;

			var leftf1 = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.top=CalculateTop('470')+ "px";

		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	 }

	 else

	 {

		 if(document.getElementById('hdfilename').value=="property_listing.php")

		 {

		 	document.frmpage1.submit();

		 }

		 else

		 {

			window.location.href=document.getElementById('hdfilename').value;

		 }

	 }

 } 

}

function form_submit_quick_changeprofile()

 {

		  if(document.getElementById('varfname').value == "")

        {

            alert("Please enter the first name");

			document.getElementById('varfname').focus();

			return false;

        }

    else if(document.getElementById('varlname').value == "")

        {

            alert("Please enter the last name");

			document.getElementById('varlname').focus();

			return false;

        }

	 else if(! checkemail1(document.getElementById('varemail').value))

        {

            alert("Please enter a valid email address");

			document.getElementById('varemail').focus();

			return false;

        }

		else if(document.getElementById('varoldpassword').value=="")

        {

            alert("Please enter Old Password ");

            document.getElementById('varoldpassword').focus();

            return false;

        }

   

   else if(document.getElementById('varpassword').value!="")

   {

	   if(document.getElementById('varpassword').value.length < 6)

        {

            alert("Please enter the password (6 Characters minimum)");

            document.getElementById('varpassword').focus();

            return false;

        }

    else if(document.getElementById('varvpass').value=="")

        {

            alert("Please enter Verify Password ");

            document.getElementById('varvpass').focus();

            return false;

        }

    else if(document.getElementById('varpassword').value != document.getElementById('varvpass').value)

        {

            alert("Both Password Not Matched");

             document.getElementById('varvpass').focus();

            return false;

        }

		 else if(document.getElementById('varphone').value=="")

        {

            alert("Please enter Phone No");

            document.getElementById('varphone').focus();

            return false;

        }

   }

		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="changeprofile.php?QT=1";

		var params = "&varfname="+document.getElementById('varfname').value;

		params=params+ "&varlname="+document.getElementById('varlname').value; 

		params=params+"&varemail="+document.getElementById('varemail').value;

		params=params+"&varpassword="+document.getElementById('varoldpassword').value;

		params=params+"&NPassword="+document.getElementById('varpassword').value;

		params=params+"&RPassword="+document.getElementById('varvpass').value;

		params=params+"&varphone="+document.getElementById('varphone').value;

		xmlHttp.open("GET",url +params ,true)

		xmlHttp.onreadystatechange=stateChangedchangeprofile 

		xmlHttp.send(null)

}

function stateChangedchangeprofile()

{

SetBackground();

if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

	 document.getElementById('dvprocessing').style.display = 'none';

	 var name=document.getElementById('varfname').value+" "+document.getElementById('varlname').value;

	 var str = trim(xmlHttp.responseText, ' ');

	 var strlengthcount = str.length;

	 if(strlengthcount > 3300)

	 {

	   var popuph = 316;

			var popupw = 360;

			var popuph2 = popuph/2;

			var popupw2 = popupw/2;

			var winW = screen.width;

			var winH = screen.height;

			if (parseInt(navigator.appVersion)>3) {

				if (navigator.appName=="Netscape") {

					

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

				if (navigator.appName.indexOf("Microsoft")!=-1) {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

			}

			var sh = winH;

			var sw = winW;

			var sh2 = sh/2;

			var sw2 = sw/2;

			var topf1 = sh2 - popuph;

			var leftf1 = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.top=CalculateTop('470')+ "px";

		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	 }

 } 

}

function form_submit_quick_login()

 {

		if(! checkemail1(document.getElementById('varemail').value))

        {

            alert("Please enter a valid email address");

			document.getElementById('varemail').focus();

			return false;

        }

    else if(document.getElementById('varpassword').value=="")

        {

            alert("Please enter the password ");

            document.getElementById('varpassword').focus();

            return false;

        }

		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="loginmodel.php?QT=1";

		var params = "&varemail="+document.getElementById('varemail').value;

		params=params+ "&varpassword="+document.getElementById('varpassword').value;

		params=params+ "&chkproid="+document.getElementById('chkproid').value;

        params=params+ "&protype="+document.getElementById('protype').value;

		//alert(url +params);

		xmlHttp.open("GET",url +params ,true)

		xmlHttp.onreadystatechange=stateChangedloginPopup 

		xmlHttp.send(null)

}

function stateChangedloginPopup()

{

SetBackground();

if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 
            
		 document.getElementById('dvprocessing').style.display = 'none';

		 var str = trim(xmlHttp.responseText, ' ');

		 var strlengthcount = str.length;

		 if(strlengthcount > 2600)

		 {

		   var popuph = 316;

			var popupw = 360;

			var popuph2 = popuph/2;

			var popupw2 = popupw/2;

			var winW = screen.width;

			var winH = screen.height;

			if (parseInt(navigator.appVersion)>3) {

				if (navigator.appName=="Netscape") {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

				if (navigator.appName.indexOf("Microsoft")!=-1) {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

			}

			var sh = winH;

			var sw = winW;

			var sh2 = sh/2;

			var sw2 = sw/2;

			var topf1 = sh2 - popuph;

			var leftf1 = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";

		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	 }

	 else

	 {

		 if(document.getElementById('hdfilename').value=="property_listing.php")

		 {

		 	document.frmpage1.submit();

		 }

		 else

		 {

			window.location.href=document.getElementById('hdfilename').value;

		 }

	 }

 } 

}

function form_submit_quick_forget()

 {

		if(! checkemail1(document.getElementById('varemail').value))

        {

            alert("Please enter a valid email address");

			document.getElementById('varemail').focus();

			return false;

        }

		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="forgotpass.php?QT=1";

		var params = "&varemail="+document.getElementById('varemail').value;

		xmlHttp.open("GET",url +params ,true)

		xmlHttp.onreadystatechange=stateChangedforgetPopup 

		xmlHttp.send(null)

}

function stateChangedforgetPopup()

{

SetBackground();

if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

		 document.getElementById('dvprocessing').style.display = 'none';

		   var popuph = 316;

			var popupw = 360;

			var popuph2 = popuph/2;

			var popupw2 = popupw/2;

			var winW = screen.width;

			var winH = screen.height;

			if (parseInt(navigator.appVersion)>3) {

				if (navigator.appName=="Netscape") {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

				if (navigator.appName.indexOf("Microsoft")!=-1) {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

			}

			var sh = winH;

			var sw = winW;

			var sh2 = sh/2;

			var sw2 = sw/2;

			var topf1 = sh2 - popuph;

			var leftf1 = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";

		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	 

 } 

}

function stateChangeregisterpopup()

{

SetBackground();

if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

	 document.getElementById('dvprocessing').style.display = 'none';

	 var str = trim(xmlHttp.responseText, ' ');

	 var strlengthcount = str.length;

	 alert(strlengthcount);

	 if(strlengthcount > 3300)

	 {

	   		var popuph = 200;

			var popupw = 360;

			var popuph2 = popuph/2;

			var popupw2 = popupw/2;

			var winW = screen.width;

			var winH = screen.height;

			if (parseInt(navigator.appVersion)>3) {

				if (navigator.appName=="Netscape") {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

				if (navigator.appName.indexOf("Microsoft")!=-1) {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

			}

			var sh = winH;

			var sw = winW;

			var sh2 = sh/2;

			var sw2 = sw/2;

			var topf1 = sh2 - popuph;

			var leftf1 = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

		document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	 }

	 else

	 {

		 alert("Your Records Are Successfully Saved");

		 reloadlist();

	 }

 } 

}

function reloadlist()

{

	location.reload( true );

}

function reloadlistwidthalert(msg)

{

	alert(msg);

	location.reload( true );

}

function funsavesearch()

{

	var params = "?seltype="+document.frmdetail.seltype.value;

	params=params+"&fk_districtglcode="+document.frmdetail.fk_districtglcode.value;

	params=params+"&intbeds="+document.frmdetail.intbeds.value;

	params=params+"&intbaths="+document.frmdetail.intbaths.value;

	params=params+"&varmls="+document.frmdetail.varmls.value;

	params=params+"&txtminprice="+document.frmdetail.txtminprice.value;

	params=params+"&txtmaxprice="+document.frmdetail.txtmaxprice.value;	

	params=params+"&txttitle="+document.frmdetail.txttitle.value;	

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="savesearchtitlepopup.php";

	xmlHttp.onreadystatechange= stateChangesaveseach

	xmlHttp.open("GET",url+params,true);

	xmlHttp.send(null);

}

function stateChangesaveseach()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 200;

var popupw = 240;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('200')+ "px";

document.getElementById('dvregisterfrm').style.left= leftf + "px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

unhideIframe();

}

}

function form_submit_funsavesearch()

{

	if(document.getElementById('varsearchname').value=="")

	{

			alert("Please Enter Search Name");

			document.getElementById('varsearchname').focus();

			return false;

	}

	var params = "&seltype="+document.getElementById('seltype').value;

	params=params+"&fk_districtglcode="+document.getElementById('fk_districtglcode').value;

	params=params+"&intbeds="+document.getElementById('intbeds').value;

	params=params+"&intbaths="+document.getElementById('intbaths').value;

	params=params+"&varmls="+document.getElementById('varmls').value;

	params=params+"&txtminprice="+document.getElementById('txtminprice').value;

	params=params+"&txtmaxprice="+document.getElementById('txtmaxprice').value;	

	params=params+"&varsearchname="+document.getElementById('varsearchname').value;

	params=params+"&varsearchdesc="+document.getElementById('varsearchdesc').value;

	params=params+"&txttitle="+document.getElementById('txttitle').value;

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="savesearchtitlepopup.php?QT=1";

	xmlHttp.onreadystatechange= stateChangesaveseachsubmit

	xmlHttp.open("GET",url+params,true);

	xmlHttp.send(null);

}

function stateChangesaveseachsubmit()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

 var str = trim(xmlHttp.responseText, ' ');

	 var strlengthcount = str.length;

	 if(strlengthcount > 800)

	 {

		var popuph = 200;

		var popupw = 360;

		var popuph2 = popuph/2;

		var popupw2 = popupw/2;

		var winW = screen.width;

		var winH = screen.height;

		if (parseInt(navigator.appVersion)>3) {

			if (navigator.appName=="Netscape") {

				

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

			if (navigator.appName.indexOf("Microsoft")!=-1) {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

		}

		var sh = winH;

		var sw = winW;

		var sh2 = sh/2;

		var sw2 = sw/2;

		var topf = sh2 - popuph;

		var leftf = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";

		document.getElementById('dvregisterfrm').style.left= leftf + "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	}

	 else

	 {

		 document.getElementById('dvregisterfrm').style.display = "none";

		// document.location.href= 'searchlist.php';
         document.location.href= 'search-list';

	 }

}

}

function showemailtofriendform(str,id)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="emailtofriendpopup.php?detail="+str+"&pid="+id;

	//alert(url);

	xmlHttp.onreadystatechange= stateChangeemailtofriend;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function showemailtofriendform_new(id)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="emailtofriendpopup.php?&pid="+id;

	xmlHttp.onreadystatechange= stateChangeemailtofriend;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function stateChangeemailtofriend()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 200;

var popupw = 360;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";

document.getElementById('dvregisterfrm').style.left= leftf + "px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

unhideIframe();

}

}

function form_submit_quick_emailtofriend(detail1)

 {

	 if(! checkemail1(document.getElementById('varuemail').value))

        {

            alert("Please enter your valid email address");

			document.getElementById('varuemail').focus();

			return false;

        }

    else if(! checkemail1(document.getElementById('varremail').value))

        {

            alert("Please enter valid Recipient's  email address");

			document.getElementById('varremail').focus();

			return false;

        }

    else if(document.getElementById('varemessage').value=="")

        {

            alert("Please enter Message ");

            document.getElementById('varemessage').focus();

            return false;

        }

    else if(document.getElementById('varecap').value=="")

               {

                   alert("Please enter the code shown above ");

                   document.getElementById('varecap').focus();

                   return false;

               }

			   else if(document.getElementById('varecap').value!=document.getElementById('hd_pin_value_hdn').value)

			   {

			   		alert("Please Enter The Given Code Correctly");

			        document.getElementById('varecap').focus();

                    return false;

			   }

		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="emailtofriendpopup.php?QT=1";

		var params = "&varuemail="+document.getElementById('varuemail').value;

		params=params+ "&varremail="+document.getElementById('varremail').value; 

		params=params+ "&pid="+document.getElementById('hdpid').value; 

		params=params+"&varemessage="+document.getElementById('varemessage').value +'<br>';

		xmlHttp.open("GET",url +params ,true)

		xmlHttp.onreadystatechange=stateChangedemailtofriendPopup 

		xmlHttp.send(null)

}

function stateChangedemailtofriendPopup()

{

SetBackground();

if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

        xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="thankingyou.php";

        xmlHttp.open("GET",url,true)

		xmlHttp.onreadystatechange=stateChangedthankyou

		xmlHttp.send(null)

	

 } 

}

function stateChangedthankyou()
{
    
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 {
    document.getElementById('dvprocessing').style.display = 'none';

	 var str = trim(xmlHttp.responseText, ' ');

	 var strlengthcount = str.length;

	 //if(strlengthcount > 3300)

	 //{

	   var popuph = 316;

			var popupw = 360;

			var popuph2 = popuph/2;

			var popupw2 = popupw/2;

			var winW = screen.width;

			var winH = screen.height;

			if (parseInt(navigator.appVersion)>3) {

				if (navigator.appName=="Netscape") {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

				if (navigator.appName.indexOf("Microsoft")!=-1) {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

			}

			var sh = winH;

			var sw = winW;

			var sh2 = sh/2;

			var sw2 = sw/2;

			var topf1 = sh2 - popuph;

			var leftf1 = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.top=CalculateTop('470')+ "px";

		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	 //}
 }
}

function showsearchedit(id)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="savedsearcheditpopup.php?pid="+id;

	xmlHttp.onreadystatechange= stateChangeshowsearchedit;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function stateChangeshowsearchedit()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 200;

var popupw = 360;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";

document.getElementById('dvregisterfrm').style.left= leftf + "px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

unhideIframe();

}

}

function form_submit_quick_searcedit()

 {

	 if(document.getElementById('varsearchname').value=="")

	{

			alert("Please Enter Search Name");

			document.getElementById('varsearchname').focus();

			return true;

	}

	var params = "&seltype="+document.getElementById('Saveseltype').value;

	params=params+"&fk_districtglcode="+document.getElementById('fk_Savedistrictglcode').value;

	params=params+"&intbeds="+document.getElementById('intbeds').value;

	params=params+"&intbaths="+document.getElementById('intbaths').value;

	params=params+"&varmls="+document.getElementById('varmls').value;

	params=params+"&txtminprice="+document.getElementById('decfromprice').value;

	params=params+"&txtmaxprice="+document.getElementById('dectoprice').value;

	params=params+"&varsearchname="+document.getElementById('varsearchname').value;

	params=params+"&varsearchdesc="+document.getElementById('varsearchdesc').value;

	params=params+"&txttitle="+document.getElementById('txttitle').value;

	if(document.getElementById('chrflagsearchsave').checked==true)

	{

		params=params+"&chrflagsearchsave=Y";

	}

	else

	{

		params=params+"&chrflagsearchsave=N";

	}

	params=params+"&varfrequency="+document.getElementById('varfrequency').value;

	params=params+"&pid="+document.getElementById('sehdpid').value;

		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="savedsearcheditpopup.php?QT=1";

		xmlHttp.open("GET",url +params ,true)

		xmlHttp.onreadystatechange=stateChangedsearchedit 

		xmlHttp.send(null)

}

function stateChangedsearchedit()

{

SetBackground();

if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 { 

	 document.getElementById('dvprocessing').style.display = 'none';

	 var str = trim(xmlHttp.responseText, ' ');

	 var strlengthcount = str.length;

	 if(strlengthcount > 3000)

	 {

	   var popuph = 316;

			var popupw = 360;

			var popuph2 = popuph/2;

			var popupw2 = popupw/2;

			var winW = screen.width;

			var winH = screen.height;

			if (parseInt(navigator.appVersion)>3) {

				if (navigator.appName=="Netscape") {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

				if (navigator.appName.indexOf("Microsoft")!=-1) {

					winW = document.body.offsetWidth;

					winH = document.body.offsetHeight;

				}

			}

			var sh = winH;

			var sw = winW;

			var sh2 = sh/2;

			var sw2 = sw/2;

			var topf1 = sh2 - popuph;

			var leftf1 = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.top=CalculateTop('470')+ "px";

		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	 }

	 else

	 {

		 document.getElementById('dvregisterfrm').style.display = "none";

		 document.location.href= 'searchlist.php?msg=2';
//       document.location.href= 'search-list-success';
	 }

 } 

}

function addtosortlist(id)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="sortlist.php?propertyid="+id;
   //alert(url);
	xmlHttp.onreadystatechange= stateChangeaddtosortlist;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function removefromsortlist(id)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="sortlist.php?sortlistcode="+id;
 // alert(url);
	xmlHttp.onreadystatechange= stateChangeaddtosortlist;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function stateChangeaddtosortlist()

{
 SetBackground();
if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

	{

	 	var str=xmlHttp.responseText;
       // alert(str);
		 var array=str.split("$");

		if(array[0]==1)

		{

		alert("Property has been saved to your account. You can also access and edit them by entering the Member's Area.");

		}

		else if(array[0]==2)

		{

			alert("Successfully removed from shortlist.");

		}

		else if(array[0]==3)

		{

			alert("You can not add more then 3 property for short list.");

		}

		document.getElementById('dvprocessing').style.display='none';

		if(array[0]!=3)

		{

			document.getElementById("addsort_"+array[1]).innerHTML=array[2];

			document.getElementById("shortcount").innerHTML="("+array[3]+")";

		}
        unhideIframe();
        document.getElementById('dimmer').style.display='none' ;
	}

}

function funnotify(id,type)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="notifyme.php?pid="+id+"&type="+type;
    //alert(url);
	xmlHttp.onreadystatechange= stateChangeadnotify;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function stateChangeadnotify()

{
SetBackground();
if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

	{
      
	 	var str=xmlHttp.responseText;
//           alert(str);
			var array=str.split("$");

		 if(array[0]==1)

		 {

			 alert("Notification Alert has been saved to your Account. Access and edit your setting anytime by entering Members Area.");

			 document.getElementById("tdnotify"+array[1]).innerHTML=array[2];

		 }

		 else if(array[0]==2)

		 {  

		 	alert("Successfully removed from notify alert.");

			document.getElementById("tdnotify"+array[1]).innerHTML=array[2];

		 }

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById("notifycount").innerHTML="("+array[3]+")";
        unhideIframe();
        document.getElementById('dimmer').style.display='none' ;
	}

}

function showmortcalc()

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="calc.php";

	xmlHttp.onreadystatechange= stateChangeregister;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function showcurrencyconverter(CU,Price)

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="currencyconvertor.php?ddlconvert="+CU+"&decp="+Price;

	xmlHttp.onreadystatechange= stateChangeregister;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function form_submit_quick_currencyconverter()

 {

		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="currencyconvertor.php?data=calculate";

		var params = "&ddlconvert="+document.getElementById('ddlconvert').value;

        params = params + "&decamount="+document.getElementById('decamount').value;

		xmlHttp.open("GET",url+params,true)

		xmlHttp.onreadystatechange=stateChangeregister 

		xmlHttp.send(null)

}

function stateChangedcurrencyconverter()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 316;

var popupw = 360;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('470')+ "px";

document.getElementById('dvregisterfrm').style.left= leftf + "px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

unhideIframe();

}

}

function enquireform()

{

		var testresults;

        var str=document.getElementById('enqemail').value;

        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

        if (filter.test(str))

        testresults=true

        else{

        testresults=false

        }

		  if(document.getElementById('enqname').value=='' || document.getElementById('enqname').value=='Name')

		  {

			  alert('Please Enter Your Name');

			  document.getElementById('enqname').focus();

			  return false;

		  }

		   else if(testresults==false)

		  {

			  alert('Please Enter Valid Email Address');

			  document.getElementById('enqemail').focus();

			  return false;

		  }

		  if(document.getElementById('enqphone').value=='' || document.getElementById('enqphone').value=='Phone')

		  {

			  alert('Please Enter Phone No');

			  document.getElementById('enqphone').focus();

			  return false;

		  }

		  else if(document.getElementById('enqmessage').value=='' || document.getElementById('enqmessage').value=='Message')

		  {

			  alert('Please Enter Message');

			  document.getElementById('enqmessage').focus();

			  return false;

		  }

		  else if(document.getElementById('enqcap').value=="")

               {

                   alert("Please enter the code shown above ");

                   document.getElementById('enqcap').focus();

                   return false;

               }

			   else if(document.getElementById('enqcap').value!=document.getElementById('pin_value_hdn').value)

			   {

			   		alert("Please Enter The Given Code Correctly");

			        document.getElementById('enqcap').focus();

                    return false;

			   }

		  var url="enquireemail.php";

		var params = "?enqname="+document.getElementById('enqname').value;

		params=params+ "&enqemail="+document.getElementById('enqemail').value; 

		params=params+"&enqphone="+document.getElementById('enqphone').value;

		params=params+"&enqmessage="+document.getElementById('enqmessage').value;

		params=params+"&pid="+document.getElementById('pid').value;

        params=params+"&hdcurrurl123="+document.getElementById('hdcurrurl123').value;

		xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	xmlHttp.onreadystatechange= stateChangeenquire;

	xmlHttp.open("GET",url+params,true);

	xmlHttp.send(null);

}

function stateChangeenquire()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

	if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

	{

		var str = trim(xmlHttp.responseText, ' ');

		alert("Email is successfully sent");

		window.location.href=document.getElementById('hdfilename').value;

	}

}

function fununsubscribe(uid,sid)

{

	var params = "?uid="+uid;	

	params=params+"&sid="+sid;

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="unsubribeuser.php";

	xmlHttp.onreadystatechange= stateChangeunsubscribe

	xmlHttp.open("GET",url+params,true);

	xmlHttp.send(null);

}

function stateChangeunsubscribe()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 200;

var popupw = 360;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";

document.getElementById('dvregisterfrm').style.left="25px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

unhideIframe();

}

}

function form_submit_fununsubscribe()

{

	var params = "&uid="+document.getElementById('uid').value;

	params=params+"&sid="+document.getElementById('sid').value;

	params=params+"&desc="+document.getElementById('varsearchdesc').value;

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="unsubribeuser.php?QT=1";

	xmlHttp.onreadystatechange= stateChangeunsubscribesubmit

	xmlHttp.open("GET",url+params,true);

	xmlHttp.send(null);

}

function stateChangeunsubscribesubmit()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

 var str = trim(xmlHttp.responseText, ' ');

	 var strlengthcount = str.length;

	 if(strlengthcount > 800)

	 {

		var popuph = 200;

		var popupw = 360;

		var popuph2 = popuph/2;

		var popupw2 = popupw/2;

		var winW = screen.width;

		var winH = screen.height;

		if (parseInt(navigator.appVersion)>3) {

			if (navigator.appName=="Netscape") {

				

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

			if (navigator.appName.indexOf("Microsoft")!=-1) {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

		}

		var sh = winH;

		var sw = winW;

		var sh2 = sh/2;

		var sw2 = sw/2;

		var topf = sh2 - popuph;

		var leftf = sw2 - popupw2;

		document.getElementById('dvprocessing').style.display='none';

		document.getElementById('dvregisterfrm').style.display='';

		document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";

		document.getElementById('dvregisterfrm').style.left= leftf + "px";

		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

		unhideIframe();

	}

	 else

	 {

		 document.getElementById('dvregisterfrm').style.display = "none";

		// document.location.href= 'searchlist.php';
         document.location.href= 'search-list';

	 }

}

}

function showsearchform()

{

	xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="searchpopup.php";

	//alert(url);

	xmlHttp.onreadystatechange= stateChangesearch;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function stateChangesearch()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

{

var popuph = 200;

var popupw = 360;

var popuph2 = popuph/2;

var popupw2 = popupw/2;

var winW = screen.width;

var winH = screen.height;

if (parseInt(navigator.appVersion)>3) {

	if (navigator.appName=="Netscape") {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

	if (navigator.appName.indexOf("Microsoft")!=-1) {

		winW = document.body.offsetWidth;

		winH = document.body.offsetHeight;

	}

}

var sh = winH;

var sw = winW;

var sh2 = sh/2;

var sw2 = sw/2;

var topf = sh2 - popuph;

var leftf = sw2 - popupw2;

document.getElementById('dvprocessing').style.display='none';

document.getElementById('dvregisterfrm').style.display='';

document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";

document.getElementById('dvregisterfrm').style.left= leftf + "px";

document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

unhideIframe();

}

}

function funsearchpopsubmit()

{

SetBackground();

//if(xmlHttp.readyState==1)
//
//{
//
//ProcessLoader();
//
//}
//
//	if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
//
//	{

		ProcessLoader();

		param="?hdnsrhome=srchhome";

		param=param+"&txttitle="+document.frmsearchpopup.txttitle.value;

		param=param+"&seltype="+document.frmsearchpopup.seltype.value;

		param=param+"&fk_districtglcode="+document.frmsearchpopup.fk_districtglcode.value;

		param=param+"&txtminprice="+document.frmsearchpopup.txtminprice.value;

		param=param+"&txtmaxprice="+document.frmsearchpopup.txtmaxprice.value;

		param=param+"&intbeds="+document.frmsearchpopup.intbeds.value;

		param=param+"&intbaths="+document.frmsearchpopup.intbaths.value;

var varmmls12="";
	if(document.frmsearchpopup.seltype.value in {'159':'', '160':'','122':''})
	{

		param=param+"&varmls="+document.frmsearchpopup.varmls2.value;
        //varmmls12 = document.frmsearchpopup.varmls2.value;
        varmmls12 = (document.frmsearchpopup.varmls2.value == "") ? "mls":document.frmsearchpopup.varmls2.value;
    }
    else
        {
            param=param+"&varmls="+document.frmsearchpopup.varmls.value;
            varmmls12 = (document.frmsearchpopup.varmls.value == "") ? "mls":document.frmsearchpopup.varmls.value;
        }
       var finaltitle = (document.frmsearchpopup.txttitle.value == "")? "title":document.frmsearchpopup.txttitle.value;
       var finaltype = (document.frmsearchpopup.seltype.value == "PleaseSelect")? "rctype":document.frmsearchpopup.seltype.value;
       var finaldist = (document.frmsearchpopup.fk_districtglcode.value == "PleaseSelect")? "dist":document.frmsearchpopup.fk_districtglcode.value;
       var finalminp = (document.frmsearchpopup.txtminprice.value == "")? "pzmin":document.frmsearchpopup.txtminprice.value;
       var finalmaxp = (document.frmsearchpopup.txtmaxprice.value == "")? "pzmax":document.frmsearchpopup.txtmaxprice.value;
       var finalbed = (document.frmsearchpopup.intbeds.value == "")? "beds":document.frmsearchpopup.intbeds.value;
       var finalbath = (document.frmsearchpopup.intbaths.value == "")? "baths":document.frmsearchpopup.intbaths.value;



        //window.location.href="property_listing.php"+param;
        window.location.href="irg-property-search-srchhome-"+finaltitle+"-"+finaltype+"-"+finaldist+"-"+finalminp+"-"+finalmaxp+"-"+finalbed+"-"+finalbath+"-"+varmmls12;

//	}

}

function showmapviewdivwithajax(pid)

{

   xmlHttp=GetXmlHttpObject();

	if(xmlHttp==null)

	{

		alert("Browser does not support HTTP Request");

		return;

	}

	var url="gmapforonelocation.php?pid="+pid;

	//alert(url);

	xmlHttp.onreadystatechange= stateChangeshowmapviewdiv;

	xmlHttp.open("GET",url,true);

	xmlHttp.send(null);

}

function stateChangeshowmapviewdiv()

{

SetBackground();

if(xmlHttp.readyState==1)

{

ProcessLoader();

}

	if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

	{

		var popuph = 316;

		var popupw = 360;

		var popuph2 = popuph/2;

		var popupw2 = popupw/2;

		var winW = screen.width;

		var winH = screen.height;

		if (parseInt(navigator.appVersion)>3) {

			if (navigator.appName=="Netscape") {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

			if (navigator.appName.indexOf("Microsoft")!=-1) {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

		}

		var sh = winH;

		var sw = winW;

		var sh2 = sh/2;

		var sw2 = sw/2;

		var topf1 = sh2 - popuph;

		var leftf1 = sw2 - popupw2;

    document.getElementById('dvprocessing').style.display='none';

    document.getElementById('dvregisterfrm').style.display='';

	document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";

    document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

    unhideIframe();

        document.getElementById('mapandimgarea').innerHTML=xmlHttp.responseText ;

       document.getElementById('dimmer').style.display='none' ;

	}

}

function funpopupvideo()

{

    xmlHttp=GetXmlHttpObject()

    if(xmlHttp==null)

    {

    alert("Browser does not support HTTP Request")

    return

    }

    var url="caymanvideo/index.html";

    xmlHttp.onreadystatechange= stateChangevideopopup

    xmlHttp.open("GET",url,true)

    xmlHttp.send(null)

}

function stateChangevideopopup()

{

    SetBackground();

    if(xmlHttp.readyState==1)

    {

		ProcessLoader();

    }

    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

    {

		var popuph = 300;

		var popupw = 600;

		var popuph2 = popuph/2;

		var popupw2 = popupw/2;

		var winW = screen.width;

		var winH = screen.height;

		if (parseInt(navigator.appVersion)>3) {

			if (navigator.appName=="Netscape") {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

			if (navigator.appName.indexOf("Microsoft")!=-1) {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

			

		}

		var sh = winH;

		var sw = winW;

		var sh2 = sh/2;

		var sw2 = sw/2;

		

		var topf1 = sh2 - popuph;

		var leftf1 = sw2 - popupw2;



    document.getElementById('dvprocessing').style.display='none';

    document.getElementById('dvregisterfrm').style.display='';

	document.getElementById('dvregisterfrm').style.top=CalculateTop('500')+ "px";

    document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;

	var so = new SWFObject("caymanvideo/cayman real estate.swf", "propertytour", "600", "300", "8.0.23", "#FFFFFF", true);so.addParam("allowScriptAccess", "always");so.addParam("quality", "high");so.write("flashcontent");

    unhideIframe();

    }

}

 function parseScript(_source) {

	 	alert(_source);

		var source = _source;

		var scripts = new Array();

                //alert(source);

		// Strip out tags

		while(source.indexOf("<script") > -1 || source.indexOf("</script") > -1) {

			var s = source.indexOf("<script");

			var s_e = source.indexOf(">", s);

			var e = source.indexOf("</script", s);

			var e_e = source.indexOf(">", e);



			// Add to scripts array

			scripts.push(source.substring(s_e+1, e));

			// Strip from source

			source = source.substring(0, s) + source.substring(e_e+1);

		}

		//alert(scripts.length);

		// Loop through every script collected and eval it

		//alert();

		for(var i=0; i<scripts.length; i++) {

			try {

				eval(scripts[i]);

			}

			catch(ex) {

				// do what you want here when a script fails

			}

		}



		// Return the cleaned source

                //alert(source);

		return source;

	}


// detail page video popup
var global_video_name = "";
function funpopupvideo_detailpage(videoname)

{

    xmlHttp=GetXmlHttpObject()

    if(xmlHttp==null)

    {

    alert("Browser does not support HTTP Request")

    return

    }
    //var url="caymanvideo/index.html";
    var url="caymanvideo/index.html";
    //alert(url);
    global_video_name = videoname;
    xmlHttp.onreadystatechange= stateChangevideopopup123456

    xmlHttp.open("GET",url,true)

    xmlHttp.send(null)

}

function stateChangevideopopup123456()

{

    SetBackground();

    if(xmlHttp.readyState==1)

    {

		ProcessLoader();

    }

    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

    {

		var popuph = 350;

		var popupw = 400;

		var popuph2 = popuph/2;

		var popupw2 = popupw/2;

		var winW = screen.width;

		var winH = screen.height;

		if (parseInt(navigator.appVersion)>3) {

			if (navigator.appName=="Netscape") {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

			if (navigator.appName.indexOf("Microsoft")!=-1) {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}



		}

		var sh = winH;

		var sw = winW;

		var sh2 = sh/2;

		var sw2 = sw/2;



		var topf1 = sh2 - popuph;

		var leftf1 = sw2 - popupw2;



    document.getElementById('dvprocessing').style.display='none';

    document.getElementById('dvregisterfrm').style.display='';

	document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";

    document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
//    alert(xmlHttp.responseText);
//alert(global_video_name);
var so = new SWFObject("upimages/"+global_video_name, "propertytour", "400", "300", "8.0.23", "#FFFFFF", true);so.addParam("allowScriptAccess", "always");so.addParam("quality", "high");so.write("flashcontent");

    unhideIframe();

    }

}


/*function funpopupvideo_villacaymanas()

{

    xmlHttp=GetXmlHttpObject()

    if(xmlHttp==null)

    {

    alert("Browser does not support HTTP Request")

    return

    }
    //var url="caymanvideo/index.html";
    var url="caymanvideo/villacaymanas.html";
    //alert(url);
    //global_video_name = videoname;
    xmlHttp.onreadystatechange= stateChangevillacaymanas

    xmlHttp.open("GET",url,true)

    xmlHttp.send(null)

}

function stateChangevillacaymanas()

{

    SetBackground();

    if(xmlHttp.readyState==1)

    {

		ProcessLoader();

    }

    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

    {

		var popuph = 350;

		var popupw = 400;

		var popuph2 = popuph/2;

		var popupw2 = popupw/2;

		var winW = screen.width;

		var winH = screen.height;

		if (parseInt(navigator.appVersion)>3) {

			if (navigator.appName=="Netscape") {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

			if (navigator.appName.indexOf("Microsoft")!=-1) {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}



		}

		var sh = winH;

		var sw = winW;

		var sh2 = sh/2;

		var sw2 = sw/2;



		var topf1 = sh2 - popuph;

		var leftf1 = sw2 - popupw2;



    document.getElementById('dvprocessing').style.display='none';

    document.getElementById('dvregisterfrm').style.display='';

	document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";

    document.getElementById('dvregisterfrm').style.left=leftf1 + "px";

    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	
	document.getElementById("dvregisterfrm").style.width="400px";
	document.getElementById("dvregisterfrm").style.height="400px";
	//document.getElementById("divvideo").src="http://search.knightfrank.com/search/support/tourhost.aspx?id=rsi081005";
	
	
//    alert(xmlHttp.responseText);
//alert(global_video_name);
//var so = new SWFObject("upimages/"+global_video_name, "propertytour", "400", "300", "8.0.23", "#FFFFFF", true);so.addParam("allowScriptAccess", "always");so.addParam("quality", "high");so.write("flashcontent");

    unhideIframe();

    }

}*/

//For search popup chage type dropdown
function changeType(strid,strval)
{



    if(strval in {'159':'', '160':'','122':''})
	{
		document.getElementById('trforlndlse').style.display='';
		document.getElementById('trforall').style.display='none';

	}
	else
	{

       document.getElementById('trforlndlse').style.display='none';
       document.getElementById('trforall').style.display='';

	}
}

var global_videoURL_name;
function funpopupvideoURL(videoname1)
{
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="caymanvideo/index.html";
    var url="caymanvideo/OpenUrl.php?videoname="+videoname1;
    //alert(url);
    global_videoURL_name = videoname1;
    xmlHttp.onreadystatechange= stateChangevideourl

    xmlHttp.open("GET",url,true)

    xmlHttp.send(null)

}

function stateChangevideourl()

{

    SetBackground();

    if(xmlHttp.readyState==1)

    {

		ProcessLoader();

    }

    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))

    {

		var popuph = 290;

		var popupw = 415;

		var popuph2 = popuph/2;

		var popupw2 = popupw/2;

		var winW = screen.width;

		var winH = screen.height;

		if (parseInt(navigator.appVersion)>3) {

			if (navigator.appName=="Netscape") {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}

			if (navigator.appName.indexOf("Microsoft")!=-1) {

				winW = document.body.offsetWidth;

				winH = document.body.offsetHeight;

			}
		}
		var sh = winH;
		var sw = winW;
		var sh2 = sh/2;
		var sw2 = sw/2;
		var topf1 = sh2 - popuph;
		var leftf1 = sw2 - popupw2;
    document.getElementById('dvprocessing').style.display='none';
    document.getElementById('dvregisterfrm').style.display='';
	document.getElementById('dvregisterfrm').style.top=CalculateTop('450')+ "px";
    document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
//    alert(xmlHttp.responseText);
//alert(global_video_name);
//var so = new SWFObject("upimages/"+global_video_name, "propertytour", "400", "300", "8.0.23", "#FFFFFF", true);so.addParam("allowScriptAccess", "always");so.addParam("quality", "high");so.write("flashcontent");

    unhideIframe();

    }

}



function form_submit_quick_quote_home_page()

 {
//    alert('here');
	 if(document.getElementById('txtquickquotename').value=="" || document.getElementById('txtquickquotename').value=="Name")

        {

            alert("Please enter your name.");

            document.getElementById('txtquickquotename').focus();

            return false;

        }
     else if(!checkemail1(document.getElementById('txtquickquotemail').value))

        {

            alert("Please enter a valid email address.");

			document.getElementById('txtquickquotemail').focus();

			return false;

        }

	 else if(document.getElementById('txtquickquotemessage').value=="" || document.getElementById('txtquickquotemessage').value=="Message")

        {

            alert("Please enter your message.");

            document.getElementById('txtquickquotemessage').focus();

            return false;

        }
        
        else if(document.getElementById('txtquickquotecode').value!=document.getElementById('hdquickquotepinvalue').value)

			   {

			   		alert("Please enter the given code correctly.");

			        document.getElementById('txtquickquotecode').focus();

                    return false;

			   }
		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		 {

		 alert ("Browser does not support HTTP Request")

		 return

		 }

		var url="index.php?QT=1";

		var params = "&txtquickquotename="+document.getElementById('txtquickquotename').value;

		params=params+"&txtquickquotemail="+document.getElementById('txtquickquotemail').value;

		params=params+"&txtquickquotemessage="+document.getElementById('txtquickquotemessage').value;

		xmlHttp.open("GET",url+params ,true)

		xmlHttp.onreadystatechange=stateChangedQuickQuoteHome

		xmlHttp.send(null)

}
function stateChangedQuickQuoteHome()

{
SetBackground();
if (xmlHttp.readyState == 1)

{

	ProcessLoader();

}

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

 {
     document.getElementById('dvquickcontacthome').style.display='';
	document.getElementById('dvprocessing').style.display='none';
    document.getElementById('dvregisterfrm').style.display='none';
    unhideIframe();
       document.getElementById('dimmer').style.display='none' ;
	}

}


var popupWindow = null;
function positionedPopup(url,winName,w,h,t,l,scroll){
settings =
'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars='+scroll+',resizable'
popupWindow = window.open(url,winName,settings)
}



//cmpleted