// JavaScript Document
            function slideshow(num){
                 max_number_img = num;
                 i = 3;
                 dispari = true;
                 timer_cambio_img = setInterval('rullo()', 3000);
            }
            function rullo(){
                browser = null;
                if (window.ActiveXObject) {
                    if (navigator.userAgent.toLowerCase().indexOf("msie 5") != -1) {
                        browser = "ie";
                    } else {
                        browser = "ie";
                    }
                }
                if (!browser && typeof(XMLHttpRequest) != 'undefined') {
                      browser = "ch";
                }
                if(i < 10){
                    src = "img_" + "0" + i;
                    } else {
                        src = "img_" + i;
                    }

                timer_fade = setInterval('fade()', 100)
            }
            function fade(){
            if(browser == "ie"){
            if(dispari){
                        var valore1 = document.getElementById("box_01").filters.alpha.opacity;
                        var valore2 = document.getElementById("box_02").filters.alpha.opacity;
                        var incremento = 5;
                            if (valore1 < 100){
                                valore1 = valore1 + incremento;
                                document.getElementById("box_01").filters.alpha.opacity = valore1;
                                valore2 = valore2 - incremento;
                                document.getElementById("box_02").filters.alpha.opacity = valore2;
                            } else {
                                    stop_timer(timer_fade);
                                    dispari = false;
                                    document.getElementById("box_02").src = "foto/index_giorno/"+ src + ".jpg";
                                    if(i<max_number_img){
                                      i++;
                                    } else {
                                        i = 1;
                                    }

                            }
            } else {
                        var valore1 = document.getElementById("box_02").filters.alpha.opacity;
                        var valore2 = document.getElementById("box_01").filters.alpha.opacity;
                        var incremento = 5;
                            if (valore1 < 100){
                                valore1 = valore1 + incremento;
                                    document.getElementById("box_02").filters.alpha.opacity = valore1;
                                valore2 = valore2 - incremento;
                                    document.getElementById("box_01").filters.alpha.opacity = valore2;
                            } else {
                                    stop_timer(timer_fade);
                                    dispari = true;
                                    document.getElementById("box_01").src = "foto/index_giorno/"+ src + ".jpg";
                                    if(i<max_number_img){
                                      i++;
                                    } else {
                                        i = 1;
                                    }
                            }
            }
        } else {
            if(dispari){
                        var valore1 = document.getElementById("box_01").style.opacity;
                        var valore2 = document.getElementById("box_02").style.opacity;
                        var incremento = 0.1;
                            if (valore1 < 1){
                                valore1 = eval(valore1) + eval(incremento);
                                    document.getElementById("box_01").style.opacity = valore1;
                                valore2 = eval(valore2) - eval(incremento);
                                    document.getElementById("box_02").style.opacity = valore2;
                            } else {
                                    stop_timer(timer_fade);
                                    dispari = false;
                                    document.getElementById("box_02").src = "foto/index_giorno/"+ src + ".jpg";
                                    if(i<max_number_img){
                                      i++;
                                    } else {
                                        i = 1;
                                    }

                            }
            } else {
                        var valore1 = document.getElementById("box_02").style.opacity;
                        var valore2 = document.getElementById("box_01").style.opacity;
                        var incremento = 0.1;
                            if (valore1 < 1){
                                valore1 = eval(valore1) + eval(incremento);
                                    document.getElementById("box_02").style.opacity = valore1;
                                valore2 = eval(valore2) - eval(incremento);
                                    document.getElementById("box_01").style.opacity = valore2;
                            } else {
                                    stop_timer(timer_fade);
                                    dispari = true;
                                    document.getElementById("box_01").src = "foto/index_giorno/"+ src + ".jpg";
                                    if( i < max_number_img ){
                                      i++;
                                    } else {
                                        i = 1;
                                    }
                            }
            }
        }
    }
    function stop_timer(id){
        clearInterval(id);
    }
	
	
	function slideshownotte(num){
                 max_number_img_notte = num;
                 i_notte = 3;
                 dispari_notte = true;
                 timer_cambio_img = setInterval('rullonotte()', 3000);
            }
            function rullonotte(){
                browser = null;
                if (window.ActiveXObject) {
                    if (navigator.userAgent.toLowerCase().indexOf("msie 5") != -1) {
                        browser = "ie";
                    } else {
                        browser = "ie";
                    }
                }
                if (!browser && typeof(XMLHttpRequest) != 'undefined') {
                      browser = "ch";
                }
                if(i_notte < 10){
                    src = "img_" + "0" + i_notte;
                    } else {
                        src = "img_" + i_notte;
                    }

                timer_fade_notte = setInterval('fadenotte()', 100)
            }
            function fadenotte(){
            if(browser == "ie"){
            if(dispari_notte){
                        var valore1 = document.getElementById("box_03").filters.alpha.opacity;
                        var valore2 = document.getElementById("box_04").filters.alpha.opacity;
                        var incremento = 5;
                            if (valore1 < 100){
                                valore1 = valore1 + incremento;
                                document.getElementById("box_03").filters.alpha.opacity = valore1;
                                valore2 = valore2 - incremento;
                                document.getElementById("box_04").filters.alpha.opacity = valore2;
                            } else {
                                    stop_timer_notte(timer_fade_notte);
                                    dispari_notte = false;
                                    document.getElementById("box_04").src = "foto/index_notte/"+ src + ".jpg";
                                    if(i_notte<max_number_img_notte){
                                      i_notte++;
                                    } else {
                                        i_notte = 1;
                                    }

                            }
            } else {
                        var valore1 = document.getElementById("box_04").filters.alpha.opacity;
                        var valore2 = document.getElementById("box_03").filters.alpha.opacity;
                        var incremento = 5;
                            if (valore1 < 100){
                                valore1 = valore1 + incremento;
                                    document.getElementById("box_04").filters.alpha.opacity = valore1;
                                valore2 = valore2 - incremento;
                                    document.getElementById("box_03").filters.alpha.opacity = valore2;
                            } else {
                                    stop_timer_notte(timer_fade_notte);
                                    dispari_notte = true;
                                    document.getElementById("box_03").src = "foto/index_notte/"+ src + ".jpg";
                                    if(i_notte<max_number_img_notte){
                                      i_notte++;
                                    } else {
                                        i_notte = 1;
                                    }
                            }
            }
        } else {
            if(dispari_notte){
                        var valore1 = document.getElementById("box_03").style.opacity;
                        var valore2 = document.getElementById("box_04").style.opacity;
                        var incremento = 0.1;
                            if (valore1 < 1){
                                valore1 = eval(valore1) + eval(incremento);
                                    document.getElementById("box_03").style.opacity = valore1;
                                valore2 = eval(valore2) - eval(incremento);
                                    document.getElementById("box_04").style.opacity = valore2;
                            } else {
                                    stop_timer_notte(timer_fade_notte);
                                    dispari_notte = false;
                                    document.getElementById("box_04").src = "foto/index_notte/"+ src + ".jpg";
                                    if(i_notte<max_number_img_notte){
                                      i_notte++;
                                    } else {
                                        i_notte = 1;
                                    }

                            }
            } else {
                        var valore1 = document.getElementById("box_04").style.opacity;
                        var valore2 = document.getElementById("box_03").style.opacity;
                        var incremento = 0.1;
                            if (valore1 < 1){
                                valore1 = eval(valore1) + eval(incremento);
                                    document.getElementById("box_04").style.opacity = valore1;
                                valore2 = eval(valore2) - eval(incremento);
                                    document.getElementById("box_03").style.opacity = valore2;
                            } else {
                                    stop_timer_notte(timer_fade_notte);
                                    dispari_notte = true;
                                    document.getElementById("box_03").src = "foto/index_notte/"+ src + ".jpg";
                                    if( i_notte < max_number_img_notte ){
                                      i_notte++;
                                    } else {
                                        i_notte = 1;
                                    }
                            }
            }
        }
    }
    function stop_timer_notte(id){
        clearInterval(id);
    }


