﻿

$(document).ready(function() {

    $("#carousel").CloudCarousel(
		        {
		            xPos: 350,
		            yPos: 0,
		            minScale: .35,
		            bringToFront: true,
		            autoRotateDelay: 3500,
		            buttonLeft: $("#right-but"),
		            buttonRight: $("#left-but"),
		            altBox: $("#alt-text"),
		            titleBox: $("#title-text"),
		            autoRotate: 'yes',
		            yRadius: 12,
		            reflHeight: 30,
		            reflGap: 3,
		            reflOpacity: .6
		        }
	        );

    $("#carousel").click(function(e) {
        switch ($(e.target).attr("name")) {
            case '1':
                window.location.href = "PAG/ART001.aspx";
                break;

            case '2':
                window.location.href = "PAG/ART002.aspx";
                break;

            case '3':
                window.location.href = "PAG/ART003.aspx";
                break;

            case '4':
                window.location.href = "PAG/ART004.aspx";
                break;

            case '5':
                window.location.href = "PAG/ART005.aspx";
                break;

            case '6':
                window.location.href = "PAG/ART006.aspx";
                break;

            case '7':
                window.location.href = "PAG/ART007.aspx";
                break;
        }

    });

    $('#opaque').css('opacity', .7);

    $('#flagita').click(function() { setlingua("ITA"); });
    $('#flagde').click(function() { setlingua("DE"); });
    //$('#flaguk').click(function() { setlingua("ENG"); });

});


//
function manutenzione() {
    var pwd = prompt('prego digitare password di protezione', '');
    window.location.href = "PAG/PAG_PANNELLO.aspx?pwd=" + pwd;
};


//
function setlingua(lng) {
    $.post('srv/srv_setlingua.ashx',
           { lang: lng },
           function(data) {
               window.location.href = "default.aspx" 
           });
};
