// JavaScript Document
function rowOverEffect(object) {
  if (object.className == 'dataTableRow') object.className = 'dataTableRowOver';
}

function rowOutEffect(object) {
  if (object.className == 'dataTableRowOver') object.className = 'dataTableRow';
}
/********************************************************************************************
    ToolTips Functions
*********************************************************************************************/


/********************************************************************************************
    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;

/*******
<img src="/images/img_help.gif" border=0 onMouseover="showToolTip('The Handle will be used for logging in and creating your homepage.<br><br><b>Format:</b> Min 6 chars, alphabets and numbers only.');" onMouseout="hideToolTip()">
/*******
/********************************************************************************************
    General Functions
*********************************************************************************************/
function checkBrowser() {
    // NS
    if (document.layers) return 0;
    // IE
    if (document.all) return 1;
    // MOZ
    if (document.getElementById) return 0;
    // OTHER
    return 1;
}

function showRow(id, on_off) {
    if (browserSupport == 1) {
        var el = document.all ? document.all[id] : document.getElementById(id);
        if(el) el.style.display = on_off ? '' : 'none';
    }
}

var browserSupport = checkBrowser();