
stuHover = function() {
    var cssRule;
    var newSelector;
    for (var i = 0; i < document.styleSheets.length; i++)
        for (var x = 0; x < document.styleSheets[i].rules.length ; x++)
        {
            cssRule = document.styleSheets[i].rules[x];
            if (cssRule.selectorText.indexOf("LI:hover") != -1)
            {
                newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
                document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
            }
        }
    var getElm = document.getElementById("nav").getElementsByTagName("LI");
    for (var i=0; i<getElm.length; i++) {
        getElm[i].onmouseover=function() {
            this.className+=" iehover";
        }
        getElm[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" iehover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", stuHover);


function switch_foto(idBase, url_foto_normal, url_foto_big){
    $('big_link_' + idBase).href = url_foto_big;
    $('curr_img_' + idBase).src = url_foto_normal;
}

function expandingWindow(website) {
    var windowprops='width=1,height=1,scrollbars=yes,status=no,resizable=yes,location=no'
    var heightspeed = 2;
    var widthspeed = 2;
    var leftdist = 10;
    var topdist = 10;
    var lunghezza = 570;
    var altezza = 680;

    if(lunghezza == 0){
        lunghezza = window.screen.availWidth;
    }
    if(altezza == 0){
        altezza = window.screen.availHeight;
    }

    if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
        var winwidth = lunghezza;
        var winheight = altezza;
        var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
        for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
            sizer.resizeTo("1", sizeheight);
        for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
            sizer.resizeTo(sizewidth, sizeheight);
        sizer.location = website;
    }
    else
        window.open(website,'mywindow');
}