// 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 Keycheckforphone(evt)
{
  var charCode = (evt.which) ? evt.which : event.keyCode
	//alert(charCode);

	if(charCode == 40 || charCode == 41 || charCode == 45 || charCode == 32)
	{
		return true;
	}
	else if (charCode > 31 && (charCode < 48 || charCode > 57))
	{
		return false;
	}
	else
	{
		return true;
	}
}


function chkprice(e)
{
//alert("testing");
   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 gotdetailpage(id)
    {
        document.frmdetail.action="shortlistproperty.php?pid="+id;
        document.frmdetail.submit();
    }
	function chkdelshortlist(id)
	{
		if(confirm('This will delete the selected item.Are you sure you want to continue?'))
					{
						window.location.href="shortlistproperty.php?delete=delete&soid="+id+"&msg=1";
					}
	}


	
	

function chkdelnotify(id)
{
	if(confirm('This will delete the selected item.Are you sure you want to continue?'))
				{
					window.location.href="notifylist.php?QT=1&id="+id;
				}
}
	
	
	

function chkdelsearch11(id)
{   
  // alert(id);
	if(confirm('This will delete the selected item.Are you sure you want to continue?'))
				{
					//alert("searchlist.php?QT=1&amp; id=" +id);
					window.location.href="searchlist.php?QT=1&id="+id;
				}
}


function showpininfo()
{
    xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="popupwindow.php"
    xmlHttp.onreadystatechange=stateChangedshowpininfo
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
	
}

function checkemail1(str)
    {

        var testresults;
        //var str=document.getElementById('varuid').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
        }
        return (testresults)
    }



function ProcessLoader()
{
    document.getElementById('dvprocessing').innerHTML = "<img src='images/ajax-loader.gif'>";
    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 ProcessLoader1()
{
    document.getElementById('dvprocessing').innerHTML = "<img src='images/ajax-loader.gif'>";
    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();
//alert(xmlHttp.readyState);

if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
//	alert(xmlHttp.responseText);
/* var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	alert(strlengthcount);
	if(strlengthcount>0)
	{*/
	   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)
{
//alert(evt);
//alert(evt.keyCode);
var key=(window.Event)?evt.which:evt.keyCode;
//alert(key);
if(key==27)
{
//alert(key);
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;}
//alert(document.body.clientHeight);
//alert(window.innerHeight);
//alert(document.documentElement.clientHeight);
var BodyHeight=document.body.clientHeight;if(BodyHeight==0)
{BodyHeight=window.innerHeight;}
if(BodyHeight==0)
{BodyHeight=document.documentElement.clientHeight}
//alert(BodyHeight);
//alert(ScrollTop);
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()
{
	//alert(GetBodyWidth());
//document.getElementById('dimmer').style.width=GetBodyWidth();
//document.getElementById('dimmer').style.height=GetBodyHeight();
//document.getElementById('dimmer').style.visibility="visible";
	//document.getElementById("dimmer").style = "filter:alpha(opacity=70);opacity:0.7;";
	//document.getElementById("dimmer").style = "filter:alpha(opacity=70);opacity:0.7;";
	//document.getElementById("dimmer").style = "filter:alpha(opacity=70);opacity:0.7;";
	if(ie)
        {
        //document.getElementById('dimmer').style.width="100%";
        //alert(document.getElementById('dimmer').style.width);
        //alert(document.documentElement.clientWidth);
        if(document.documentElement.clientWidth!=0)
          {
            document.getElementById('dimmer').style.width=document.documentElement.clientWidth;
            document.getElementById('dimmer').style.width= (parseInt(document.documentElement.clientWidth)-85);
          }
        else
          {
            document.getElementById('dimmer').style.width="100%";
          }
        //alert(document.getElementById('dimmer').style.width);
		//alert(document.body.scrollHeight);
        //document.getElementById('dimmer').style.height=document.body.scrollHeight - 80;
		document.getElementById('dimmer').style.height=GetBodyHeight();

	}
    else
	{
		document.getElementById('dimmer').style.width=GetBodyWidth();
		document.getElementById('dimmer').style.height=GetBodyHeight();
	}

	document.getElementById('dimmer').style.visibility="visible";

}

function init()
{
isMozilla=(document.all)?0:1;
if(isMozilla)
{
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);
}
/*document.onmousedown=MouseDown;document.onmousemove=MouseMove;document.onmouseup=MouseUp;*/
}
init();
function hideIframe()
{
if(ie)
{
var theIframe=document.getElementById("fadeboxiframe")
//theIframe.style.display="none";
}
}


function unhideIframe()
{
	if(ie)
	{
		var theIframe=document.getElementById("fadeboxiframe");
		//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;
}
//if(isMozilla)
//{
	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);
//if(isMozilla)
//{
FinalHeight=FinalHeight-85;
//}
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))	
    {
        //alert("hello");
        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;
	 	//alert(xmlHttp.status);
	 /*alert(xmlHttp.responseText);*/
		
		document.getElementById("divproperty").style.display='none';
		
		document.getElementById("divaddproperty").innerHTML=xmlHttp.responseText;
		document.getElementById("divaddproperty").style.display='';
		
		//alert(document.getElementById('fk_typeglcode').value);
		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('btnsumit').style.display='';
		//document.getElementById('btncancel').style.display='';
		//document.getElementById('btnnext').style.display='none';
		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';
		//document.getElementById('btnsumit').style.display='none';
		//document.getElementById('btncancel').style.display='';
		//document.getElementById('btnnext').style.display='';
		
		
	}
}




function funpropertydetail()
{
	//alert('fbg');
	
	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('vartitle').value == "")
        {
            alert("Please enter the Title");
			document.getElementById('vartitle').focus();
			return false;
        }
	 else if(document.getElementById('varmls').value == "")
        {
            alert("Please enter MLS # Value");
			document.getElementById('varmls').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('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)
{
//alert("testing");
   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()
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="registration.php";
	//alert(url);
	xmlHttp.onreadystatechange= stateChangeregister;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function stateChangeregister()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
 //alert(xmlHttp.responseText);
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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
var sh = winH;
var sw = winW;
var sh2 = sh/2;
var sw2 = sw/2;

var topf = sh2 - popuph;
var leftf = sw2 - popupw2;


//alert(popuph2 + ":" + popuph + ":" + sh2 + ":" + sh + ":" + topf);
//alert(popupw2 + ":" + popupw + ":" + sw2 + ":" + sw + ":" + leftf);


document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
//document.getElementById('dvregisterfrm').style.height=10;
//document.getElementById('dvregisterfrm').style.width=10;

//document.getElementById('dvregisterfrm').style.top=CalculateTop('316')+ "px";
//document.getElementById('dvregisterfrm').style.left=CalculateLeft('392')+ "px";

// binit comment
/*document.getElementById('dvregisterfrm').style.top= topf + "px";
*/
document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";
//document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";
// binit comment end
document.getElementById('dvregisterfrm').style.left= leftf + "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}

function funpopuplogin()
{
	xmlHttp=GetXmlHttpObject()
    if(xmlHttp==null)
    {
    alert("Browser does not support HTTP Request")
    return
    }
    //var url="loginpopup.php"
    //url=url+"?frmid="+str
    //url=url+"&sid="+Math.random()
    var url="loginmodel.php";
    xmlHttp.onreadystatechange= stateChangeloginpopup
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
}

function stateChangeloginpopup()
{
    SetBackground();
    //alert(xmlHttp.readyState);
    //alert(xmlHttp.responseText);
    if(xmlHttp.readyState==1)
    {
    ProcessLoader();
    }
    if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
    {
		//alert(xmlHttp.responseText);
		
		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 = 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;
				//winW = window.innerWidth;
				//winH = window.innerHeight;
			}
			
		}
		//alert(window.innerWidth + ":" + window.innerHeight );
		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';-->
    //alert(xmlHttp.responseText);
    document.getElementById('dvprocessing').style.display='none';
    document.getElementById('dvregisterfrm').style.display='';
    //document.getElementById('dvregisterfrm').style.height='190';
    //document.getElementById('dvregisterfrm').style.width='320'; //topf
    //document.getElementById('dvregisterfrm').style.top=CalculateTop('190')+ "px";
    //document.getElementById('dvregisterfrm').style.left=CalculateLeft('320')+ "px";
	document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";
	//document.getElementById('dvregisterfrm').style.top=topf1 + "px";
    document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
        //alert(document.getElementById('dvregisterfrm').style.height);
        //alert(document.getElementById('dvregisterfrm').style.width);
    document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
    unhideIframe();
    }
}

function showrforgetpass()
{
xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request")
return
}
//var url="loginpopup.php"
//url=url+"?frmid="+str
//url=url+"&sid="+Math.random()
var url="forgotpass.php";
xmlHttp.onreadystatechange= stateChangeforgetpass
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChangeforgetpass()
{
SetBackground();

//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);

if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);

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 = 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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
var sh = winH;
var sw = winW;
var sh2 = sh/2;
var sw2 = sw/2;

var topf = sh2 - popuph;
var leftf = sw2 - popupw2;


//alert(popuph2 + ":" + popuph + ":" + sh2 + ":" + sh + ":" + topf);
//alert(popupw2 + ":" + popupw + ":" + sw2 + ":" + sw + ":" + leftf);


document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
//document.getElementById('dvregisterfrm').style.height=10;
//document.getElementById('dvregisterfrm').style.width=10;

//document.getElementById('dvregisterfrm').style.top=CalculateTop('316')+ "px";
//document.getElementById('dvregisterfrm').style.left=CalculateLeft('392')+ "px";
document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";
//document.getElementById('dvregisterfrm').style.top= topf + "px";
document.getElementById('dvregisterfrm').style.left= leftf + "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
setfocus_onform();
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 stateChangechangeprofile()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);
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 = 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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
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.top= topf + "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(document.getElementById('varphone').value=="")
        {
            alert("Please enter Phone No");
            document.getElementById('varphone').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("Password and Verify passoword not matched");
             document.getElementById('varvpass').focus();
            return false;
        }
	 else if(document.getElementById('txtimage').value!=document.getElementById('pin_value_hdn').value)
			   {
			   alert("Please Enter The Given Code Correctly");
			       document.getElementById('txtimage').focus();
                     return false;
			   }
		 
		else if(document.getElementById('chkaggry').checked==false)
		{
			alert("Please check the Check Box.");
            document.getElementById('chkaggry').focus();
            return false;
		}
		//document.registration_form.submit();
		//document.registration_form.edit_refresh.value = '1';
		//fillRequest();
		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+ "&varcompanyname="+document.getElementById('varcompanyname').value; 
		params=params+"&varemail="+document.getElementById('varemail').value;
		params=params+"&varpassword="+document.getElementById('varpassword').value;
		params=params+"&varphone="+document.getElementById('varphone').value;
		//alert(url+params);
		xmlHttp.open("GET",url+params ,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		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);
	 //document.getElementById('lblusername').innerHTML=name;
	 
	 
	 var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	 //alert(strlengthcount);
	 //alert(xmlHttp.responseText);
	 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.top=topf1 + "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(document.getElementById('varphone').value=="")
        {
            alert("Please enter Phone No");
            document.getElementById('varphone').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("Password and Verify passoword not matched");
             document.getElementById('varvpass').focus();
            return false;
        }
   }
   
		
	
		//document.registration_form.submit();
		//document.registration_form.edit_refresh.value = '1';
		//fillRequest();
		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+ "&varcompany="+document.getElementById('varcompanyname').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;
		//alert(url +params);
		xmlHttp.open("GET",url +params ,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		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;
	 document.getElementById('lblusername').innerHTML=name;
	 //alert(name);
	 
	 var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	 //alert(strlengthcount);
	 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.top=topf1 + "px";
		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
			
		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
		unhideIframe();
	 }
	 /*else
	 {
		 reloadlist();
	 }*/
 } 
}






function form_submit_quick_login()
 {
		
		//alert("in");
		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;
        }
   
//alert("in1");
  
		//document.registration_form.submit();
		//document.registration_form.edit_refresh.value = '1';
		//fillRequest();
		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; 
		
		//alert(url +params);
		xmlHttp.open("GET",url +params ,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		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';
		 //alert("in response");
		 var str = trim(xmlHttp.responseText, ' ');
		 var strlengthcount = str.length;
		//alert(xmlHttp.responseText);
		//alert(strlengthcount);
		 if(strlengthcount > 1900)
		 {
		   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.top=topf1 + "px";
		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
			
		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
		unhideIframe();
	 }
	else
	 {
		 //reloadlist();
		 //window.location.href="index.php";
		// alert ("hiiiii");
		 if(document.getElementById('hdfilename').value=="property_listing.php")
		 {
		 	document.frmpage1.submit();
		
		 }
		 else
		 {  //alert("hiii");
			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;
        
		 
		
		//alert(url +params);
		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 str = trim(xmlHttp.responseText, ' ');
		 var strlengthcount = str.length;
		 alert(xmlHttp.responseText);
		 alert(strlengthcount);*/
		 
		   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.top=topf1 + "px";
		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
			
		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
		setfocus_onform();
		unhideIframe();
	 
 } 
}




// BELOW CODE IS OLD








function propertycancel()
{
	
	document.getElementById("divproperty").style.display='';
		
	document.getElementById("divaddproperty").style.display='none';
}

function addpropertyback()
{

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

function chkaddprorpertydetail()
{
	
	//alert('hi');
	if(document.getElementById('fk_class').value == "PleaseSelect")
        {
            alert("Please Select Class");
			document.getElementById('fk_class').focus();
			return false;
        }
    else if(document.getElementById('fk_cons').value == "PleaseSelect")
        {
            alert("Please Select Construction");
			document.getElementById('fk_cons').focus();
			return false;
        }
	  else if(document.getElementById('fk_fon').value == "PleaseSelect")
        {
            alert("Please Select Foundation Name");
			document.getElementById('fk_fon').focus();
			return false;
        }
		 else if(document.getElementById('fk_fur').value == "PleaseSelect")
        {
            alert("Please Select Furnished");
			document.getElementById('fk_fur').focus();
			return false;
        }
		
		property_submit("noland");
}

function property_submit(str)
{
	
	//alert('');
	var i;
	var j=document.getElementById('hdneighb').value;
	var neighid="";
	for(i=1;i<=j;i++)
	{
		
		if(document.getElementById('chkNeigh'+i).checked==true)
		{
			neighid+=document.getElementById('chkNeigh'+i).value+",";
		}
	}
	
	
	param="&fk_agentid="+document.getElementById('fk_agentid').value;
	param=param+"&vartitle="+document.getElementById('vartitle').value;
	param=param+"&vartitleb="+document.getElementById('vartitleb').value;
	param=param+"&varmls="+document.getElementById('varmls').value;
	param=param+"&fk_typeglcode="+document.getElementById('fk_typeglcode').value;
	param=param+"&fk_stateglcode="+document.getElementById('fk_districtglcode').value;
	param=param+"&varaddress="+document.getElementById('varaddress').value;
	param=param+"&varblock="+document.getElementById('varblock').value;
	param=param+"&varparser="+document.getElementById('varparser').value;
	param=param+"&decoldprice="+document.getElementById('decoldprice').value;
	param=param+"&decprice="+document.getElementById('decprice').value;
	param=param+"&varfulldesc="+document.getElementById('varfulldesc').value;
	
	param=param+"&intdisplayorder="+document.getElementById('intdisplayorder').value;
	param=param+"&varwidth="+document.getElementById('varwidth').value;
	param=param+"&vardepth="+document.getElementById('vardepth').value;
	param=param+"&decacreage="+document.getElementById('decacreage').value;
	param=param+"&status="+document.getElementById('fk_status').value;
    param=param+"&sector="+document.getElementById('fk_Sector').value; 
	param=param+"&zoning="+document.getElementById('fk_Zoning').value;
	param=param+"&currency="+document.getElementById('fk_Currency').value;
	param=param+"&views="+document.getElementById('fk_Views').value;
	param=param+"&soil="+document.getElementById('fk_Soil').value;
	param=param+"&neighid="+neighid;
	
	param=param+"&hduserdo="+trim(document.getElementById('hduserdo').value);
	param=param+"&hdpid="+trim(document.getElementById('hdpid').value);
	param=param+"&hiintdisplayorder="+trim(document.getElementById('hiintdisplayorder').value);
	
	if(document.getElementById('chrdisplay').checked==true)
	{
		param=param+"&chrdisplay=true";
	}
	else
	{
		param=param+"&chrdisplay=false";
	}
	
	
	/*alert(param);*/
	
	
	if(str=="land")
	{
		
		
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
		
		var url="propertysave.php?land=land";
		
		/*alert(url+param);*/
		
		xmlHttp.open("GET",url+param,true)
		
		
		xmlHttp.onreadystatechange=propertysavestatechange
		xmlHttp.send(null)
		
	}
	else if(str=="noland")
	{
		
		
		i=0;
		var j=document.getElementById('hdHF').value;
		var HomeF="";
		for(i=1;i<=j;i++)
		{
			
			if(document.getElementById('chkHF'+i).checked==true)
			{
				HomeF+=document.getElementById('chkHF'+i).value+",";
			}
		}
		
		i=0;
		var j=document.getElementById('hdComF').value;
		var ComF="";
		for(i=1;i<=j;i++)
		{
			
			if(document.getElementById('chkComF'+i).checked==true)
			{
				ComF+=document.getElementById('chkComF'+i).value+",";
			}
		}
		
		param=param+"&varannualtax="+document.getElementById('varannualtax').value;
		param=param+"&intyearbuilt="+document.getElementById('intyearbuilt').value;
		param=param+"&varsquarefeet="+document.getElementById('varsquarefeet').value;
		param=param+"&intbeds="+document.getElementById('intbeds').value;
		param=param+"&intbaths="+document.getElementById('intbaths').value;
		param=param+"&varfloors="+document.getElementById('varfloors').value;
		
		
		param=param+"&class="+document.getElementById('fk_class').value;
		param=param+"&cons="+document.getElementById('fk_cons').value;
		param=param+"&fon="+document.getElementById('fk_fon').value;
		param=param+"&fur="+document.getElementById('fk_fur').value;
		
		param=param+"&HomeF="+HomeF;
		param=param+"&ComF="+ComF;
		
		
		
		
		
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
		
		var url="propertysave.php?land=noland";
		
		
		
		xmlHttp.open("GET",url+param,true)
		
		
		xmlHttp.onreadystatechange=propertysavestatechange
		xmlHttp.send(null)
		
	}
}
function propertysavestatechange()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		reloadlistwidthalert("Your Records Are Successfully Saved");
	 }
}
function proprerty_sumit_land()
{
	alert('hi');
	var x=funpropertydetail();
	
	if(x==false)
	{
		return false;
	}
	
	property_submit("land");
	return false;
}






function showaddpropertyimageform(id)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="propertylistimage.php?Protyid="+id;
	xmlHttp.onreadystatechange= stateChangeaddimage;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}


function stateChangeaddimage(id)
{
	/*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;
		//alert(str);
	 	//alert(xmlHttp.status);
	 /*alert(xmlHttp.responseText);*/
	 // var str = trim(xmlHttp.responseText, ' ');
	 //var strlengthcount = str.length;
	 //alert(strlengthcount);
		
		document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('divpropertyimage').style.display = 'block';
	   document.getElementById('divaddpropertyimage').style.display = 'none';
	   document.location.href= 'propertylistimage.php?Protyid='+document.getElementById('Protyid').value;
	   //document.getElementById('divpropertyimage').style.display = 'none';
	    
 if(strlengthcount > 3300)
	 {
	   /*document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('divpropertyimage').style.display = 'none';
	   document.location.href= 'propertylistimage.php?Protyid='+document.getElementById('Protyid').value;
	   document.getElementById('divpropertyimage').style.display = 'none';
	    document.getElementById('divaddpropertyimage').style.display = 'block';*/
	   //document.getElementById('dvregisterfrm').style.width = '395';
	   //document.getElementById('dvregisterfrm').style.height = '';
       //document.getElementById('dvregisterfrm').style.top = CalculateTop('493')+ "px";
       //document.getElementById('dvregisterfrm').style.left = CalculateLeft('392')+ "px";
	   //document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   //document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   //unhideIframe();
	 }
	 else
	 {
		 document.getElementById('dvregisterfrm').style.display = "none";
		 document.location.href= 'propertylistimage.php?Protyid='+document.getElementById('Protyid').value;
	 }
		
		
		
	}
}


function setfocus_onform()
{
	var a=0;
	for (var i = 0; document.forms[0].elements[i].type == 'hidden'; i++)
	{
		a=0;
	}
	document.forms[0].elements[i].focus();
}



function chkuserdetail()
{
	
	
	var testresults;
        //var str=document.getElementById('varuid').value;
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(document.getElementById('varemail').value))
        testresults=true
        else{

        testresults=false
        }
		
		
	
	if(trim(document.getElementById('varfname').value) == "")
        {
            alert("Please Enter First Name");
			document.getElementById('varfname').focus();
			return false;
        }
    else if(trim(document.getElementById('varlname').value) == "")
        {
            alert("Please Enter Last Name");
			document.getElementById('varlname').focus();
			return false;
        }
	else if(testresults==false)
        {
            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('varcpassword').value=="")
        {
            alert("Please enter Confirm Password ");
            document.getElementById('varcpassword').focus();
            return false;
        }
    else if(document.getElementById('varpassword').value != document.getElementById('varcpassword').value)
        {
            alert("Password and Confirm passoword not matched");
             document.getElementById('varcpassword').focus();
            return false;
        }
	else if(document.getElementById('varphone').value=="")
        {
            alert("Please enter Phone No");
            document.getElementById('varphone').focus();
            return false;
        }
		
	param="&varfname="+document.getElementById('varfname').value;
	param=param+"&varlname="+document.getElementById('varlname').value;
	param=param+"&varemail="+document.getElementById('varemail').value;
	param=param+"&varpassword="+document.getElementById('varpassword').value;
	param=param+"&varphone="+document.getElementById('varphone').value;
	
	
	alert(param);
	if(document.getElementById('chrdisplay').checked==true)
	{
		param=param+"&chrdisplay=true";
	}
	else
	{
		param=param+"&chrdisplay=false";
	}
	
	param=param+"&intdisplayorder="+trim(document.getElementById('intdisplayorder').value);
	param=param+"&hiintdisplayorder="+trim(document.getElementById('hiintdisplayorder').value);
	param=param+"&userdo="+trim(document.getElementById('hduserdo').value);
	
	param=param+"&uid="+trim(document.getElementById('hduid').value);
	
	
	
	xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
		
		var url="adduser.php?QT=1";
		
		alert(url+param);
		
		xmlHttp.open("GET",url+param,true)
		
		
		xmlHttp.onreadystatechange=stateChangeregisterpopup
		xmlHttp.send(null)
	
}

function stateChangeregisterpopup()
{
SetBackground();
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
      
	  //alert(xmlHttp.responseText);
	 document.getElementById('dvprocessing').style.display = 'none';
	 alert (xmlHttp.responseText);
	 var str = trim(xmlHttp.responseText, ' ');
	 var strlengthcount = str.length;
	 alert(strlengthcount);
	 if(strlengthcount > 300)
	 {
	   
	   		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.top=topf1 + "px";
		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 showagentaddform(userdo,id)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="addagent.php?userdo="+userdo+"&uid="+id;
	xmlHttp.onreadystatechange= stateChangeaddagent;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}


function stateChangeaddagent()
{

		
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
	{
		 var str = trim(xmlHttp.responseText, ' ');
	 	var strlengthcount = str.length;
	 	//alert(xmlHttp.status);
	 /*alert(xmlHttp.responseText);*/
		
		document.getElementById("divagent").style.display='none';
		
		document.getElementById("addagent").innerHTML=xmlHttp.responseText;
		document.getElementById("addagent").style.display='';
		
	}
}

function chkaddagent()
{
	
	
	var testresults;
        //var str=document.getElementById('varuid').value;
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(document.getElementById('varemail').value))
        testresults=true
        else{

        testresults=false
        }
		
		
	
	if(trim(document.getElementById('varfname').value) == "")
        {
            alert("Please Enter First Name");
			document.getElementById('varfname').focus();
			return false;
        }
    else if(trim(document.getElementById('varlname').value) == "")
        {
            alert("Please Enter Last Name");
			document.getElementById('varlname').focus();
			return false;
        }
	else if(testresults==false)
        {
            alert("Please enter a valid email address");
			document.getElementById('varemail').focus();
			return false;
        }
	
	else if(trim(document.getElementById('intdisplayorder').value)=="" || document.getElementById('intdisplayorder').value==0)
        {
            alert("Please enter Display Order");
            document.getElementById('intdisplayorder').focus();
            return false;
        }
	 else if(trim(document.getElementById('hduserdo').value) == "Add" && document.getElementById('file1').value=="")
        {
            alert("Please Select Image");
			document.getElementById('file1').focus();
			return false;
        }	
		
		
	param="&varfname="+document.getElementById('varfname').value;
	param=param+"&varlname="+document.getElementById('varlname').value;
	param=param+"&varemail="+document.getElementById('varemail').value;
	param=param+"&varsitename="+document.getElementById('varsitename').value;
	param=param+"&varphone="+document.getElementById('varphone').value;
	
	if(document.getElementById('chrdisplay').checked==true)
	{
		param=param+"&chrdisplay=true";
	}
	else
	{
		param=param+"&chrdisplay=false";
	}
	
	if(document.getElementById('varblock').checked==true)
	{
		param=param+"&varblock=true";
	}
	else
	{
		param=param+"&varblock=false";
	}
	
	param=param+"&varmobileno="+document.getElementById('varmobileno').value;
	param=param+"&intdisplayorder="+trim(document.getElementById('intdisplayorder').value);
	param=param+"&hiintdisplayorder="+trim(document.getElementById('hiintdisplayorder').value);
	param=param+"&userdo="+trim(document.getElementById('hduserdo').value);
	param=param+"&uid="+trim(document.getElementById('hduid').value);
	
/*	param=param+"&file1="+document.getElementById('file1');*/
param=param+"&file1="+document.frmagent.file1;
	
	var inst = FCKeditorAPI.GetInstance("FCKeditor1");
	var sValue = inst.GetHTML();
	param=param+"&FCKeditor1="+sValue;
	
	
	xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
		
		var url="addagent.php?QT=1";
		
		//alert(url+param);
		
		xmlHttp.open("GET",url+param,true)
		
		
		xmlHttp.onreadystatechange=stateChangeagentsave
		xmlHttp.send(null)
		

}
function stateChangeagentsave()
{

		
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
	{
		 reloadlistwidthalert("Your Records Are Successfully Saved");
		
	}
}

function shownewimageform(id)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="addimage.php?imagecode="+id;
	param="&File1="+document.getElementById('file1').value;
	//alert(url +param);
	//xmlHttp.setRequestHeader("Content-type", "multipart/form-data;");
	xmlHttp.onreadystatechange= stateChangenewimage;
	xmlHttp.open("GET",url +param,true);
	xmlHttp.send(null);
	
}


function stateChangenewimage()
{

		
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
	{
		 //var str = trim(xmlHttp.responseText, ' ');
	 	var str=xmlHttp.responseText;
      // alert(str);

		 var array=str.split("$");
        //alert(array[1]);

        //alert(array[2]);
        //alert(array[0]);
		document.getElementById("divagent").style.display='none';
		
		document.getElementById("testWrap").innerHTML=xmlHttp.responseText;
		document.getElementById("testWrap").style.display='';
		
	}
}
function showcropimageform()
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="simplecrop.php?x1="+document.getElementById('x1').value;
	param="&y1="+document.getElementById('y1').value;
	param=param+"&x2="+document.getElementById('x2').value;
	param=param+"&y2="+document.getElementById('y2').value;
	param=param+"&imagename="+document.getElementById('imagename').value;
	param=param+"&intglcode="+document.getElementById('intglcode').value;
	param=param+"&Protyid="+document.getElementById('Protyid').value;
	param=param+"&intdisplayorder="+document.getElementById('intdisplayorder').value;
	//alert(url +param);
	xmlHttp.onreadystatechange= stateChangecropimage;
	xmlHttp.open("GET",url +param,true);
	xmlHttp.send(null);
	
}


function stateChangecropimage()
{
//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("$");
        //alert(array[1]);

        //alert(array[2]);
        //alert(array[0]);
     //document.getElementById('inputbox'+array[1]).style.display="none";
      document.getElementById('cropimagediv').innerHTML=str;


    }

		
 }




function showviewflyerform(intglcode)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="viewflyer.php?intglcode="+intglcode;
	xmlHttp.onreadystatechange= stateChangeviewflyerform;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function stateChangeviewflyerform()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);
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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
var sh = winH;
var sw = winW;
var sh2 = sh/2;
var sw2 = sw/2;

var topf = sh2 - popuph;
var leftf = sw2 - popupw2;


//alert(popuph2 + ":" + popuph + ":" + sh2 + ":" + sh + ":" + topf);
//alert(popupw2 + ":" + popupw + ":" + sw2 + ":" + sw + ":" + leftf);


document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
//document.getElementById('dvregisterfrm').style.height=10;
//document.getElementById('dvregisterfrm').style.width=10;

//document.getElementById('dvregisterfrm').style.top=CalculateTop('316')+ "px";
//document.getElementById('dvregisterfrm').style.left=CalculateLeft('392')+ "px";

// binit comment
/*document.getElementById('dvregisterfrm').style.top= topf + "px";
*/
document.getElementById('dvregisterfrm').style.top=CalculateTop('550')+ "px";
document.getElementById('dvregisterfrm').style.left= leftf + "px";
// binit comment enddocument.getElementById('dvregisterfrm').style.left= leftf + "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}

function checkalluser()
	{
		var a,sel;

		
		if (document.frmflyeremaillist.chkHeader.checked == true)
		{
			sel = true;
		}
		else
		{
			sel = false;
		}
		for(var i=0;i<document.frmflyeremaillist.length;i++)
			{
                
				if (document.frmflyeremaillist.elements[i].type == "checkbox")
				{
					document.frmflyeremaillist.elements[i].checked = sel;
				
				}
			}
		//	alert(upperid);
	}
	
	function funsbmtviewflyer()
		{

			var testresults;
			var str=document.frmflyeremaillist.txtfrom.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
			}
			
		
			var con=0;
			var mailidlist="";
			for (var i=0; i<document.frmflyeremaillist.length; i++)
			{
				if(document.frmflyeremaillist.elements[i].type == "checkbox")
				{
					if ( document.frmflyeremaillist.elements[i].checked == true )
					{
						mailidlist+=document.frmflyeremaillist.elements[i].value+",";
						con++;
					}
				}
			}
			if (con==0)
			{
				alert('Please select atleast one Email Address');
				return false;
			}
			else
			{
				
				if(testresults==false)
				{
					alert("Please Valid Enter From Address");
					document.frmflyeremaillist.txtfrom.focus();
					return false;
				}
				else if(document.frmflyeremaillist.txtsubject.value=="")
				{
					alert("Please Enter Subject");
					document.frmflyeremaillist.txtsubject.focus();
					return false;
				}
				else if(document.frmflyeremaillist.txtmessage.value=="")
				{
					alert("Please Enter Text Message");
					document.frmflyeremaillist.txtmessage.focus();
					return false;
				}
				document.frmflyeremaillist.action="viewflyer.php?submit=submit&stype="+document.frmflyeremaillist.stype.value;
				document.frmflyeremaillist.submit();
				return true;
			}
            return false;
		}
		
function SendflyerEmail(userdo,id)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	
	param="&finlanintglcode="+document.getElementById('finlanintglcode');
	param=param+"&mailidlist="+document.getElementById('mailidlist').value;
	param=param+"&txtareaemail="+document.getElementById('txtareaemail').value;
	
	param=param+"&txtfrom="+document.getElementById('txtfrom').value;
	param=param+"&txtsubject="+document.getElementById('txtsubject').value;
	param=param+"&txtmessage="+document.getElementById('txtmessage').value;
	
	var url="viewflyer.php?submit=submit";
	xmlHttp.setRequestHeader("Content-type", "multipart/form-data;");
	xmlHttp.onreadystatechange= stateChangeflyeremail;
	xmlHttp.open("GET",url+param,true);
	xmlHttp.send(null);
	
}


function stateChangeflyeremail()
{

		
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
	{
		 var str = trim(xmlHttp.responseText, ' ');
	 	var strlengthcount = str.length;
	 	//alert(xmlHttp.status);
	 /*alert(xmlHttp.responseText);*/
		
		reloadlistwidthalert("Emails are successfully send");
		
	}
}

function showfuturepropertyform(userdo,id)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="addfeatureproperty.php?userdo="+userdo+"&uid="+id;
	xmlHttp.onreadystatechange= stateChangefuture;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function stateChangefuture()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);
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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
var sh = winH;
var sw = winW;
var sh2 = sh/2;
var sw2 = sw/2;

var topf = sh2 - popuph;
var leftf = sw2 - popupw2;


//alert(popuph2 + ":" + popuph + ":" + sh2 + ":" + sh + ":" + topf);
//alert(popupw2 + ":" + popupw + ":" + sw2 + ":" + sw + ":" + leftf);


document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
document.getElementById('dvregisterfrm').style.height=10;
document.getElementById('dvregisterfrm').style.width=10;

//document.getElementById('dvregisterfrm').style.top=CalculateTop('316')+ "px";
//document.getElementById('dvregisterfrm').style.left=CalculateLeft('392')+ "px";

// binit comment
/*document.getElementById('dvregisterfrm').style.top= topf + "px";
*/
document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";
// binit comment end
document.getElementById('dvregisterfrm').style.left= leftf + "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}




function showfindpropertyform(id,value)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="findproperty.php?id="+value+"&tycode="+id;
	//param="&File1="+document.getElementById('file1').value;
	//alert(url);
	//xmlHttp.setRequestHeader("Content-type", "multipart/form-data;");
	xmlHttp.onreadystatechange= stateChangefindproperty;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}


function stateChangefindproperty()
{

		
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
	{
		 //var str = trim(xmlHttp.responseText, ' ');
	 	var str=xmlHttp.responseText;
       //alert(str);

		 var array=str.split("$");
        //alert(array[1]);

        //alert(array[2]);
        //alert(array[2]);

		document.getElementById("propertylistbox").innerHTML=array[2];
		
	
		
	}
}


function chkfeaturepropertydetail()
{
	
	if(document.getElementById('fk_typeglcode').value == "PleaseSelect")
        {
            alert("Please Select Sell/Rent Type");
			document.getElementById('fk_typeglcode').focus();
			return false;
        }
    else if(document.getElementById('propertylist').value == "PleaseSelect")
        {
            alert("Please Select Property");
			document.getElementById('propertylist').focus();
			return false;
        }
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
	
		var url="addfeatureproperty.php?QT=1";
	param="&fk_listingglcode="+document.getElementById('propertylist').value;
	param=param+"&intdisplayorder="+document.getElementById('intdisplayorder').value;
	param=param+"&hiintdisplayorder="+trim(document.getElementById('hiintdisplayorder').value);
	param=param+"&userdo="+trim(document.getElementById('hduserdo').value);
	
	param=param+"&uid="+trim(document.getElementById('hduid').value);
	
		//alert(url+param);
		
		xmlHttp.open("GET",url+param,true)
		
		
		xmlHttp.onreadystatechange=stateChangefeaturepropertypopup
		xmlHttp.send(null)
	
}

function stateChangefeaturepropertypopup()
{
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(str);
	 //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.top=topf1 + "px";
		document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";
		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
			//document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
		unhideIframe();
	 }
	 else
	 {
		/* document.getElementById('dvregisterfrm').style.display = "";
		 document.location.href= 'addfeatureproperty.php';*/
		 alert("Your Records Are Successfully Saved");
		 reloadlist();
	 }
 } 
}

function showdevelopmentform(userdo,id)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="adddevelopment.php?userdo="+userdo+"&uid="+id;
	xmlHttp.onreadystatechange= stateChangedevelopment;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function stateChangedevelopment()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);
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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
var sh = winH;
var sw = winW;
var sh2 = sh/2;
var sw2 = sw/2;

var topf = sh2 - popuph;
var leftf = sw2 - popupw2;


//alert(popuph2 + ":" + popuph + ":" + sh2 + ":" + sh + ":" + topf);
//alert(popupw2 + ":" + popupw + ":" + sw2 + ":" + sw + ":" + leftf);


document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
document.getElementById('dvregisterfrm').style.height=10;
document.getElementById('dvregisterfrm').style.width=10;

//document.getElementById('dvregisterfrm').style.top=CalculateTop('316')+ "px";
//document.getElementById('dvregisterfrm').style.left=CalculateLeft('392')+ "px";

// binit comment
/*document.getElementById('dvregisterfrm').style.top= topf + "px";
*/
document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";
// binit comment end
document.getElementById('dvregisterfrm').style.left= leftf + "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}



function chkdevelopmentdetail()
{
	
	if(document.getElementById('fk_typeglcode').value == "PleaseSelect")
        {
            alert("Please Select Sell/Rent Type");
			document.getElementById('fk_typeglcode').focus();
			return false;
        }
    else if(document.getElementById('propertylist').value == "PleaseSelect")
        {
            alert("Please Select Property");
			document.getElementById('propertylist').focus();
			return false;
        }
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
         
	
		var url="adddevelopment.php?QT=1";
	param="&vardevelopment="+document.getElementById('vardevelopment').value;
	param=param+"&intdisplayorder="+document.getElementById('intdisplayorder').value;
	param=param+"&hiintdisplayorder="+trim(document.getElementById('hiintdisplayorder').value);
	param=param+"&userdo="+trim(document.getElementById('hduserdo').value);
	
	param=param+"&uid="+trim(document.getElementById('hduid').value);
	
		//alert(url+param);
		
		xmlHttp.open("GET",url+param,true)
		
		
		xmlHttp.onreadystatechange=stateChangedevelopmentpopup
		xmlHttp.send(null)
	
}

function stateChangedevelopmentpopup()
{
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(str);
	 //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.top=topf1 + "px";
		document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";
		document.getElementById('dvregisterfrm').style.left=leftf1 + "px";
			//document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
		document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
		unhideIframe();
	 }
	 else
	 {
		/* document.getElementById('dvregisterfrm').style.display = "";
		 document.location.href= 'addfeatureproperty.php';*/
		 alert("Your Records Are Successfully Saved");
		 reloadlist();
	 }
 } 
}




function showimagepopup(imgpath,type)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="showimg.php?imgpath="+imgpath+"&type="+type;
	xmlHttp.onreadystatechange= stateChangeshowimg;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function stateChangeshowimg()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);
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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
var sh = winH;
var sw = winW;
var sh2 = sh/2;
var sw2 = sw/2;

var topf = sh2 - popuph;
var leftf = sw2 - popupw2;


//alert(popuph2 + ":" + popuph + ":" + sh2 + ":" + sh + ":" + topf);
//alert(popupw2 + ":" + popupw + ":" + sw2 + ":" + sw + ":" + leftf);


document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
/*document.getElementById('dvregisterfrm').style.height=100;
document.getElementById('dvregisterfrm').style.width=100;*/

//document.getElementById('dvregisterfrm').style.top=CalculateTop('316')+ "px";
//document.getElementById('dvregisterfrm').style.left=CalculateLeft('392')+ "px";

// binit comment
/*document.getElementById('dvregisterfrm').style.top= topf + "px";
*/
document.getElementById('dvregisterfrm').style.top=CalculateTop('600')+ "px";
//document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";
// binit comment end
document.getElementById('dvregisterfrm').style.left= leftf + "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}
function funchksearch()
	{
 
		if(document.getElementById('hduserid').value=="")
		{
			funpopuplogin()
		}
		else
		{
           
			funsavesearch()
		}
	}

function funsavesearch()
{
	
	//alert(document.frmpage1.seltype.value);
	var params = "?seltype="+document.frmpage1.seltype.value;
	
	params=params+"&fk_districtglcode="+document.frmpage1.fk_districtglcode.value;
	
	params=params+"&intbeds="+document.frmpage1.intbeds.value;
	
	params=params+"&intbaths="+document.frmpage1.intbaths.value;

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

	params=params+"&txtminprice="+document.frmpage1.txtminprice.value;
	
	params=params+"&txtmaxprice="+document.frmpage1.txtmaxprice.value;
	
	params=params+"&txttitle="+document.frmpage1.txttitle.value;
	
				//alert(params);
				
							
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="savesearchtitlepopup.php";
	//alert(url+params);
	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;

//alert(leftf);


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').style.left="25px";
	
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";
	//alert(url+params);
	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, ' ');
 //alert(str);
	 var strlengthcount = str.length;
//alert(strlengthcount);
	 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';
	 }
}
}

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 stateChangeemailtofriend()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
 //alert(xmlHttp.responseText);
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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
var sh = winH;
var sw = winW;
var sh2 = sh/2;
var sw2 = sw/2;

var topf = sh2 - popuph;
var leftf = sw2 - popupw2;


//alert(popuph2 + ":" + popuph + ":" + sh2 + ":" + sh + ":" + topf);
//alert(popupw2 + ":" + popupw + ":" + sw2 + ":" + sw + ":" + leftf);


document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
//document.getElementById('dvregisterfrm').style.height=10;
//document.getElementById('dvregisterfrm').style.width=10;

//document.getElementById('dvregisterfrm').style.top=CalculateTop('316')+ "px";
//document.getElementById('dvregisterfrm').style.left=CalculateLeft('392')+ "px";

// binit comment
/*document.getElementById('dvregisterfrm').style.top= topf + "px";
*/
document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";
//document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";
// binit comment end
document.getElementById('dvregisterfrm').style.left= leftf + "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}


function form_submit_quick_emailtofriend(detail1)
 {
	//alert('tst-'+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;
			   }
		//document.registration_form.submit();
		//document.registration_form.edit_refresh.value = '1';
		//fillRequest();
		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('varecap').value; 
		params=params+"&varemessage="+document.getElementById('varemessage').value +'<br>'+detail1;
		//params=params+"&="+document.getElementById('varemessage').value;
		
	//	alert(url +params);
		xmlHttp.open("GET",url +params ,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangedemailtofriendPopup 
	//	alert("hi");
		xmlHttp.send(null)
}


function stateChangedemailtofriendPopup()
{
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);
	// alert(xmlHttp.responseText);
	 if(strlengthcount > 450)
	 {
	   /*document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '350';
	   document.getElementById('dvregisterfrm').style.height = '';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('155')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('388')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();*/
	   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.top=topf1 + "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= 'conference.php';
	 }*/
 } 
}

/* save edit */

function showsearchedit(id)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="savedsearcheditpopup.php?pid="+id;
	//alert(url);
	xmlHttp.onreadystatechange= stateChangeshowsearchedit;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function stateChangeshowsearchedit()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
 //alert(xmlHttp.responseText);
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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
var sh = winH;
var sw = winW;
var sh2 = sh/2;
var sw2 = sw/2;

var topf = sh2 - popuph;
var leftf = sw2 - popupw2;


//alert(popuph2 + ":" + popuph + ":" + sh2 + ":" + sh + ":" + topf);
//alert(popupw2 + ":" + popupw + ":" + sw2 + ":" + sw + ":" + leftf);


document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
//document.getElementById('dvregisterfrm').style.height=10;
//document.getElementById('dvregisterfrm').style.width=10;

//document.getElementById('dvregisterfrm').style.top=CalculateTop('316')+ "px";
//document.getElementById('dvregisterfrm').style.left=CalculateLeft('392')+ "px";

// binit comment
/*document.getElementById('dvregisterfrm').style.top= topf + "px";
*/
document.getElementById('dvregisterfrm').style.top=CalculateTop('430')+ "px";
//document.getElementById('dvregisterfrm').style.top=CalculateTop('211')+ "px";
// binit comment end
document.getElementById('dvregisterfrm').style.left= leftf + "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
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;
//	alert(params);
	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";
		
		
		
		//alert(url +params);
		xmlHttp.open("GET",url +params ,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		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;
	 //alert(strlengthcount);
	 if(strlengthcount > 3000)
	 {
	   /*document.getElementById('dvregisterfrm').style.display = '';
	   document.getElementById('dvregisterfrm').style.width = '350';
	   document.getElementById('dvregisterfrm').style.height = '';
       document.getElementById('dvregisterfrm').style.top = CalculateTop('155')+ "px";
       document.getElementById('dvregisterfrm').style.left = CalculateLeft('388')+ "px";
	   document.getElementById('dvregisterfrm').style.backgroundColor = '#FFFFFF';
	   document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
	   unhideIframe();*/
	   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.top=topf1 + "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';
	 }
 } 
}
function addtosortlist(id)
{
	
	xmlHttp=GetXmlHttpObject();
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	var url="sortlist.php?propertyid="+id;
	//param="&File1="+document.getElementById('file1').value;
	//alert(url);
	//xmlHttp.setRequestHeader("Content-type", "multipart/form-data;");
	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;
	//param="&File1="+document.getElementById('file1').value;
	//alert(url);
	//xmlHttp.setRequestHeader("Content-type", "multipart/form-data;");
	xmlHttp.onreadystatechange= stateChangeaddtosortlist;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}


function stateChangeaddtosortlist()
{
if (xmlHttp.readyState == 1)
{
	ProcessLoader();
}
	
		
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
	{
		 //var str = trim(xmlHttp.responseText, ' ');
	 	var str=xmlHttp.responseText;
       //alert(str);

		 var array=str.split("$");
        //alert(array[0]);
		

		
		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.");
		}
        //alert(array[3]);
        //alert(array[2]);
		//reloadlistwidthalert("Your Records Are Successfully Saved");
		
		if(array[0]!=3)
		{
		document.getElementById("shortcount").innerHTML="("+array[3]+")";
		document.getElementById("addsort_"+array[1]).innerHTML=array[2];
		
		}
		document.getElementById('dvprocessing').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;
	//param="&File1="+document.getElementById('file1').value;
	//alert(url);
	//xmlHttp.setRequestHeader("Content-type", "multipart/form-data;");
	xmlHttp.onreadystatechange= stateChangeadnotify;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}
function stateChangeadnotify()
{
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("$");
			//alert(array[3]);
			
		 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("notifycount").innerHTML="("+array[3]+")";
		document.getElementById('dvprocessing').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;
	}
	
	//alert('test');
	
	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";
		//alert(url);
		var params = "&ddlconvert="+document.getElementById('ddlconvert').value;
        params = params + "&decamount="+document.getElementById('decamount').value;
		//alert(url + params);
		xmlHttp.open("GET",url+params,true)
		
		//xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		//xmlHttp.setRequestHeader("Content-length", params.length);
		//xmlHttp.setRequestHeader("Connection", "close");
		xmlHttp.onreadystatechange=stateChangeregister 
		xmlHttp.send(null)
}

function stateChangedcurrencyconverter()
{
SetBackground();
//alert(xmlHttp.readyState);
//alert(xmlHttp.responseText);
if(xmlHttp.readyState==1)
{
ProcessLoader();
}
if((xmlHttp.readyState==4||xmlHttp.readyState=="complete")&&(xmlHttp.status==200))
{
<!--document.getElementById('dvprocessing').style.display='none';-->
//alert(xmlHttp.responseText);
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 = 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;
		//winW = window.innerWidth;
		//winH = window.innerHeight;
	}
	
}
//alert(window.innerWidth + ":" + window.innerHeight );
var sh = winH;
var sw = winW;
var sh2 = sh/2;
var sw2 = sw/2;

var topf = sh2 - popuph;
var leftf = sw2 - popupw2;


//alert(popuph2 + ":" + popuph + ":" + sh2 + ":" + sh + ":" + topf);
//alert(popupw2 + ":" + popupw + ":" + sw2 + ":" + sw + ":" + leftf);


document.getElementById('dvprocessing').style.display='none';
document.getElementById('dvregisterfrm').style.display='';
//document.getElementById('dvregisterfrm').style.height=10;
//document.getElementById('dvregisterfrm').style.width=10;

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

//document.getElementById('dvregisterfrm').style.top= topf + "px";
document.getElementById('dvregisterfrm').style.left= leftf + "px";
	//alert(document.getElementById('dvregisterfrm').style.height);
	//alert(document.getElementById('dvregisterfrm').style.width);
document.getElementById("dvregisterfrm").innerHTML=xmlHttp.responseText;
unhideIframe();
}
}

function KeycheckOnlyPhonenumber(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 <= 39) || (KeyID >= 42 && KeyID <= 44) || (KeyID >= 46 && KeyID <= 47) || (KeyID >= 58 && KeyID <= 64) || (KeyID >= 91 && KeyID <= 96) || (KeyID >= 123 && KeyID <= 126))	
    {
        //alert("hello");
        return false;
    }
    
    return true;
}

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
        }
		
	//	alert(document.getElementById('enqcap').value);
	//	alert(document.getElementById('pin_value_hdn').value);
		
		  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 Given Code Correctly");
                   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+"&hdagentemail="+document.getElementById('hdagentemail').value;
		params=params+"&hdagentname="+document.getElementById('hdagentname').value;
		params=params+"&pid="+document.getElementById('pid').value;
        params=params+"&txtcaptcha="+document.getElementById('enqcap').value;
	
        params=params+"&hdncaptcha="+document.getElementById('pin_value_hdn').value;
         params=params+"&file="+document.getElementById('hdfilename').value;
	//	alert(url+params);
		xmlHttp=GetXmlHttpObject();
		
	if(xmlHttp==null)
	{
		alert("Browser does not support HTTP Request");
		return;
	}
	
	//alert(url);
	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))
	{
	//	alert(xmlHttp.responseText);
        //reloadlistwidthalert("Your Email is Successfully Send");
	
		//alert(document.getElementById('hdfilename').value);
		window.location.href=document.getElementById('hdfilename').value;
        alert("Your Email is Successfully Sent");
	}
    	
}



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";
	//alert(url+params);
	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= leftf + "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";
	//alert(url+params);
	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, ' ');
 //alert(str);
	 var strlengthcount = str.length;
//alert(strlengthcount);
	 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';
	 }
}


}

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)
}

