// lets define the browser we have instead of multiple calls throughout the filevar userAgent = navigator.userAgent.toLowerCase();var is_opera  = (userAgent.indexOf('opera') != -1);var is_saf    = ((userAgent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc."));var is_webtv  = (userAgent.indexOf('webtv') != -1);var is_ie     = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));var is_ie4    = ((is_ie) && (userAgent.indexOf("msie 4.") != -1));var is_moz    = ((navigator.product == 'Gecko') && (!is_saf));var is_kon    = (userAgent.indexOf('konqueror') != -1);var is_ns     = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf));var is_ns4    = ((is_ns) && (parseInt(navigator.appVersion) == 4));// catch possible bugs with WebTV and other older browsersvar is_regexp = (window.RegExp) ? true : false;// let's find out what DOM functions we can usevar DOMtype = '';if (document.getElementById) {	DOMtype = "std";} else if (document.all) {	DOMtype = "ie4";} else if (document.layers) {	DOMtype = "ns4";}// make an array to store cached locations of objects called by fetch_objectvar aObjects = new Array();// function to emulate document.getElementByIdfunction fetch_object(idname, forcefetch) {	if (forcefetch || typeof(aObjects[idname]) == "undefined") {		switch (DOMtype) {			case "std": {				aObjects[idname] = document.getElementById(idname);	            break;			}						case "ie4":	{				aObjects[idname] = document.all[idname];    	        break;			}						case "ns4": {				aObjects[idname] = document.layers[idname];        	    break;			}		}	}		return aObjects[idname];}// make an array to store cached locations of objects called by fetch_arrayvar aArrayObjects = new Array();// function to emulate document.getElementsByNamefunction fetch_array(idname, forcefetch) {	if (forcefetch || typeof(aArrayObjects[idname]) == "undefined") {		aArrayObjects[idname] = document.getElementsByName(idname);	}		return aArrayObjects[idname];}function moveLayer( sLayerName, sStyleTarget, sMode, iDistance, bIsRecursion) {	var oLayer = fetch_object( sLayerName);	var iCurrDistance = 0;      if ( !bIsRecursion) {      fetch_object( sLayerName + "_link").href = "javascript: moveLayer( '"+ sLayerName +"', '"+ sStyleTarget +"', '"+ getOpposite( sMode) +"', "+ iDistance +");";   }   	if ( iDistance > 10 ) {   	iCurrDistance = 10;	} else {		iCurrDistance = iDistance;	}	   if ( sMode == "increase") {      eval( "oLayer.style." + sStyleTarget + " = ( parseInt( oLayer.style." + sStyleTarget + ") + " + iDistance + ") + \"px\";");   } else if ( sMode == "decrease") {      eval( "oLayer.style." + sStyleTarget + " = ( parseInt( oLayer.style." + sStyleTarget + ") - " + iDistance + ") + \"px\";");   }   	if ( iDistance != 0) {		setTimeout( "moveLayer( '" + sLayerName + "', '" + sStyleTarget + "', '"+ sMode +"'," + ( iDistance - iCurrDistance) + ", true);", 40);   }}function getOpposite( sExpr) {   var aOpposites = new Array();   aOpposites["top"] = "bottom";   aOpposites["left"] = "right";   aOpposites["increase"] = "decrease";      for ( var key in aOpposites) {      if ( key == sExpr) {         return aOpposites[ key];      } else if ( aOpposites[ key] == sExpr) {         return key;      }   }      return null;}// sets the CSS-Class of an Elementfunction setClass( oElement, sClass) {	oElement.className = sClass;}// sets a CSS-Style Attributefunction setStyle( oElement, sStyleAttr, sStyleValue, bCaseSensitive) {	oElement.style.setAttribute( sStyleAttr, sStyleValue, bCaseSensitive)}function setImgSrc( oImage, sSource) {	oImage.src = sSource;}
