<!--
// STATUS
function setStatus(text){
	window.status = text;
}
// CURSOR
function cursor(elementID, cursorType){
	if (cursorType == 'hand'){
		if (is_ie){
			eval(elementID).style.cursor = 'hand';
		}else{
			document.getElementById(elementID).style.cursor = 'pointer';
		}
	}
}
//SHIFT KEY EDIT DETECTION (IE ONLY)
var shiftKey = false;
function setShiftKey(id) {
	shiftKey = false;
	if (navigator.appName == 'Microsoft Internet Explorer' && window.event.shiftKey && (event.button == 1)) {
		shiftKey = true;
	}
}
// CHECKS URL VARIABLES
function QSHandler() {
	var qs = location.search.substr(1).split("&");
	this.data = [];
	for(var i = 0; i < qs.length; i++) this.data[qs[i].split("=")[0]] = qs[i].split("=")[1];

	this.QueryString = function(x) {
		return this.data[x];
	}
}
// VISIT, GO, EDIT
function go(newURL) {
	if (newURL != ""){
		//location.href = websawPath + newURL;
		href = "http://" + serverName + websawPath + newURL;
		//alert("go: " + href);
		location.href = href;
	}
}

function popup(newURL, context, options) {
	var websawPath;
	if (context == "wscomm"){
		websawPath = siteRoot + "/comm";
	}else if (context == "wsglobal"){
		websawPath = siteRoot + "/adt";
	}else if (context == "wssmbiz"){
		websawPath = siteRoot + "/smbiz";
	}else if (context == "wsgov"){
		websawPath = siteRoot + "/gov";
	}else if (context == "wsresi"){
		websawPath = siteRoot + "/resi";
	}
	
	

	return void window.open(websawPath + newURL, '', options);
}

function sGo(newURL) {
	if(newURL != "") {
		href = "https://" + serverName + websawPath + newURL;
		location.href = href;
	}
}

function visit(newURL) {
	if (newURL != ""){
		//location.href = newURL;
		href = "http://" + serverName + newURL;
		//alert("visit: " + href);
		location.href = href;
	}
}


function sVisit(newURL) {
	if (newURL != ""){
		//location.href = newURL;
		href = "https://" + serverName + newURL;
		//alert("visit: " + href);
		location.href = href;
	}
}

function editText(){
	location.href = siteRoot + "/admin/editText.jsp?file=" + fileName + "&lastpage=" + escape(location.href) + "&classname=" + className;
}
function editImage(){
	location.href = siteRoot + "/admin/editImage.jsp?file=" + fileName + "&lastpage=" + escape(location.href) + "&nodeID=" + imageOn + "&context=" + contextPath;
	
}
function editStyle(){
	parent.location.href = siteRoot + "/admin/editStyle.jsp?file=" + className + "&lastpage=" + escape(location.href);
}
function editXMLNode(){
	location.href = siteRoot + "/admin/editXMLNode.jsp?file=" + fileName + "&lastpage=" + escape(location.href) + "&classname=" + className + "&nodeID=" + textOn + "&context=" + contextPath;
}
function editXMLDoc(){
	location.href = siteRoot + "/admin/editXMLDoc.jsp?file=" + fileName + "&lastpage=" + escape(location.href) + "&context=" + contextPath;
}
function editXMLContent(){
	var sURL = location.href + "";
	var check1 = sURL.indexOf("#");
	var check2 = sURL.indexOf("?");

	if (check1 != -1) {
		location.href = sURL.substring(0, check1) + "?edit=true&context=" + contextPath;
	}else if (check2 != -1) {
		var Request = new QSHandler();
		var check3 = Request.QueryString("file");
		if (check3 != null) {
			location.href = sURL.substring(0, check1) + "?edit=true&context=" + contextPath + "&file=" + check3;
		}else{
			alert(check3 + " Since this page is a dynamically generated xml page,\nthe \"Edit Content\" feature has been disabled for now.\nIn the meantime, use the remaining features to make\nany neccessary content changes.");
		}
	}else{
		location.href = location.href + "?edit=true&context=" + contextPath;
	}
}
// POSITION
var tempEl;
function getRealLeft(imgElem){
	if(ns4){
		xPos=imgElem.x;
	}else if(!exclude){
		xPos=eval(imgElem).offsetLeft;
		tempEl=eval(imgElem).offsetParent;
		while(tempEl!=null){
			xPos+=tempEl.offsetLeft;
			tempEl=tempEl.offsetParent;
		}
	}
	if(is_ie && is_mac){
		xPos+=parseInt(document.body.leftMargin);
	}
	return xPos;
};
function getRealTop(imgElem){
	if(ns4){
		yPos=imgElem.y;
	}else if(!exclude){
		yPos=eval(imgElem).offsetTop;
		tempEl=eval(imgElem).offsetParent;
		while(tempEl!=null){
			yPos+=tempEl.offsetTop;
			tempEl=tempEl.offsetParent;
		}
	}
	if(is_ie && is_mac){
		yPos+=parseInt(document.body.topMargin);
	}
	return yPos;
};
// OPEN WINDOW
var newWindow
function openWindow(width, height, url, childName){
	var childFeatures = ""
	childFeatures += "width=" + width + ","
	childFeatures += "height=" + height + ","
	childFeatures += "directories=0,"
	childFeatures += "menubar=0,"
	childFeatures += "resizable=1,"
	childFeatures += "scrollbars=0,"
	childFeatures += "status=0,"
	childFeatures += "toolbar=0,"
	childFeatures += "alwaysLowered=0,"
	childFeatures += "alwaysRaised=0,"
	childFeatures += "channelmode=0,"
	childFeatures += "dependent=1,"
	childFeatures += "fullscreen=0,"
	childFeatures += "hotkeys=1,"
	childFeatures += "location=0,"
	childFeatures += "titlebar=0,"
	childFeatures += "z-lock=0,"
	if (!newWindow || newWindow.closed){
		newWindow = window.open(url, childName, childFeatures)
		if (!newWindow.opener){
			newWindow.opener = window
		}
	}else{
		newWindow = window.open(url, childName, childFeatures)
		newWindow.focus()
	}
	return true
}
function openScrollWindow(width, height, url, childName){
	var childFeatures = ""
	childFeatures += "width=" + width + ","
	childFeatures += "height=" + height + ","
	childFeatures += "directories=0,"
	childFeatures += "menubar=0,"
	childFeatures += "resizable=1,"
	childFeatures += "scrollbars=1,"
	childFeatures += "status=1,"
	childFeatures += "toolbar=0,"
	childFeatures += "alwaysLowered=0,"
	childFeatures += "alwaysRaised=0,"
	childFeatures += "channelmode=0,"
	childFeatures += "dependent=1,"
	childFeatures += "fullscreen=0,"
	childFeatures += "hotkeys=1,"
	childFeatures += "location=0,"
	childFeatures += "titlebar=0,"
	childFeatures += "z-lock=0,"
	if (!newWindow || newWindow.closed){
		newWindow = window.open(url, childName, childFeatures)
		if (!newWindow.opener){
			newWindow.opener = window
		}
	}else{
		newWindow = window.open(url, childName, childFeatures)
		newWindow.focus()
	}
	return true
}
//-->
