/********************************************************************************************
    ToolTips Functions
*********************************************************************************************/

var tt_offsetxpoint=-60; //Customize x offset of tooltip
var tt_offsetypoint=20; //Customize y offset of tooltip
var tt_ie=document.all;
var tt_ns6=document.getElementById && !document.all;
var tt_enabletip=false;
if (tt_ie||tt_ns6)
    var tt_tipobj=document.all? document.all["TOOLTIPS"] : document.getElementById? document.getElementById("TOOLTIPS") : "";

function tt_ietruebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function tt_positiontip(e){
    if (tt_enabletip){
        var tt_curX=(tt_ns6)?e.pageX : event.x+tt_ietruebody().scrollLeft;
        var tt_curY=(tt_ns6)?e.pageY : event.y+tt_ietruebody().scrollTop;
        //Find out how close the mouse is to the corner of the window
        var tt_rightedge=tt_ie&&!window.opera? tt_ietruebody().clientWidth-event.clientX-tt_offsetxpoint : window.innerWidth-e.clientX-tt_offsetxpoint-20
        var tt_bottomedge=tt_ie&&!window.opera? tt_ietruebody().clientHeight-event.clientY-tt_offsetypoint : window.innerHeight-e.clientY-tt_offsetypoint-20

        var tt_leftedge=(tt_offsetxpoint<0)? tt_offsetxpoint*(-1) : -1000

        //if the horizontal distance isn't enough to accomodate the width of the context menu
        if (tt_rightedge<tt_tipobj.offsetWidth)
            //move the horizontal position of the menu to the left by it's width
            tt_tipobj.style.left=tt_ie? tt_ietruebody().scrollLeft+event.clientX-tt_tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tt_tipobj.offsetWidth+"px"
        else if (tt_curX<tt_leftedge)
            tt_tipobj.style.left="5px"
        else
            //position the horizontal position of the menu where the mouse is positioned
            tt_tipobj.style.left=tt_curX+tt_offsetxpoint+"px"

        //same concept with the vertical position
        if (tt_bottomedge<tt_tipobj.offsetHeight)
            tt_tipobj.style.top=tt_ie? tt_ietruebody().scrollTop+event.clientY-tt_tipobj.offsetHeight-tt_offsetypoint+"px" : window.pageYOffset+e.clientY-tt_tipobj.offsetHeight-tt_offsetypoint+"px"
        else
            tt_tipobj.style.top=tt_curY+tt_offsetypoint+"px"
            tt_tipobj.style.visibility="visible"
    }
}

function showToolTip(thetext, thecolor, thewidth){
    if (tt_ns6||tt_ie){
        if (typeof thewidth =="undefined") thewidth = 200;
        if (typeof thecolor =="undefined" || thecolor=="") thecolor = "#FFFFCC";
        tt_tipobj.style.width=thewidth+"px";
        tt_tipobj.style.backgroundColor=thecolor;
        tt_tipobj.innerHTML=thetext;
        tt_enabletip=true;
        //tt_positiontip;
        return false;
    }
}

function hideToolTip(){
    if (tt_ns6||tt_ie){
        tt_enabletip=false;
        tt_tipobj.style.visibility="hidden";
        tt_tipobj.style.left="-1000px";
        tt_tipobj.style.backgroundColor='';
        tt_tipobj.style.width='';
    }
}

document.onmousemove = tt_positiontip;


<!-- Highlight Form Fields -->


//Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="lightyellow"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}



function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=400,height=220,scrollbars=yes');
return false;
}

