	//
	//	universal javascript functions
	//	updated for ie6 and ns6
	//
	//	author: mikan huppertz
	//	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\";");}
		}
	}
	
	//
	//	open centered window
	//
	function openWindow(inURL, inWidth, inHeight){
		checkWinSize();
		if(!center_x || !center_y){
			center_x = 400;
			center_y = 300;
		}
		sitewindow = window.open(inURL, "sitewindow", "resizable=no, width="+inWidth+", height="+inHeight);
		sitewindow.resizeTo(inWidth,inHeight);
		sitewindow.moveTo( (center_x - Math.round((inWidth/2)) ),(center_y - Math.round((inHeight/2)) ) );
	}
	
	//
	//	std dhtml lib
	//	
	function obj(obj,nest){ 
		if(!bw.bw) return bw_message('Old browser')
		nest=(!nest) ? "":'document.'+nest+'.'
		this.evnt=bw.dom? document.getElementById(obj):
			bw.ie4?document.all[obj]:
				bw.ns4?eval(nest+"document.layers." +obj):
					0;	
		if(!this.evnt) return bw_message('The layer does not exist ('+obj+') - \nIf your using Netscape please check the nesting of your tags!')
		this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
		this.ref=bw.dom||bw.ie4?document:this.css.document;
		this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0;
		this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0;
		this.w=this.evnt.offsetWidth||this.css.clip.width||this.ref.width||this.css.pixelWidth||0; 
		this.h=this.evnt.offsetHeight||this.css.clip.height||this.ref.height||this.css.pixelHeight||0;
		//Clip values
		this.c=0; 
		if((bw.dom || bw.ie4) && this.css.clip) {
			this.c=this.css.clip; 
			this.c=this.c.slice(5,this.c.length-1); 
			this.c=this.c.split(' ');
			for(var i=0;i<4;i++){
				this.c[i]=parseInt(this.c[i])
			}
		}
		this.ct=this.css.clip.top||this.c[0]||0; 
		this.cr=this.css.clip.right||this.c[1]||this.w||0;
		this.cb=this.css.clip.bottom||this.c[2]||this.h||0; 
		this.cl=this.css.clip.left||this.c[3]||0;
		this.obj = obj + "Object"; eval(this.obj + "=this")
		// extra non standard functions:
		return this
	}
	
	obj.prototype.moveIt = function(x,y){
	  this.x=x;
	  this.y=y; 
	  this.css.left=x;
	  this.css.top=y;
	}
	
	obj.prototype.moveBy = function(x,y){
		this.css.left=this.x+=x; 
		this.css.top=this.y+=y;
	}
	
	obj.prototype.showIt = function(){
		this.css.visibility="visible";
	}
	
	obj.prototype.hideIt = function(){
		this.css.visibility="hidden";
	}
	
	obj.prototype.bg = function(color){ 
		if(bw.dom || bw.ie4){
			this.css.backgroundColor=color;
		} else if(bw.ns4) {
			this.css.bgColor=color;
		}
	}
	
	obj.prototype.writeIt = function(text,startHTML,endHTML){
		if(bw.ns4){
	    	if(!startHTML){
				startHTML="";
				endHTML="";
			}
		  	this.ref.open("text/html"); 
	    	this.ref.write(startHTML+text+endHTML); 
	   		this.ref.close()
		} else {
			this.evnt.innerHTML=text;
		}
	}
	
	obj.prototype.clipTo = function(t,r,b,l,setwidth){ 
		this.ct=t; this.cr=r; this.cb=b; this.cl=l
		if(bw.ns4){
			this.css.clip.top=t;
			this.css.clip.right=r
			this.css.clip.bottom=b;
			this.css.clip.left=l
		} else {
			if(t<0){
				t=0;
			}
			if(r<0){
				r=0;
			}
			if(b<0){
				b=0;
			}
			if(b<0){
				b=0;
			}
			this.css.clip="rect("+t+","+r+","+b+","+l+")";
			if(setwidth){
				this.css.pixelWidth=this.css.width=r; 
	    		this.css.pixelHeight=this.css.height=b;
			}
		}
	}
	
	obj.prototype.clipBy = function(t,r,b,l,setwidth){ 
		this.clipTo(this.ct+t,this.cr+r,this.cb+b,this.cl+l,setwidth);
	}
	
	function doc_size(){ 
		this.x=0;
		this.x2=bw.ie && document.body.offsetWidth-20||innerWidth||0;
		this.y=0;
		this.y2=bw.ie && document.body.offsetHeight-5||innerHeight||0;
		if(!this.x2||!this.y2){
			return message('Document has no width or height');
		}
	  	this.x50=this.x2/2;
		this.y50=this.y2/2;
	  	return this;
	}

