function resize() {
     var dove = window.location.href;
     var posizione = dove.indexOf("default.aspx");
//alert(dove)

    var myWidth = 0;
    var myHeight = 0;
    var Width = 2458, Height = 1536;
   // var Width = 2048, Height = 717;
    var AspectRatioImg = Width / Height;

    var img = document.getElementById("imm3");
    var logoimg = document.getElementById("logoimg");

    if (posizione > 0) {
        var eventi = document.getElementById("eventi");
        var webmailimg = document.getElementById("webmailimg");
        var findimg = document.getElementById("findimg");
        var intranetimg = document.getElementById("intranetimg");
    }

    if (typeof (window.innerWidth) == 'number') {
        //Non-IE
        myWidth = window.innerWidth-21;
        myHeight = window.innerHeight;
    }
    else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
    else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        //IE  compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }

    var AspectRatioWindow = myWidth / myHeight;

    if (AspectRatioImg < AspectRatioWindow) {
        img.width = myWidth;
        img.height = myWidth / AspectRatioImg;
        if (posizione > 0) {
            if (myWidth < 1150) {
                eventi.style.fontSize = "18px";
                logoimg.style.width = "306px";
                webmailimg.style.width = "100%";
                findimg.style.width = "100%";
                intranetimg.style.width = "100%";
            } else {
                eventi.style.fontSize = "24px";
                logoimg.style.width = "510px";
                webmailimg.style.width = "220px";
                findimg.style.width = "220px";
                intranetimg.style.width = "220px";

            }
        } else {
            if (myWidth < 1150) {
            logoimg.style.width = "306px";
              
            } else {
              
                logoimg.style.width = "510px";
              

            }
        }
        
    }
    else {
        img.width = myHeight * AspectRatioImg;
        img.height = myHeight;
       
    }


}

