var d=document;var w=window;var p=parent;var Pref;

String.prototype.trim = function(){return this.replace(/(^\s*)|(\s*$)/g, "");}    
 
if(document.getElementById && navigator.userAgent.indexOf('Opera') < 0)
 Pref = 'document.getElementById(Id)';
else Pref = 'document.all[Id]';
 
function Wid(Id,Contents){
 if(eval(Pref) != null){
  eval(Pref+'.innerHTML = Contents;');}}
function WidAdd(Id,Contents){
 if(eval(Pref) != null){
  eval(Pref+'.innerHTML += Contents;');}}
function WidImg(Id,Contents){
 if(eval(Pref) != null){
  eval(Pref+'.src = Contents;');}}
 
function Widv(Id,Contents){eval(Pref+'.value = Contents');}
 
function Rido(Id){
 if(eval(Pref) != null)
  if(eval(Pref+'.selectedIndex')!=null && eval(Pref+'.selectedIndex') >= 0)
   return eval(Pref+'.options['+eval(Pref+'.selectedIndex')+'].text');
  else return null;
 else return null;}

function Ridv(Id){
 if(eval(Pref) != null)
  return eval(Pref+'.value');
 else return null;}

function Ridi(Id){
 if(eval(Pref) != null)
  return eval(Pref+'.innerHTML');
 else return null;}

function WStyle(Id,Name,Value)
{
 if(eval(Pref) != null){
  if(document.getElementById){
   if(eval(Pref+'.style;') != undefined){
    eval(Pref+'.style.'+Name+' = "'+Value+'"');}}
  else if(d.layers)
   eval('document.'+Id+'.'+Name+' = "'+Value+'"');
  else
   eval(Id+'.'+Name+' = "'+Value+'"');}
 else return null;}

function RStyle(Id,Name)
{
 if(eval(Pref)!=null){
  if(document.getElementById){
   if(eval(Pref+'.style;')!=undefined){return eval(Pref+'.style.'+Name+';');}
   else return null;}
  else if(d.layers) return eval('document.'+Id+'.'+Name+';');
  else return eval(Id+'.'+Name+';');}
 else return null;}

function Get_Cookie(name){ 
 var start = document.cookie.indexOf( name + "=" ); 
 var len = start + name.length + 1; 
 if((!start) && (name!=document.cookie.substring(0, name.length))){return null;}
 if(start==-1) return null; 
 var end = document.cookie.indexOf(";", len); 
 if(end==-1) end = document.cookie.length; 
 return unescape(document.cookie.substring(len, end));} 

function getObj(Id){
 var buff=Pref.replace('(Id)', '(\''+Id+'\')'); buff=buff.replace('[Id]', '[\''+Id+'\']'); buff=eval(buff);
 return buff;}

function createObj2(objName, actProc, actURL, method, param){
 if(typeof objName=='undefined'){return null;}
 if(typeof method=='undefined'){method='GET';}
 if(typeof window.ActiveXObject != 'undefined') {
  objName = new ActiveXObject('Microsoft.XMLHTTP');
  objName.onreadystatechange = actProc;}
 else {
  objName = new XMLHttpRequest();
  objName.onload = actProc;}
 if(method=='GET'){
  objName.open(method, actURL, false);
  objName.send(null);}
 else{
  objName.open(method, actURL, false);
  objName.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
  objName.setRequestHeader("Content-length", param.length); 
  objName.setRequestHeader("Connection", "close"); 
  objName.send(param);}

  return objName;
}

