IE=(document.all)?1:0;
NS=(document.layers)?1:0;
if (!IE && !NS) {
/*
    Dummy event var for v3 browsers. 
   I use eval because IE will not allow 
   event to be assigned directly even within the if!
*/
   eval('event = ""'); 
}
function toolTip(e,msg,on) { 
   if (!IE && !NS) {
      if (!msg) msg = '';
      window.status = msg; 
      return true;
   }
   if (IE && window.event.srcElement.title == '') window.event.srcElement.title = msg;
   else if (NS) {
      if (on) {
         document.layers["tooltip"].document.write('<table border=1><tr><td>'+msg+'</td></tr></table>'); 
         document.layers["tooltip"].document.close(); 
         document.layers["tooltip"].top = e.pageY+15;
         document.layers["tooltip"].left= e.pageX; 
         document.layers["tooltip"].visibility="show"; 
      }
      else document.layers["tooltip"].visibility="hide"; 
   }
   return true;
}
function WclAlert(msg)
{
  alert(msg);
}
function WclReqCtl(control,errmsg)
{
  if (control.value.length > 0)
    return true;
  else
  {
    control.focus();
    WclAlert(errmsg);
    return false;
  }
}
function TableRowHighlight(therowName)
{
  if(therowName.length>0)
  {
    if ( document.getElementById )
    {   // any DOM browser
        var theRow = document.getElementById( therowName );
    } 
    else
    {
      if ( document.all )
      {   // IE4
          var theRow = document.all[ therowName ];
      }
      else
      {  // sorry this browser cannot handle it
         WclAlert('Please upgrade to a DOM browser to use this site!');
         return false;
      }
    }
    if (theRow.className=='OpuQueryRow')
    {
         theRow.className='OpuSelectedQueryRow';
    }
  }
  return true;
}
function TableRowDeHighlight(therowName)
{
  if(therowName.length>0)
  {
    if ( document.getElementById )
    {   // any DOM browser
        var theRow = document.getElementById( therowName );
    } 
    else
    {
      if ( document.all )
      {   // IE4
          var theRow = document.all[ therowName ];
      }
      else
      {  // sorry this browser cannot handle it
         WclAlert('Please upgrade to a DOM browser to use this site!');
         return false;
      }
    }
    if (theRow.className=='OpuSelectedQueryRow')
    {
         theRow.className='OpuQueryRow';
    }
  }
  return true;
}
function setFieldValue(thefieldName,theValue)
{
   if ( document.getElementById )
   {   // any DOM browser
       var theField = document.getElementById( thefieldName );
   } 
   else
   {
     if ( document.all )
     {   // IE4
         var theField = document.all[ thefieldName ];
     }
     else
     {  // sorry this browser cannot handle it
        WclAlert('Please upgrade to a DOM browser to use this site!');
        return false;
     }
   }
   theField.value=theValue;
   return true;
}
function FieldValue(thefieldName)
{
   if ( document.getElementById )
   {   // any DOM browser
       var theField = document.getElementById( thefieldName );
   } 
   else
   {
     if ( document.all )
     {   // IE4
         var theField = document.all[ thefieldName ];
     }
     else
     {  // sorry this browser cannot handle it
        WclAlert('Please upgrade to a DOM browser to use this site!');
        return false;
     }
   }
   if (theField.value.length)
   {
     return theField.value;
   }
   else
   {
     return "";
   }
}
function SubmitForm(theformName)
{
   if ( document.getElementById )
   {   // any DOM browser
       var theForm = document.getElementById( theformName );
   } 
   else
   {
     if ( document.all )
     {   // IE4
         var theForm = document.all[ theformName ];
     }
     else
     {  // sorry this browser cannot handle it
        WclAlert('Please upgrade to a DOM browser to use this site!');
        return false;
     }
   }
   theForm.submit();
   return true;
}
function openwindow(url,width,height)
{
   window.open(url,"",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height);
   return true;
}

