$(function(){
  changeLink();
});

function changeLink(){
  // check cookie to see if user is logged in
  if ($.cookies.get('customer_id') != null || ($.cookies.get('MOZY_USERNAME') != null && $.cookies.get('MOZY_USERNAME').length > 0)) {
    $('#header').addClass("logged-in");

    // swap the links
    if ($.cookies.get("lang_id") == "fr") {
      $('#navlink2 a').html("My Account").attr("href", "/accesmoncompte");
      $('#navlink5 a').html("Log Out").attr("href", "/deconnection");
    } else {
      $('#navlink2 a').html("My Account").attr("href", "/account");
      $('#navlink5 a').html("Log Out").attr("href", "/logout");
    }
  }
}

