//<!--


// --- 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))
    // 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();

if (!is.comp) window.location="../home/html/notcompatible.html";


// --- 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;
}


// --- POSITION ---

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 (is.ns4comp)     elt.top=y;
  else if (is.ie4comp) elt.style.pixelTop=y;
  else if (is.ns6comp) elt.style.top= (y + "px");
}
function setEltWidth (elt, w)
{ if (is.ns4comp) elt.document.width = w;
  else if (is.ie4comp) elt.style.pixelWidth = w;
  else if (is.ns6comp) elt.style.width = w+"px";
}
function setEltHeight (elt, h)
{ if (is.ns4comp) elt.document.height = h;
  else if (is.ie4comp) elt.style.pixelHeight = w;
  else if (is.ns6comp) elt.style.height = w+"px";
}



function getEltTop (elt)
{ 
    if (is.ns4comp)     return (elt.top);
    else if (is.ie4comp) return elt.offsetTop;
    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);
}


// --- 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 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) 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++;
		}
	}
}


// --- 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();



// -->
