/*
  'Ultimate JavaScript Client Sniffer' V 3.03
   By Mozilla (http://www.mozilla.org/docs/web-developer/sniffer/browser_type_oo.html)
 */            
 
 var x,y,winW,winH  // current positions
 var IWIDTH=550  // Pictures box width
 var idiv=null   // Pointer to infodiv container
 var px="px"     // position suffix with "px" in some cases
 var ns4         // Are we using Netscape4?
 var kon         // Are we using KDE Konqueror?
 
 function Is (){
 
  // convert all characters to lowercase to simplify testing
  var agt=navigator.userAgent.toLowerCase();
  ns4=(document.layers)?true:false, ie4=(document.all)?true:false;
  kon=(navigator.userAgent.indexOf('konqueror')>0)?true:false;
  
  x=0;y=0;winW=800;winH=600;
 
  this.major = parseInt(navigator.appVersion);
  this.minor = parseFloat(navigator.appVersion);
  
    this.moz     = ((agt.indexOf('mozilla') != -1) && (agt.indexOf('spoofer')==-1)
                   && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                   && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    this.moz2    = (this.moz && (this.major == 2));
    this.moz3    = (this.moz && (this.major == 3));
    this.moz4    = (this.moz && (this.major == 4));
    this.moz4up  = (this.moz && (this.major >= 4));
    this.moz5    = (this.moz && (this.major == 5));
    this.moz5up  = (this.moz && (this.major >= 5));
    this.gecko   = (agt.indexOf('gecko') != -1);

    this.nav2    = this.moz2;
    this.nav3    = this.moz3;
    this.nav4    = this.moz4;
    this.nav4up  = (this.nav4 || ((this.major >= 4) && (agt.indexOf("netscape") != -1)));
    this.nav     = (this.nav2 || this.nav3 || this.nav4);
    this.nav6    = (this.moz && (this.major == 5) && (agt.indexOf("netscape6/6") != -1));
    this.nav6up  = (this.moz && (this.major >= 5) && (agt.indexOf("netscape") != -1));
    this.nav7    = (this.moz && (this.major == 5) && (agt.indexOf("netscape/7") != -1));
    this.nav7up  = (this.nav6up && !this.nav6);
    this.navonly = (this.nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) );

    this.mozilla  = (this.moz && this.gecko);
    this.mozilla1 = (this.moz && this.gecko && (agt.indexOf("rv:1") != -1));

    this.ie      = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie3     = (this.ie && (this.major < 4));
    this.ie4     = (this.ie && (this.major == 4) && (agt.indexOf("msie 4") != -1) );
    this.ie4up   = (this.ie && (this.major >= 4));
    this.ie5     = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0") != -1) );
    this.ie5_5   = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") != -1));
    this.ie5up   = (this.ie && !this.ie3 && !this.ie4);
    this.ie5_5up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5);
    this.ie6     = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.") != -1) );
    this.ie6up   = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);
    this.ie7     = (this.ie && (this.major == 4) && (agt.indexOf("msie 7.") != -1) );
    this.ie7up   = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5 && !this.ie6);

    this.msn    = (this.ie4up && (agt.indexOf("msn") != -1));
    this.msn2_5 = (this.msn && (agt.indexOf("msn 2.5") != -1));
    this.msn2_6 = (this.msn && (agt.indexOf("msn 2.6") != -1));

    this.aol      = (agt.indexOf("aol") != -1);
    this.aol3     = (this.aol && this.ie3);
    this.aol4ie3  = (this.aol && this.ie3);
    this.aol4ie4  = (this.aol && this.ie4);
    this.aol4     = (this.aol4ie3 || this.aol4ie4);
    this.aol5     = (agt.indexOf("aol 5") != -1);
    this.aol6     = (agt.indexOf("aol 6") != -1);
    this.aol7     = ((agt.indexOf("aol 7") != -1) || agt.indexOf("aol/7") != -1);
    this.aol8     = ((agt.indexOf("aol 8") != -1) || agt.indexOf("aol/8") != -1);

    this.opera = (agt.indexOf("opera") != -1);
    this.opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    this.opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    this.opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    this.opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);
    this.opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1);
    this.opera6up = (this.opera6 || this.opera5up);

    this.webtv = (agt.indexOf("webtv") != -1); 

    this.TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    this.AOLTV = this.TVNavigator;

    this.hotjava = (agt.indexOf("hotjava") != -1);
    this.hotjava3 = (this.hotjava && (this.major == 3));
    this.hotjava3up = (this.hotjava && (this.major >= 3));
	
    if(window.Event && document.captureEvents)
      document.captureEvents(Event.MOUSEMOVE); 
 	
    document.onmousemove = mousemove;

//   // Workaround for just another netscape bug: Fix browser confusion on resize
//   // obviously conqueror has a similar problem :-(
//   if(ns4||kon){ nsfix() }
//   if(ns4) { px=""; }

 }
 
 
 /*
  dHTML basic layer manipulation
   By Stephen Miller at 3LA Pty Ltd (www.3la.com.au)
   - Uses Mozilla's 'Ultimate JavaScript Client Sniffer'
   - May also use code derived from public domain sources 
 */      
 
//Create a layer
 function getLayer(div){
  var lyr;
  //if (is.ie6||is.gecko)
  if (is.ie6up||is.gecko)
    lyr = eval('document.getElementById(\'' + div + '\')');  
  else if (is.ie)
    lyr = eval('document.all["' + div + '"]');
  else if (is.ns)
    lyr = eval('document.' + div);
  return lyr; 
 }

// Writes to a layer
 function writeDiv(div,txt){ 
  var lyr=getLayer(div);
 if (is.ie||is.gecko){
   lyr.innerHTML = txt;
  } 
 else if (is.ns){
   lyr.document.write(txt);
   lyr.document.close();
  } 
 }

//Hide a layer
 function hideDiv(div){
  var obj=getLayer(div);
  if(typeof(obj)=="object" && obj!=null){ 
   if (is.ie||is.gecko)
     obj.style.visibility ="hidden";
   else if (is.ns)
     obj.visibility="hide";
  }  
 }

//Show a layer
 function showDiv(div){
  //alert("ShowDiv");
  var obj=getLayer(div);
  if(typeof(obj)=="object" && obj!=null){
   if (obj.innerHTML =="")return;
   if (is.ie||is.gecko)
     obj.style.visibility ="visible";
   else if (is.ns)
     obj.visibility="show";
  }  
 }
// Move a layer
 function moveDiv(div,xL,yL){
  var lyr=getLayer(div);
  if (is.moz) {
  	///alert("mozilla");
    document.getElementById(div).style.left=xL;
	  document.getElementById(div).style.top=yL;
  }	
  else if (is.ie6up||is.gecko){
  	///alert("gecko");
    lyr.style.left = xL;
    lyr.style.top = yL;
  } 
  else if (is.ie){
    ///alert("ie");
    lyr.left = xL;
    lyr.top = yL;
  } 
  else if (is.ns){
    ///alert("netscape");
    lyr.left = xL;
    lyr.top = yL;
  }
  
 }
 
 function showPics(div) {
 	showDiv(div);
	moveDiv(div, x, y);
 }
 
 function showBox(div) {
 	showDiv(div);
	moveDiv(div, x, y);
 }
 
 /*
  Calculate layer's position
   By Stephen Miller at 3LA Pty Ltd (www.3la.com.au)
   - Uses Mozilla's 'Ultimate JavaScript Client Sniffer'
   - May also use code derived from public domain sources
 */
 function Pos(div){
  if (!div &&this)
    div =this;

  this.L = div.offsetLeft;
  this.T = div.offsetTop;
  this.W = div.offsetWidth;
  this.H = div.offsetHeight;
   
  // identify first offset parent element
  var divParent = div.offsetParent;

  // itterate through element hierarchy
  while (divParent !=null){
   if (divParent.tagName!='BODY'){
    if(is.ie){
     // if parent a table cell, then append cell border width to calcs
     if(divParent.tagName =="TD"){
      this.L += divParent.clientLeft;
      this.T += divParent.clientTop;
      this.W += divParent.clientWidth;
      this.H += divParent.clientHeight;
     }
    }
    else if (is.gecko) {
     // if parent is a table, then get its border as a number
     if(divParent.tagName =="TABLE"){
      var nParBorder = parseInt(divParent.border);
      // if no valid border attribute, then check the table's frame attribute
      if(isNaN(nParBorder)){
       var nParFrame = divParent.getAttribute('frame');
       // if frame has ANY value, then append one pixel to counter
       if(nParFrame !=null)
        nLeftPos += 1;
      }
      // if a border width is specified, then append the border width to counter
      else if(nParBorder > 0)
       nLeftPos += nParBorder;
     }
    }
    // append left offset of parent
    this.L += divParent.offsetLeft;
    this.T += divParent.offsetTop;
    this.W += divParent.offsetWidth;
    this.H += divParent.offsetHeight;
   }
   divParent = divParent.offsetParent;
  }
 }
 

function mousemove(e){

  if (!e) // make sure "e" is defined, if not make it so -- IE design flaw
  var e = window.event||window.Event;

 if('undefined'!=typeof e.pageX)
 {
  x = e.pageX;
  y = e.pageY;
 }
 else
  {
   x = e.clientX + document.body.scrollLeft;
   y = e.clientY + document.body.scrollTop;
  } 

}

 
 