window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);

window.defaultStatus = "Syscairn, LLC"

// sets the height of the right and lef columns (div's)
function sizeColumns(){
    var intMinHeight = 400;		//minimum possible height of contaent area
    var intLeftNavConst = 260;			//amount to subtract from the height of the content element (height of left nav and header)
	var intFooterConst = 0;
	var intContentHeight;		//height of content div element
	
	if(IE4){
	    intContentHeight = document.all.divContent.offsetHeight;
		
		if(intContentHeight < intMinHeight){
			intFooterConst = intMinHeight - intContentHeight;
			intContentHeight = intMinHeight;	
		}
		document.all.divLeftCol.style.height = intContentHeight - intLeftNavConst;
        	document.all.divRightCol.style.height = intContentHeight - intLeftNavConst;
		document.all.tblFooter.style.marginTop = intFooterConst;
		//document.all.divFooter.style.top = intContentHeight + intFooterConst;
	}

	if(NS4){
		intContentHeight = document.getElementById("divContent").offsetHeight;
		
		if(intContentHeight < intMinHeight){
			intFooterConst = intMinHeight - intContentHeight;			
			intContentHeight = intMinHeight;
		}
		
		document.getElementById("divLeftCol").style.height = intContentHeight - intLeftNavConst;
		document.getElementById("divRightCol").style.height = intContentHeight - intLeftNavConst;
		document.getElementBy("tblFooter").style.marginTop = intFooterConst;
		//document.getElementById("divFooter").style.top = intContentHeight + intFooterConst;
	}
	
}

function swapImage(imgName,swapSrc) {
	eval("document." + imgName + ".src = \"" + swapSrc + "\"");
}


// POPUPs //

function popUpLink(strID, strType) {
	var strURL = "/link/?ID=" + strID + "&type=" + strType;
	// get center of browser window
	var browserWidth = GetBrowserWidth() / 2
	var browserHeight = (GetBrowserHeight() / 2)-50		//slide the window up just a bit from center
	var objWindow;
	var intWidth = 800;
	var intHeight = 400;
	var strWindowName = "";
	
	objWindow = window.open(strURL, strWindowName, 'channelmode=0,dependent=0,directories=0,fullscreen=0,location=1,menubar=1,resizable=1,scrollbars=1,status=1,toolbar=1, width=' + intWidth + ',height=' + intHeight + ',top=' + (window.screenTop + (browserHeight - (intHeight/2))) + ',left=' + (window.screenLeft + (browserWidth - (intWidth/2))))     	
	//objWindow.focus()
		
	if (objWindow.opener == null) {
		objWindow.opener = self;
	}
	objWindow.focus();
		
	if (typeof(strWindowName) != "undefined") {
		objWindow.focus();
	}
	
}




function popUpCenter(strURL, strWindowName, intWidth, intHeight) {
	// get center of browser window
	var browserWidth = GetBrowserWidth() / 2
	var browserHeight = (GetBrowserHeight() / 2)-50		//slide the window up just a bit from center
	var objWindow;
	
	objWindow = window.open(strURL, strWindowName, 'channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0, width=' + intWidth + ',height=' + intHeight + ',top=' + (window.screenTop + (browserHeight - (intHeight/2))) + ',left=' + (window.screenLeft + (browserWidth - (intWidth/2))))     	
	//objWindow.focus()
		
	if (objWindow.opener == null) {
		objWindow.opener = self;
	}
	objWindow.focus();
		
	if (typeof(strWindowName) != "undefined") {
		objWindow.focus();
	}
}

// utils

function GetBrowserWidth() {
	if (navigator.userAgent.indexOf("MSIE") > 0){
		return(document.body.clientWidth);
	}
	else {
		return window.outerWidth;
	}
}

function GetBrowserHeight() {
	if (navigator.userAgent.indexOf("MSIE") > 0) {
		return(document.body.clientHeight);
	} 
	else {
		return(window.outerHeight);
	}
}

function ClosePopUp(){
	self.close();
	window.opener.focus();
}