/**********************************************************************************
PopupDescriptions
*   Copyright (C) 2001 Thomas Brattli
*   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 Thomas Brattli
*
*   Script date: 09/04/2001 (keep this date to check versions)
*********************************************************************************/

/***************************************************************************************
Variables to set:
***************************************************************************************/

var start_left = -200;
var end_left = 0;
var end_top = 200;
var end_top2 = 490;

var steps = 10;

//Makes crossbrowser object.
function makeObj(obj){
   	this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
	if(!this.evnt) return false
	this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;
   	this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;
	this.moveIt=b_moveIt;
	this.repositionDiv=repositionDiv;
	this.slid_out=slid_out;
	this.slid_in=slid_in;
	return this
}
// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x+px; this.css.top=this.y+px;}

//Capturing mousemove
var descx = 0
var descy = 0
function popmousemove(e){
	descx=bw.ns4||bw.ns6?e.pageX:event.x; descy=bw.ns4||bw.ns6?e.pageY:event.y
}

function slid_out(i,speed) {
	if(i<end_left){
		next_i = i+steps;
		//var maxValue = Math.max(document.body.scrollTop+end_top,document.documentElement.scrollTop+end_top);
		//this.moveIt(next_i,maxValue);
		this.moveIt(next_i,end_top2);
		setTimeout("oLayer.slid_out("+next_i+","+speed+")",speed);
	}
}
function slid_in(i,speed) {
	if(i>start_left){
		next_i = i-steps;
		//var maxValue = Math.max(document.body.scrollTop+end_top,document.documentElement.scrollTop+end_top);
		//this.moveIt(next_i,maxValue);
		this.moveIt(next_i,end_top2);
		setTimeout("oLayer.slid_in("+next_i+","+speed+")",speed);
	} else {
		oLayer2.css.visibility = "visible";
	}
}

var oLayer;
//Shows the messages
function showlayer(){
    if(oLayer){
		oLayer.css.left = start_left;
		oLayer.css.visibility = "visible";
		oLayer.slid_out(start_left,0);
		oLayer2.css.visibility = "hidden";
    }
}
//Hides it
function hidelayer(){
	if(oLayer) {
		oLayer.slid_in(end_left,0);
	}
}
function repositionDiv() {
	var maxValue = Math.max(document.body.scrollTop+end_top,document.documentElement.scrollTop+end_top);
	oLayer.css.top = maxValue;
	var maxValue = Math.max(document.body.scrollTop+end_top2,document.documentElement.scrollTop+end_top2);
	//oLayer2.css.top = maxValue;
}
function setPopup(){
   	if(bw.ns4)document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove = popmousemove;
	oLayer = new makeObj('staff-exp')
	oLayer2 = new makeObj('s-exp-open')
	//window.onscroll = repositionDiv;
	//repositionDiv();
}

var mousex;
var mousey;

