<!--
var lastMouseX;
var lastMouseY;
var curPopupWindow = null;
var helpWindow = null;
function setLastMousePosition(e) {
   e = window.event;
   lastMouseX = e.screenX;
   lastMouseY = e.screenY;
}
function openPopup(url, name, pWidth, pHeight, features, snapToLastMousePosition) {
   closePopup();
   if (snapToLastMousePosition) {
      if (lastMouseX - pWidth < 0) {
         lastMouseX = pWidth;
      }
      if (lastMouseY + pHeight > screen.height) {
         lastMouseY -= (lastMouseY + pHeight + 50) - screen.height;
      }
      lastMouseX -= pWidth;
      lastMouseY += 10;
      features += "screenX=" + lastMouseX + ",left=" + lastMouseX + "screenY=" + lastMouseY + ",top=" + lastMouseY;
   }
   curPopupWindow = window.open(url, name, features, false);
}
function closePopup() {
   if (curPopupWindow != null) {
      if (!curPopupWindow.closed) {
         curPopupWindow.close();
      }
      curPopupWindow = null;
   } 
}
// for changing the tabs when clicked.
function changetab(txt)
{
document.getElementById(txt).src="/images/shell/"+txt+"2.JPG"
}
//function openLookup(baseURL,modified,searchParam) {
//if (modified == '1') baseURL = baseURL + searchParam;
//openPopup(baseURL,'','width=350,height=300,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1');
//width=350,height=300,toolbar=no,status=yes,directories=no,menubar=no,resizable=yes,scrollbars=yes
//}
function openLookup(page,horz,vert) {
if (document.all || document.layers || document.getElementById ) {
w = screen.availWidth;
h = screen.availHeight;
}
var leftPos = (w-horz)/2;
var topPos = (h-vert)/2;
OpenWin = window.open(page,'','toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=' + horz + ',height=' + vert + ',top=' + topPos + ',left=' + leftPos );
}
function pick(form,field,val) {
   eval("document."+form+"[\""+field+"\"].value=" + "\""+val+"\"");
   closePopup();
   return false;
}
function openCalendar(url) {
   openPopup(url, 'Calendar', 200,145, 'width=200,height=145,dependent=yes,resizable=yes,toolbar=no,status=no,menubar=no', true);
}
function lookupPick(form, field, id, text) {
   eval("document." + form + "[\""+field+"\"].value=" + "\""+id+"\"");
   eval("document." + form + "[\""+field+"_text\"].value=" + "\""+text+"\"");
   closePopup();
   return false;
}
function lookupPick2(formName, parentIdElementName, parentEditElementName, id, display) {
   var parentIdElement = "document." + formName + "[\"" + parentIdElementName + "\"]";
   var parentEditElement = "document." + formName + "[\"" + parentEditElementName + "\"]";
   var parentEditOldValueElement = "document." + formName + "[\"" + parentEditElementName + "_lkold" + "\"]";
   if (eval(parentIdElement + ".type") == "select-one") {
         var found = false;
         for (i = 0; i < eval(parentIdElement + ".options.length"); i++) {
            if (eval(parentIdElement + ".options[" + i + "].value") == id ) {
               eval(parentIdElement + ".selectedIndex=" + i);
               found = true;
               break;
            } 
         }
         if (!found) {
            eval(parentIdElement + ".options[" + parentIdElement + ".options.length] = new Option('" + display + "','" + id + "')");
            eval(parentIdElement + ".selectedIndex=" + parentIdElement + ".options.length - 1");
         }
         eval(parentEditElement + ".value = " + "\"" + display +"\"");
         eval(parentEditOldValueElement + ".value = " + "\"" + display +"\"");
      } 
      else {
         eval(parentIdElement + ".value = " + "\"" + id +"\"");
         eval(parentEditElement + ".value = " + "\"" + display +"\"");
         eval(parentEditOldValueElement + ".value = " + "\"" + display +"\"");
      }
   var parentSubmitParam = parentEditElementName+"_lspf";
   var doPost = eval("document."+formName+"[\""+ parentSubmitParam + "\"].value");
   if (doPost == '1') {
   eval("document."+formName+".submit()");
   }
closePopup();
return false;
}
// begin layers
function show(object) {
   if (document.layers && document.layers[object]) {
      document.layers[object].visibility = 'visible';
   }
   else if (document.all) {
      document.all[object].style.visibility = 'visible';
      document.all[object].style.zIndex = 100;
   }
   else if (document.getElementById(object)) {
      document.getElementById(object).style.visibility = 'visible';
      document.getElementById(object).style.zIndex = 100;
      document.getElementById(object).style.right = '15px';
   } 
}
function hide(object) {
   if (document.layers && document.layers[object]) {
      document.layers[object].visibility = 'hidden';
   }
   else if (document.all) {
      document.all[object].style.visibility = 'hidden';
   }
   else if (document.getElementById(object)) {
      document.getElementById(object).style.visibility = 'hidden';
   } 
}
// end layers
function OpenRandWindow(WinName,width,height)
{      	
var d = new Date();
var t = d.getTime();
var myWindow = window.open(WinName, 'Win' + t, 'resizable=yes,location=no,scrollbars=no,status=0,width=' + width + ',height=' + height );
}
// begin open window
function SetWindowName() {
window.name="main";
}
SetWindowName();
function OpenWindow(WinName,width,height) {
var myWindow = window.open(WinName, 'newWin', 'resizable=yes ,scrollbars=no,status=0,width=' + width + ',height=' + height );
if (!myWindow.opener) myWindow.opener = "main";
}
// end open window
// begin rollover for calendar
function HoverRollOver(oTd) {
if (!oTd.contains(event.fromElement)) {
oTd.bgColor="#e2e6ff";
} }
function HoverRollOut(oTd) {
if (!oTd.contains(event.toElement)) {
oTd.bgColor="#ffffff";
} }
// end rollover for calendar
// begin textarea size
function rowsOne(n,f) {
var x= eval('document.forms.' + f + '.' + n + '.style');
x.height="20px";
}
function rowsSeven(n,f) {
var x= eval('document.forms.' + f + '.' + n + '.style');
x.height="120px";
}
function ch(n){
var x= document.forms.myForm.updates;
x.value = x.value + '|' + n;
}
// end textarea size
//-->
function checkNum() {
	var carCode = event.keyCode;
	if (carCode!=13) {
		if ( (carCode < 48) || (carCode > 57) ) {
		   event.cancelBubble = true;
		   event.returnValue = false;
		}
	}
 }