function Is4() {
         if (parseInt(navigator.appVersion) >= 4) {
             return(true)
         } else {
             return(false)
         }
}

function GetScreenWidth() {
         if (Is4()) {
             return(screen.width)
         } else {
             return("")
         }
}

function GetScreenHeight() {
         if (Is4()) {
             return(screen.height)
         } else {
             return("")
         }
}

function GetColorDepth() {
	// 256 - 8
	// 16 bit - 14
	// 24
         if (Is4()) {
             return(screen.colorDepth)
         } else {
             return("")
         }
}

function GetConnectionType() {
    var ret = ""
    if (navigator.appName == "Microsoft Internet Explorer") {
        ret = oClientCaps.connectionType
    }

    if (ret == "") {
        ret = ""
    }
    return(ret)
}

function GetDateTimeStamp() {
	var dt = new Date()
	var adjYear = dt.getYear()
	if(dt.getYear().toString().length == 3) { adjYear = dt.getYear() + 1900 }
	//alert(adjYear)
	var rtrn = dt.getMonth()+1  +"/"+ dt.getDate() +"/"+ adjYear +" " //+ dt.getHours() +":"+ dt.getMinutes() +":"+  dt.getSeconds()
	if (dt.getHours() > 12) {
		rtrn += dt.getHours()-12 +":"+ dt.getMinutes() +":"+  dt.getSeconds() + " PM"
	} else {
		rtrn += dt.getHours() +":"+ dt.getMinutes() +":"+  dt.getSeconds() + " AM"
	}
	//alert(rtrn)
	return(escape(rtrn))

}

function setLoadCookie() {
	setPermCookie('dtLoad', GetDateTimeStamp())
	setPermCookie("print",0)

}




function setExitCookie() {
	dt = GetDateTimeStamp();
	setPermCookie('dtExit', dt)
	//alert(dt);
	//alert(document.cookie)
}

function setPrintCookie() {
	var intPrint = parseInt(getCookie("print"))
	if (intPrint == "") {intPrint = 0}
	setPermCookie("print",intPrint += 1)

}

function setLink(url) {
	setPermCookie('dtExit', GetDateTimeStamp())
	document.location.href = url
}

function linkOver(url) {
	window.status = window.location.protocol + "//" + window.location.hostname + url
	return true;
}

// Popup window
var popupwin = null;
function popup(url,props) {
	if (!props) props = "width=575,height=280,scrollbars=no,resizable=no,menubar=no,statusbar=no";
	popupwin = window.open(url,"popupwin",props);
	return false;
}



// SETUP OUR ONLOAD AND ONEXIT FUNCTIONS
//window.onload = setLoadCookie

if (Is4() && navigator.appName == "Microsoft Internet Explorer") {
	window.onbeforeunload = setExitCookie
} else {
	window.onunload = setExitCookie
}
if (parseInt(navigator.appVersion) >= 4 && navigator.appName == "Microsoft Internet Explorer") {
	window.onafterprint = setPrintCookie;
}


