
// OnBodyResize event handler
function OnResize() {
    // try to call resize methods for all iframes
    for (var i = 0; i < frames.length; i++) {
        try {
            fr.Resize();
        } catch (e) { }
    }
    // call Resize method if itr defined
    try {
        Resize();
    } catch (e) { }
}




function TooltipShowIE(obj) {
    var popup = createPopup();
    body = popup.document.body;
    var div = popup.document.createElement("span");
    div.innerHTML = obj.getAttribute("tooltiptext");
    div.style.border = "1px solid black";
    div.style.fontSize = "12px";
    div.style.fontFamily = "Arial";
    div.style.backgroundColor = "#FFFFC0";
    // div.style.margin = "5px";
    div.style.padding = "5px";
    div.style.position = "absolute";
    //    body.style.padding = "5px";
    //   body.style.margin = "0px";
    body.appendChild(div);
    popup.show(event.screenX - div.offsetWidth, event.screenY + 18, 180, 25);
    popup.show(event.screenX - div.offsetWidth, event.screenY + 18, div.offsetWidth, div.offsetHeight);
    // popup.show(event.screenX, event.screenY+18, div.offsetWidth, div.offsetHeight);        
    document.body.popup = popup;
}

function TooltipHideIE(obj) {
    document.body.popup.hide();
}

function TooltipMoveGecko(e) {

}

function TooltipShowGecko(obj) {
    var div = document.createElement("span");
    div.innerHTML = obj.getAttribute("tooltiptext");
    div.style.border = "1px solid black";
    div.style.fontSize = "12px";
    div.style.backgroundColor = "#FFFFC0";
    div.style.margin = "0px";
    div.style.padding = "5px";
    div.style.position = "absolute";
    var bounds = Utils.getBounds(obj); // getBounds(obj);
    div.style.left = 0 + "px";
    div.style.top = (bounds.top + 25) + "px";
    div.style.zIndex = "101010";
    document.body.appendChild(div);
    obj.onmousemove = TooltipMoveGecko;
    document.body.popup = div;
}

function TooltipHideGecko(obj) {
    obj.onmousemove = null;
    document.body.removeChild(document.body.popup);
    document.body.popup = null;
}

function TooltipShow(obj) {
    if (window.createPopup)
        TooltipShowIE(obj);
    else
        TooltipShowGecko(obj);
}

function TooltipHide(obj) {
    if (window.createPopup)
        TooltipHideIE(obj);
    else
        TooltipHideGecko(obj);
}





// ***************** Select row in a grid
var pRow = null;
var oldClassName = "";

function selectRow(tB_row) {
    while (tB_row.tagName != 'TR' && tB_row.parentNode)
        tB_row = tB_row.parentNode;
    if (tB_row != pRow) {
        if (pRow)
            pRow.className = oldClassName;
        pRow = tB_row;
        oldClassName = tB_row.className;
        tB_row.className = "selectedrow";
         tB_row.oldClassName = "selectedrow";
    }

}

var oldgridSelectedColor;

function setMouseOverColor(element) {
    oldgridSelectedColor = element.style.backgroundColor;
    element.style.backgroundColor = 'yellow';
    element.style.cursor = 'hand';
    element.style.textDecoration = 'none'; // 'underline';
}

function setMouseOutColor(element) {
    element.style.backgroundColor = oldgridSelectedColor;
    element.style.textDecoration = 'none';
}





