$(document).ready(function () {

    //aggiunge classi ad alcuni tag dopo il caricamento della pagina
    $('#col_l .menu:first li:eq(4)').addClass('last');
    $('.news li.article:last').addClass('last');
    $('.highlights ul li:last').addClass('last');
    $('#wrap_main .box.dettaglio.mt25:last').addClass('noBG');
    $('.box.sectors.inverseHover.cf .article:last').addClass('mr0');

    $('img[src=""]').remove(); 	//elimina tutte le immagini senza l'attributo src
    //$('div.section.highlights li.article.cf div.item_image a.youtube').parent().children('a.fancyframe').remove();	//rimuove tutti gli a con classe facybox se nello stesso livello c'è un a con classe youtube
    //$('div.section.highlights li.article.cf a.youtube').parent().children('a.fancyframe').remove();	//rimuove tutti gli a con classe facybox se nello stesso livello c'è un a con classe youtube

    


    $('#header .lang li a').click(function () {
        var lang
        lang = $(this).attr('class');
        lang = lang.substring(0, 2);
        //alert(lang);
        switch (lang) {
            case 'it':
                window.location.href = 'http://' + window.location.host + '/switch_lang.asp?lg=1'
                break;
            case 'en':
                window.location.href = 'http://' + window.location.host + '/switch_lang.asp?lg=2'
                break;
            case 'de':
                window.location.href = 'http://' + window.location.host + '/switch_lang.asp?lg=3'
                break;
            case 'nl':
                window.location.href = 'http://' + window.location.host + '/switch_lang.asp?lg=4'
                break;
            default:
                window.location.href = 'http://' + window.location.host + '/switch_lang.asp?lg=2'
        }
        return false;
    });


    /* Copia email all'interno del iframe
    - - - - - - - - - - - - - - - - - - - */
    //var mail =$('.newsletter form label input#email', window.parent.document).val();	//lettura mail per newsletter
    var mail = parent.document.getElementById("temail").value; //lettura mail per newsletter
    $('#txtEmail').val(mail);

});

   
