	//
	//	universal javascript functions
	//	updated for ie6 and ns6
	//
	//	author: mikan huppertz	[mikan@playcollective.com]
	//	version: 1.5
	//	date: 2-10-2002
	//	browser check code by thomas brattli [www.bratta.com]
	//
	
	//
	//	succesfully tested on: win ie5, ie6, ns6 - mac ie5, ns6, ns7
	//
	
	//
	//	browser check
	//
	function lib_bwcheck(){ //Browsercheck (needed)
		this.ver=navigator.appVersion;
		this.agent=navigator.userAgent;
		this.dom=document.getElementById?1:0;
		this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0;
		this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
		this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
		this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
		this.ie=(this.ie4||this.ie5||this.ie6);
		this.mac=this.agent.indexOf("Mac")>-1;
		this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
		this.ns4=(document.layers && !this.dom)?1:0;
		this.ns=(this.ns4||this.ns6);
		this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
		return this;
	}
	var bw=lib_bwcheck()
	
	//
	// mac ie on error handler. 
	//
	if(bw.mac && bw.ie){ onerror = errorhandler; }
	function errorhandler(inMsg, inUrl, inLine){
		//alert(inMsg+"\n\n"+inUrl+"\n\n"+inLine);
		return true;
	}
	
	//
	// window sizes check
	//
	var window_width = 0;
	var window_height = 0;
	var center_x = 0;
	var center_y = 0;
	
	function checkWinSize(){
		if(bw.ns){
			window_width = this.window.innerWidth;
			window_height = this.window.innerHeight;
		}
		if(bw.ie){
			window_width = document.body.offsetWidth;
			window_height = document.body.offsetHeight;
		}
		
		if(window_width == 0){ window_width = 800; }
		if(window_height == 0){ window_height = 600; }
		
		if(bw.ns){
			center_x = Math.round(screen.width/2);
			center_y = Math.round(screen.height/2);
		}
		if(bw.ie){
			center_x = Math.round(screen.availwidth/2);
			center_y = Math.round(screen.availheight/2);
		}
	
	}
	
	//
	// image pre-loader
	//
	function PreLoadImages(inPath, inImageStr){
		var ImagesArr = new Array();
		ImagesArr = inImageStr.split(',');
		for (i=0; i<ImagesArr.length; i++){
			eval(ImagesArr[i].slice(0,-4)+"= new Image();");
			eval(ImagesArr[i].slice(0,-4)+".src = '"+inPath+ImagesArr[i]+"';");
		}
	}
	
	//
	// image swap in root document
	//
	function SwapImage(inImageName, inImage){
		if(bw.ie){
			eval("document.all."+inImageName+".src = "+inImage+".src;");
		} else if(bw.ns4){
			eval("document."+inImageName+".src = "+inImage+".src;");
		} else if(bw.ns6){
			eval("document."+inImageName+".src = "+inImage+".src;");
		} else {
			eval("document.all."+inImageName+".src = "+inImage+".src;");
		}
	}
	
	//
	// image swap in layer
	//
	function SwapImageLayer(inImageName, inLayer, inImage){
		if(bw.ie){
			eval("document.all."+inImageName+".src = "+inImage+".src;");
		} else if(bw.ns4){
			eval("document."+inLayer+".document."+inImageName+".src = "+inImage+".src;");
		} else if(bw.ns6){
			eval("document.getElementById(\""+inLayer+"\").document."+inImageName+".src = "+inImage+".src;");
		}
	}
	
	//
	//	layer visibility handlers
	//
	function ShowLayer(inLayer, inState){
		if(inState){
			if(bw.ie){eval("document.all."+inLayer+".style.visibility=\"visible\";");}
			if(bw.ns4){eval("document."+inLayer+".visibility=\"show\";");}
			if(bw.ns6){eval("document.getElementById(\""+inLayer+"\").style.visibility=\"visible\";");}
		} else {
			if(bw.ie){eval("document.all."+inLayer+".style.visibility=\"hidden\";");}
			if(bw.ns4){eval("document."+inLayer+".visibility=\"hide\";");}
			if(bw.ns6){eval("document.getElementById(\""+inLayer+"\").style.visibility=\"hidden\";");}
		}
	}
		

