
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=((this.ver.indexOf("MSIE 5")>-1 || this.ver.indexOf("MSIE 6")>-1) && this.dom)?1:0;	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()


//To set the font size, font type, border color or remove the border or whatever,
//change the clDescription class in the stylesheet.

//Makes crossbrowser object.
function makeObj(obj){								
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0;	
   	this.wref=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj].document:0;		
	this.writeIt=b_writeIt;																
	return this
}
function b_writeIt(text){if(bw.ns4){this.wref.write(text);this.wref.close()}
else this.wref.innerHTML=text}

//Capturing mousemove
var descx,descy;
//function popmousemove(e){descx=bw.ns4?e.pageX:event.x; descy=bw.ns4?e.pageY:event.y}
function popmousemove(e){descx=bw.ns4||bw.ns5?e.pageX:event.x; descy=bw.ns4||bw.ns5?e.pageY:event.y}

//Initiates page
var isLoaded;
function popupInit(){

    oDesc=new makeObj('divDescription')
    if(bw.ns4||bw.ns5)document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove=popmousemove;
    isLoaded=true;

}	
//Shows the messages
function popup(num){
    if(isLoaded && menuInit){
		oDesc.writeIt('<table bgcolor="#8CBDF7" border="0" cellpadding="0" cellspacing="0" width="216" height="138"><tr><td width=15><img src="/sanitat/images/blank.gif" width="15"></td><td valign="top"><span class="clDescription"><br>'+messages[num]+'</span></td></tr></table>')
		if(bw.ie5) descy=descy+document.body.scrollTop
//		oDesc.css.left=descx+fromX; oDesc.css.top=descy+fromY
		if (descy > 0) {
			if (bw.ns5) oDesc.css.top=descy+fromY + "px";
			else oDesc.css.top=descy+fromY;
			oDesc.css.visibility='visible'
		}
    }
}
//Hides it
function popout(num){
	if(isLoaded) oDesc.css.visibility='hidden'
}

