// BrowserCheck Object
// provides most commonly needed browser checking variables
// 19990326

// Copyright (C) 1999 Dan Steinman
// Distributed under the terms of the GNU Library General Public License
// Available at http://www.dansteinman.com/dynapi/

function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.minorv = parseFloat(navigator.appVersion)
	this.ns = (this.b=="ns" && this.minorv!=4.05)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
}

// automatically create the "is" object
is = new BrowserCheck()


//this function is used to create rollover effect with images
function SwitchGif(imgDocID,ImgObjName)
{
if (is.ns)
	document.images[imgDocID].src = eval(ImgObjName + ".src")

else if (is.ie)
	document.images[imgDocID].src = eval(ImgObjName + ".src")
}

function yellow(cellID,layerID) { 
if(is.ns) {
	document.layers[layerID].bgColor ='#ffffcc';
	}
else {
	document.all[cellID].bgColor = '#ffffcc';
	}
}

function white(cellID,layerID) { 
if(is.ns) {
	document.layers[layerID].bgColor ='#ffffff';
	}
else {
	document.all[cellID].bgColor = '#ffffff';
	}
}

function popup(wURL,wName,wOptions){
	var newwin = window.open(wURL,wName,wOptions);
	return false;
}

function clCookie(name) {
   var dc = document.cookie;
   var prefix = name + "=";
   var begin = dc.indexOf("; " + prefix);
   if (begin == -1) {
     begin = dc.indexOf(prefix);
     if (begin != 0) return null;
   } else {begin += 2;}
   var end = document.cookie.indexOf(";", begin);
   if (end == -1) {end = dc.length;}
   return unescape(dc.substring(begin + prefix.length, end));
 }

function claroSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else {
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
    }
  }
  var myDims = new Array(5);
  myDims[0] = myWidth;
  myDims[1] = myHeight;
  myDims[2] = screen.width;
  myDims[3] = screen.height;
  myDims[4] = screen.colorDepth;
  return myDims;
}

function genWinSizeImg() {
  var myDims = new Array(5);
  myDims = claroSize();
  return '';
  //return '<img alt="" height="0" width="0" src="/images/WinSizeImg_ww'+myDims[0]+'_wh'+myDims[1]+'_sw'+myDims[2]+'_sh'+myDims[3]+'_sc'+myDims[4]+'">';
}
