// CONFIGURATION

var InfoIcon = "/";
var CloseIcon = "/";
var titlebackcolor = "#C39272";     // 1.COLUMN COLOR
var fcolor = "#dddddd";             // 2.COLUMN COLOR
var backcolor = "#986441";          // TABLE BORDER COLOR
var tablebordercolor1 = "#cccccc";   // Table Outer Border Color
var tablebordercolor2 = "#ffffff";
var textcolor = "#986441";          // Main Text color
var TextSizeNormal = "1";           // Normal Size
var TextSizeCaption = "2";          // Caption Text Size
var capcolor = "#FFFFFF";           // Color of the caption text
var closecolor = "#9999FF";         // Color of "Close" when using Sticky
var width = "160";                  // Width of the popups in pixels (100-300 pixels is typical)
var border = "1";                   // CELLPADDING - SPACE BETWEEN TEXT AND OUTER BORDER
var offsetx = 0;                    // How many pixels to the right/left of the cursor to show the popup (Values between 3 and 12 are best)
var offsety = 20;                   // How many pixels to the below the cursor to show the popup (Values between 3 and 12 are best)

image_1 = new Image();
image_1.src = InfoIcon;
image_2 = new Image();
image_2.src = CloseIcon;

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

if (ie4) {
    if (navigator.userAgent.indexOf('MSIE 5')>0) {
        ie5 = true;
    } else {
        ie5 = false; }
} else {
    ie5 = false;
}

var x = 0;
var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dir = 1;
var tr = 1;
if ( (ns4) || (ie4) ) {
    if (ns4) over = document.overDiv
    if (ie4) over = overDiv.style
    document.onmousemove = mouseMove
    if (ns4) document.captureEvents(Event.MOUSEMOVE)
}

function drs(text) {
    dts(1,text);
}

function drc(text, title) {
    dtc(1,text,title);
}

function src(text,title) {
    stc(1,text,title);
}

function dls(text) {
    dts(0,text);
}

function dlc(text, title) {
    dtc(0,text,title);
}

function slc(text,title) {
    stc(0,text,title);
}

function dcs(text) {
    dts(2,text);
}

function dcc(text, title) {
    dtc(2,text,title);
}

function scc(text,title) {
    stc(2,text,title);
}

function nd() {
    if ( cnt >= 1 ) { sw = 0 };
    if ( (ns4) || (ie4) ) {
        if ( sw == 0 ) {
            snow = 0;
            hideObject(over);
        } else {
            cnt++;
        }
    }
}

function dts(d,text) {
    txt = "<TABLE WIDTH="+width+" BORDER=1 bordercolor=\"+tablebordercolor1+\" CELLPADDING=0 CELLSPACING=0><TR><TD BGCOLOR=\""+backcolor+"\"><TABLE WIDTH=100% BORDER=1 bordercolor=\"+tablebordercolor2+\" CELLPADDING="+border+" CELLSPACING=1><TR><TD ALIGN=CENTER VALIGN=MIDDLE BGCOLOR=\""+fcolor+"\"><FONT FACE=\"Arial,Helvetica\" SIZE="+TextSizeNormal+" COLOR=\""+textcolor+"\">"+text+"&nbsp;&nbsp;&nbsp;</FONT></TD></TR></TABLE></TD></TR></TABLE>"

    layerWrite(txt);
    dir = d;
    disp();
}

function dtc(d,text, title) {
    txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD BGCOLOR=\""+backcolor+"\"><TABLE WIDTH=100% BORDER=0 CELLPADDING="+border+" CELLSPACING=1><TR><TD ALIGN=CENTER VALIGN=MIDDLE BGCOLOR=\""+titlebackcolor+"\"><B><FONT FACE=\"Arial, Verdana\" SIZE="+TextSizeCaption+" COLOR=\""+capcolor+"\">"+title+"&nbsp;&nbsp;&nbsp;</FONT></B></TD></TR><TR><TD BGCOLOR=\""+fcolor+"\"><FONT FACE=\"Arial, Verdana\" Size="+TextSizeNormal+" COLOR=\""+textcolor+"\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"

    layerWrite(txt);
    dir = d;
    disp();
}

function stc(d,text, title) {
    sw = 1;
    cnt = 0;
    txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD BGCOLOR=\""+backcolor+"\"><TABLE WIDTH=100% BORDER=0 CELLPADDING="+border+" CELLSPACING=1><TR><TD ALIGN=CENTER VALIGN=MIDDLE BGCOLOR=\""+titlebackcolor+"\"><B><FONT FACE=\"Arial, Verdana\" SIZE="+TextSizeCaption+" COLOR=\""+capcolor+"\"><IMG SRC=\""+InfoIcon+"\" BORDER=0 align=left>"+title+"&nbsp;&nbsp;&nbsp;</FONT></B></TD><TD WIDTH=10 ALIGN=RIGHT VALIGN=MIDDLE BGCOLOR=\""+titlebackcolor+"\"><A HREF=\"/\" onMouseOver=\"cClick();\"><IMG SRC=\""+CloseIcon+"\" BORDER=0 align=left></A></TD></TR><TR><TD COLSPAN=2 BGCOLOR=\""+fcolor+"\"><FONT FACE=\"Arial, Verdana\" Size="+TextSizeNormal+" COLOR=\""+textcolor+"\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
    layerWrite(txt);
    dir = d;
    disp();
    snow = 0;
}

function disp() {
    if ( (ns4) || (ie4) ) {
        if (snow == 0)  {
            if (dir == 2) {
                moveTo(over,x+offsetx-(width/2),y+offsety);
            }
            if (dir == 1) {
                moveTo(over,x+offsetx,y+offsety);
            }
            if (dir == 0) {
                moveTo(over,x-offsetx-width,y+offsety);
            }
            showObject(over);
            snow = 1;
        }
    }
// Here you can make the text goto the statusbar.
}

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) {
            moveTo(over,x+offsetx-(width/2),y+offsety);
        }
        if (dir == 1) {
            moveTo(over,x+offsetx,y+offsety);
        }
        if (dir == 0) {
            moveTo(over,x-offsetx-width,y+offsety);
        }
    }
}

function cClick() {
    hideObject(over);
    sw=0;
}

function layerWrite(txt) {

       if (ns4) {
                var lyr = document.overDiv.document
                lyr.write(txt)
                lyr.close()
        }
        else if (ie4) document.all.overDiv.innerHTML = txt
        if (tr) { trk(); }
}

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"
}

function moveTo(obj,xL,yL) {
        obj.left = xL
        obj.top = yL
}

function trk() {
// tr = 0;
}