var browser_name = navigator.appName;


var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
	if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes";
	win=window.open(mypage,myname,settings);
	win.focus();
}

 /////////////////////////////////////////
 //FORMS/AUTOTAB: Auto Tab with phone numbers
 /////////////////////////////////////////
 var isNN = (navigator.appName.indexOf("Netscape")!=-1);
 function autoTab(input,len, e) {
 var keyCode = (isNN) ? e.which : e.keyCode;
 var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
 if(input.value.length >= len && !containsElement(filter,keyCode)) {
 input.value = input.value.slice(0, len);
 input.form[(getIndex(input)+1) % input.form.length].focus();
 }
 function containsElement(arr, ele) {
 var found = false, index = 0;
 while(!found && index < arr.length)
 if(arr[index] == ele)
 found = true;
 else
 index++;
 return found;
 }
 function getIndex(input) {
 var index = -1, i = 0, found = false;
 while (i < input.form.length && index == -1)
 if (input.form[i] == input)index = i;
 else i++;
 return index;
 }
 return true;
}

///////////////////////////////////////////
//NAVIGATION: rolls
///////////////////////////////////////////
/*
Author: Michele
Date: 01/24/2005 
Description: navigation rollovers
*/
if (document.images) {
	var emb1 = new Image();
	emb1.src = "images/propertymanagersoff.gif";
	var emb2 = new Image();
	emb2.src = "images/commercialbuildersoff.gif";
	var emb3 = new Image();
	emb3.src = "images/fadeoff.gif";
	var emb3a = new Image();
	emb3a.src = "images/fadeoff.gif";
	var emb4 = new Image();
	emb4.src = "images/mainphoto.jpg";
	
	

function img_act(imgName) {
	if (document.images) {
		document.images[imgName].src = eval(imgName + "aon.src");
		document.images[imgName].src = eval(imgName + "bon.src");
	}
}

function img_inact(imgName) {
	if (document.images) {
		document.images[imgName].src = eval(imgName + "off.src");
		document.images[imgName].src = eval(imgName + "off.src");
	}
}

}

function showDiv(layer) {
  	elem = document.getElementById(layer);
  	elem.style.display = "block";
}
function hideDiv(layer) {
  	elem = document.getElementById(layer);
  	elem.style.display = "none";
}




