function winPrint() {
	window.print();
}

loaded = 0;
function loadimages() {
	if (document.images) {

	home_on = new Image;
	home_on.src = "/images/btn_home_on.gif";
	home_off = new Image;
	home_off.src = "/images/btn_home_off.gif";
	HomeSearch_on = new Image;
	HomeSearch_on.src = "/images/btn_HomeSearch_on.gif";
	HomeSearch_off = new Image;
	HomeSearch_off.src = "/images/btn_HomeSearch_off.gif";
	Relocate_on = new Image;
	Relocate_on.src = "/images/btn_Relocate_on.gif";
	Relocate_off = new Image;
	Relocate_off.src = "/images/btn_Relocate_off.gif";
	ConsumerInfo_on = new Image;
	ConsumerInfo_on.src = "/images/btn_ConsumerInfo_on.gif";
	ConsumerInfo_off = new Image;
	ConsumerInfo_off.src = "/images/btn_ConsumerInfo_off.gif";
	OurOffice_on = new Image;
	OurOffice_on.src = "/images/btn_OurOffice_on.gif";
	OurOffice_off = new Image;
	OurOffice_off.src = "/images/btn_OurOffice_off.gif";
	ContactUs_on = new Image;
	ContactUs_on.src = "/images/btn_ContactUs_on.gif";
	ContactUs_off = new Image;
	ContactUs_off.src = "/images/btn_ContactUs_off.gif";

	loaded = 1	 
	}
}

loadimages();
timerID = null	 
function on_img(imagename) {
	if (document.images && loaded == 1) {
		if (timerID) {
			clearTimeout(timerID);
		}
	if (document.images) {
		document.images[imagename].src = eval(imagename + '_on.src');
		}
	}
}
function off_img(imagename) {
	if (document.images && loaded == 1) {
		if (document.images) {
			document.images[imagename].src = eval(imagename + '_off.src');
		}
	}
}

function viewLg_img(imgname, imgFilename) {
	if (document.images) {
		document.images[imgname].src = eval(imgFilename + '_lg.src');
	}
}

function launchRemote(url) {
	remote = window.open(url,"remoteWin","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=0,resizable=0,width=405,height=350");		   
	remote.location.href = url;
    if (remote.opener == null) remote.opener = window; 
	remote.opener.name = "opener";
}

function launchVtour(url) {
	remote = window.open(url,"vtourWin","toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=0,resizable=0,width=405,height=400");		   
	remote.location.href = url;
    if (remote.opener == null) remote.opener = window; 
	remote.opener.name = "opener";
}

function launchFullPgView(url) {
	remote = window.open(url,"fullPgViewWin","toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=1015,height=550");
	remote.location.href = url;
    if (remote.opener == null) remote.opener = window; 
	remote.opener.name = "opener";
}

var winopts = "toolbar=no,location=0,directories=0,status=yes,menubar=yes,scrollbars=no,resizable=no,height=350,width=510,copyhistory=0,"
var smallwindow = null;
function setEvent() {
	return false;
}
function WindowFocus() {
   if( navigator.appVersion.indexOf("2.") == -1 &&
      navigator.appVersion.indexOf("MSIE") == -1 )
	smallwindow.focus();
}
function historywin(filename) {
	fileURL = filename;
	if (parseInt(navigator.appVersion) < 4) {
		if (smallwindow != null) smallwindow.close();
	}  
	timerID = setTimeout('Opener(fileURL)', 200);
}
function Opener(winname) {
	filename = winname;
	winname = "historywin"
	smallwindow = window.open(filename,winname,winopts)
	if (navigator.appVersion.indexOf("(X11") != -1 || navigator.appVersion.indexOf("(Mac") != -1)
		smallwindow = window.open(filename,winname,winopts)
	if (navigator.appVersion.indexOf("MSIE") == -1 )
		smallwindow.mainWin = this;
		WindowFocus();
}

// MLS Search function... this one displays or hides price criteria on search form
function changeDisplay(theChecked,theWhat) {
	var theNode;
	var theDisplay;
	/* alert("in changeDisplay. theWhat=" + theWhat + " theChecked = " + theChecked);  */
	if (theChecked == true)
		theDisplay = "";
	else
		theDisplay = "none";
	for (var i=1;;i++) {
		// Check if the getElementById method is available
		if (document.getElementById) {
			theNode = document.getElementById(theWhat + i);
			/* alert(theNode); */
			if (theNode == null) {
				return;
			}
		} else if (document.all) {
			// The alert lets me verify that I tested the path.
			alert("Running an older version of IE." + " May not be able to hide rows");
			theNode = document.all[theWhat + i];
			if (theNode == null){
				return;
			}
		} else {
			alert("Cannot change visibility of the display element." + " Was " + theWhat);
			return;
		}
		theNode.style.display = theDisplay;
	}
}
function hidePriceRangeRes(all) {
	var all = ["priceRangeRes"];
	for (var i = 0; i < all.length; i++) {
		changeDisplay(false, all[i]);
	}
}
function hidePriceRangeRnt(all) {
	var all = ["priceRangeRnt"];
	for (var i = 0; i < all.length; i++) {
		changeDisplay(false, all[i]);
	}
}
function priceRangeSelect() {
	formStr = document.searchForm.propType;
	formSelInd = formStr.selectedIndex;
	propTypeVal = formStr.options[formSelInd].value;
	// alert("Selected: " + propTypeVal);
	if (propTypeVal == "RNT") {
		show = ["priceRangeRnt"];
		hide = ["priceRangeRes"];
	} else {
		show = ["priceRangeRes"];
		hide = ["priceRangeRnt"];
	}
	for (var i = 0; i < show.length; i++) {
		changeDisplay(true, show[i]);
	}
	for (var i = 0; i < hide.length; i++) {
		changeDisplay(false, hide[i]);
	}
}