
        var reg_exp = /^([a-zA-Z0-9_.,àòè éùì])+$/;
        var reg_num = /^([0-9_ -])+$/;
        var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
        

    function ChkContatti() {

        var IsToSend = 1;

        var nome = $('#txt_C_Nome').val();
        var email = $('#txt_C_Email').val();
        var oggetto = $('#txt_C_Richiesta').val();

        $('#txt_C_Nome').removeClass('nocompiled');
        $('#txt_C_Email').removeClass('nocompiled');
        $('#txt_C_Richiesta').removeClass('nocompiled');
        $('#cprivacy').removeClass('nocompiled2');

        //Effettua il controllo sul campi            
        if ((nome == "") || (nome == "undefined")) { IsToSend = 0; $('#txt_C_Nome').addClass('nocompiled'); }
        else if (!reg_exp.test(nome)) { IsToSend = 0; $('#txt_C_Nome').addClass('nocompiled'); }

        if ((email == "") || (email == "undefined")) { IsToSend = 0; $('#txt_C_Email').addClass('nocompiled'); }
        else if (!email_reg_exp.test(email)) { IsToSend = 0; $('#txt_C_Email').addClass('nocompiled'); }

        if ((oggetto == "") || (oggetto == "undefined")) { IsToSend = 0; $('#txt_C_Richiesta').addClass('nocompiled'); }
        //else if (!reg_exp.test(oggetto)) { IsToSend = 0; $('#txt_C_Richiesta').addClass('nocompiled'); }

        if ($('#ck_C_Privacy').attr('checked') != 'checked') 
        { IsToSend = 0; 
            $('#cprivacy').addClass('nocompiled2'); 
            //alert('ATTENZIONE: è necessario accettare la direttiva sulla privacy');
            }

        //alert(IsToSend);

        if (IsToSend == 1) 
        {
            if (confirm('Sei sicuro volerci contattare?'))
                    return true;
                else
                    return false;
        }
        else return false;
    }

    function ChkJob() {

        var IsToSend = 1;

        var nome = $('#txt_J_Nome').val();
        var email = $('#txt_J_Email').val();
        var oggetto = $('#txt_J_Richiesta').val();

        $('#txt_J_Nome').removeClass('nocompiled');
        $('#txt_J_Email').removeClass('nocompiled');
        $('#txt_J_Richiesta').removeClass('nocompiled');
        $('#jprivacy').removeClass('nocompiled2');

        //Effettua il controllo sul campi            
        if ((nome == "") || (nome == "undefined")) { IsToSend = 0; $('#txt_J_Nome').addClass('nocompiled'); }
        else if (!reg_exp.test(nome)) { IsToSend = 0; $('#txt_C_Nome').addClass('nocompiled'); }

        if ((email == "") || (email == "undefined")) { IsToSend = 0; $('#txt_J_Email').addClass('nocompiled'); }
        else if (!email_reg_exp.test(email)) { IsToSend = 0; $('#txt_J_Email').addClass('nocompiled'); }

        if ((oggetto == "") || (oggetto == "undefined")) { IsToSend = 0; $('#txt_J_Richiesta').addClass('nocompiled'); }
        else if (!reg_exp.test(oggetto)) { IsToSend = 0; $('#txt_J_Richiesta').addClass('nocompiled'); }

        if ($('#ck_J_Privacy').attr('checked') != 'checked') 
        { IsToSend = 0; 
            $('#jprivacy').addClass('nocompiled2'); 
            //alert('ATTENZIONE: è necessario accettare la direttiva sulla privacy');
            }

        if (IsToSend == 1) 
        {
            if (confirm('Sei sicuro volerci contattare?'))
                    return true;
                else
                    return false;
        }
        else return false;
    }



$(document).ready(function() {
//bg resize
    $("div#supersize").supersize();
//visualizzazione tab
$('.tab-menu').tabify();
});

//slider home (nivo slider)
//$(window).load(function() {
//    $('#slider').nivoSlider({
//        effect: 'fade', // Specify sets like: 'fold,fade,sliceDown'
//        animSpeed: 500, // Slide transition speed
//        pauseTime: 5000, // How long each slide will show
//        directionNav: false, // Next & Prev navigation
//        directionNavHide: false, // Only show on hover
//        controlNav: false, // 1,2,3... navigation
//        controlNavThumbs: false, // Use thumbnails for Control Nav
//        controlNavThumbsFromRel: false, // Use image rel for thumbs
//        keyboardNav: false, // Use left & right arrows
//        pauseOnHover: false, // Stop animation while hovering
//        manualAdvance: false, // Force manual transitions
//        captionOpacity: 1, // Universal caption opacity
//    });
//});

//slider home http://jonraasch.com/blog/a-simple-jquery-slideshow

function slideSwitch() {
    var $active = $('#slideshow div.active');

    if ( $active.length == 0 ) $active = $('#slideshow div:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow div:first');

    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 500, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 3000 );
});

