<!--
function openwin(link){
    win = window.open(link,'info','scrollbars=yes,resizable=yes,width=800,height=600');
    win.focus();
}

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 MM_findObj(n, d) { //v4.01
  var p,i,x;  
  if(!d) d=document; 
  
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
  }

  if(!(x=d[n])&&d.all) x=d.all[n]; 
  
  for (i=0;!x&&i<d.forms.length;i++) 
      x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
      x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); 
  
  return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function showhide(dname, v, oo){
	
  if ((obj=MM_findObj(dname))!=null) { 
    if (v == 'show') {
      if (visobj != null && visobj != obj) {
          visobj.style.visibility = 'hidden';
      }
      visobj = obj;
    }
    
    if (obj.style) { 
        v = (v == 'show') ? 'visible' : (v=='hide') ? 'hidden' : v; 
    }
    obj.style.visibility = v; 
  }

  var divObj = document.getElementsByTagName("div");
  for(var i=0; i < divObj.length; i++)	{
		var id = divObj[i].getAttribute("id");
		//if(id != null && id != '' && id != 'menus' && id != dname && id != 'VideoBox' && id != 'press' && id != 'box')
			//document.getElementById(id).style.visibility = 'hidden';
		if(id != null && id != '' && id != 'menus' && id != dname)
		{
			if(id.indexOf("menu") != -1)
				document.getElementById(id).style.visibility = 'hidden';
		}
  }
  
  var divElement=document.getElementById("menus");
  var menuDivObj = document.getElementById(dname);

  divElement.onmouseout = function(e){if(menuDivObj != null && menuDivObj != '') {menuDivObj.style.visibility = 'hidden';}};
  
  if(menuDivObj != null && menuDivObj != '') {
  	menuDivObj.onmouseover =  function(e){menuDivObj.style.visibility = 'visible';};
  	menuDivObj.onmouseout =  function(e){menuDivObj.style.visibility = 'hidden';};
  }
}

function hidevisobj(){
    if (visobj != null) {
          visobj.style.visibility = 'hidden';
    }
}

visobj = null;


function init() {
    if (INIT != '') {
        eval(INIT);
    }
}

function randimages(url){
    imagesNum = 9;
	
	flag = new Boolean(true);
	imageNo = new Array();
	randVal = Math.floor(Math.random() * imagesNum) + 1;	
	imageNo[0] = randVal;

	while (imageNo.length < 3) {
		randVal = Math.floor(Math.random() * imagesNum) + 1;
		for (i=0; i<imageNo.length; i++) {
			if (randVal == imageNo[i]) {
				flag = false;
			}
		}
		
		if (flag) {
			imageNo[imageNo.length] = randVal;
		}
		flag = true;
	}

	for (i=1; i<=imageNo.length; i++) {
		path = url + '/homes/images/top_photos/top' + imageNo[i-1] + '.jpg';
		eval('image' + i + '.src = "' + path + '"');
	}
}

function priceWin(path) {
    window.open(path,"priceWin","width=" + 370 + ",height=" + 500 + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
}

function opencf(id) {
	if (id == 'HS') {
		url = '<?= $sitemap; ?>';
	} else if (id == 'CF') {		
		url = 'cfeature.php?cfeatureID=<?= $cfeatureID ?>&neighbor=<?= $neighborName; ?>';
    }
    win = window.open(url, 'info', 'scrollbars=yes,resizable=yes,width=800,height=600');
}

function goSearch() {

	var condPrice    = form1.selMarketArea.value;
	var condBedrooms = form1.selBedrooms.value;
	var condLivingsq = form1.selLivingSq.value;
	var search = '';
	
	if (condBedrooms == '' && condLivingsq == '') {
		alert('Please Select Conditions');
		return(0);
	}
	
	if (condPrice != '') {
		search = condPrice + ' ';
	}
	
	if (condBedrooms != '') {
		if (search == '') {
			search = condBedrooms + ' ';
		} else {
			search += 'AND ' + condBedrooms + ' ';
		}
	}
	
	if (condLivingsq != '') {
		if (search == '') {
			search = condLivingsq + ' ';
		} else {
			search += 'AND ' + condLivingsq + ' ';
		}
	}
	
	form1.search.value = search;
	form1.selMarketAreaID.value = form1.selMarketArea.selectedIndex;
	form1.selBedroomsID.value   = form1.selBedrooms.selectedIndex;
	form1.selLivingSqID.value   = form1.selLivingSq.selectedIndex;

 	document.form1.action = 'model_homes.php';
	document.form1.submit();	
}

function openCom(communityName, neighborID) {

	communityName = new String(communityName);
	communityName = communityName.toLowerCase();
	communityName = communityName.replace(' ', '');
	
	if (neighborID == '') {		// Community Top Page
		url = getImageURL(communityName) + 'index.html';
	} else {					// Redirect To Neighbors Top
		url = getImageURL(communityName) + 'application/homes/neighborhood.php?neighborID=' + neighborID;
	}
	
	modwin = window.open(url, 'modwin');
    modwin.focus();
}

function openFloorPlan(communityName, modelNo) {
	openwin(getImageURL(communityName) + 'upload/homeplan.php?link=' + modelNo + '&disp=0');
}

function getImageURL(communityName) {
	communityName = new String(communityName);
	communityName = communityName.toLowerCase();
	communityName = communityName.replace(' ', '');

	url = 'http://' + this.location.hostname + '/' + communityName + '/';
	return(url);
}

//-->
