function getCookieVar(varName) {
return $.cookie(varName);
}
function checkLoginStatus() {
var cookieValue = getCookieVar('tmg_p13n');
var output;
var registrationUrl=document.getElementById('topbar_login_base_url').value;
var contactUs='http://www.telegraph.co.uk/topics/about-us/3489870/Contact-us.html';
if (cookieValue != null) {
cookieValue = cookieValue.replace(/\\/g, "");
cookieValue = cookieValue.substring(1,cookieValue.length-1);
var myJSONObject = eval('(' + cookieValue + ')');
var firstName = myJSONObject.firstName;
output = "Welcome, "+firstName+" | Log out | Help";
} else {
output = "Log in | Register now";
}
document.getElementById('regDetails').innerHTML=output;
}