$(document).ready(function() {
    if ($("form#form-iscrizione").length>0)
        $("form#form-iscrizione").validate();
});
$(function() {
    /*$("#boxscroll").jCarouselLite({
        auto: 3000,
        speed: 3000,
        vertical: true,
        visible: 1,
        circular: true,
        scroll: 1
    });*/
    
    // scroll delle news del banner2.php
    if ($('#boxscroll').length > 0) {
        var divarray = new Array();
        var id = 0;
        var currid = 0;
        var totel = 0;
        $('#boxscroll > div').each(function() {
            divarray[id] = $(this).html();
            id++;
        });
        totel = divarray.length;
        $('#boxscroll').html('<div></div>');
        $('#boxscroll div').html(divarray[0]);
        currid++;
        
        var interval = setInterval(function() {
            //$('#boxscroll div').hide(function() {
                //$(this).remove();
                $('#boxscroll div').html(divarray[currid]);
                currid++;
                if (currid==totel) currid=0;
            //});
        }, 5000);
    }
    
    // iscrizione alla newsletter
    /*$('#boxNewsletter #textfield').keypress(function (e) {
        if (e.which == 13) {
            location.href = 'newsletter_iscrizione.php?email=' + $(this).val();
        }
    });*/
});

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
