CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { return CSFindElement(s,0); }
function CSFindElement(n,ly) { if (CSBVers < 4) return document[n];
var curDoc = ly ? ly.document : document; var elem = curDoc[n];
if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {
elem = CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
return elem;
}

function CSURLPopupShow(formName, popupName, target) {
	var form  = CSFindElement(formName);
	var popup = form.elements[popupName];
	window.open(popup.options[popup.selectedIndex].value, target);
}

function nothing() {
}

function help() {
	helpwin=window.open("help.html","","toolbar=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,location=no,width=250,height=350");
	helpwin.moveTo(10,10);
}

function printable(url) {
	printablewin=window.open(url,"","toolbar=yes,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,location=no,width=550,height=600");
	printablewin.moveTo(10,10);
}

function clipboard (url) {
	clip=window.open(url,"","toolbar=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,location=no,width=300,height=150");
	clip.moveTo((screen.availWidth - 300) / 2,(screen.availHeight - 150) / 2);
}

function hires (url,width,height) {
	window.open(url,"","toolbar=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,location=no,width=" + width + ",height=" + height);
}

function addToFavorites() {
	if (window.external) {
  		window.external.AddFavorite(location.href, document.title);
  	}
}

function floorplan(url) {
	var floorplan;
	
	if(!floorplan) {
		floorplan=window.open(url,"","toolbar=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,location=no,width=1000,height=620");
		floorplan.moveTo((screen.availWidth - 1000) / 2,(screen.availHeight - 620) / 2);
	}
}

function objectByID(id) {
	if (document.getElementById)
		var returnVar = document.getElementById(id);
	else if (document.all)
		var returnVar = document.all[id];
	return returnVar;
}

function toggleVisible(id) {
	var obj = objectByID(id);
	if(obj.style.display == "none") {
		obj.style.display = "block";
	} else {
		obj.style.display = "none";
	}
}

function onNewsletterFieldFocus(defaultText) {
	var field = objectByID('newsletter.email.field');
	if(field.value == defaultText) {
		field.value = "";
		field.style.color = "black";
	}
}

function onNewsletterFieldBlur(defaultText) {
	var field = objectByID('newsletter.email.field');
	if(field.value == "") {
		field.value = defaultText;
		field.style.color = "#808080";
	}
}

function onSearchFieldFocus(defaultText) {
	var field = objectByID('search.field');
	if(field.value == defaultText) {
		field.value = "";
		field.style.color = "black";
		field.style.fontWeight = "bold";
	}
}

function onSearchFieldBlur(defaultText) {
	var field = objectByID('search.field');
	if(field.value == "") {
		field.style.color = "#808080";
		field.style.fontWeight = "normal";
		field.value = defaultText;
	}
}