function Is() 
{
  agent       = navigator.userAgent.toLowerCase();
  this.major  = parseInt(navigator.appVersion);
  this.minor  = parseFloat(navigator.appVersion);

  this.ns     = ((agent.indexOf('mozilla')   != -1) &&
                (agent.indexOf('spoofer')    == -1) &&
                (agent.indexOf('compatible') == -1) &&
                (agent.indexOf('opera')      == -1) &&
                (agent.indexOf('webtv')      == -1) &&
                (agent.indexOf('hotjava')    == -1));

  this.ns2    = (this.ns && (this.major      ==  2));
  this.ns3    = (this.ns && (this.major      ==  3));
  this.ns4    = (this.ns && (this.major      ==  4));
  this.ns6    = (this.ns && (this.major      >=  5));

  this.ie     = ((agent.indexOf("msie")      != -1) &&
                (agent.indexOf("opera")      == -1));

  this.ie3    = (this.ie && (this.major      <   4));

  this.ie4    = (this.ie && (this.major      ==  4) &&
                (agent.indexOf("msie 4")     != -1));

  this.ie5    = (this.ie && (this.major      ==  4) &&
                (agent.indexOf("msie 5.")    != -1) &&
                (agent.indexOf("msie 5.5")   == -1) &&
                (agent.indexOf("mac")        == -1));

  this.iem5   = (this.ie && (this.major      ==  4) &&
                (agent.indexOf("msie 5.")    != -1) &&
                (agent.indexOf("mac")        != -1));

  this.ie55   = (this.ie && (this.major      ==  4) &&
                (agent.indexOf("msie 5.5")   != -1));

  this.ie6    = (this.ie && (this.major      ==  4) &&
                (agent.indexOf("msie 6.")    != -1));

  this.nsdom  = (this.ns4 || this.ns6);
  this.ie5dom = (this.ie5 || this.iem5   || this.ie55);
  this.iedom  = (this.ie4 || this.ie5dom || this.ie6);
  this.w3dom  = (this.ns6 || this.ie6);
  this.flash6 = (this.ns6 && getPlugin("r65"));
  this.plugin = (this.flash6 || this.ns4 || this.ie5 || this.ie55 || this.ie6)
}

function objectSetup(bResize)
{
  var is = new Is();
  if(is.iedom || is.nsdom) 
  {
    page               = new Object();
    page.width         = (is.nsdom) ? innerWidth  : document.body.clientWidth;
    page.height        = (is.nsdom) ? innerHeight : document.body.clientHeight;
    if (bResize == false)
    {
      layerSetup(null,"ContentLyr",(page.width - 990)/2,(page.height - 590)/2,990,590,1,"visible");
    }
    else
    {
      this.obj                 = new getObject("layer",null,"ContentLyr");
      this.obj.left            = (page.width - 990)/2;
      this.obj.top             = (page.height - 590)/2;
    }
    
  }
}



function layerSetup(parent,id,left,top,width,height,zindex,visibility) 
{
  var is = new Is();
  this.obj                 = new getObject("layer",parent,id);
  this.obj.left            = left;
  this.obj.top             = top;
  if(width != null) 
  {
    if(is.ns4) 
    {
      this.obj.clip.right  = width;
    }
    else
    {
      this.obj.width       = Math.abs(width);
    }
  }

  if(height != null) 
  {
    if(is.ns4) 
    {
      this.obj.clip.bottom = height;
    }
    else
    {
      this.obj.height      = Math.abs(height);
    }
  }
  this.obj.zIndex          = zindex;
  this.obj.visibility      = visibility;
  return this.obj;
}


function getObject(type,parent,id) 
{
  var is = new Is();
  if(type == "layer") 
  {
    if(is.ns4) 
    {
      if(id != "ContentLyr") 
      {
        this.obj     = (parent == null) ? document["ContentLyr"].document[id] : parent.document[id];
        this.obj.htm = (parent == null) ? document["ContentLyr"].document[id].document : parent.document[id].document;
      } 
      else
      {
        this.obj     = document[id];
      }
    } 
    else if(is.iedom && !is.ie6) 
    {
      this.obj       = document.all[id].style;
      this.obj.htm   = document.all[id];
    } 
    else if(is.iem5 || is.ns6 || is.ie6) 
    {
      this.obj       = document.getElementById(id).style;
      this.obj.htm   = document.getElementById(id);
    }
  } 
  else if(type == "image") 
  {
    if(is.ns4) 
    {
      this.obj       = parent.document[id];
    }
    else if(is.ie4 || is.ie5 || is.ie55) 
    {
      this.obj       = document[id];
    }
    else if(is.iem5 || is.ns6 || is.ie6) 
    {
      this.obj       = document.getElementById(id);
    }
    this.obj.parent  = parent;
  }
  return this.obj;
}


