// Main background color
	if (typeof fcolor == 'undefined') { var fcolor = "#FFFF99";}
// Border color and color of caption
	if (typeof backcolor == 'undefined') { var backcolor = "#000000";}
// Text color
	if (typeof textcolor == 'undefined') { var textcolor = "#000000";}
// Color of the caption
	if (typeof capcolor == 'undefined') { var capcolor = "#FFFFFF";}
// Width of the popups in pixels
	if (typeof width == 'undefined') { var width = "140";}
// How thick the border should be in pixels
	if (typeof border == 'undefined') { var border = "2";}
// How many pixels to the r/l of the cursor to show the popup
	if (typeof offsetx == 'undefined') { var offsetx = 12;}
// How many pixels to the below the cursor to show the popup
	if (typeof offsety == 'undefined') { var offsety = 12;}
	
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
// Microsoft Stupidity Check.
if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) {
		ie5 = true;
	} else {
		ie5 = false; }
} else {
	ie5 = false;
}
if (navigator.userAgent.indexOf('Netscape6')>0) {
		ns6 = true;
	} else {
		ns6 = false; }
if (ns6) {
	ns4 = true;
	}

var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dir = 1;

if ( (ns4) || (ie4) ) {
	if (ns6) {
		over = document.getElementById("overDiv").style;
		c_over = document.getElementById("overDiv");
	}
	else if (ns4) {
		over = document.overDiv;
		c_over = document.overDiv.document;
		}
	if (ie4) {
		over = overDiv.style;
		// c_over = document.all["overDiv"];
		c_over = document.getElementById("overDiv");
		}
	document.onmousemove = mouseMove;
	if (ns4) document.captureEvents(Event.MOUSEMOVE);
 	}

// Change image
function changeit(picture,w)
 {
      nuova=eval(picture+ w + ".src");
      document[picture].src= nuova;
 }

// Clears popups if appropriate
function nd() {
	if ( cnt >= 1 ) { sw = 0 };
	if ( (ns4) || (ie4) ) {
		if ( sw == 0 ) {
			snow = 0;
			hideObject(over);
			} else {
			cnt++;
		}
	}
	return true;
}

// Caption popup 1=right 2=center 0=left
function dtc(d,text, title) {
	if (ns6)
		brd = border
	else
		brd = 0
	if (title == "")
		txt = "<TABLE WIDTH="+width+" BORDER="+brd+" CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"popups\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT></SPAN></TD></TR></TABLE></TD></TR></TABLE>";
	else
		txt = "<TABLE WIDTH="+width+" BORDER="+brd+" CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD><P ALIGN=\"center\"><SPAN ID=\"ptitle\"><B><FONT COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD></P></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=9 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"popups\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>";
	layerWrite(txt);
	dir = d;
	disp();
	return true;
}

// Writes to a layer
function layerWrite(txt) {
	if ((ns6) || (ie4)) c_over.innerHTML = txt;
		else if (ns4) {
			var lyr = document.overDiv.document;
	        	lyr.write(txt);
	                lyr.close();
        }
        		
}


// Common calls
function disp() {
	if ( (ns4) || (ie4) ) {
		if (snow == 0) 	{
			if (dir == 2) { // Center
				moveTo(over,x+offsetx-(width/2),y+offsety);
			}
			if (dir == 1) { // Right
				moveTo(over,x+offsetx,y+offsety);
			}
			if (dir == 0) { // Left
				moveTo(over,x-offsetx-width,y+offsety);
			}
			showObject(over);
			snow = 1;
		}
	}
// Here you can make the text goto the statusbar.
}
// Moves the layer
function mouseMove(e) {
	if (ns4) {x=e.pageX; y=e.pageY;}
	if (ie4) {x=event.x; y=event.y;}
	if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
	if (snow) {
		if (dir == 2) { // Center
			moveTo(over,x+offsetx-(width/2),y+offsety);
		}
		if (dir == 1) { // Right
			moveTo(over,x+offsetx,y+offsety);
		}
		if (dir == 0) { // Left
			moveTo(over,x-offsetx-width,y+offsety);
		}
	}
}

// Make an object visible
function showObject(obj) {
	if ((ie4) || (ns6)) obj.visibility = "visible";
        else if (ns4) obj.visibility = "show";
}

// Hides an object
function hideObject(obj) {
	if ((ns6) || (ie4)) obj.visibility = "hidden";
	else if (ns4) obj.visibility = "hide";
}
// Move a layer
function moveTo(obj,xL,yL) {
        obj.left = xL
        obj.top = yL
}

// for (prop in navigator)
//	document.write (prop + "=" + navigator[prop] + "<br>");
//document.write ("ie4 " + ie4 + "<br>");
//document.write ("ie5 " + ie5 + "<br>");
//document.write ("ns4 " + ns4 + "<br>");
//document.write ("ns6 " + ns6 + "<br>");

