////////////////////////////////////////////////////////////////////////////////////
// CONFIGURATION
////////////////////////////////////////////////////////////////////////////////////
// Main background color (the large area)
//	if (typeof fcolor == 'undefined') { var fcolor = "+amfcolor+";}
// Border color and color of caption
//	if (typeof backcolor == 'undefined') { var backcolor = "#999999";}
// Text color
//	if (typeof textcolor == 'undefined') { var textcolor = "#001CAB";}
// Color of the caption text
//	if (typeof capcolor == 'undefined') { var capcolor = "#FFFFFF";}
// Width of the popups in pixels - 100-300 pixels is typical
//	if (typeof width == 'undefined') { var width = "130";}
// How thick the border should be in pixels
	if (typeof border == 'undefined') { var border = '1';}
// How many pixels to the right/left of the cursor to show the popup (3 to 12 is best)
	if (typeof offsetx == 'undefined') { var offsetx = 7;}
// How many pixels to the below the cursor to show the popup  (3 to 12 is best)
	if (typeof offsety == 'undefined') { var offsety = 3;}
////////////////////////////////////////////////////////////////////////////////////
// END CONFIGURATION
////////////////////////////////////////////////////////////////////////////////////

var eff;
var dur;

   supp_DOM = (document.getElementById) ? true : false;
         IE = (document.all) ? true : false;
        IE4 = IE && !supp_DOM;
        IE5 = IE && supp_DOM;
      isMac = (navigator.appVersion.indexOf("Mac") != -1) ? 1 : 0;   
     IE4Mac = IE4 && isMac;
     IE5Mac = IE5 && isMac;
      IEWin =  IE && !isMac;
      IEMac =  IE && isMac;
     IE4Win = IE4 && IEWin;
     IE5Win = IE5 && IEWin;
         NS = navigator.appName == ("Netscape");
        NS4 = (document.layers) ? 1 : 0;
     NS4old = (NS4 && (parseFloat(navigator.appVersion) < 4.02));
        NS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
       ver4 = (NS4 || IE4) ? 1 : 0;   
isTrans = (IE5Win) ? 1 : 0;
canshow = (!IEMac);

var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dir = 1;
var tr = 1;
if ( canshow ) {
	if (NS4) over = document.overDiv
        if (NS6) over = document.getElementById('overDiv').style
        if (IE) over = overDiv.style
       	document.onmousemove = mouseMove
	if (NS4) document.captureEvents(Event.MOUSEMOVE)
}

// Caption popup right
function drc(text, title, amfcolor, ambackcolor, amtextcolor, amcapcolor, amwidth) {

    if (canshow) dtc(1,text,title,amfcolor,ambackcolor,amtextcolor,amcapcolor,amwidth);
}



// Clears popups if appropriate
function nd() {
if ( canshow ) 
  {
	if ( cnt >= 1 ) { sw = 0 };
	if ( (NS4) || (IE) || (NS6) ) {
		if ( sw == 0 ) {
			snow = 0;
			hideObject(over);
		} else {
			cnt++;
		}
	}
  }
}

// Non public functions. These are called by other functions etc.

// Simple popup
function dts(d,text,amfcolor,ambackcolor,amtextcolor,amcapcolor,amwidth) {
	txt = "<TABLE WIDTH="+amwidth+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+ambackcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+amfcolor+"\"><TR><TD><FONT FACE=\"Arial,Helvetica\" COLOR=\""+amtextcolor+"\" SIZE=\"-2\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
	layerWrite(txt);
	dir = d;
	disp();
}

// Caption popup
function dtc(d,text, title, amfcolor, ambackcolor, amtextcolor, amcapcolor, amwidth) {
	widthbrows = (NS6) ? 99 : 100 ;
        txt = '<TABLE WIDTH="'+amwidth+'" BORDER="0" CELLPADDING="'+border+'" CELLSPACING="0" BGCOLOR="'+ambackcolor+'"><TR><TD><TABLE WIDTH="100%" BORDER="0" CELLPADDING="1" CELLSPACING="0"><TR><TD><B><FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" COLOR=\"'+amcapcolor+'"\" SIZE=\"-2\">'+title+'</FONT></B></TD></TR></TABLE><CENTER><TABLE WIDTH="'+widthbrows+'%" BORDER="0" CELLPADDING="2" CELLSPACING="0" BGCOLOR="'+amfcolor+'"><TR><TD><FONT FACE="Verdana,Arial,Helvetica,sans-serif" COLOR="'+amtextcolor+'" SIZE="-2">'+text+'</FONT></TD></TR></TABLE></CENTER></TD></TR>';
        if (NS6) {txt = txt +'<TR><TD><IMG SRC="images/transparent.gif" width="1" height="1"></TD></TR>';}
        txt = txt + '</TABLE>';         
        layerWrite(txt);
	dir = d;
	disp();
        snow = 0;
}

// Sticky
function stc(d,text, title,amfcolor, ambackcolor, amtextcolor, amcapcolor, amwidth) {
	sw = 1;
	cnt = 0;
	txt = "<TABLE WIDTH="+amwidth+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+ambackcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT COLOR=\""+amcapcolor+"\">"+title+"</FONT></B></SPAN></TD><TD ALIGN=RIGHT><A HREF=\"/\" onMouseOver=\"cClick();\" ID=\"PCL\"><FONT COLOR=\""+closecolor+"\">Close</FONT></A></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+amfcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT COLOR=\""+amtextcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
	layerWrite(txt);
	dir = d;
	disp();
	snow = 0;
}

// Common calls
function disp() {
	if ( (NS4) || (IE) || (NS6) ) {
                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);
			}
			snow = 1;
			showObject(over);
		}
	}
// Here you can make the text goto the statusbar.
}

// Moves the layer
function mouseMove(e) {
	if ((NS4) || (NS6)) {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);
		}
	}
       
   
}


// Writes to a layer
function layerWrite(txt) {
        if (NS4) {
                var lyr = document.overDiv.document
                lyr.write(txt)
                lyr.close()
        }
        else if (IE) document.all["overDiv"].innerHTML = txt
        else if (NS6) document.getElementById('overDiv').innerHTML = txt
}

// Make an object visible
function showObject(obj) {
        if (NS4)  obj.visibility = "show"
        else if (isTrans) {doTrans('overDiv',5,'0.1')}
        else if ((IEMac) || (IE4Win) || (NS6)) {obj.visibility = "visible"}

}

// Hides an object
function hideObject(obj) {
       if (NS4)  obj.visibility = "hide"
       else if ((IE) || (NS6)) obj.visibility = "hidden"
          
}

// Move a layer
function moveTo(obj,xL,yL) {
        obj.left = xL
        obj.top = yL
}

/////////////////////////////////
// TRANSITION GENERATOR
/////////////////////////////////

function doTrans(a,transNo,dur) {
       transNo = parseInt(transNo);
       overDiv.style.filter = "revealTrans(duration=" + dur + ",transition=" + transNo + ")";
       endState = "visible";
	 overDiv.style.visibility="hidden";
	 overDiv.onfilterchange = clearFilt;
	 overDiv.filters.revealTrans.apply();
       overDiv.filters.revealTrans.play();
       overDiv.style.visibility = endState;
}

function clearFilt() {
	overDiv.style.filter="";
}



