jQuery(document).ready(function(){
    jQuery('#block-views-projects-thumbnail-view-block td, #block-views-projects-thumbnail-view-block-2 td, #block-views-projects-thumbnail-view-block-3 td').each(function(){

        var cboxlink = jQuery('.views-field-field-fullsize-image a', this).attr('href');
        var origlink = jQuery('.views-field-title a', this);
        var cboxtitle = jQuery('.views-field-field-fullsize-image a', this).attr("title");
        jQuery(origlink).click(function(){
            jQuery(this).colorbox({
                href: cboxlink,
                title: cboxtitle,
                maxHeight: "100%",
                maxWidth: "100%"
            });
        });
    });
    
    if(window.location.href.split('/')['3'] == "it" || window.location.href.split('/')['3'] == 'de') {
        jQuery('img').each(function(){
            var src = jQuery(this).attr("src");
            src = src.replace("it/", "");
            src = src.replace("de/", "");
            jQuery(this).attr("src", src);
        });
        jQuery('embed').each(function(){
            var src = jQuery(this).attr("src");
            src = src.replace("it/", "");
            src = src.replace("de/", "");
            jQuery(this).attr("src", src);
        });
        jQuery('param').each(function(){
            var src = jQuery(this).attr("src");
            src = src.replace("it/", "");
            src = src.replace("de/", "");
            jQuery(this).attr("value", src);
        });
        jQuery('.node-page a, .block a').each(function(){
            var href = jQuery(this).attr("href");
            if(href!=null) {
                if (href.indexOf(".pdf") > 0) {
                    href = href.replace("it/", "");
                    href = href.replace("de/", "");
                    jQuery(this).attr("href", href);
                }
            }
            
        });
    }

});




;

