function lib_bwcheck(){ 
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	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.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()
function makeObj(obj){
	this.elm = bw.ns4?eval("document.layers." +obj):bw.ie4?document.all[obj]:document.getElementById(obj);
   	this.css = bw.ns4?this.elm:this.elm.style;
   	this.wref= bw.ns4?this.elm.document:this.elm;
	this.obj= obj+'makeObj'; eval(this.obj+'=this'); 
	this.w= bw.ns4? this.elm.clip.width: this.elm.offsetWidth;
	this.h= bw.ns4? this.elm.clip.height: this.elm.offsetHeight;
	if(!bw.ns4){this.sel=bw.ie4?window.document.all.tags("SELECT"):window.document.getElementsByTagName("SELECT");}
	return this;
}

fromX= -160;
fromY= 21;
delay= 0;
fixedPos= true;     

var px = "" //bw.ns4||window.opera?"":"px";

if(document.layers){ 
    scrX= window.innerWidth; scrY= window.innerHeight;
    onresize= function(){if(scrX!= window.innerWidth || scrY!= window.innerHeight){history.go(0)}};
}
makeObj.prototype.measureIt= function(){
	this.w= bw.ns4? this.elm.clip.width: this.elm.offsetWidth;
	this.h= bw.ns4? this.elm.clip.height: this.elm.offsetHeight;
};
makeObj.prototype.writeIt= function(text){
	if (bw.ns4) {
		this.wref.write(text); 
		this.wref.close();
	}else{
		this.wref.innerHTML= text;
	}
};

var mouseX=0,mouseY=0,setX=0,setY=0;
function getMousemove(e){
	mouseX= (bw.ns4||bw.ns6)? e.pageX: bw.ie&&bw.win&&!bw.ie4? (event.clientX-2)+document.body.scrollLeft : event.clientX+document.body.scrollLeft;
	mouseY= (bw.ns4||bw.ns6)? e.pageY: bw.ie&&bw.win&&!bw.ie4? (event.clientY-2)+document.body.scrollTop : event.clientY+document.body.scrollTop;
	if (isLoaded && hovering){
		if(!fixedPos){
			placeIt();
			fixedPos = true;
		}
	}
}
function placeIt(){
	setX= mouseX+fromX+tooltip.w>screenWscrolled?mouseX-fromX-tooltip.w:mouseX+fromX;
	setY= mouseY+fromY+tooltip.h>screenHscrolled?mouseY-fromY-tooltip.h:mouseY+fromY;
	if (setX<0) setX= 0;
	if (setY<0) setY= 0;
	tooltip.css.left= setX+px;
	tooltip.css.top= setY+px;
}

var hovering=false, screenWscrolled=0, screenHscrolled=0;
makeObj.prototype.showTimer= null;
function popUp(num){
	if(isLoaded){
		clearTimeout(tooltip.popTimer);
		cleanpopOut();
		if (bw.ns4){
			var text= '<span class="netscape4Style">' + messages[num] + '</span>';
			tooltip.writeIt(text);
		}
		if (!bw.ns4){
			tooltip.writeIt(messages[num]);
		}
		screenWscrolled= screenW;
		screenHscrolled= screenH;
		hovering= true;
		tooltip.measureIt(); 
		placeIt();
		tooltip.showTimer= setTimeout('tooltip.blendIn()', delay);
		if(!bw.ns4){
			for(i=0;i<tooltip.sel.length;i++){
				selx=0; sely=0; var selp;
				if(tooltip.sel[i].offsetParent){
					selp=tooltip.sel[i]; 
					while(selp.offsetParent){
					selp=selp.offsetParent; 
					selx+=selp.offsetLeft; 
					sely+=selp.offsetTop;
					}
				}
				selx+=tooltip.sel[i].offsetLeft; 
				sely+=tooltip.sel[i].offsetTop;
				selw=tooltip.sel[i].offsetWidth; 
				selh=tooltip.sel[i].offsetHeight;
				if(((selx+selw)>tooltip.css.left.replace('px','') && selx<(tooltip.css.left.replace('px','')+tooltip.w))&&((sely+selh)>tooltip.css.top.replace('px','') && sely<(tooltip.css.top.replace('px','')+tooltip.h))){					
					if(tooltip.sel[i].style.visibility!="hidden"){
						tooltip.sel[i].style.visibility="hidden"; 
					}
				}else{
					tooltip.sel[i].style.visibility="visible"
				}
			}
		}
    }
}
makeObj.prototype.popTimer= null;
function popOut(){
	if (isLoaded) {
		tooltip.popTimer= setTimeout('dopopOut()', 0)
	}
	if(!bw.ns4){
		for(i=0;i<tooltip.sel.length;i++){
			tooltip.sel[i].style.visibility="visible"
		}
	}
}
function cleanpopOut(){
	hovering= false;
	clearTimeout(tooltip.showTimer);
	tooltip.css.visibility= 'hidden';
	clearTimeout(tooltip.fadeTimer);
	tooltip.i= 0;
}
function dopopOut(){
	tooltip.blendOut();
	hovering= false;
	clearTimeout(tooltip.showTimer);
	tooltip.css.visibility= 'hidden';
	clearTimeout(tooltip.fadeTimer);
	tooltip.i= 0;
}
var scrollbarWidth= bw.ns6&&bw.win?14:bw.ns6&&!bw.win?16:bw.ns4?16:0;
function measureScreen() {
	screenW = 0;
	screenH = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		screenW = window.innerWidth;
		screenH = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		screenW = document.documentElement.clientWidth;
		screenH = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		screenW = document.body.clientWidth;
		screenH = document.body.clientHeight;
	}


	tooltip.css.top= 0+px;
	tooltip.css.left= 0+px;
}

makeObj.prototype.blendOut= function(){
	if (bw.ie && bw.win && !bw.ie4) {
		this.css.filter= 'blendTrans(duration=0.5)';
		this.elm.filters.blendTrans.apply();
		this.css.visibility= 'hidden';
		this.elm.filters.blendTrans.play();
	}
	else {
		this.css.visibility= 'visible';
	}
};
makeObj.prototype.blendIn= function(){
	if (bw.ie && bw.win && !bw.ie4) {
		this.css.filter= 'blendTrans(duration=0.5)';
		this.elm.filters.blendTrans.apply();
		this.css.visibility= 'visible';
		this.elm.filters.blendTrans.play();
	}
	else {
		this.css.visibility= 'visible';
		if (!bw.ns4) this.fadeIt();
	}
};
makeObj.prototype.step= 8;
makeObj.prototype.i= 0;
makeObj.prototype.fadeTimer= null;
makeObj.prototype.fadeIt= function(){
	this.i+= this.step;
	this.css.MozOpacity= this.i/100;
	if (this.i<100) this.fadeTimer= setTimeout(this.obj+'.fadeIt()', 40);
	else this.i= 0;
};

var isLoaded= false;
function doMouseover(){
	clearTimeout(tooltip.popTimer); 
	if(bw.ns4){
		setTimeout('clearTimeout(tooltip.popTimer)',20)
	}
	fixedPos = false;
}
function popupInit(){
	bw.win= (navigator.userAgent.indexOf('Windows')>-1)
	tooltip= new makeObj('divTooltip');
	tooltip.elm.onmouseover= doMouseover;
	tooltip.elm.onmouseout= dopopOut;
	if (bw.ns4) document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove= getMousemove;
	measureScreen();
	if (!bw.ns4) onresize= measureScreen;
	if (!bw.ns4) tooltip.elm.className= 'normalStyle';
	if (bw.ie && bw.win && !bw.ie4) tooltip.css.filter= 'alpha(opacity=100)'; 
	isLoaded= true;
}







