$(document).ready(function(){ // Show profile link instead of login if user is logged in var email = $.cookie(Botleagues.cookie_login_email); if (typeof email != 'undefined' && $.cookie(Botleagues.cookie_login_valid_till) > (new Date()).getTime()) { setupLoginMenu(); } }); function setupLoginMenu() { $('#nav .login-link').remove(); if ($('#nav').find('[href="/profile"]').length == 0) { $('
  • ').append( $('') .attr('role', 'presentation') .attr('title', 'User profile') .attr('href', '/profile') .text('Profile')) .appendTo($('#nav')); } $('
  • ').append( $('') .attr('role', 'presentation') .attr('title', 'Logout') .attr('href', '/logout') .text('Logout')) .appendTo($('#nav')); }