<!--

// --- CLIENTCHECK ---

function getClient() {
  // convert all characters to lowercase to simplify testing
  var agt=navigator.userAgent.toLowerCase()
  var apv=navigator.appVersion.toLowerCase()
  this.major = parseInt(navigator.appVersion)
  this.minor = parseFloat(navigator.appVersion)
  // browserversion

  this.opera = (agt.indexOf('opera')!=-1);
  this.ns  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
  this.ns4 = (this.ns && (this.minor >= 4.03) && (this.major < 5))
  this.ns6 = (this.ns && (this.major == 5) || this.opera)
  this.gecko = (this.ns && (this.major >= 5))
  this.ie   = (agt.indexOf("msie") != -1)
  this.ie4  = (this.ie && (this.major == 3))
  this.ie45 = (agt.indexOf('msie 4.5') != -1);
  this.ie5  = (this.ie && (this.major == 4));
  this.ie6 = (agt.indexOf('msie 6.') != -1);
  // platform
  this.mac = (apv.indexOf("macintosh")>0);
  this.win = (apv.indexOf("win")>0);	
  // compatible browsers
  this.ie4comp = ((this.ie4 && !this.mac) || this.ie45 || this.ie5)
  this.ns4comp = (this.ns4);
  this.ns6comp = (this.gecko || this.ns6);
  this.comp = (this.ie4comp || this.ns4comp || this.ns6comp);
  return (this)
}

var is = new getClient();

// --- GET ELEMENT(LAYERREFERENCE) ---

function getElt () 
{ 
   if (is.ns4comp)
  {
    var currentLayer = document.layers[getElt.arguments[0]];
    for (var i=1; i<getElt.arguments.length && currentLayer; i++)
    {   currentLayer = currentLayer.document.layers[getElt.arguments[i]];
    }
    return currentLayer;
  } 
  else if (is.ie4comp) {
    var elt = eval('document.all.' + getElt.arguments[getElt.arguments.length-1]);
	return(elt);
	
  }
  else if (is.ns6comp) {
	var elt = document.getElementById(getElt.arguments[getElt.arguments.length-1]);
	return(elt);
  }
}

// --- DISPLAY ---

function setEltDisplay (elt, value) {
  if (!elt || elt == null) return;
  if (is.ns4comp) elt.display = value;
  else if (is.ie4comp) elt.style.display = value;
  else if (is.ns6comp) elt.style.display = value;
}

// --- VISIBILITY ---

function setEltVisibility (elt, value) {
  if (!elt || elt == null) return;
  if (is.ns4comp) elt.visibility = value;
  else if (is.ie4comp) elt.style.visibility = value;
  else if (is.ns6comp) elt.style.visibility = value;
}

// --- POSITION ---

function setEltLeft (elt, x) {
  if (!elt || elt == null) return;
  if (is.ns4comp)     elt.left=x;
  else if (is.ie4comp) elt.style.pixelLeft=x;
  else if (is.ns6comp) elt.style.left = (x + "px");
}

function setEltTop (elt, y) {
  if (!elt || elt == null) return;
  if (is.ns4comp)     elt.top=y;
  else if (is.ie4comp) elt.style.pixelTop=y;
  else if (is.ns6comp) elt.style.top= (y + "px");
}

function getEltTop (elt) { 
  if (!elt || elt == null) return;
  if (is.ns4comp)     return (elt.top);
  else if (is.ie4comp) return (elt.style.pixelTop);
  else if (is.ns6comp) return (elt.offsetTop);
}

function getEltWidth (elt) { 
  if (!elt || elt == null) return;
  if (is.ns4comp) return(elt.document.width);
  else if (is.ie4comp) return (elt.offsetWidth);
  else if (is.ns6comp) return (elt.offsetWidth);
}

function getEltHeight (elt){ 
  if (!elt || elt == null) return;
  if (is.ns4comp) return(elt.document.height);
  else if (is.ie4comp) return (elt.offsetHeight);
  else if (is.ns6comp) return (elt.offsetHeight);
}

// --- CLIPPING ---

function setEltClip (elt, cliptop, clipright, clipbottom, clipleft) 
{ if (is.ns4comp) {
    elt.clip.left   = clipleft;
    elt.clip.top    = cliptop;
    elt.clip.right  = clipright;
    elt.clip.bottom = clipbottom;
  }
  else if (is.ie4comp)  elt.style.clip = 'rect(' + cliptop + ' ' +  
       clipright + ' ' + clipbottom + ' ' + clipleft +')';
  else if (is.ns6comp)  elt.style.clip = 'rect(' + cliptop + ' ' +  
       clipright + ' ' + clipbottom + ' ' + clipleft +')';
}

// --- WINDOW PROPERTIES ---

function getWinHeight() 
{ if (is.ns4comp) return(window.innerHeight);
  else if (is.ie4comp) return(document.body.clientHeight);
  else if (is.ns6comp) return(window.innerHeight);
}

function getWinScrollLeft()
{ if (is.ns4comp) return(window.pageXOffset);
  else if (is.ie4comp) return(document.body.scrollLeft);
  else if (is.ns6comp) return(window.pageXOffset);
}

function getWinScrollTop()
{ if (is.ns4comp) return(window.pageYOffset);
  else if (is.ie4comp) return(document.body.scrollTop);
  else if (is.ns6comp) return(window.pageYOffset);
}


// ---MOUSE EVENT PROPERTIES ---

function getMouseWinTop(e) 
{ if (is.ns4comp) return(e.pageY - window.pageYOffset);
  else if (is.ie4comp) return(event.clientY);
  else if (is.ns6comp) return(e.pageY - window.pageYOffset);
}


// --- IMAGE SWAP ---

function swapImage(imgSrc, imgName, elt) { 
	if ((is.ns4comp) || (is.ie4comp)) {
		if (swapImage.arguments.length == 3) {
			eval("elt.document." + imgName + ".src = '" + imgSrc + "'");
		} else {
			eval("document." + imgName + ".src = '" + imgSrc + "'");
		}
	} else if (is.ns6comp) {
		var img = document.getElementsByName(imgName);
		img[0].src = imgSrc;
	}
}


// --- IMAGE PRELOAD ---

function preloadImages() { 
	if (document.images) {
		var imgStr = preloadImages.arguments;
		if (!document.preloadArray) document.preloadArray = new Array();
		var n = document.preloadArray.length;
		for (var i=0; i<preloadImages.arguments.length; i++) {
			document.preloadArray[n] = new Image;
			document.preloadArray[n].src = imgStr[i];
			n++;
		} 
	}
}

// --- FORMS ---

function getForm(formName,elt) { 
  if (is.opera || is.ns6comp) {
    return document.forms[formName];
  }
	else if ((is.ns4comp) || (is.ie4comp)) {
		if (getForm.arguments.length == 2) {
			return eval("elt.document." + formName);
		} else {
			return eval("document." + formName);
		}
	}
}

function formSubmit(elt,formName) { 
	formRef = getForm(formName,elt);
	formRef.submit();
}

function formReset(elt,formName) { 
	formRef = getForm(formName,elt);
	formRef.reset();
}

// --- FIX RESIZE BUG IN NETSCAPE ---

function initResizeBug() {
	document.orPageWidth = innerWidth;
	document.orPageHeight = innerHeight;
	onresize = nsResizeBug;
}

function nsResizeBug() {
	if (innerWidth != document.orPageWidth || innerHeight != document.orPageHeight) location.reload();
}

if (is.ns4comp) initResizeBug();



// -->

