//   This library is a simple and faster version of the 
//   library overLIB 3.10 (Last modified 2000-03-30.) -- 
//            Copyright Erik Bosrup 1998-2000. 
//            erik@bosrup.com
//            http://www.bosrup.com/web/overlib/license.html
//            Portions by Dan Steinman (dansteinman.com).
//
//  Modified by Egbert Bleyenburg, (17 july 2000)
//            ebleyenburg.member8freeler.nl
//            For ZEEZEILEN
//            ZZLN@ZZLN.NL
//            WWW.ZZLN.NL


var LEFT		=	7;
var RIGHT		=	8;
var CENTER		=	9;
var ABOVE		=	35;
var BELOW		=	36;

var o3_text = "Default Text";
var o3_hpos = RIGHT;
var o3_vpos = BELOW;
var o3_aboveheight = 0;
var o3_offsetx = 120;
var o3_offsety = 10;
var o3_width = 200;
var o3_height = -1;
var o3_border = 1;
var o3_fgcolor = "#FFFFEF";
var o3_bgcolor = "#003399";
var o3_textcolor ="#003399";
var o3_textfont = "Verdana,Arial,Helvetica";
var o3_textsize = "1";

var o3_status = "";
var o3_fixx = -1;
var o3_frame = self;
var o3_x = 0;
var o3_y = 0;
var o3_allowmove = 0;
var over = null;

//decide browser version
var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false
var ie5 = false;

// Microsoft Stupidity Check(tm).
if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) {
		ie5 = true;
	}
}

// Capture events, alt. diffuses the overlib function.
if ( (ns4) || (ie4) ) {
	document.onmousemove = mouseMove
	if (ns4) document.captureEvents(Event.MOUSEMOVE)
} else {
	overlib  = no_overlib;
	nd       = no_overlib;
	ver3fix  = true;
}

// Fake function for 3.0 users.
function no_overlib() {
	return ver3fix;
}

// PUBLIC FUNCTIONS
function overlib() {
	if ( (ns4) || (ie4) ) {
		if (ns4) over = o3_frame.document.overDiv
		if (ie4) over = o3_frame.overDiv.style
	}
	for (i = 0; i < arguments.length; i++) {
			o3_text = arguments[i];
			parsemode = 0;
	}
	
	return overlib310();
}

function nd() {
	if ( (ns4) || (ie4) ) {
			o3_allowmove = 0;
			hideObject(over);
	}
	return true;
}

// PRIVATE FUNCTIONS
// This function decides what it is we want to display and how we want it done.
function overlib310() {
	var layerhtml;
	if (o3_height > 0) {
		o3_height = "HEIGHT=" + o3_height;
	} else {
		o3_height = "";
	}
	layerhtml = ol_content_simple(o3_text);
	layerWrite(layerhtml);
	disp(o3_status);
	return true;
	}

function ol_content_simple(text) {                                                                                                                                                 
	txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 	BGCOLOR=\""+o3_bgcolor+"\" "+o3_height+"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0	BGCOLOR=\""+o3_fgcolor+"\"  "+o3_height+"><TR><TD VALIGN=TOP><FONT FACE=\""+o3_textfont+"\" COLOR=\""+o3_textcolor+"\" SIZE=\""+o3_textsize+"\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
	return txt;
}

// Displays the popup
function disp(statustext) {
	if ( (ns4) || (ie4) ) {
		if (o3_allowmove == 0) 	{
			placeLayer();
			showObject(over);
			o3_allowmove = 1;
		}
	}

	if (statustext != "") {
		self.status = statustext;
	}
}

// Decides where we want the popup.
function placeLayer() {
	var placeX, placeY;
	if (o3_hpos == CENTER) { 
		placeX = o3_x+o3_offsetx-(o3_width/2);
	}
	if (o3_hpos == RIGHT) { 
		placeX = o3_x+o3_offsetx;
	}
	if (o3_hpos == LEFT) { 
		placeX = o3_x-o3_offsetx-o3_width;
	}
		if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
		placeY = o3_y - (o3_aboveheight + o3_offsety);
	} else {
		placeY = o3_y + o3_offsety;
	}
	moveTo(over, placeX, placeY);
}

// Moves the layer
function mouseMove(e) {
	if (ns4) {o3_x=e.pageX; o3_y=e.pageY;}
	if (ie4) {o3_x=event.x; o3_y=event.y;}
	if (ie5) {o3_x=event.x+o3_frame.document.body.scrollLeft; o3_y=event.y+o3_frame.document.body.scrollTop;}
	if (o3_allowmove) {
		placeLayer();
	}
}

function layerWrite(txt) {
        if (ns4) {
                var lyr = o3_frame.document.overDiv.document
                lyr.write(txt)
                lyr.close()
        }
        else if (ie4) o3_frame.document.all["overDiv"].innerHTML = txt
}

function showObject(obj) {
        if (ns4) obj.visibility = "show"
        else if (ie4) obj.visibility = "visible"
}

function hideObject(obj) {
        if (ns4) obj.visibility = "hide"
        else if (ie4) obj.visibility = "hidden"
        self.status = "";
}

// Move a layer
function moveTo(obj,xL,yL) {
        obj.left = xL
        obj.top = yL
}
//END of LIBRARY

