// JavaScript Document
function BASIC_GetCookie(Name){
		var re=new RegExp(Name+"=[^;]+", "i");
		if (document.cookie.match(re)) 
  			return decodeURIComponent(document.cookie.match(re)[0].split("=")[1]); 
		return "";
	}

	function BASIC_SetCookie(name, value, days){
		if (typeof days!="undefined"){ 
 			var expireDate = new Date();
  			var expstring=expireDate.setDate(expireDate.getDate()+days);
  			document.cookie = name+"="+decodeURIComponent(value)+"; expires="+expireDate.toGMTString();
		}
		else document.cookie = name+"="+decodeURIComponent(value);
	}
	function LoadDiv(status) {
		centerThis('popup_news');
		if (status == 'hide') {
			$("#popup_news").fadeOut("slow");
		}
		else {
			var cookie_current = BASIC_GetCookie('popup');
			//alert(cookie_current) ;
			//cookie_current = '';
			if (cookie_current=='') {
				var Time_expires = 24 * 3600 * 1000;
				BASIC_SetCookie('popup','true',Time_expires);
				$("#popup_news").fadeIn("slow");
			}
		}
	}
	function LoadDiv2(status) {
		centerThis('popup_news2');
		if (status == 'hide') {
			$("#popup_news2").fadeOut("slow");
		}
		else {
			$("#popup_news").fadeOut("");
			//var cookie_current = BASIC_GetCookie('popup');
			//alert(cookie_current) ;
			cookie_current = '';
			if (cookie_current=='') {
				var Time_expires = 24 * 3600 * 1000;
				BASIC_SetCookie('popup','true',Time_expires);
				$("#popup_news2").fadeIn("slow");
			}
		}
	}
	function beforedownload(status) {
		centerThis('popup_downloadalert');
		if (status == 'hide') {
			$("#popup_downloadalert").fadeOut("slow");
		}
		else {
			var cookie_current = BASIC_GetCookie('popupalert');
			if (cookie_current=='') {
				var Time_expires = 24 * 3600 * 1000;
				BASIC_SetCookie('popupalert','true',Time_expires);
				$("#popup_downloadalert").fadeIn("slow");
			}
		}
	}
	function centerThis(div) {
		var winH = $(window).height();
		var winW = $(window).width();
		var a = winH/2-$('#' + div).height()/2;
		$('#' + div).css({ "top": 50});
		//$('#' + div).css({ "top": winH/2-$('#' + div).height()/2 });
		$('#' + div).css({ "left": winW/2-$('#' + div).width()/2 });
	} 
