jQuery(document).ready(function () {
        jQuery(document.body).append('<div id="pb-opacity"></div><div id="pb-content"></div>');
        jQuery('#pb-opacity').hide(); jQuery('#pb-content').hide();

});
/**
 * Traduzione dei campi tendina
 */
jQuery(document).ready(function(){
        translations = new Array();
        translations['Motori di ricerca'] = 'Search Engine';
        translations['Pubblicità - Banner'] = 'Advertising - Banner';
        translations['Siti dei partners'] = 'Partner websites';
        translations['Fiere'] = 'Expos';
        translations['Passaparola'] = 'Word of mouth';
        translations['Altro...'] = 'Other ...';
        if (/^(.+)\/english\/(.+)$/.test(document.location.href)) {
                jQuery("select > option").each(function(idx) {
                        opt = jQuery(this);
                        if(typeof translations[opt.text()] != 'undefined') {
                                opt.text(translations[opt.text()]);
                        }
                });
        }
});
                                        
openBox = function (obj) {
        if (!(sourceObj = jQuery(jQuery(obj).attr('href')))) { return false; }
        opacityObj = jQuery('#pb-opacity'); contentObj = jQuery('#pb-content');
        contentObj.css('width', (sourceObj.width() + 20)+'px').css('height', (sourceObj.height() + 44)+'px').corner();
        contentObj.css('margin-top', '-'+Math.round((sourceObj.height() + 44) / 2)+'px');
        contentObj.css('margin-left', '-'+Math.round((sourceObj.width() + 20) / 2)+'px');
        opacityObj.css('width','100%').css('height','100%').fadeIn().click(closeBox);
        contentObj.html('<div style="padding: 10px;">'+sourceObj.html()+'<div id="pb-closer"><a href="javascript:closeBox();"></a></div></div>');
        contentObj.fadeIn();
        return false;
}

openBoxMod = function (obj) {
        if (!(sourceObj = jQuery(/^#/.test(obj) ? obj : jQuery(obj).attr('href')))) { return false; }
        opacityObj = jQuery('#pb-opacity'); contentObj = jQuery('#pb-content');
        contentObj.css('width', (sourceObj.width() + 20)+'px').css('height', (sourceObj.height() + 44)+'px').corner();
        contentObj.css('margin-top', '-'+Math.round((sourceObj.height() + 44) / 2)+'px');
        contentObj.css('margin-left', '-'+Math.round((sourceObj.width() + 20) / 2)+'px');
        opacityObj.css('width','100%').css('height','100%').fadeIn().click(closeBox);
        contentObj.html('<div style="padding: 10px;">'+sourceObj.html()+'<div id="pb-closer"><a href="javascript:closeBox();"></a></div></div>');
        contentObj.fadeIn();
        if (!/^#/.test(obj)) { return false; }
}

        
closeBox = function () {
        jQuery('#pb-opacity').fadeOut();
        jQuery('#pb-content').fadeOut();
}

