/***************************************/
function Rnd(s)
{
  return new String(s+"rnd="+Math.random()).replace(".","");
}
//***
function Screen(i,frm)
{
  if(arguments.length == 1) frm="frmFind";
  document.forms[frm].Screen.value=i;
  document.forms[frm].submit();
}
//***
function Digital()
{
  if(((self.event.keyCode >= 48) && (self.event.keyCode <= 57)) ||
     ((self.event.keyCode == 46) || (self.event.keyCode == 44))) return self.event.returnValue=true;
  return self.event.returnValue=false;
}
//***
function getE(id)
{ 
  return document.getElementById(id);
}
function Press(str,c)
{
   if(arguments.length == 1) c=" ";
   return new String(str.replace(new RegExp(c+"+","ig"),c));
}
//*** string
function Trim(str)
{
   return LTrim(RTrim(str));
}
function LTrim(str)
{
   return new String(str).replace(/^(\s)*/,"");
}
function RTrim(str)
{
   return new String(str).replace(/(\s)*$/,"");
}
function Left(str,len)
{
   return new String(str).substr(0,len);
}
function Right(str,len)
{
   return new String(str).substr(str.length-len);
}
function Mid(str,start,len)
{
   if(arguments.length < 3) return new String(str).substr(start-1);
   return new String(str).substr(start-1,len);
} 
function Replace(s,s1,s2)
{
   return new String(s).replace(new RegExp(s1,"gi"),s2);
}
//*** class document
function clsDocument(str) 
{
 this.text=new Array();
 if(arguments.length != 0) this.text[this.text.length]=str; 
 this.write=function(str) 
 { 
  this.text[this.text.length]=str; 
 }
//*** write line
 this.writeln=function(str)  
 { 
  this.text[this.text.length]=str+"\n"; 
 }
//*** join to string
 this.toString=function()
 { 
  return this.text.join(""); 
 }
//*** clear array
 this.clear=function()
 { 
  delete this.text;
  this.text=null;
  this.text=new Array(); 
 }
} 
