﻿function isIE() {
    if (window.XMLHttpRequest) {
        // Analizza se è IE7
        if (navigator.userAgent.match(/MSIE \d\.\d+/) && (navigator.appVersion.indexOf("MSIE 7.")!=-1))
            return true;
    } else {

    // IE6, vecchi browser
    alert("Il browser che stai utilizzando è obsoleto e non è compatibile con questo sito. Si prega di aggiornarlo");
    return true;    
    }
    
    

    return false;
}

function zIndexWorkaround() {
    if (isIE()) {
        var zi = 1000;
        $$("div.block").each(function(block) {
            block.style.zIndex = zi--;
        });
    }
}

$(function () {
    if (isIE()) {
        $("div.menu").parents().each(function () {
            var p = $(this);
            var pos = p.css("position");
            if (pos == "relative" ||
               pos == "absolute" ||
               pos == "fixed") {
                p.hover(function () {
                    $(this).addClass("rmOnTop");
                },
                    function () {
                        $(this).removeClass("rmOnTop");
                    });
            }
        });
    }
});


