/** window.onresize = function(){
	updateGuestNotification();
};

function updateGuestNotification(){
	var winHeight, winWidth;

	if ( window.innerHeight ) {
		winHeight = window.innerHeight;
		winWidth = window.innerWidth;
	} else if ( document.documentElement.clientHeight ) {
		winHeight = document.documentElement.clientHeight;
		winWidth = document.documentElement.clientWidth;
	}

	guestNotify = document.getElementById('guest-notification').style;
	
	var gnHeight=guestNotify.height.replace(/px/gi, "");
	var gnWidth=guestNotify.width.replace(/px/gi, "");
	//gnHeight=gnHeight.replace(/px/gi, "");
	//var guestNotifyTop=winHeight-gnHeight;
	//guestNotify.top=guestNotifyTop+"px";
	guestNotify.top=(winHeight-gnHeight)+"px";
	guestNotify.left=(winWidth-gnWidth)+"px";
} */

var today = new Date();
var expiry = new Date(today.getTime() + 60 * 60 * 1000);

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) { endstr = document.cookie.length; }
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
			return getCookieVal (j);
		}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break; 
	}
	return null;
}

function DeleteCookie (name,path,domain) {
	if (GetCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

function SetCookie (name,value,expires,path,domain,secure) {
	document.cookie = name + "=" + escape (value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}

function initNotify() {
	opera.postError("foo");
	if (GetCookie('bimmermania_guest') == null) {
		// Show the notification since the user hasn't clicked to hide it yet
		opera.postError("bar");
		document.getElementById('guest-notification').style.display="block";
	}
	// Else: Don't show the notification for 24 hours (thats when it expires)
}

function hideNotify() {
	SetCookie('bimmermania_guest', '', expiry);
	$(document.getElementById('guest-notification')).animate({'right': '-=400px'}, 'slow');
}

