	//browser detection variables
	var bV = parseInt(navigator.appVersion);
	var isPC = (navigator.userAgent.indexOf('Win')  != -1 && navigator.userAgent.indexOf('95')  != -1 )? true : false;
	var IE4 = ((document.all) && (bV>=4)) ? true : false;
	var NS4 = (!(navigator.userAgent.indexOf('4.04') !=-1 && isPC) && document.layers) ? true : false;
	var NS6 = (document.getElementById)? true : false;
	var ver4 = (NS4 || IE4 || NS6) ? true : false;

	// Fix Netscape's OnResize Bug
	//
	// This code is required if we have positioned <div> elements.

	if(!window.saveInnerWidth) {
	  window.onresize = resize;
	  window.saveInnerWidth = window.innerWidth;
	  window.saveInnerHeight = window.innerHeight;
	}

	function resize() {
	  if (saveInnerWidth < window.innerWidth ||
	    saveInnerWidth > window.innerWidth ||
	    saveInnerHeight > window.innerHeight ||
	    saveInnerHeight < window.innerHeight )
	  {
	    window.history.go(0);
	  }
	}
	// End: Fix Netscape's OnResize Bug

	//DHTML scripting
	if (NS4) {
	     var layerRef = 'document.layers';
	     var styleSwitch = '';
	     var leftSwitch = '.left';
	     var rightSwitch = '.right';
	}else{
	     var layerRef = 'document.all';
	     var styleSwitch = '.style';
	     var leftSwitch = '.pixelLeft';
	     var rightSwitch = '.pixelRight';
	}

	//called onmouseover and onmouseout
	function imgflip(imgname, imgpath) {
	  	if (!ver4) return;
		if (document.images) {
			if (eval('typeof document.images.' + imgname) != 'undefined') {
				var layerImgObj = eval("document.images." + imgname);
				layerImgObj.src = imgpath;
			}
			else if (eval('typeof parent.document.images.' + imgname) != 'undefined') {
				var layerImgObj = eval("parent.document.images." + imgname);
				layerImgObj.src = imgpath;
			}
		}
	}

	// Navigates current document and parent documents looking for layers with images to flip
	function imgLayerFlip(layerName, imgname, imgpath) {
	  	if (!ver4) return;
		if (document.images) {
			//Check the current document for layer
			if (isLayer(layerName)) {
				if (eval('typeof document.images.' + imgname) != 'undefined') {
					var layerImgObj = eval("document.images." + imgname);
					layerImgObj.src = imgpath;
					return true;
				}
			}
			//If possible, Check the parent document for layer
			if(eval('typeof parent.' + layerRef+'["'+layerName+'"]') != 'undefined'){
				var layerObj = eval('parent.' + layerRef+'["'+layerName+'"]');
				if (layerObj.document.images && eval('typeof layerObj.document.images.' + imgname) != 'undefined') {
					var layerImgObj = eval('layerObj.document.images.' + imgname);
					layerImgObj.src = imgpath;
					return true;
				}
			}
		}
	}

	function imgResize(imgname, width, height) {
	  	if (!ver4) return;
		if (document.images) {
			if (eval('typeof document.images.' + imgname) != 'undefined') {
				var layerImgObj = eval("document.images." + imgname);
				layerImgObj.width = width;
				layerImgObj.height = height;
			}
			else if (eval('typeof parent.document.images.' + imgname) != 'undefined') {
				var layerImgObj = eval("parent.document.images." + imgname);
				layerImgObj.width = width;
				layerImgObj.height = height;
			}
		}
	}

	function resizeImage(imageOrImageName, width, height) {
		var image = typeof imageOrImageName == 'string' ? document[imageOrImageName] : imageOrImageName;
		if (document.layers) {
			image.currentWidth = width;
			image.currentHeight = height;
			var layerWidth = image.width > width ? image.width : width;
			var layerHeight = image.height > height ? image.height : height;
			if (!image.overLayer) {
				var l = image.overLayer = new Layer(layerWidth);
			}
			var l = image.overLayer;

			l.bgColor = document.bgColor;
			l.clip.width = layerWidth;
			l.clip.height = layerHeight;
			l.left = image.x;
			l.top = image.y;

			var html = '';
			html += '<IMG SRC="' + image.src + '"';
			html += image.name ? ' NAME="overLayer' + image.name + '"' : '';
			html += ' WIDTH="' + width + '" HEIGHT="' + height + '">';
			l.document.open();
			l.document.write(html);
			l.document.close();
			l.visibility = 'show';
		}
		else {
			image.width = width;
			image.height = height;
		}
	}

	function zoomImage (imageOrImageName, factor) {
		var image = typeof imageOrImageName == 'string' ? document[imageOrImageName] : imageOrImageName;
		if (document.layers) {
			var currentWidth = image.currentWidth ? image.currentWidth : image.width;
			var currentHeight = image.currentHeight ? image.currentHeight : image.height;
		}
		else {
			var currentWidth = image.width;
			var currentHeight = image.height;
		}
		var width = parseInt(currentWidth * factor);
		var height = parseInt(currentHeight * factor);
		resizeImage(image, width, height);
	}

	function isLayer(layerName){
	  	if (!ver4) return;
		if(eval(layerRef+'["'+layerName+'"]')){
			return true;
		}
		return false;
	}

	function changeColor(ObjName, color){
	  	if (!ver4) return;
		if(eval(layerRef+'["'+ObjName+'"]')){
			eval(layerRef+'["'+ObjName+'"]'+styleSwitch+'.color = "'+color+'"');
		}
	}

	//called by onmouseout
	function showLayer(layerName){
	  	if (!ver4) return;
		if(eval(layerRef+'["'+layerName+'"]')){
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility = "visible"');
		}
	}

	//called by onmouseout
	function hideLayer(layerName){
	  	if (!ver4) return;
		if(eval(layerRef+'["'+layerName+'"]')){
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility = "hidden"');
		}
	}

	// List an Ojects properties
	function dumpObject(o, objName) {
	        var result = ""
	        count = 0
	        for (var i in o) {
	                result += o + "." + i + "=" + o[i] + "\n"
	                count++
	                if (count == 25) {
	                        alert(result)
	                        result = ""
	                        count = 0
	                }
	        }
	        alert(result)
	}
	// Remove the leading space/s of an argument.
	function ltrim(argvalue) {
		while (1) {
			if (argvalue.substring(0, 1) != " ")
				break;
			argvalue = argvalue.substring(1, argvalue.length);
		}
		return argvalue;
	}

	// Remove the trailing space/s of an argument.
	function rtrim(argvalue) {
		while (1) {
			if (argvalue.substring(argvalue.length - 1, argvalue.length) != " ")
				break;
			argvalue = argvalue.substring(0, argvalue.length - 1);
		}
		return argvalue;
	}

	// Remove both the leading and the trailing space/s of an argument.
	function trim(argvalue) {
		var tmpstr = argvalue;
		var tmpstr = ltrim(tmpstr);
		return rtrim(tmpstr);
	}


	/* ----------------------------------------------------------------------------------------
		Routines for cross-platform DHTML
		----------------------------------------------------------------------------------------
	*/
	// Convert object name string or object reference
	// into a valid object reference
	function getObject(obj) {
		var theObj
		if (typeof obj == "string") {
			if (obj.indexOf(".") == -1)
				theObj = eval(layerRef +'["' + obj + '"]' + styleSwitch);
			else
				theObj = eval(obj);
		} else {
			theObj = obj
		}
		return theObj
	}

	function isObject(obj) {
		if (typeof obj + "" == "undefined" || obj == null) {
			return false
		}
		else {
			if (typeof obj == "object")
				return true
			else if (typeof obj == "string") {
				if (eval("window.document." + range + obj + styleObj)) alert('error in isobject');

				if (typeof(eval("window." + obj)) + "" == "object" ||
					 typeof(eval("window.document." + range + obj + styleObj)) + "" == "object" ||
					 typeof(eval("window.document." + obj)) + "" == "object") {
					return true
				}
				return false
			}
			return false
		}
	}

	// Positioning an object at a specific pixel coordinate
	function shiftTo(obj, x, y) {
		var theObj = getObject(obj)
		if (typeof theObj + "" == "undefined" || theObj == null) return
		if (NS4) {
			theObj.moveTo(x,y)
		} else {
			theObj.pixelLeft = x
			theObj.pixelTop = y
		}
	}

	// Moving an object by x and/or y pixels
	function shiftBy(obj, deltaX, deltaY) {
		var theObj = getObject(obj)
		if (NS4) {
			theObj.moveBy(deltaX, deltaY)
		} else {
			theObj.pixelLeft += deltaX
			theObj.pixelTop += deltaY
		}
	}

	// Setting the z-order of an object
	function setZIndex(obj, zOrder) {
		var theObj = getObject(obj)
		theObj.zIndex = zOrder
	}


