<!--

// --- 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.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.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) && agt.indexOf('msie 6.0') == -1);
    this.ie6  = (agt.indexOf('msie 6.0') != -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.ie6);
	
	// 22/11/2002 -- MZ: Opera 7.x support
	this.opera   = (agt.indexOf("opera") != -1);
	this.opera7comp   = ((this.opera) && (agt.indexOf("opera 7") != -1));
	
	this.comp = (this.ie4comp || this.ns4comp || this.ns6comp || this.opera7comp);
	
	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);
	}
}


// --- VISIBILITY ---

function setEltVisibility (elt, value)
{  if (is.ns4comp) elt.visibility = value;
   else if (is.ie4comp) elt.style.visibility = value;
   else if (is.ns6comp) elt.style.visibility = value;
}

function getEltVisibility (elt)
{  if (is.ns4comp) 
   {  var value = elt.visibility;
      if (value == "show") return "visible";
      else if (value == "hide") return "hidden";
      else return value;
   }
   else if (is.ie4comp) return elt.style.visibility;
   else if (is.ns6comp) return elt.style.visibility;
}

function setEltDisplay (elt, value)
{  if (is.ns4comp) elt.display = value;
   else if (is.ie4comp) elt.style.display = value;
   else if (is.ns6comp) elt.style.display = value;
}

function getEltDisplay (elt)
{  if (is.ns4comp) 
   {  var value = elt.display;
      if (value == "show") return "visible";
      else if (value == "hide") return "hidden";
      else return value;
   }
   else if (is.ie4comp) return elt.style.display;
   else if (is.ns6comp) return elt.style.display;
}


// --- POSITION ---

function moveEltTo (elt, x, y) 
{ if (is.ns4comp) elt.moveTo(x, y);
  else if (is.ie4comp) {
    elt.style.pixelLeft = x;
    elt.style.pixelTop  = y;
  }
  else if (is.ns6comp) {
    elt.style.left = x;
    elt.style.top  = y;
  }
}

// don't work with nested layers
function moveEltBy (elt, x, y) 
{ if (is.ns4comp) elt.moveBy(x, y);
  else if (is.ie4comp)  {
    elt.style.pixelLeft = parseInt(elt.offsetLeft) + x;
    elt.style.pixelTop  = parseInt(elt.offsetTop)  + y;
  }
  else if (is.ns6comp)  {
    elt.style.left = (parseInt(elt.offsetLeft) + x + "px");
    elt.style.top  = (parseInt(elt.offsetTop)  + y + "px");
  }
}

function setEltLeft (elt, x) 
{  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) {return false;}

  if (is.ns4comp)     elt.top=y;
  else if (is.ie4comp) elt.style.pixelTop=y;
  else if (is.ns6comp) elt.style.top= (y + "px");
}

function getEltLeft (elt) {
  if (is.ns4comp)     return (elt.left);
  else if (is.ie4comp) return (elt.style.pixelLeft);
  else if (is.ns6comp) return (elt.offsetLeft);
}

function getEltTop (elt) 
{ 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 (is.ns4comp) return(elt.document.width);
  else if (is.ie4comp) return (elt.offsetWidth);
  else if (is.ns6comp) return (elt.offsetWidth);
}

function getEltHeight (elt)
{ if (is.ns4comp) return(elt.document.height);
  else if (is.ie4comp) return (elt.offsetHeight);
  else if (is.ns6comp) return (elt.offsetHeight);
}

function setEltWidth (elt, x)
{ 
	if (x != "auto") {
		if (is.ns4comp) elt.document.width = x;
		else if (is.ie4comp) elt.style.width = x;
		else if (is.ns6comp) elt.style.width = (x + 'px');
	} else {
		if (is.ns4comp) elt.document.width = x;
		else if (is.ie4comp) elt.style.width = x;
		else if (is.ns6comp) elt.style.width = x;
	}
}

function setEltHeight (elt, y)
{
	if (y != "auto") {
		if (is.ns4comp) elt.document.height = y;
		else if (is.ie4comp) elt.style.height = y;
		else if (is.ns6comp) elt.style.height = (y + 'px');
	} else {
		if (is.ns4comp) elt.document.height = y;
		else if (is.ie4comp) elt.style.height = y;
		else if (is.ns6comp) elt.style.height = y;
	}
}

// --- 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 +')';
}

// --- Z-INDEX ---

function getEltZIndex (elt) 
{ if (is.ns4comp) return(elt.zIndex);
  else if (is.ie4comp) return (elt.style.zIndex);
  else if (is.ns6comp) return (elt.style.zIndex);
}

function setEltZIndex (elt, z) 
{ if (is.ns4comp) elt.zIndex = z;
  else if (is.ie4comp) elt.style.zIndex = z;
  else if (is.ns6comp) elt.style.zIndex = z;
}


// --- WRITE IN LAYERS ---

function setEltContent(elt, content) {
	if (is.ns4comp) 
	{	elt.document.open();
		elt.document.write(content);
		elt.document.close();
	} 
	else if (is.ie4comp) elt.innerHTML = content;
	else if (is.ns6comp) elt.innerHTML = content;
}

// --- WINDOW PROPERTIES ---

function getWinWidth() 
{ if (is.ns4comp) return(window.innerWidth);
  else if (is.ie4comp) return(document.body.clientWidth);
  else if (is.ns6comp) return(window.innerWidth);
}

function getWinHeight() 
{ if (is.ns4comp) return(window.innerHeight);
  else if (is.ie4comp) return(document.body.clientHeight);
  else if (is.ns6comp && !is.ie6) return(window.innerHeight);
  else if (is.ns6comp && is.ie6) return(document.body.clientHeight);
}

function getWinSrollLeft()
{ if (is.ns4comp) return(window.pageXOffset);
  else if (is.ie4comp) return(document.body.scrollLeft);
  else if (is.ns6comp) return(window.pageXOffset);
}

function getWinSrollTop()
{ 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 getMouseWinLeft(e) 
{ if (is.ns4comp) return(e.pageX);
  else if (is.ie4comp) return(event.clientX + document.body.scrollLeft);
  else if (is.ns6comp) return(e.pageX);
}

function getMouseWinTop(e) 
{ if (is.ns4comp) return(e.pageY);
  else if (is.ie4comp) return(event.clientY + document.body.scrollTop);
  else if (is.ns6comp) return(e.pageY);
}

function getMousePageLeft(e) 
{ if (is.ns4comp) return(e.pageX - window.pageXOffset);
  else if (is.ie4comp) return(event.clientX);
  else if (is.ns6comp) return(e.pageX - window.pageXOffset);
}

function getMousePageTop(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, imgID, elt) { 
	if ((is.ns4comp) || (is.ie4comp)) {
		if (swapImage.arguments.length == 3) {
			eval("elt.document." + imgID + ".src = '" + imgSrc + "'");
		} else {
			eval("document." + imgID + ".src = '" + imgSrc + "'");
		}
	} else if (is.ns6comp) {
		var img = document.getElementsByName(imgID);
		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(elt,formID) { 
	if ((is.ns4comp) || (is.ie4comp)) {
		return eval("elt.document." + formID);
	} else if (is.ns6comp) {
		return document.getElementsByName(formID);
	}
}

function formSubmit(elt,formID) { 
	formRef = getForm(elt,formID);
	formRef.submit();
}

function formReset(elt,formID) { 
	formRef = getForm(elt,formID);
	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();



// -->
