// -->
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;
function hidelayer(lay) {
if (ie4) {document.all[lay].style.visibility = "hidden";}
if (ns4) {document.layers[lay].visibility = "hide";}
if (ns6) {document.getElementById([lay]).style.display = "none";}
}
function showlayer(lay) {
if (ie4) {document.all[lay].style.visibility = "visible";}
if (ns4) {document.layers[lay].visibility = "show";}
if (ns6) {document.getElementById([lay]).style.display = "block";}
}
function writetolayer(lay,txt) {
if (ie4) {
document.all[lay].innerHTML = txt;
}
if (ns4) {
// doesn't work
//document[lay].document.write(txt);
//document[lay].document.close();
}
if (ns6) {
over = document.getElementById([lay]);
range = document.createRange();
range.setStartBefore(over);
domfrag = range.createContextualFragment(txt);
while (over.hasChildNodes()) {
over.removeChild(over.lastChild);
}
over.appendChild(domfrag);
   }
}

function changeCellColor(cellRef,colorRef){
	if (ie4) {document.all[cellRef].style.backgroundColor = colorRef;}
	if (ns4) {return false;}
	if (ns6) {document.getElementById([cellRef]).style.backgroundColor = colorRef;}
}
function resetCellColor(cellRef){
	if (ie4) {document.all[cellRef].style.backgroundColor = '';}
	if (ns4) {return false;}
	if (ns6) {document.getElementById([cellRef]).style.backgroundColor = '';}
}


function selectBox(element){
	if(element.createTextRange != null){
		txtRange=element.createTextRange();
		formValue=element.value;
		txtRange.select();
	}
}

function clearField(element,defaultValue){
	strValue=element.value;
	if(element && strValue==defaultValue){
		element.value="";
		selectBox(element);
	}else{
		selectBox(element);
	}
}

function popWindowOpener(url,winName,width,height,isScroll){
	var screenW = 0;
	var screenH = 0;
	var scroll = 'scrollbars = yes';
	if(screen.width){
		screenW = screen.width;
		screenH = screen.height;
	}else{
		screenW = 800;
		screenH = 600;
	}
	if(isScroll){
	}else{
		scroll = 'scrollbars = no';
	}
	var boxWidth = width;
	var boxHeight = height;
	// 12 and 52 values are for the bars on the newwindow
	// note: only ie has constant bars, netscape 4+ adds as necc
	var windowLeft = ((screenW - boxWidth)/2-10);
	var windowTop = ((screenH - boxHeight)/2-52);
	window.open(url,winName,'' + scroll + ',resizable=yes,status=no,width=' + width + ',height=' + height + ',left=' + windowLeft + ',top=' + windowTop);
}

function emailAFriend(strPage){
	popWindowOpener('/emailafriend.cfm?emailpage=' + strPage,'emailFriend',340,420,false)
}
//  End -->