// CodeVersion = "$Archive: /CreditWeb_Web/WorkList.asp $ $Revision: 7 $ $Modtime: 10/11/01 1:34p $"

// common page interface
  var NS=(navigator.appName=='Netscape')

  function setScroll() {
		var scrollX = (NS)?self.pageYOffset : document.body.scrollTop;
		document.forms[0].scrollHorizontal.value = scrollX
  }
	
	function onloadScroll() {
		var scrollAmount = document.forms[0].scrollHorizontal.value;
		if(!NS) document.body.scrollTop = scrollAmount;
		if(NS) scrollTo(0,scrollAmount);
  }
  
  
 	function changeBG(strID) {
		var e = document.getElementById(strID);
		if (e.className == "leftNavButtonBackOn") {
			e.className = "leftNavButtonBackOff";
		}
		else {
			e.className = "leftNavButtonBackOn";
		}
	} 
  
// Rollover
function change(name,file) {
  if (document.images)
    eval('document.images["'+name+'"].src="'+file+'"')
}

function action(actionValue){
    //setCursorToWait('theBody')
    setScroll();
    document.forms[0].action.value = actionValue;
		document.forms[0].submit();
  }
   
//change field background when focused on
 function focusField(strId) {
 	e = document.getElementById(strId);
	if (e.className == "fieldsOn") {
		e.className = "fieldsOff";
	}
	else {
		e.className = "fieldsOn";
	}
 }

// Auto Tab for SS number
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !containsElement(filter,keyCode)) {
		input.value = input.value.slice(0, len);
		input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
	var found = false, index = 0;
	while(!found && index < arr.length)
	if(arr[index] == ele)
		found = true;
	else
		index++;
		return found;
}
function getIndex(input) {
	var index = -1, i = 0, found = false;
	while (i < input.form.length && index == -1)
	if (input.form[i] == input)index = i;
	else i++;
	return index;
}
return true;
}

function infoWindow(message,messagetype)   {
  if (messagetype == "error") {
    var fontColor = "red"
  }
  else
  {
    var fontColor = "black"
  }
  var iWindow = window.open('','infowindow','width=300, height=300')
  var theMessageHMTL = "<html>"
  theMessageHMTL += "<head>"
  theMessageHMTL += "<title>help window</title>"
  theMessageHMTL += "</head>"
  theMessageHMTL += "<body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 background='include/images/iwindow_background.gif'>"
  theMessageHMTL += "<table border=0 width=100% height=100%><tr><td align=center>"
  theMessageHMTL += "<font face='verdana' size='1' color='" + fontColor + "'>"
  theMessageHMTL += message
  theMessageHMTL += "</font>"
  theMessageHMTL += "</td></tr></table>"  
  theMessageHMTL += "</body>"
  theMessageHMTL += "</html>"
  iWindow.document.write(theMessageHMTL)
  iWindow.focus()
}


// help window
 function helpWindow(file)
  {
	window.open(file,'helpWindow','location=no, toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500');
  }


// tour window
 function tourWindow(file,winname,features)
  {
	window.open(file,'tourWindow','location=no, toolbar=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=800,height=420');
  }



 
