/**********************************************************************************
PopupDescriptions
*   Copyright (C) 2001 <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a>
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by <a href="/dhtmlcentral/thomas_brattli.asp">Thomas Brattli</a>
*********************************************************************************/
function Auth_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.ie7=(this.ver.indexOf("MSIE 7")>-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.Auth_bw=(this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
	return this;
}

var Auth_PopupLibLoaded = true;
var Auth_bw = new Auth_lib_bwcheck();

/***************************************************************************************
Variables to set:
***************************************************************************************/

var Auth_PopupWidth = 244; //width in pixels of the popup object (must be the same as in the style sheet)
var Auth_fromX = 50; //How much from the actual mouse X should the description box appear?
var Auth_fromY = -20; //How much from the actual mouse Y should the description box appear?

// A unit of measure that will be added when setting the position of a layer.
var Auth_px = Auth_bw.ns4||window.opera?"":"px";
var Auth_oGroup = new Array();

// Capturing mousemove
var Auth_descx = 0;
var Auth_descy = 0;
function Auth_popmousemove(e) 
{
    Auth_descx = Auth_bw.ns4||Auth_bw.ns6?e.pageX:event.x;
    Auth_descy = Auth_bw.ns4||Auth_bw.ns6?e.pageY:event.y;
}

// Makes crossbrowser object.
function Auth_makeObj(obj)
{
   	this.evnt=Auth_bw.dom? document.getElementById(obj):Auth_bw.ie4?document.all[obj]:Auth_bw.ns4?document.layers[obj]:0;
	if(!this.evnt) return false;
	this.css=Auth_bw.dom||Auth_bw.ie4?this.evnt.style:Auth_bw.ns4?this.evnt:0;
   	this.wref=Auth_bw.dom||Auth_bw.ie4?this.evnt:Auth_bw.ns4?this.css.document:0;
	this.writeIt=Auth_b_writeIt;
	return this;
}

function Auth_b_writeIt(text)
{
	if (Auth_bw.ns4){this.wref.write(text);this.wref.close();}
	else this.wref.innerHTML = text;
}

function Auth_setPopup(DivName)
{
   	if(Auth_bw.ns4) document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = Auth_popmousemove;
	Auth_oGroup[DivName] = new Auth_makeObj(DivName);
}

// Shows the messages
function Auth_popup(DivName)
{
    var obj = Auth_oGroup[DivName];
    if (obj)
    {
		if(Auth_bw.ie5||Auth_bw.ie6||Auth_bw.ie7) 
		{
			Auth_descy = Auth_descy+document.body.scrollTop;
			Auth_descx = Auth_descx+document.body.scrollLeft
		}
		
		//Check it isn't going to popup off the screen (rigth) if it is, move it to the left of the mouse.
		if (Auth_descx+Auth_fromX+Auth_PopupWidth+100 > screen.width)
			obj.css.left = (Auth_descx-Auth_fromX-Auth_PopupWidth)+Auth_px;
		else
			obj.css.left = (Auth_descx+Auth_fromX)+Auth_px;
		
		// This is if some doctype is specified in the page a javascript variable is needed in the page 'DocType' to make it work properly.
		var ExtraScroll = 0;
		if (true || typeof(DocType) != 'undefined') 
		{	
			if(Auth_bw.ie5||Auth_bw.ie6||Auth_bw.ie7||Auth_bw.opera5) 
			{
				if( typeof( window.pageYOffset ) == 'number' ) 
					ExtraScroll = window.pageYOffset;
				else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
					ExtraScroll = document.body.scrollTop;
				else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
					ExtraScroll = document.documentElement.scrollTop ;
			}
			else
				ExtraScroll = 0; 
		}
		
		obj.css.top  = ExtraScroll + (Auth_descy+Auth_fromY) +"px";
		obj.css.visibility = "visible";	
    }
}

// Hides it
function Auth_popout(DivName)
{
	if (Auth_oGroup[DivName]) Auth_oGroup[DivName].css.visibility = "hidden";
}


         