function buildheaders() {
document.getElementById('loginmenu').innerHTML = buildrightloginmenu();
document.getElementById('headermenu').innerHTML = buildheadermenu();
}
function returnloginlevel() {
var tempname = "";
try {
tempname = Get_Cookie("email");
} catch (e) {
tempname = "";
}
var passhash = "";
try {
passhash = Get_Cookie("passhash");
} catch (e) {
passhash = "";
}
if (tempname && passhash) {
try {
if (tempname != 'null' && passhash != 'null' && tempname.length > 1 && passhash.length > 1) {
return "3";
} else {
return "0";
}
} catch(e) {
return "0";
}
}
if (tempname) {
if (tempname.length > 1) {return "1";}
}
}
function buildrightloginmenu() {
var mystring;
var loginlevel = returnloginlevel();
if (loginlevel > 0) {
mystring = "welcome " + Get_Cookie("email") + ", you are logged in.
if this is not you,click here";
if (loginlevel < 3) {
mystring = mystring + "
click here to verify this session";
}
} else {
mystring = "
";
mystring = "";
}
return mystring;
}
function buildheadermenu() {
var mystring;
var loginlevel = returnloginlevel();
if (loginlevel > 0) {
mystring = '';
} else {
mystring = '';
}
return mystring;
}
function logout() {
Delete_Cookie( 'email', '/', '.gamesketcher.com');
Delete_Cookie( 'passhash', '/', '.gamesketcher.com');
amiloggedin=false;
get_method_body("logout.php", "get=logout");
}
function verifysession() {
amiloggedin=false;
buildheaders();
}