//Date Modified: 11/26/2004 08:56:56 AM

function fReplaceImage(strObjectName, strSource)
{
   eval("document.all." + strObjectName + ".src='" + strSource + "';");
}

function fSubmit(strFormName, strValue)
{
   eval("document." + strFormName + ".hdnSubmit.value=\"" + strValue + "\";");
   return true;
}

function fLoad(strFormName, strObject)
{
   try
   { 
      eval(strFormName + "." + strObject + ".focus();");
   } 
   catch(e){}
}

function fTrim(asStr)
{
   return asStr.replace(/^\s+/,'').replace(/\s+$/,'');
}

function fClear(strForm, strObject)
{
   eval("document." + strForm + "." + strObject + ".value=\"\"")
}
	
function fFocus(strForm, strObject)
{
   eval("document." + strForm + "." + strObject + ".focus()")
}
	
function fClearFocus(strForm, strObject)
{
   eval("document." + strForm + "." + strObject + ".value=\"\"")
   eval("document." + strForm + "." + strObject + ".focus()")
}

//Calculates the object's absolute position, and width and height
function GetAbsPosition(object) 
{
   var position = new Object;
      
   position.x = 0;
   position.y = 0;
   if (object)
   {
      position.x = object.offsetLeft;
      position.y = object.offsetTop;
      if (object.offsetParent) 
      {
         var parentpos = GetAbsPosition(object.offsetParent);
         position.x += parentpos.x;
         position.y += parentpos.y;
      }
   }

   position.cx = object.offsetWidth;
   position.cy = object.offsetHeight;

   return position;
}

//Disable right mouse button. IE 4+ and NS 4+
/*var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) 
{
   if (document.layers||(document.getElementById&&!document.all)) 
      if (e.which==2||e.which==3) {(message);return false;}
}
if (document.layers) 
{  
   document.captureEvents(Event.MOUSEDOWN);
   document.onmousedown=clickNS;
}
else 
{  
   document.onmouseup=clickNS;
   document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false");*/

//The following code allows you to hit the enter key instead of clicking button
ie = (document.all)?true:false;
nn = (document.layers)?true:false;
function showKey(e)
{
   var icode,ncode,key;
   
   if (ie) {icode = event.keyCode; ncode = 0;
      key=String.fromCharCode(event.keyCode);}
   if(nn) {icode=0; ncode = e.which; key=String.fromCharCode(e.which);}
   if(icode==13 || ncode==13)
   {
      try 
	  {
	     OnEnterKey();    	 
	  }
	  catch(e){}
   }
}
document.onkeydown = showKey;
if(nn) {document.captureEvents = (Event.KEYDOWN);}