     function ImageSwap(imgDocID,imgObjName)
     {
          document.images[imgDocID].src = eval(imgObjName + ".src");
     }

     function CheckUserInputChar(Type,Value)
     {
     
          if (!Type)
               Type = "posinteger";    
     
          Type = Type.toLowerCase()
     
          if (document.all)
               InputCharCode = window.event.keyCode;
          else
               InputCharCode = FF_LastEvent.which;
     
          if (!InputCharCode || InputCharCode==8)
               return (true);
          
          if (Type=='posinteger')
          {
               if (InputCharCode >= 48 && InputCharCode <= 57)
                    return(true);
          }
     
          if (Type == 'decimal' || Type == "posdecimal")
          {
               if (InputCharCode == 44)
               {
                    if (document.all)
                         window.event.keyCode = 46
                    else
                    {
                         alert("',' not allowed! use '.'")
                         return(false)
                    }
               }
               if (!Value)
               {
                    if ((InputCharCode >= 48 && InputCharCode <= 57) || InputCharCode == 46)
                         return(true);
               }
               else
               {
                    if ((InputCharCode >= 48 && InputCharCode <= 57) || (InputCharCode == 46 && substr_count(Value,String.fromCharCode(46))<1))
                         return (true)
               }          
          }
          if (Type == 'phonenumber')
          {
               if (InputCharCode >= 48 && InputCharCode <= 57)
                    return (true)
               else
               {
                    if (document.all)
                    {
                         if (InputCharCode >=97 && InputCharCode <=122)
                              InputCharCode = InputCharCode - 32;
          
                         if (InputCharCode>82)
                              InputCharCode = InputCharCode -1;
                         if (InputCharCode==89)
                              InputCharCode = InputCharCode -1;
                         if (InputCharCode>=65 && InputCharCode<=90)
                         {
                              window.event.keyCode = Math.floor((InputCharCode - 65) / 3) + 50;
                              return (true);
                         }
                    }
               }
          }
     
          return (false);
     }
     
     function FF_SaveEvent(evt)
     {
          FF_LastEvent = evt;
     }
     
     if (!document.all)
     {
          var FF_LastEvent = "";
          document.onkeydown = FF_SaveEvent;
     }
     
     String.prototype.LTrim=new Function("return this.replace(/^\\s+/,'')")
     String.prototype.RTrim=new Function("return this.replace(/\\s+$/,'')")
     String.prototype.Trim= new Function("return this.replace(/^\\s+|\\s+$/g,'')")
 