<!--
var arrTemp = self.location.href.split("?"); 
var picUrl = (arrTemp.length>0)?arrTemp[1]:""; 
var NS = (navigator.appName=="Netscape")?true:false;

function FitPic() { 
	iWidth = (NS)?window.innerWidth:document.body.clientWidth;
	iHeight = (NS)?window.innerHeight:document.body.clientHeight;
	iWidth = document.images[0].width - iWidth;
	iHeight = document.images[0].height - iHeight;
	window.resizeBy(iWidth, iHeight);
	//window.moveTo((screen.width / 2) - (document.images[0].width / 2), (screen.height / 2) - (document.images[0].height / 2));
	self.focus();
 }

function PopupPic(sPicURL) {
	var winProp = 'width=50,height=50,left=200,top=200,scrollbars=0,resizable=1,menubar=no';
	window.open("Popup.asp?"+sPicURL, "", winProp);
}

function Popup(sURL,sName,sWidth,sHeight) {
	var winProp = 'width=' + sWidth + ',height=' + sHeight + ',scrollbars=0,resizable=1,menubar=no';
	window.open(sURL, sName, winProp);
}

function MoveCenter() {
	if (navigator.appName.indexOf("Microsoft")!= -1) {
		winW = document.body.offsetWidth;
		winH = document.body.offsetHeight;
	} else {
		winW = window.innerWidth;
		winH = window.innerHeight;
	}
	
	window.moveTo((screen.width / 2) - (winW / 2), (screen.height / 2) - (winH / 2));
}

var vphone = /^\D*([1-9]\d{2})\D*(\d{3})\D*(\d{4})\D*$/

function FormatPhone(x){
	if (x.value != 0){
		if(vphone.test(x.value)){
			x.value=x.value.replace(vphone,'($1) $2-$3');
		}
		else {
			alert('Invalid phone number!');
		}
	}
}

// SwapButton is called from the WebMenu OnShow and OnHide events
// state is "on" or "off" and id is the WM.Group ID property
function SwapButton(id, state) {
	if(state == "on")
		eval(id + ".src='Images/nav_" + id + "_on_01.gif'");
	else if(state == "off")
		eval(id + ".src='Images/nav_" + id + "_01.gif'");
}

function makeClickableLabels() {
	if ((!document.body.children) || 
	(typeof window.opera != "undefined") ||
	(navigator.appVersion.indexOf("Mac") != -1)) return;
	
	var labels = document.getElementsByTagName("label"); 
	var len = labels.length;
	for (var i=0;  i<len;  i++)
	{
		if (labels[i].className.indexOf("clickable") != -1)
		{
			labels[i].onclick = function() {this.children[0].click(); }
			labels[i].setAttribute("unselectable","on"); //aesthetic improvement for IE
		}
	}
}

window.onload = function() {
	makeClickableLabels();
}

// function that sets focus to the first form element
function PlaceFocus() {
	if (document.forms.length > 0) {
		var field = document.forms[0];

		for (i = 0; i < field.length; i++) {
			if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s") && (field.elements[i].disabled != true)) {
				document.forms[0].elements[i].focus();
				break;
			}
		}
	}
}

//function that shows or hides a layer
function ShowHideLayer(lay) {
    var elem = document.getElementById(lay);

	if (elem.style.display == "") {
		elem.style.display = "none";
	} else {
		elem.style.display = "";
	}
}
// -->