var resizeflag=false;

var mypage=""
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all

HM_NS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko")) ? true : false;
HM_DOM = (document.getElementById) ? true : false;
HM_NS4 = (document.layers) ? true : false;
HM_IE = (document.all) ? true : false;
HM_IE4 = HM_IE && !HM_DOM;
HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
HM_IE4M = HM_IE4 && HM_Mac;
HM_Opera = (navigator.userAgent.indexOf("Opera")!=-1);
HM_Konqueror = (navigator.userAgent.indexOf("Konqueror")!=-1);

HM_IsMenu = !HM_Opera && !HM_Konqueror && !HM_IE4M && (HM_DOM || HM_NS4 || HM_IE4);

HM_BrowserString = HM_NS4 ? "NS4" : HM_DOM ? "DOM" : "IE4";

function getReal(xy,el){
   if((HM_IE)||(HM_DOM)){
      Pos=(xy=="x")?el.offsetLeft:el.offsetTop;

      if ((HM_IE)&&(!HM_Mac)&&(el.tagName)&&
          (el.tagName.toUpperCase()=="TABLE")&&
          (el.border)&&(el.border>0)) Pos++;
      tmpEl=el.offsetParent;
      while(tmpEl!=null){
         Pos+=(xy=="x")?tmpEl.offsetLeft:tmpEl.offsetTop;
         if ((HM_IE)&&(!HM_Mac)&&(tmpEl.tagName)&&
             (tmpEl.tagName.toUpperCase()=="TABLE")&&
             (tmpEl.border)&&(tmpEl.border>0)) Pos++;
         tmpEl=tmpEl.offsetParent;
      }
   }else{
      Pos=(xy=="x")?el.x:el.y;
	   
   }
     if (HM_IE&&HM_Mac) {
	   Pos+=(xy=="x")?parseInt(document.body.currentStyle.marginLeft) :
		parseInt(document.body.currentStyle.marginTop);
	   }

   return Pos;
}

function findXY(xory,placename) {
	var thePlacer = HM_DOM ? document.getElementById(placename) : 
				    HM_IE ? document.all(placename) : document.images[placename];
				   
	retVal=getReal(xory,thePlacer);
	return retVal;
}

function sendtofriend()
{
	if (ie||ns6){
	sendobj=document.getElementById? document.getElementById("sendfriend") : document.all.sendfriend

	left1 = findXY('x','topcorner')+240
	if(!ns6)
	top1 = document.body.scrollTop+((screen.height/2)-230)
	else
	top1 = pageYOffset+((screen.height/2)-230)+'px'

	sendobj.style.left = ns6? left1+'px' : left1
	sendobj.style.top = ns6? top1+'px' : top1
	sendobj.style.visibility="visible"

	}

}

function subscribe()
{
	if (ie||ns6){
	newsobj=document.getElementById? document.getElementById("news") : document.all.news

	left1 = findXY('x','topcorner')+390
	top1 = findXY('y','subs')-110

	/*if(!ns6)
	top1 = document.body.scrollTop+((screen.height/2)-230)
	else
	top1 = pageYOffset+((screen.height/2)-230)+'px'*/

	newsobj.style.left = ns6? left1+'px' : left1
	newsobj.style.top = ns6? top1+'px' : top1
	newsobj.style.visibility="visible"
	document.frmSubscribe.txtEmail.focus();

	}

}

function alertbox()
{
	if (ie||ns6)
	{

	alertobj=document.getElementById? document.getElementById("alert") : document.all.alert

	left1 = findXY('x','topcorner')+395
	top1 = findXY('y','topcorner')+100
	/*if(!ns6)
	top1 = document.body.scrollTop+((screen.height/2)-230)
	else
	top1 = pageYOffset+((screen.height/2)-230)+'px'*/

	alertobj.style.left = ns6? left1+'px' : left1
	alertobj.style.top = ns6? top1+'px' : top1
	alertobj.style.visibility="visible"	
		document.frmLogin1.txtUsername.focus();
	}
}

function openupload()
{
	if (ie||ns6){
	uploadobj=document.getElementById? document.getElementById("uploadphoto") : document.all.uploadphoto

	left1 = findXY('x','topcorner')+300
	top1 = findXY('y','topcorner')+620

	uploadobj.style.left = ns6? left1+'px' : left1
	uploadobj.style.top = ns6? top1+'px' : top1
	uploadobj.style.visibility="visible"

	}
}

function closeupload()
{
	if (ie||ns6)
	uploadobj.style.visibility="hidden"
}

function closesubscribe()
{
	if (ie||ns6){
	newsobj.style.visibility="hidden"
	}
}

function closealert()
{
	if (ie||ns6){
	alertobj.style.visibility="hidden"
	}
}


function closesendfriend()
{
	if (ie||ns6){
	sendobj=document.getElementById? document.getElementById("sendfriend") : document.all.sendfriend
	sendobj.style.visibility="hidden"

	}

}

function setloginsign()
{
	if (ie||ns6){

	loginpgobj=document.getElementById? document.getElementById("loginpg") : document.all.loginpg
	forgotpgobj=document.getElementById? document.getElementById("forgotpg") : document.all.forgotpg
	signupobj=document.getElementById? document.getElementById("signuppg") : document.all.signuppg
	left1=findXY('x','topcorner')+498
	top1=findXY('y','topcorner')
		
	loginpgobj.style.left = ns6? left1+'px' : left1
	loginpgobj.style.top = ns6? top1+'px' : top1

	forgotpgobj.style.left = ns6? left1+'px' : left1
	forgotpgobj.style.top = ns6? top1+'px' : top1

	signupobj.style.left = ns6? left1+'px' : left1
	signupobj.style.top = ns6? top1+'px' : top1

	}

}


setloginsign();

function showpg(whichpg)
{
	loginpgobj=document.getElementById? document.getElementById("loginpg") : document.all.loginpg
	signupobj=document.getElementById? document.getElementById("signuppg") : document.all.signuppg
	forgotobj=document.getElementById? document.getElementById("forgotpg") : document.all.forgotpg


	left1=findXY('x','topcorner')+533
	top1=findXY('y','topcorner')
		
	loginpgobj.style.left = ns6? left1+'px' : left1
	loginpgobj.style.top = ns6? top1+'px' : top1

	forgotobj.style.left = ns6? left1+'px' : left1
	forgotobj.style.top = ns6? top1+'px' : top1

	left1=findXY('x','topcorner')+490

	signupobj.style.left = ns6? left1+'px' : left1
	signupobj.style.top = ns6? top1+'px' : top1

	if(whichpg=='login')
	{
	loginpgobj.style.visibility="visible"
	signupobj.style.visibility="hidden"
	forgotobj.style.visibility="hidden"
	
	}
	else if(whichpg=='signup')
	{
	signupobj.style.visibility="visible"
	loginpgobj.style.visibility="hidden"
	forgotobj.style.visibility="hidden"
	
	}
	else if(whichpg=='forgot')
	{
	forgotobj.style.visibility="visible"
	loginpgobj.style.visibility="hidden"
	signupobj.style.visibility="hidden"
	
	}
		else{
	signupobj.style.visibility="hidden"
	loginpgobj.style.visibility="hidden"
	forgotobj.style.visibility="hidden"
	
	}

}


function showsearch(whichpg)
{
	searchobj=document.getElementById? document.getElementById("searchdiv") : document.all.searchdiv
	if(whichpg=='searchdiv')
	{
	signupobj.style.visibility="hidden"
	loginpgobj.style.visibility="hidden"
	//forgotobj.style.visibility="hidden"
	left1=findXY('x','topcorner')+544
	top1=findXY('y','topcorner')+305
	searchobj.style.left = ns6? left1+'px' : left1
	searchobj.style.top = ns6? top1+'px' : top1
	searchobj.style.visibility="visible"
	}

	else{
	
	searchobj.style.visibility="hidden"
	}
}

function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	//alert(	arrayPageSize)
	return arrayPageSize;
}

var arrayPageSize = getPageSize();

function searchmappos(refId)
{
	fadeobj=document.getElementById? document.getElementById("greylayer") : document.all.greylayer
	fadeobj.style.visibility="visible"
	arrayPageSize = getPageSize();
	fadeobj.style.height=arrayPageSize[1]
	left1=findXY('x','topcorner')
	top1=findXY('y','topcorner')-28

	fadeobj.style.left=ns6? left1+'px' : left1
	fadeobj.style.top=ns6? top1+'px' : top1
	
	if (ie||ns6){
	ifrmobj=document.getElementById? document.getElementById("diviframe") : document.all.diviframe

	
	left1 = (screen.width/2)-320
	if(!ns6)
	top1 = document.body.scrollTop+(arrayPageSize[3]-400)
	else
	top1 = pageYOffset+(arrayPageSize[3]-400)

	ifrmobj.style.top= ns6? top1+'px' : top1
	ifrmobj.style.left= ns6? left1+'px' : left1

	ifrmobj.style.visibility="visible"

	fadeobj.onclick = function() {
	fadeobj.style.height=10
	fadeobj.style.visibility="hidden"
	
	ifrmobj.style.visibility="hidden"
	ifrmobj.style.top=ns6? 0+'px' : 0
	}

	ifrmobj.innerHTML ='<table width="477" border="0" cellpadding="0" cellspacing="0">  <tr><td><img src="images/detailcorner.gif"  width="42" height="28" align="absmiddle"></td>    <td width="370" bgcolor="#2f79b6" class="white">Property Details</td>    <td><img src="images/closedetail.gif" width="65" height="28" border="0" usemap="#Map"></td>  </tr></table><map name="Map">  <area shape="rect" coords="2,4,51,24" href="javascript:parent.closesearchmap()" alt="Close"></map><iframe name="ifrm" id="ifrm" width="477" height="341" scrolling="yes" frameborder="0">Sorry, your browser doesnt support iframes.</iframe>'
//<table  border="0" cellpadding="0" cellspacing="0"><tr><td bgcolor="#000000" ><img src="images/spacer.gif"  width="1" height="2" ></td> <td bgcolor="#e6e6e6" ><img src="images/spacer.gif"  width="460" height="2" ></td>  </tr><tr><td colspan="2" bgcolor="#000000"><img src="images/spacer.gif"  width="1" height="1" ></td>  </tr></table>
document.getElementById("ifrm").src='propertyDetails.asp?RefId=' + refId;
	}
}

function fnContactAgent(refId)
{
	fadeobj=document.getElementById? document.getElementById("greylayer") : document.all.greylayer
	fadeobj.style.visibility="visible"
	arrayPageSize = getPageSize();
	fadeobj.style.height=arrayPageSize[1]
	left1=findXY('x','topcorner')
	top1=findXY('y','topcorner')-28

	fadeobj.style.left=ns6? left1+'px' : left1
	fadeobj.style.top=ns6? top1+'px' : top1
	
	if (ie||ns6){
	ifrmobj=document.getElementById? document.getElementById("diviframe") : document.all.diviframe

	
	left1 = (screen.width/2)-320
	if(!ns6)
	top1 = document.body.scrollTop+(arrayPageSize[3]-400)
	else
	top1 = pageYOffset+(arrayPageSize[3]-400)

	ifrmobj.style.top= ns6? top1+'px' : top1
	ifrmobj.style.left= ns6? left1+'px' : left1

	ifrmobj.style.visibility="visible"

	fadeobj.onclick = function() {
	fadeobj.style.height=10
	fadeobj.style.visibility="hidden"
	
	ifrmobj.style.visibility="hidden"
	ifrmobj.style.top=ns6? 0+'px' : 0
	}

	ifrmobj.innerHTML ='<table width="477" border="0" cellpadding="0" cellspacing="0">  <tr><td><img src="images/detailcorner.gif"  width="42" height="28" align="absmiddle"></td>    <td width="370" bgcolor="#2f79b6" class="white">Property Details</td>    <td><img src="images/closedetail.gif" width="65" height="28" border="0" usemap="#Map"></td>  </tr></table><map name="Map">  <area shape="rect" coords="2,4,51,24" href="javascript:parent.closesearchmap()" alt="Close"></map><iframe name="ifrm" id="ifrm" width="477" height="341" scrolling="yes" frameborder="0">Sorry, your browser doesnt support iframes.</iframe>'
	document.getElementById("ifrm").src='ContactAgent.asp?RefId=' + refId;
	}
}

function fnContactAgent1(refId)
{
	fadeobj=document.getElementById? document.getElementById("greylayer") : document.all.greylayer
	fadeobj.style.visibility="visible"
	arrayPageSize = getPageSize();
	fadeobj.style.height=arrayPageSize[1]
	left1=findXY('x','topcorner')
	top1=findXY('y','topcorner')-28

	fadeobj.style.left=ns6? left1+'px' : left1
	fadeobj.style.top=ns6? top1+'px' : top1
	
	if (ie||ns6){
	ifrmobj=document.getElementById? document.getElementById("diviframe") : document.all.diviframe

	
	left1 = (screen.width/2)-320
	if(!ns6)
	top1 = document.body.scrollTop+(arrayPageSize[3]-400)
	else
	top1 = pageYOffset+(arrayPageSize[3]-400)

	ifrmobj.style.top= ns6? top1+'px' : top1
	ifrmobj.style.left= ns6? left1+'px' : left1

	ifrmobj.style.visibility="visible"

	fadeobj.onclick = function() {
	fadeobj.style.height=10
	fadeobj.style.visibility="hidden"
	
	ifrmobj.style.visibility="hidden"
	ifrmobj.style.top=ns6? 0+'px' : 0
	}

	ifrmobj.innerHTML ='<table width="477" border="0" cellpadding="0" cellspacing="0">  <tr><td><img src="images/detailcorner.gif"  width="42" height="28" align="absmiddle"></td>    <td width="370" bgcolor="#2f79b6" class="white">Property Details</td>    <td><img src="images/closedetail.gif" width="65" height="28" border="0" usemap="#Map"></td>  </tr></table><map name="Map">  <area shape="rect" coords="2,4,51,24" href="javascript:parent.closesearchmap()" alt="Close"></map><iframe name="ifrm" id="ifrm" width="477" height="341" scrolling="yes" frameborder="0">Sorry, your browser doesnt support iframes.</iframe>'
	document.getElementById("ifrm").src='ContactAgent1.asp?RefId=' + refId;
	}
}


function fnPropertyEdit(refId)
{
	if (ie||ns6)
	{
		fadeobj=document.getElementById? document.getElementById("greylayer") : document.all.greylayer
		ifrmobj=document.getElementById? document.getElementById("editFrame") : document.all.editFrame
		fadeobj.style.visibility="visible"
	arrayPageSize = getPageSize();
	fadeobj.style.height=arrayPageSize[1]
	left1=findXY('x','topcorner')
	top1=findXY('y','topcorner')-28

	fadeobj.style.left=ns6? left1+'px' : left1
	fadeobj.style.top=ns6? top1+'px' : top1
		left1 = (screen.width/2)-320
		if(!ns6)
		top1 = document.body.scrollTop+(arrayPageSize[3]-400)
		else
		top1 = pageYOffset+(arrayPageSize[3]-400)

		ifrmobj.style.top = top1
		ifrmobj.style.left = left1
		ifrmobj.style.visibility="visible"
		//}
		ifrmobj.innerHTML ='<table width="477" border="0" cellpadding="0" cellspacing="0"><tr><td><img src="images/detailcorner.gif"  width="42" height="28" align="absmiddle"></td>    <td width="370" bgcolor="#2f79b6" class="white">Edit Property</td>    <td><img src="images/closedetail.gif" width="65" height="28" border="0" usemap="#Map"></td>  </tr></table><map name="Map">  <area shape="rect" coords="2,4,51,24" href="javascript:parent.closesearchmap()" alt="Close"></map><iframe name="editFrm" id="editFrm" width="477" height="341" scrolling="yes" frameborder="0">Sorry, your browser doesnt support iframes.</iframe>'
		document.getElementById("editFrm").src='propertyEdit.asp?RefId=' + refId;
	}
}

function closesearchmap()
{	
	fadeobj.style.height=10
	fadeobj.style.visibility="hidden"
	ifrmobj.style.top=ns6? 0+'px' : 0
	ifrmobj.style.visibility="hidden"
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function scrollfn()
{
	fadeobj=document.getElementById? document.getElementById("greylayer") : document.all.greylayer
	arrayPageSize = getPageSize();
	if(fadeobj.style.visibility=="visible")
	{
	left1 = (screen.width/2)-320
	if(!ns6)
	top1 = document.body.scrollTop+(arrayPageSize[3]-400)
	else
	top1 = pageYOffset+(arrayPageSize[3]-400)
//alert(ifrmobj.name)
	ifrmobj.style.top= ns6? top1+'px' : top1
	ifrmobj.style.left= ns6? left1+'px' : left1
	}

}


function opendev()
{


}

window.onscroll=scrollfn