///Funzioni di gestione menu
window.addEvent('domready', function() {

    //HOME solo illuminazione
    var el = $('home'),
		bgimghome = el.getStyle('backgroundImage');

    // We are setting the opacity of the element to 0.5 and adding two events
    $('home').set('opacity', 1).addEvents({
        mouseenter: function() {
            this.style.cursor = 'pointer';
            document.getElementById("lblhome").style.color = "white";
            // This morphes the opacity and backgroundColor
            this.morph({
                'opacity': 1,
                'background-image': 'url(App_Themes/ThemeSmsHotel/Images/home_On.jpg)'
            });


        },
        mouseleave: function() {
            document.getElementById("lblhome").style.color = "#73767d";
            // Morphes back to the original style
            this.morph({
                opacity: 1,
                backgroundImage: bgimghome
            });

        }

    });


    $('home').addEvent('click', function(e) {
        window.location = "Default.aspx";
        e.stop();


    });
    //  fine HOME

    //PAGAMENTI solo illuminazione
    var el = $('pagamenti'),
		bgimgpagamenti = el.getStyle('backgroundImage');

    // We are setting the opacity of the element to 0.5 and adding two events
    $('pagamenti').set('opacity', 1).addEvents({
        mouseenter: function() {
            this.style.cursor = 'pointer';
            document.getElementById("lblpagamenti").style.color = "white";
            // This morphes the opacity and backgroundColor
            this.morph({
                'opacity': 1,
                'background-image': 'url(App_Themes/ThemeSmsHotel/Images/pagamenti_ON.jpg)'
            });
            
            $('SmPagamenti').set('tween', {
                duration: 1000,
                transition: Fx.Transitions.Bounce.easeOut
            }).tween('height', '150px');
        },
        mouseleave: function() {

            document.getElementById("lblpagamenti").style.color = "#73767d";

            this.morph({
                opacity: 1,
                backgroundImage: bgimgpagamenti
            });
            $('SmPagamenti').set('tween', {}).tween('height', '0px');
        }



    });

    $('pagamenti').addEvent('click', function(e) {
        window.location = "pagamenti.aspx";
        e.stop();


    });


    //Quando Passo con il mouse sul sotto menu sotto menu SmPagamenti
    $('SmPagamenti').addEvents({
        'mouseenter': function() {
            document.getElementById("lblpagamenti").style.color = "white";
            $('pagamenti').morph({
                'opacity': 1,
                'background-image': 'url(App_Themes/ThemeSmsHotel/Images/pagamenti_ON.jpg)'
            });

            this.set('tween', {
                duration: 1000,
                transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
            }).tween('height', '150px');
        },
        'mouseleave': function() {
            document.getElementById("lblpagamenti").style.color = "#73767d";
            this.set('tween', {}).tween('height', '0px');
            $('pagamenti').morph({
                opacity: 1,
                backgroundImage: bgimgpagamenti
            });
        }
    });
    
    //  PARTNERS 


    var el = $('partners'),
		bgimgpartners = el.getStyle('backgroundImage');

    // We are setting the opacity of the element to 0.5 and adding two events
    $('partners').set('opacity', 1).addEvents({
        mouseenter: function() {
            document.getElementById("lblpartners").style.color = "white";
            // This morphes the opacity and backgroundColor
            this.morph({
                'opacity': 1,
                'background-image': 'url(App_Themes/ThemeSmsHotel/Images/partners_ON.jpg)'
            });

            $('smPartners').set('tween', {
                duration: 1000,
                transition: Fx.Transitions.Bounce.easeOut
            }).tween('height', '150px');
        },
        mouseleave: function() {

            document.getElementById("lblpartners").style.color = "#73767d";
            this.morph({
                opacity: 1,
                backgroundImage: bgimgpartners
            });
            $('smPartners').set('tween', {}).tween('height', '0px');
        }
    });


    //    $('partners').addEvent('click', function(e) {
    //    window.location = "partners.aspx";
    //        e.stop();
    //
    //	});
    //fine PARTNERS

    //Quando Passo con il mouse sul sotto menu sotto menu pagamenti
    $('smPartners').addEvents({
        'mouseenter': function() {

            document.getElementById("lblpartners").style.color = "white";
            $('partners').morph({
                'opacity': 1,
                'background-image': 'url(App_Themes/ThemeSmsHotel/Images/partners_ON.jpg)'
            });

            this.set('tween', {
                duration: 1000,
                transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
            }).tween('height', '150px');
        },
        'mouseleave': function() {
            document.getElementById("lblpartners").style.color = "#73767d";
            this.set('tween', {}).tween('height', '0px');
            $('partners').morph({
                opacity: 1,
                backgroundImage: bgimgpartners
            });
        }
    });


    //  Prenotaioni
    var el = $('prenotazioni'),
		bgimgprenotazioni = el.getStyle('backgroundImage');

    // We are setting the opacity of the element to 0.5 and adding two events
    $('prenotazioni').set('opacity', 1).addEvents({
        mouseenter: function() {
            document.getElementById("lblprenotazioni").style.color = "white";
            this.style.cursor = 'pointer';
            // This morphes the opacity and backgroundColor
            this.morph({
                'opacity': 1,
                'background-image': 'url(App_Themes/ThemeSmsHotel/Images/prenotazioni_ON.jpg)'
            });
            $('smPrenotazioni').set('tween', {
                duration: 1000,
                transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
            }).tween('height', '150px');
        },
        mouseleave: function() {
            document.getElementById("lblprenotazioni").style.color = "#73767d";
            // Morphes back to the original style
            this.morph({
                opacity: 1,
                backgroundImage: bgimgprenotazioni
            });
            $('smPrenotazioni').set('tween', {}).tween('height', '0px');
        }
    });

    $('prenotazioni').addEvent('click', function(e) {
            window.location = "TestoPrenotazioni.aspx";
        e.stop();


    });
    //fine Prenotaioni



    //Quando Passo con il mouse sul sotto menu sotto menu prenotazioni
    $('smPrenotazioni').addEvents({
        'mouseenter': function() {
            document.getElementById("lblprenotazioni").style.color = "white";
            $('prenotazioni').morph({
                'opacity': 1,
                'background-image': 'url(App_Themes/ThemeSmsHotel/Images/prenotazioni_ON.jpg)'
            });

            this.set('tween', {
                duration: 1000,
                transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
            }).tween('height', '150px');
        },
        'mouseleave': function() {
            document.getElementById("lblprenotazioni").style.color = "#73767d";
            this.set('tween', {}).tween('height', '0px');
            $('prenotazioni').morph({
                opacity: 1,
                backgroundImage: bgimgprenotazioni
            });
        }
    });




    //  Supporto
    var el = $('supporto'),
		bgimgsupporto = el.getStyle('backgroundImage');

    // We are setting the opacity of the element to 0.5 and adding two events
    $('supporto').set('opacity', 1).addEvents({
        mouseenter: function() {
            this.style.cursor = 'pointer';
            document.getElementById("lblsupporto").style.color = "white";
            // This morphes the opacity and backgroundColor
            this.morph({
                'opacity': 1,
                'background-image': 'url(App_Themes/ThemeSmsHotel/Images/supporto_ON.jpg)'
            });
            $('smSupporto').set('tween', {
                duration: 1000,
                transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
            }).tween('height', '150px');
        },
        mouseleave: function() {
            document.getElementById("lblsupporto").style.color = "#73767d";
            // Morphes back to the original style
            this.morph({
                opacity: 1,
                backgroundImage: bgimgsupporto
            });
            $('smSupporto').set('tween', {}).tween('height', '0px');
        }
    });

    $('supporto').addEvent('click', function(e) {
        window.location = "Faq.aspx";
        e.stop();


    });
    //fine Supporto


    //Quando Passo con il mouse sul sotto menu sotto menu Supporto
    $('smSupporto').addEvents({
        'mouseenter': function() {
            document.getElementById("lblsupporto").style.color = "white";
            $('supporto').morph({
                'opacity': 1,
                'background-image': 'url(App_Themes/ThemeSmsHotel/Images/supporto_ON.jpg)'
            });

            this.set('tween', {
                duration: 1000,
                transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
            }).tween('height', '150px');
        },
        'mouseleave': function() {
            document.getElementById("lblsupporto").style.color = "#73767d";
            this.set('tween', {}).tween('height', '0px');
            $('supporto').morph({
                opacity: 1,
                backgroundImage: bgimgsupporto
            });
        }
    });


});
