jQuery.fn.beta_pop_up = function() {

	return this.each(function(){
			var thisID=$(this).attr("id"); 		
			  var cookieName="beta_pop_up";
			  cookie=getCookie(cookieName);
			  if (cookie == null) {
			  	width = $(document).width();
			  	centerX = width / 2 - $(this).width() / 2;
			  	$(this).css({
			  		left: centerX + 'px',
			  		top: '0px',
			  		position: 'absolute'
			  	}).animate({
			  		"height": "toggle",
			  		"opacity": "toggle"
			  	}, "normal");
				newCookie(cookieName,"1",30);
				
				$("#close_beta_pop_up").click(function(){
					$("#"+thisID).fadeOut("normal");
				});				
			  }
			  
			  
			  			  
			  function newCookie(name,value,days) {
					var date = new Date();
					date.setTime(date.getTime()+(days*24*60*60*1000));
					var validTill = "; expires="+date.toGMTString();
					document.cookie = name+"="+value+validTill+"; path=/";
			  }
			  
			  function getCookie(name) {
				var searchName = name + "=";
				var ca = document.cookie.split(';');
				for(var i=0;i < ca.length;i++) {
					var c = ca[i];
					while (c.charAt(0)==' ') c = c.substring(1,c.length);
					if (c.indexOf(searchName) == 0) return c.substring(searchName.length,c.length);
				}
				return null;
			}

	});
}
