//////////////////////////////////////////////////////
// Configurable JS style functions                  //
//////////////////////////////////////////////////////
    function TooltipConfig(e, width, xOffset, yOffset, above) {
        // In Koo Kim 200605
        // the following configures the wz_tooltip
        if (xOffset && xOffset != null) {
            e.T_OFFSETX=xOffset;
        } else {
            e.T_OFFSETX=10;
        }
        if (yOffset && yOffset != null) {
            e.T_OFFSETY=yOffset;
        } else {
            e.T_OFFSETY=10;
        }
        if (above && above != null) {
            e.T_ABOVE=above;
        }
        e.T_DELAY = 300;
        e.T_BORDERWIDTH=0;
        e.T_FONTCOLOR='#333333';
        e.T_FONTFACE='Arial, Verdana, Geneva, Helvetica, sans-serif';
        e.T_FONTSIZE='10px';
        e.T_OPACITY=95;
        e.T_PADDING=0;
        e.T_STATIC=false;
        e.T_TEXTALIGN='left';
        if (width && width!= null) {
            e.T_WIDTH=width;
        }
        return e;
    }
    function TooltipConfigImage(e, width, xOffset, yOffset, above) {
        // In Koo Kim 200605
        // the following configures the wz_tooltip
        if (xOffset && xOffset != null) {
            e.T_OFFSETX=xOffset;
        } else {
            e.T_OFFSETX=-250;
        }
        if (yOffset && yOffset != null) {
            e.T_OFFSETY=yOffset;
        } else {
            e.T_OFFSETY=10;
        }
        if (above && above != null) {
            e.T_ABOVE=above;
        }
        e.T_DELAY = 300;
        e.T_BORDERWIDTH=0;
        e.T_FONTCOLOR='#333333';
        e.T_FONTFACE='Arial, Verdana, Geneva, Helvetica, sans-serif';
        e.T_FONTSIZE='9px';
        e.T_OPACITY=100;
        e.T_PADDING=0;
        e.T_STATIC=false;
        e.T_TEXTALIGN='left';
        if (width && width!= null) {
            e.T_WIDTH=width;
        } else {
            e.T_WIDTH=300;
        }
        return e;
    }
    function TooltipConfigSimple(e, width, xOffset, yOffset, above) {
        // In Koo Kim 200605
        // the following configures the wz_tooltip
        if (xOffset && xOffset != null) {
            e.T_OFFSETX=xOffset;
        } else {
            e.T_OFFSETX=10;
        }
        if (yOffset && yOffset != null) {
            e.T_OFFSETY=yOffset;
        } else {
            e.T_OFFSETY=10;
        }
        if (above && above != null) {
            e.T_ABOVE=above;
        }
        e.T_DELAY = 100;
        e.T_BORDERWIDTH=0;
        e.T_FONTCOLOR='#333333';
        e.T_FONTFACE='Arial, Verdana, Geneva, Helvetica, sans-serif';
        e.T_FONTSIZE='12px';
        e.T_OPACITY=100;
        e.T_PADDING=0;
        e.T_STATIC=false;
        e.T_TEXTALIGN='left';
        if (width && width!= null) {
            e.T_WIDTH=width;
        }
        return e;
    }

    function TooltipKeyword(keyword, definition) {
        // In Koo Kim 200605
        // this js object delivers the keyword and definition
        // to the tooltip constructor
        this.keyword=keyword;
        this.definition=definition;
    }
    function ConstructTooltip(tooltipKeyObj) {
        // In Koo Kim 200605
        // this method accepts a TooltipKeyword object
        // and constructs the tooltip table as a string
        var tooltip_body_str_1 = "<table cellpadding=\'0\' cellspacing=\'0\' border=\'0\'><tr valign=\'top\'><td width=\'6\' height=\'6\'><img src=%27/images/tooltip_corner_ul.gif/%27 width=\'6\' height=\'6\' border=\'0\'><\/td><td class=\'tooltip_t\'><img src=%27/images/x.gif/%27 width=\'1\' height=\'6\' border=\'0\'><\/td><td width=\'6\'><img src=%27/images/tooltip_corner_ur.gif/%27 width=\'6\' height=\'6\' border=\'0\'><\/td><\/tr><tr><td class=\'tooltip_l\' width=\'6\'><img src=%27/images/x.gif/%27 width=\'6\' height=\'1\' border=\'0\'><\/td><td bgcolor=\'#FFFFFF\'><table cellpadding=\'3\' cellspacing=\'0\' border=\'0\' width=\'100%\'><tr><td><table cellpadding=\'1\' cellspacing=\'0\' border=\'0\' width=\'100%\'><tr><td class=\'tooltip_body\' colspan=\'2\'><div style=\'float:left; padding-right:4px; width:20px;\'><img src=%27/images/i_icon.gif/%27 width=\'18\' height=\'14\' border=\'0\'></div>";
        var tooltip_body_str_2 = "<\/td><\/tr><\/table><\/td><\/tr><\/table><\/td><td class=\'tooltip_r\'><img src=%27/images/x.gif/%27 width=\'6\' height=\'1\' border=\'0\'><\/td><\/tr><tr valign=\'top\'><td width=\'6\' height=\'6\'><img src=%27/images/tooltip_corner_ll.gif/%27 width=\'6\' height=\'6\'><\/td><td class=\'tooltip_b\'><img src=%27/images/x.gif/%27 width=\'1\' height=\'6\' border=\'0\'><\/td><td><img src=%27/images/tooltip_corner_lr.gif/%27 width=\'6\' height=\'6\' border=\'0\'><\/td><\/tr><\/table>";
        var tooltip_buffer;
        tooltip_buffer = tooltip_body_str_1 + tooltipKeyObj.definition + tooltip_body_str_2;
        return tooltip_buffer;
    }
    function ConstructImageTooltip(tooltipKeyObj) {
        // In Koo Kim 200605
        // this method accepts a TooltipKeyword object
        // and constructs the tooltip table as a string
        var tooltip_body_str_1 = "<table cellpadding=\'0\' cellspacing=\'0\' border=\'0\'><tr valign=\'top\'><td width=\'6\' height=\'6\'><img src=%27/images/tooltip_corner_ul.gif/%27 width=\'6\' height=\'6\' border=\'0\'><\/td><td class=\'tooltip_t\'><img src=%27/images/x.gif/%27 width=\'1\' height=\'6\' border=\'0\'><\/td><td width=\'6\'><img src=%27/images/tooltip_corner_ur.gif/%27 width=\'6\' height=\'6\' border=\'0\'><\/td><\/tr><tr><td class=\'tooltip_l\' width=\'6\'><img src=%27/images/x.gif/%27 width=\'6\' height=\'1\' border=\'0\'><\/td><td bgcolor=\'#FFFFFF\'><table cellpadding=\'3\' cellspacing=\'0\' border=\'0\' width=\'100%\'><tr><td><table cellpadding=\'1\' cellspacing=\'0\' border=\'0\' width=\'100%\'><tr><td class=\'tooltip_body\' colspan=\'2\'><div style=\'float:left; padding-right:5px; padding-bottom:3px;\'>";

        var tooltip_body_str_2 = "</div>"

        var tooltip_body_str_3 = "<\/td><\/tr><\/table><\/td><\/tr><\/table><\/td><td class=\'tooltip_r\'><img src=%27/images/x.gif/%27 width=\'6\' height=\'1\' border=\'0\'><\/td><\/tr><tr valign=\'top\'><td width=\'6\' height=\'6\'><img src=%27/images/tooltip_corner_ll.gif/%27 width=\'6\' height=\'6\'><\/td><td class=\'tooltip_b\'><img src=%27/images/x.gif/%27 width=\'1\' height=\'6\' border=\'0\'><\/td><td><img src=%27/images/tooltip_corner_lr.gif/%27 width=\'6\' height=\'6\' border=\'0\'><\/td><\/tr><\/table>";
        var tooltip_buffer;
        tooltip_buffer = tooltip_body_str_1 + tooltipKeyObj.keyword + tooltip_body_str_2 + tooltipKeyObj.definition + tooltip_body_str_3;
        return tooltip_buffer;
    }
    function ConstructSimpleTooltip(tooltipKeyObj) {
        // In Koo Kim 200606
        // this method accepts a TooltipKeyword object
        // and constructs the tooltip table as a string
        var tooltip_body_str_1 = "<table cellpadding=\'0\' cellspacing=\'0\' border=\'0\'><tr valign=\'top\'><td bgcolor=\'#FF9933\' colspan=\'3\'><img src=%27/images/x.gif/%27 width=\'1\' height=\'1\' border=\'0\'><\/td><\/tr><tr><td  bgcolor=\'#FF9933\' width=\'1\'><img src=%27/images/x.gif/%27 width=\'1\' height=\'1\' border=\'0\'><\/td><td bgcolor=\'#FFFFFF\'><table cellpadding=\'5\' cellspacing=\'0\' border=\'0\'><tr><td bgcolor=\'#FFFFFF\' class=\'tooltip_body\'>";
        var tooltip_body_str_3 = "<\/td><\/tr><\/table><\/td><td  bgcolor=\'#FF9933\'><img src=%27/images/x.gif/%27 width=\'1\' height=\'1\' border=\'0\'><\/td><\/tr><tr valign=\'top\'><td colspan=\'3\' bgcolor=\'#FF9933\'><img src=%27/images/x.gif/%27 width=\'1\' height=\'1\' border=\'0\'><\/td><\/tr><\/table>";
        var tooltip_buffer;
        tooltip_buffer = tooltip_body_str_1 + tooltipKeyObj.definition + tooltip_body_str_3;
        return tooltip_buffer;
    }
    var subModalTargetPage = '/vendors/loading.html';
    function updateSubmodal(targetPage, submodalTitle) {
        if (targetPage && targetPage != '') {
            subModalTargetPage = targetPage;
        }
        scroll(0,0);
        if (document.getElementById('popupTitle')) {
            document.getElementById('popupTitle').innerHTML = submodalTitle;
        }
        showPopWin(subModalTargetPage, 700, 500);
        if (ua.ie) {
            changeOpac(70,'popupMask');
        } else {
            pageChronometer.addTask(new ChronometerTask("fade(0, 70, \'popupMaskFadeIn\')", null, 50, 5), 'popupMaskFadeIn');
        }
    }
    function confirmSubmodal(targetPage, submodalTitle) {
        if (targetPage && targetPage != '') {
            subModalTargetPage = targetPage;
        }
        if (document.getElementById('popupTitle')) {
            document.getElementById('popupTitle').innerHTML = submodalTitle;
        }
        showPopWin(subModalTargetPage, 400, 130);
        changeOpac(30,'popupMask');
    }
    var currentTooltipLiteCommand = null;
    function tooltipLite(tooltipPrefix, tooltipId, rowId) {
        if (document.getElementById("console")) {// wait for page to load
            var nextCommand = 'tooltipLiteAction(\'' + tooltipPrefix + '\', \'' + tooltipId + '\', \'' + rowId + '\')';
            currentTooltipLiteCommand = setTimeout(nextCommand, 20);
        }
    }
    function tooltipLiteAction(tooltipPrefix, tooltipId, rowId) {
            var tooltipVar = eval(tooltipPrefix + tooltipId);
            var tooltipImgId = tooltipPrefix + tooltipId + '_' + rowId + '_img';
            var tooltipImgObj = getImageCoordinates(tooltipImgId, 0, 2);
            var tooltipLiteContainerObj = document.getElementById('tooltipLiteContainer');
            if (tooltipImgObj && tooltipLiteContainerObj) {
                tooltipLiteContainerObj.innerHTML = ConstructSimpleTooltip(tooltipVar);
                tooltipLiteContainerObj.style.left=tooltipImgObj.x + "px";
                tooltipLiteContainerObj.style.top=tooltipImgObj.y + "px";
                tooltipLiteContainerObj.style.visibility='visible';
                tooltipLiteContainerObj.style.width='250px';
            } else {
                console.append("TooltipLite error : missing a needed image or container object.");
            }
    }
    function hideTooltipLite() {
        var tooltipLiteContainerObj = document.getElementById('tooltipLiteContainer');
        if (tooltipLiteContainerObj) {
            if (currentTooltipLiteCommand != null) {
                // console.append('clearing timeout ' + currentTooltipLiteCommand);
                clearTimeout(currentTooltipLiteCommand);
                currentTooltipLiteCommand = null;
            }
            tooltipLiteContainerObj.style.visibility='hidden';
        }
    }
