var userLogged = 0; var urlContact = ''; var Libero = { 'HF': { 'writeLoginBar': function(event){ var info = event.data; if (info.logged == true) { userLogged = 1; urlContact = 'https://aiuto.virgilio.it/le-mie-attivita/'; //var name_el = jQuery('div#name_user'); var name_el = jQuery("#dxbox").contents().find("div#name_user"); if (info.name) { var name_user = info.name; } else { var name_user = info.email.split('@')[0]; } name_el.append(name_user); //var email = jQuery('div#mail_user'); var email = jQuery("#dxbox").contents().find("div#mail_user"); email.append(info.email); //var esci = jQuery('div#libsso_esci'); var esci = jQuery("#dxbox").contents().find("div#libsso_esci"); esci.click(function() { window.location.assign('https://login.virgilio.it/logout.php?service_id=aiuto&ret_url=https://aiuto.virgilio.it/'); }); //var box_login_logg = jQuery('#box_login.login_logg'); var box_login_logg = jQuery("#dxbox").contents().find("#box_login.login_logg"); box_login_logg.show(); } else { userLogged = 0; urlContact = 'https://login.virgilio.it?service_id=aiuto&ret_url=https://aiuto.virgilio.it/le-mie-attivita/'; //var box_login = jQuery('#box_login.login'); var box_login = jQuery("#dxbox").contents().find("#box_login.login"); //var entra = jQuery('input.login_entra'); var entra = jQuery("#dxbox").contents().find("input.login_entra"); entra.click(function() { window.location = 'https://login.virgilio.it?service_id=aiuto&ret_url=' + window.location.href; }); box_login.show(); } } } }; function goContact() { location.href = urlContact; return false; } jQuery(window).on('load', {'logged': false, 'email': 'unknow@unknow', name: ''}, Libero.HF.writeLoginBar);