function CheckBrowser()
{
  var b        = navigator.appName;
  if      ( b == "Netscape" ) this.b = "ns";
  else if ( b == "Microsoft Internet Explorer" ) this.b = "ie";
  else if ( b == "Opera" ) this.b = "op";
  else this.b = b;
  this.version = navigator.appVersion;
  this.v       = parseInt( this.version );
  this.dom     = document.getElementById ? true : false;
  this.ns      = ( this.b == "ns" && this.v >= 4 );
  this.ns4     = ( this.b == "ns" && this.v == 4 && !this.dom );
  this.ns5     = ( this.b == "ns" && this.v == 5 && this.dom );
  this.ns6     = ( this.b == "ns" && this.v == 6 && this.dom );
  this.ie      = ( this.b == "ie" && this.v >= 4 );
  this.ie4     = ( this.version.indexOf( 'MSIE 4' ) > 0 && !this.dom );
  this.ie5     = ( this.version.indexOf( 'MSIE 5' ) > 0 && this.dom );
  this.op5     = ( this.b == "op" && this.v == 5 && this.dom );
  this.min     = ( this.ns || this.ie );
  this.pr      = ( window.print ) ? true : false;
  this.mac     = ( navigator.userAgent.indexOf( "Mac" ) != -1 );
}
is = new CheckBrowser();

function FrameURL( URL, FrameName )
{
  TargetFrame = eval( FrameName );
  TargetFrame.location.href = URL;
}

function ConfirmDelete( text, link )
{
  returnvalue = confirm( text );
  if ( returnvalue )
  {
    FrameURL( link, "this" );
  }
}

function valid_date( datum )
{
  for ( i = 0; i < datum.length; i++ )
  {
    if ( ( datum.charAt( i ) < "0" )
    ||   ( datum.charAt( i ) > "9" ) )
    {
      if ( ( i != 2 )
      &&   ( i != 5 ) )
      {
        return 0;
      }
    }
  }
  return 1;
}

function trim( str )
{
  while ( str.substr( 0, 1 ) == " " )
  {
    str = str.substr( 1, str.length - 1 );
  }
  while ( str.substr( str.length - 1, 1 ) == " " )
  {
    str = str.substr( 0, str.length - 1 );
  }
  return str;
}

function NewImage( Path )
{
  if ( document.images )
  {
    Result = new Image();
    Result.src = Path;
    return Result;
  }
}

function ChangeImage( Name, ObjectName )
{
  if ( document.images && ( bPreloadFlag == true ) )
  {
    document[Name].src = ObjectName.src;
  }
}

function GetElement( id )
{
  if ( is.dom == true )
  {
    return document.getElementById( id );
  }
  else
  {
    return document.all[id];
  }
  return null;
}

function SetContent( ObjectId, Content )
{
  document.getElementById( ObjectId ).firstChild.nodeValue = Content;
}

