var action = getQueryVariable("action");
if( action ){
	switch(action){
		case "signout":
			setCookie("bob_userID","",30,"/");
			setCookie("bob_userName","",30,"/");
			setCookie("bob_signedIn","false",30,"/");
			window.location.href = "/kill.switch.asp";
			break;
		default:
			break;
	}
}

var bob_userID = getCookie("bob_userID");
var bob_userName = getCookie("bob_userName");
var bob_signedIn = getCookie("bob_signedIn");

switch(bob_signedIn){
	case "false":
		bob_signedIn = false;
		break;
	case "true":
		bob_signedIn = true;
		break;
	case "null":
		bob_signedIn = null;
		break
}

$(document).ready(function(){	
	if (bob_signedIn){
			var welcome = "Welcome " + bob_userName + "&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"?action=signout\">Sign Out</a>";
			$("#signIn").children(".repeat").html(welcome)
			.end()
			.children(".arrow").remove();
			$("#myPhoneBook > .content").html("<p><img src=\"/_images/loading_on_white.gif\" alt=\"loading..\" /></p>");
	}
});
