
function getE(name) {
    if (document.getElementById)
        var elem = document.getElementById(name);
    else if (document.all)
        var elem = document.all[name];
    else if (document.layers)
        var elem = document.layers[name];
    return elem;
}

function OpenWindow(query, w, h, scroll) {
    var l = (screen.width - w) / 2;
    var t = (screen.height - h) / 2;

    winprops = 'resizable=0, height=' + h + ',width=' + w + ',top=' + t + ',left=' + l + 'w';
    if (scroll) winprops += ',scrollbars=1';
    var f = window.open(query, "_blank", winprops);
}



function openWindow(catid, itemid) {
    var curlink = window.document.location.toString();
    alert("Referlink?");
    //window.open('Referlink.aspx?catid=' + catid + "&itemid=" + itemid + '&link=' + curlink, 'popupTIPS', 'width=570,height=650,scrollbars=no');
}

function addToFavorite(favTitle) {
    var title = favTitle;
    var url = location.href;

    if (window.sidebar) {
        window.sidebar.addPanel(title, url, "");
    }
    else if (window.opera && window.print) {
        var mbm = document.createElement('a');
        mbm.setAttribute('rel', 'sidebar');
        mbm.setAttribute('href', url);
        mbm.setAttribute('title', title);
        mbm.click();
    }
    else if (document.all) {
        window.external.AddFavorite(url, unescape(favTitle));
    }
} 
