function isBlank(stringa) {
    if (stringa == null)
        return true;
    if (stringa == "")
        return true;
    for (var i = 0; i < stringa.length; i++) {
        var charString = stringa.charAt(i);
        if ((charString != ' ') && (charString != '\n') && (charString != '\t')) return false;
    }
    return true;
}

function checkIt(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        return false
    }
    status = ""
    return true
}



function valLogin() {
    var isOK = true;
    var thisDocument = document.FormLogin;
    var user = thisDocument.userName.value;
    var pass = thisDocument.userPwd.value;

    if (isBlank(user)) {
        alert("Attenzione inserire [userName] \n [userName] required");
        thisDocument.userName.focus();
        thisDocument.userName.select();
        isOK = false;
    }
    else if (isBlank(pass)) {
        alert("Attenzione inserire [Password] \n [Password] required");
        thisDocument.userPwd.focus();
        thisDocument.userPwd.select();
        isOK = false;
    }

    return isOK
}

function valSearch() {
    var isOK = true;
    var thisDocument = document.FormSearch;
    var Search = thisDocument.Search.value;

    if (isBlank(Search)) {
        alert("Attenzione inserire almeno una chiave di ricerca.");
        thisDocument.Search.focus();
        thisDocument.Search.select();
        isOK = false;
    }
    return isOK
}


//$(document).ready(function () {
//    $("#featured").tabs({ fx: { opacity: "toggle"} }).tabs("rotate", 5000, true);
//})

(function (d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) { return; }
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
    fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));


$(document).ready(function ($) {

    $('#mega-menu-header').dcMegaMenu({
        rowItems: '5',
        speed: 'fast',
        effect: 'slide'
    });

});

$(document).ready(function () {
    $(".newsticker-jcarousellite").jCarouselLite({
        vertical: true,
        hoverPause: true,
        visible: 1,
        auto: 200,
        speed: 2000
    });

    
    $('.slideshowHeader').cycle({
        fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });

});

