
var strAgt = navigator.userAgent.toLowerCase(); 
var blnWin = ((strAgt.indexOf("win") != -1) || (strAgt.indexOf("16bit") != -1) || (strAgt.indexOf("32bit") != -1));
var blnMac = (strAgt.indexOf("mac") != -1);
var blnUnix = ((strAgt.indexOf("x11") != -1) || (strAgt.indexOf("sunos") != -1) || (strAgt.indexOf("irix") != -1) || (strAgt.indexOf("hp-ux") != -1) || (strAgt.indexOf("sco") != -1) || (strAgt.indexOf("unix") != -1) || (strAgt.indexOf("ncr") != -1) || (strAgt.indexOf("dec") != -1) || (strAgt.indexOf("osf1") != -1) || (strAgt.indexOf("ultrix") != -1) || (strAgt.indexOf("alpha") != -1) || (strAgt.indexOf("sinix") != -1) || (strAgt.indexOf("aix") != -1) || (strAgt.indexOf("inux") != -1) || (strAgt.indexOf("bsd") != -1));
var blnNS = ((strAgt.indexOf("mozilla") != -1) && (strAgt.indexOf("compatible") == -1));
var blnIE = (strAgt.indexOf("msie") != -1);
var dblVer = parseFloat(navigator.appVersion);
var blnN4 = (blnNS && (dblVer < 5));
var blnN6 = (blnNS && (dblVer >= 5));
var intNN6PopupWidthAdjust = (blnNS && (dblVer >= 5))?15:0;
if (blnIE) {
	var intStart = strAgt.indexOf("msie") + 5;
	var intEnd = strAgt.indexOf(";", intStart)
	dblVer = parseFloat(strAgt.substring(intStart, intEnd));
}

var intBrowserW = intBrowserH = 0;
var blnLoaded = true;




function obj(id, nestref) {
	if (blnNS) {
		if (dblVer >= 5) {
			this.elm = this.evt = document.getElementById(id);
			this.ref = this.elm;
			this.css = this.elm.style;
			this.doc = document;
			this.x = this.begx = (nestref) ? this.elm.offsetLeft - nestref.offsetLeft : this.elm.offsetLeft;
			this.y = this.begy = (nestref) ? this.elm.offsetTop - nestref.offsetTop : this.elm.offsetTop;
			this.clipW = this.scrollW = this.elm.offsetWidth;
			this.clipH = this.scrollH = this.elm.offsetHeight;
			this.self = id; 
			eval(this.self + "=this");
		} else {
			this.css = (nestref) ? eval("nestref.document.layers." + id) : eval("document.layers." + id);
			this.ref = this.css;
			this.elm = this.evt = this.css;
			this.doc = this.css.document;
			this.x = this.begx = this.css.left;
			this.y = this.begy = this.css.top;
			//this.w,h alaises added for GN DHTML
			this.clipW = this.scrollW = this.w = this.css.clip.width;
			this.clipH = this.scrollH = this.h = this.css.clip.height;
			this.self = id; 
			eval(this.self + " = this");
		}
	} else if (blnIE) {
		this.elm = this.evt = document.all[id];
		this.css = this.elm.style;
		this.doc = document;
		this.x = this.begx = this.elm.offsetLeft;
		this.y = this.begy = this.elm.offsetTop;
		this.clipW = this.elm.offsetWidth;
		this.clipH = this.elm.offsetHeight;
		this.scrollW = this.elm.scrollWidth;
		this.scrollH = this.elm.scrollHeight;
		this.self = id + "Obj";
		eval(this.self + " = this"); 
	}
	this.id = id; 
	this.i = 1;
	this.slidingTID = null;
	this.fading = false;
	this.copyFrom = copyFrom;
	this.clip = clip;
	this.num = 0;
	this.slidecoords = slidecoords;
	this.menuslide = menuslide;
	this.changedoc = changedoc;
  this.scroll = scroll;
	this.down = true;
	this.sliding = false;
	this.clipping = false;
	return;
}
	

function io(id, nestref) {
	if (blnN4) {
	  this.img = (nestref) ? eval("nestref.images."+id) : eval("document.images."+id);
      this.relX = this.absX = this.img.x; 
      this.relX = this.absY = this.img.y;
      this.w = this.img.width;
      this.h = this.img.height;
  } 
  
  else if (document.getElementById) {
    this.img = document.images[id];
		this.relX = this.img.offsetLeft;
		this.relY = this.img.offsetTop;
    this.absX = 0;
    this.absY = 0;
    ob = this.img;
		do {
			this.absX += ob.offsetLeft;
			this.absY += ob.offsetTop;
			ob = ob.offsetParent;
		} while (ob != null);
    this.w = this.img.width;
    this.h = this.img.height;
  }
	// x and y are deprecated
	this.x = this.absX;
	this.y = this.absY;
	this.imgoff = new Image();
	this.imgoff.src = this.img.src;
  return;
}

		
function menuslide(whichMenu) {
	var slideVariation = (whichMenu == 'panel2') ? 6 : 3;
	var func = "";
	var steps = 1;
	var amount = 0;
	if (this.sliding) {
		clearTimeout(slidingID2);
		this.i = 1;
	}
	this.sliding = true;
	if (this.down) {
		steps = Math.max(1, Math.floor(-this.y / 30));
		func = this.self+".slidecoords("+this.x+", "+this.y+", "+this.x+", 0, "+ steps +", 60)";
		this.down = false;
	} else {
		steps = Math.max(1, Math.floor((this.scrollheight + this.y) / 30));
		amount = -this.scrollheight + slideVariation;
		func = this.self+".slidecoords("+this.x+", "+this.y+", "+this.x+", "+ amount +", "+ steps +", 60)";
		this.down = true;
	}
	eval(func);
	return;
}


function slidecoords(xbeg, ybeg, xend, yend, steps, rate) {
	if (blnNS && (dblVer >= 5)) {
		this.x = Math.round(xbeg+((xend-xbeg)*(this.i/steps)));
		this.css.left = this.x + "px";
		this.y = Math.round(ybeg+((yend-ybeg)*(this.i/steps)))
		this.css.top = this.y + "px";
	} else {
		this.css.left = this.x = Math.round(xbeg+((xend-xbeg)*(this.i/steps)));
		this.css.top = this.y = Math.round(ybeg+((yend-ybeg)*(this.i/steps)));
	}
	this.i++;
	if (this.i <= steps) {
		slidingID2 = setTimeout(this.self+".slidecoords("+xbeg+", "+ybeg+", "+xend+", "+yend+", "+steps+", "+rate+")", rate);  
	} else { 
		this.i = 1;
		this.sliding = false;
	}
}


function changedoc(str) {
	if (blnNS && (dblVer < 5)) {
		this.doc.open();
		this.doc.write(str);
		this.doc.close();
	} else if (blnIE || (blnNS && (dblVer >= 5))) {
		this.elm.innerHTML = str;
	}
	return;
}


function newImage(imagePath) {
     if (document.images) {
          var rslt = new Image();
          rslt.src = imagePath;
          return rslt;
     }
}

function copyFrom(srcObj) {
	for (var prop in srcObj) {
		this.prop = srcObj[prop];
	}
	return;
} 


function clip(T, R, B, L) {
  if (blnNS) {
    this.css.clip.top = T;
    this.css.clip.right = R;
    this.css.clip.bottom = B;
    this.css.clip.left = L;
    this.clipW = this.css.clip.width;
    this.clipH = this.css.clip.height;
  } else if (blnIE) {
    this.css.clip = "rect("+T+", "+R+", "+B+", "+L+")";
    this.css.width = R;
    this.css.height = B;
    this.clipW = R-L;
    this.clipH = B-T;
  }
  return;
}  



function rollOn(imgObjName){
if (!blnLoaded || !document.images) 
	{
		return;
	}
	imgObjName.img.src = imgObjName.imgon.src;
	return;
}


function rollOff(imgObjName){
if (!blnLoaded || !document.images) 
	{
		return;
	}
	imgObjName.img.src = imgObjName.imgoff.src;
	return;
}


function changeCssTop(obj, value){
	obj.css.top  = value;
	return;
}






