var PROPS = {
	username:		getUsername(),
	userLink:		"http://community.webshots.com/user/" + getUsername(),
	signoutLink:	"http://daily.webshots.com/login?action=logout&backUrl=" + encodeURIComponent(location.href),
	skin:			getCookie('skin')
};
setSkin(PROPS.skin);

addEvent(window, 'load', function() {
	if (PROPS.username != "") {
		setDisplay('login', 'none');
		setVisibility('messages', 'visible');
	} else {
		setDisplay('messages', 'none');
		setVisibility('login', 'visible');
	}
});

function getUsername() {
	var username = "";
	if (SignedUp) {
		var start = AllCookies.indexOf("G_x1{:t}") + 8;
		var end = AllCookies.indexOf("{:n}", start);
		if (start >= 0)
			username = AllCookies.substring(start, end);
	}
	return username;
}
function setDisplay(div, value) {
	var el = $(div);
	if (el) { el.style.display = value; }
}
function setVisibility(div, value) {
	var el = $(div);
	if (el) { el.style.visibility = value; }
}