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);
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 = false;


function obj(id, nestref) {
	this.ok = false;
	if (blnNS) {
		if (dblVer >= 5) {
			if ((("" + document.getElementById(id)) != "undefined") && (("" + document.getElementById(id)) != "null")) {
				this.elm = this.evt = document.getElementById(id);
				this.ref = this.elm;
				this.css = this.elm.style;
				this.doc = document;
				this.x = (nestref) ? this.elm.offsetLeft - nestref.offsetLeft : this.elm.offsetLeft;
				this.y = (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");
				this.ok = true;
			}
		} else {
			if (("" + eval("document.layers." + id)) != "undefined") {
				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.css.left;
				this.y = this.css.top;
				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");
				this.ok = true;
			}
		}
	} else if (blnIE) {
		if (("" + document.all[id]) != "undefined") {
			this.elm = this.evt = document.all[id];
			this.css = this.elm.style;
			this.doc = document;
			this.x = this.elm.offsetLeft;
			this.y = 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.ok = true;
		}
	}
	this.id = id; 
	return;
}

function io(id, nestref) {
	if (blnNS && (dblVer < 5)) {
	  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 newImage(imagePath) {
     if (document.images) {
          var rslt = new Image();
          rslt.src = imagePath;
          return rslt;
     }
}
			
function checksize() {
	if ((intBrowserW <= 0) || (intBrowserH <= 0)) {
		return;
	}
	if (blnNS) {
		if (intBrowserW != window.innerWidth || intBrowserH != window.innerHeight) {
			location.reload();
			}
	} 
	return;
}

function cleanup() {
	if (blnNS) {
		document.releaseEvents(Event.MOUSEMOVE);
	}
	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 focusMail() {
	if(window.frames) {
		if(window.frames.emailframename) {
			if(window.frames.emailframename.focusMailLocal) {
				window.frames.emailframename.focusMailLocal();
			}
		}
	}
	self.location="#email";
	return false;
}


