var sessionid = null; var timeleft = null; var export_window = null; var timeoutwarnwindow = null;
var IE = 0; var IE7 = 0;  var IE6 = 0; var NN = 0; var FF = 0; var SF = 0; var MAC = 0;
var click = false; var wopener = window.opener; var backurl = "#"; browserDetect();
document.oncontextmenu = function () { return false }; if (FF && !MAC) addEvent(document,'keypress',FFkeypress,true);
if (NN && !MAC) addEvent(document,'keypress',FFkeypress,true); if (IE && !MAC) addEvent(document,'keydown', IEkeydown,true);
if (!IE) addEvent(document,'click',clicked,true);  var disappeardelay=200;   var enableanchorlink=0; 
var hidemenu_onclick=1;  var towindow = 0; var count = 15 * 60;  var count2 = 5 * 60; 
var countinterval = 100;  var ticklimit = 10;  var tick = 0; var defaultww; var defaultwh;
if (screen.availWidth >= 1024 && screen.availHeight >= 768) {defaultww = 1010, defaultwh = 760;}
else {defaultww = 790, defaultwh = 530;}; function bodyload () { initEnableInput();
placeFocus(); var cookie = GetCookie("style"); var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title); if (window.name == 'main' + sessionid) { window.setInterval('countdown()',countinterval);
} else if (window.name == 'help' + sessionid) { window.setInterval('countdownhelp()',countinterval);
} else { if (wopener) { wopener.initEnableInput(); if (wopener.name == 'main' + sessionid) {
wopener.count = count; }; }; window.setInterval('countdownpopup()',countinterval);
}; }; function bodyunload () { initDisableInput(); if (export_window) export_window.close();
if (timeoutwarnwindow) timeoutwarnwindow.close(); }; function setActiveStyleSheet(title) {
var i, a, main; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true; if(a.getAttribute("title") == title) a.disabled = false; SetCookie("style", title);
}; }; }; function getActiveStyleSheet() { var i, a; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
}; return null; }; function getPreferredStyleSheet() { var i, a; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1
&& a.getAttribute("title") ) return a.getAttribute("title"); }; return null; }; function SetCookie(cookieName,cookieValue) {
var today = new Date(); var expire = new Date(); expire.setTime(today.getTime() + 3600000*24*3000);
document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
}; function GetCookie(cookieName) { var theCookie=""+document.cookie; var ind=theCookie.indexOf(cookieName);
if (ind==-1 || cookieName=="") return "";  var ind1=theCookie.indexOf(';',ind); if (ind1==-1) ind1=theCookie.length; 
return unescape(theCookie.substring(ind+cookieName.length+1,ind1)); }; function countdown() {
if (pdevelop == 0) { if (towindow == 1) { if (timeoutwarnwindow.closed){ count = 15 * 60;
count2 = 5 * 60; towindow = 0; }; }; tick++; if (tick == ticklimit) { tick = 0; count--;
var mins = Math.floor(count/60); var secs = count - mins * 60; if (secs < 10) secs = '0' + secs;
var timeleft = document.getElementById('timeleft'); if (timeleft) { timeleft.lastChild.nodeValue = mins + ':' + secs;
}; if (count>0){ if ((count == 300) || (count == 150) || (count ==60)) { popup('timeoutwarn.asp?seconds='+count, 'timeoutwarn' + sessionid, windowfeatures(400,100,0,0),'timeoutwarn.asp');
timeoutwarnwindow = popupwindow; towindow = 1; };  return; }; window.location = 'timeout.asp?Mode='+GetQueryString('MODE');
};  } };  var countlast = -1; function countdownpopup(){ if (wopener) { if (wopener.closed) {
window.opener = top; window.close(); return; }; var s; s = '' + wopener.location;
if (s.indexOf('timeout.asp') != -1) { window.opener = top; window.close(); return;
}; var count = wopener.count; if (count != countlast) { countlast = count; var mins = Math.floor(count/60);
var secs = count - mins * 60; if (secs < 10) secs = '0' + secs; var timeleft = document.getElementById('timeleft');
timeleft.lastChild.nodeValue = mins + ':' + secs; };  };  }; function countdownhelp(){
if (wopener) { if (wopener.closed) { window.opener = top; window.close(); return;
}; var s; s = '' + wopener.location; if (s.indexOf('timeout.asp') != -1) { window.opener = top;
window.close(); return; }; }; }; function addEvent(obj, evType, fn, useCapture) {
if (obj.addEventListener) { obj.addEventListener(evType, fn, useCapture); return true;
}  else if (obj.attachEvent) { var r = obj.attachEvent("on" + evType, fn); return r;
}; }; function removeEvent(obj, evType, fn, useCapture) { if (obj.addEventListener) {
obj.removeEventListener(evType, fn, useCapture); return true; }  else if (obj.attachEvent) {
var r = obj.detachEvent("on" + evType, fn); return r; }; }; function killEvent(evt) {
if (evt.stopPropagation) { evt.stopPropagation(); evt.preventDefault(); } else if (window.event)
evt.keyCode = 0; evt.returnValue = false; return false; }; function clicked(evt) {
if (evt.type == 'click'){ click = true; }; }; function FFkeypress(evt) { var charcode = evt.charCode; 
var keycode = evt.keyCode; var target = evt.target || evt.srcElement; var targettype = target.type;
if (charcode == 0) {  if (keycode >= 112 && keycode <= 135) {  if (evt.altKey && keycode == 115) { 
return;  }; killEvent(evt); }; if (keycode == 93) {  killEvent(evt);  }; if (keycode >= 166 && keycode <= 172) {
alert('Don\'t use these keys!'); window.close(); killEvent(evt); }; if (evt.altKey && keycode == 36) { 
killEvent(evt); }; if ((keycode == 9) || (keycode >= 33 && keycode <= 46)) {  return;
}; if (keycode == 13){  return; }; if (keycode == 8){  if (targettype != "text" && targettype != "textarea" && targettype != "password") { 
killEvent(evt); }; return; }; }; if (keycode == 0){ if (evt.ctrlKey) { if (charcode == 97) return; 
if (charcode == 99) return;  if (charcode == 100) return;  if (charcode == 102) return; 
if (charcode == 112) return;  if (charcode == 118) return;  if (charcode == 120) return; 
if (charcode == 45) return;  if (charcode == 61) return;  killEvent(evt);  }; if ((!evt.altKey) && (!evt.ctrlKey) && (!evt.metaKey)) {
return;  }; }; killEvent(evt); }; function SFkeypress(evt) { var charcode = evt.charCode; 
var keycode = evt.keyCode; var target = evt.target || evt.srcElement; var targettype = target.type;
if (keycode >= 63236 && keycode <= 63259) {  killEvent(evt); }; if (evt.shiftKey && evt.metaKey && keycode == 63273) {
killEvent(evt); }; if (evt.metaKey) { if (keycode == 97) return;  if (keycode == 99) return; 
if (keycode == 100) return;  if (keycode == 102) return;  if (keycode == 112) return; 
if (keycode == 118) return;  if (keycode == 120) return;  if (keycode == 113) return; 
if (keycode == 119) return;  if (keycode == 45) return;  if (keycode == 43) return; 
killEvent(evt);  }; if ((!evt.altKey) && (!evt.ctrlKey) && (!evt.metaKey)) { if (keycode == 8) { 
if (targettype != "text" && targettype != "textarea" && targettype != "password") { 
killEvent(evt); }; return; }; return;  }; killEvent(evt); }; function IEkeydown() {
var keycode = window.event.keyCode; var keymod = 0; if (event.altKey) keymod = keymod | 1;
if (event.ctrlKey) keymod = keymod | 2; if (event.shiftKey) keymod = keymod | 4; if ((keycode == 16) || (keycode == 17) || (keycode == 18)) return;
document.onhelp = function () { return false; }; if ((keymod == 0) || (keymod == 4)) {
if (keycode == 8) {  if (event.srcElement.type != "text" && event.srcElement.type != "textarea" &&
event.srcElement.type != "password") {  event.keyCode = 0; event.returnValue = false;
return false; }; return;  }; if (keycode == 93) {  alert('Application Key Disabled');
event.keyCode = 0; event.returnValue = false; return false; }; if (keycode >= 112 && keycode <= 135) { 
event.keyCode = 0; event.returnValue = false; return false; }; if (keycode >= 166 && keycode <= 172) { 
alert('Don\'t use these keys!'); window.close(); event.keyCode = 0; event.returnValue = false;
event.cancelBubble = true; return false; }; return;  }; if (keymod == 2) { if (keycode == 65) return; 
if (keycode == 67) return;  if (keycode == 68) return;  if (keycode == 70) return; 
if (keycode == 80) return;  if (keycode == 86) return;  if (keycode == 88) return; 
event.keyCode = 0; event.returnValue = false; return false; }; if (event.altKey && keycode == 36) { 
alert('Verboten!'); return false; }; event.keyCode = 0; event.returnValue = false;
return false; }; function initDisableInput () { if (document.layers) { window.captureEvents(Event.CLICK);
window.onclick = killEvent; } else if (document.all && !document.getElementById) document.onclick = killEvent;
else if (document.all) document.attachEvent('onclick', killEvent); else if (document.addEventListener)
document.addEventListener('click', killEvent, true); var i, a; for(i=0; (a = document.getElementsByTagName("button")[i]); i++) {
a.disabled = true; }; var i, a; for(i=0; (a = document.getElementsByTagName("select")[i]); i++) {
a.disabled = true; }; }; function initEnableInput () { if (document.layers) { window.releaseEvents(Event.CLICK);
window.onclick = null; } else if (document.all && !document.getElementById) document.onclick = null;
else if (document.all) document.detachEvent('onclick', killEvent); else if (document.addEventListener)
document.removeEventListener('click', killEvent, true); var i, a; for(i=0; (a = document.getElementsByTagName("button")[i]); i++) {
if (a.className != "disabled") { a.disabled = false; } }; var i, a; for(i=0; (a = document.getElementsByTagName("select")[i]); i++) {
if (a.className != "disabled") { a.disabled = false; }; }; }; function windowfeatures(ww, wh, rs, sb) {
var wtop = 0; var wleft = 0; if (IE && window.event) { wtop = window.screenTop; wleft = window.screenLeft;
wtop = wtop + 20; wleft = wleft + 20; } else if (!IE && click) {  wtop = window.screenY;
wleft = window.screenX; wtop = wtop + 20; wleft = wleft + 20; }   else { wtop = Math.floor((window.screen.availHeight-wh)/2);
wleft = Math.floor((window.screen.availWidth-ww)/2); }; if (typeof(rs) == 'undefined') rs = '1';
if (typeof(sb) == 'undefined') sb = '1'; return 'width='+ww+',height='+wh+',top='+wtop+',left='+wleft+',resizable='+rs+',scrollbars='+sb;
}; var popupwindow; function popup(url, windowname , features, urlphrase) { if (typeof(features) == 'undefined') features = '';
if (features == '') features = windowfeatures(defaultww,defaultwh); if (pdevelop == 1) features = 'menubar=1,toolbar=1,location=1,status=1,' + features;
if (typeof(urlphrase) != 'undefined') { var h = window.open('',windowname,features);
var hurl = h.location.href;  if (hurl.indexOf(urlphrase) != -1) { h.focus();  return false;
}; };  popupwindow = window.open(url, windowname, features); if (!popupwindow || typeof(popupwindow) == "undefined")
{ alert("You must allow popup windows for the Cruncher site. You will need to allow pop-ups, then re-open Cruncher.");
}; return false; }; function GetQueryString(itemname) { var i, itemvaluepair; var querystring = window.location.search.substring(1);
var queryvars = querystring.split("&"); for (i=0; i<queryvars.length; i++) { itemvaluepair = queryvars[i].split("=");
if (itemvaluepair[0] == itemname) { return itemvaluepair[1]; }; };  return ""; };
function timer() { var d = new Date; return d.getTime(); }; function ClipBoard(tdObj,ObjNum) {
if (!document.all) {return; } else { var holdtext = document.all['holdtext' + ObjNum];
holdtext.innerText = tdObj.innerText; Copied = holdtext.createTextRange(); Copied.execCommand("Copy");
} }; function printDoc(){ if(window.print){ window.print(); return } if(MAC){ alert("Your Browser does not support this function. Please press Command+P to print."); return;
} alert("Your Browser does not support this function. Please press Ctrl+P to print.")
}; function browserDetect() { var detect = navigator.userAgent.toLowerCase(); var place,total,thestring;
var version = 0; var ok = 0; if (checkIt('safari')) { if (document.addEventListener && document.getElementById){
SF = 1;  ok = 1;  }; }; if (checkIt('netscape')) { if (document.addEventListener && document.getElementById){
NN = 1;  ok = 1;  }; }; if (checkIt('firefox')) { if (document.addEventListener && document.getElementById){
FF = 1;  ok = 1;  }; }; if (checkIt('msie')) { if (document.all && document.getElementById){
IE = 1; ok = 1;  }; }; if (checkIt('mac')) { MAC = 1; }; function checkIt(string) {
place = detect.indexOf(string) + 1; thestring = string; return place; }; if (ok == 0) { 
document.location.href = "BrowserWarn.asp"; }; }; 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 == "checkbox") || (field.elements[i] == "option") || (field.elements[i].type == "radio")) && (!field.elements[i].disabled)) {
field.elements[i].focus(); break; } } } }; function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop; var parentEl=what.offsetParent;
while (parentEl!=null){ totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent; }; return totaloffset; }; function showhide(obj, e, visible, hidden){
dropmenuobj.style.left=dropmenuobj.style.top=-500; if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") {
obj.visibility=visible; } else if (e.type=="click"){ obj.visibility=hidden; }; };
function iecompattest(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}; function clearbrowseredge(obj, whichedge){ var edgeoffset=0; if (whichedge=="rightedge"){
var windowedge=IE && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth; if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure){
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth; }; } else{ var topedge=IE && !window.opera? iecompattest().scrollTop : window.pageYOffset;
var windowedge=IE && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight; if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ 
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight; if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure){ 
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge; }; }; }; return edgeoffset; };
function dropdownmenu(obj, e, dropmenuID){ if (window.event) event.cancelBubble=true;
else if (e.stopPropagation) e.stopPropagation(); if (typeof dropmenuobj!="undefined") { 
dropmenuobj.style.visibility="hidden"; clearhidemenu(); }; obj.onmouseout=delayhidemenu;
dropmenuobj=document.getElementById(dropmenuID); if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden';};
dropmenuobj.onmouseover=clearhidemenu; dropmenuobj.onmouseout=IE? function(){ dynamichide(event)} : function(event){ dynamichide(event)};
showhide(dropmenuobj.style, e, "visible", "hidden"); dropmenuobj.x=getposOffset(obj, "left");
dropmenuobj.y=getposOffset(obj, "top"); dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px";
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px";
return clickreturnvalue(); }; function clickreturnvalue(){ if (!enableanchorlink) return false;
else return true; }; function contains_ns6(a, b) { while (b.parentNode) if ((b = b.parentNode) == a){
return true; }; return false; }; function dynamichide(e){ if (IE&&!dropmenuobj.contains(e.toElement)){
delayhidemenu(); } else if (!IE&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)){
delayhidemenu(); }; }; function delayhidemenu(){ delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay);
}; function clearhidemenu(){ if (typeof delayhide!="undefined") clearTimeout(delayhide);
};
