function clickButton(e, buttonid) { var evt = e ? e : window.event; var bt = document.getElementById(buttonid); if (bt) { if (evt.keyCode == 13) { bt.click(); return false; } } }
function detectIE6() { var browser = navigator.appName; if (browser == "Microsoft Internet Explorer") { var b_version = navigator.appVersion; var re = /\MSIE\s+(\d\.\d\b)/; var res = b_version.match(re); if (res[1] <= 6) { return true; } } return false; }

//function menu_on(obj){obj.style.color='#ced9f9';}
//function menu_out(obj){obj.style.color='white';}
function tab_on(obj) { document.getElementById(obj).className = 'MenuTabHover'; }
function tab_out(obj) { document.getElementById(obj).className = 'MenuTabLink'; }
function HideModalPopup() { $find("ModalBehaviour").hide(); $('select', 'object', 'embed').each(function () { $(this).show(); /*.style.visibility = 'visible'*/ }); }
function HideModalPopup2() { $find("ModalBehaviour2").hide(); $('select', 'object', 'embed').each(function (node) { node.style.visibility = 'visible' }); }
function open_printable_version(link) { var win = "menubar=no,location=no,resizable=yes,scrollbars=yes"; newWin = window.open(link, 'perintableWin', win); newWin.focus(); }

function reBindTooltip() {
    $(".showtooltip").each(function () {
        var title = $(this).attr("toolTipText");
        $(this).qtip(
                {
                    content: "<span>" + title + "</space>",
                    style: {
                        "background-color": "#FFFFFF",
                        "padding": 3,
                        "font-weight": "bold",
                        "font-size": 11
                    }
                });
    });
}

function bindQTipmiddlePictureSrc() {
    $(".middlePictureSrc").filter(function (a) { return $(this).attr("abbr") != undefined; }).each(function () {
        if ($(this).data('qtip')) { return true; }
        var imgPath = $(this).attr("abbr");
        $(this).qtip({
            content: "<div><img src='" + imgPath + "' /></div>",
            position: { adjust: { screen: true} },
            style: {
                width: {
                    max: 1000
                },
                show: { solo: true }
            }
        });
    });
}

function esc_press(D) {
    D = D || window.event;
    var A = D.keyCode;
    if (A == 27) {
        HideModalPopup();
    }
}
