jQuery(document).ready(function(){
	if ( jQuery.cookie('emailboks') != null ){
		jQuery('.emailboks').remove();
	}
});
		
/*jQuery('.emailboks a.close').live('click', function(){
	closeEmailbox(false);return false;
});*/

function closeEmailbox(submit){
	var submit=submit||false;
	var expire=0;
	if ( jQuery('#nevershowagain:checked').length > 0 ||  submit ){
		expire=new Date('2037'); //close enough
	}
	closeSkyggeBox('.emailboks',expire);
}

function closeSkyggeBox(box,showAgain){
	var showAgain=showAgain||-1;
	if ( jQuery.browser.msie && parseInt(jQuery.browser.version) <= 8 ){
		//your browser sucks, and you are a horrible person for not upgrading it. Shame on you, your computer thinks you looks fat. Also that cake really was a lie.
		document.cookie=box.replace(/\./g,'')+'=true; expires=Thu, 01 Jan 2037 00:00:00 GMT; path=/';
	}else{
		jQuery.cookie(box.replace(/\./g,''),true,{expires: showAgain});
	}
	jQuery(box).remove();
}

