(function(){

	//获取对象
	var $ = function(id){if(document.getElementById){return eval('document.getElementById("'+id+'")')}else{return eval('document.all.'+id)}};

	//获取cookie
	var getAdCookie = function(N){
		var c=document.cookie.split("; ");
		for(var i=0;i<c.length;i++){var d=c[i].split("=");if(d[0]==N)return unescape(d[1]);}
		return "";
	};

	//设置cookie
	var setAdCookie = function(N,V,Q){
		var L=new Date();
		var z=new Date(L.getTime()+Q*3600000);

		document.cookie=N+"="+escape(V)+";path=/;domain=sina.com.cn;expires="+z.toGMTString()+";";

	};

	//构造函数
	var init = function(){
	  try{
		document.write('\
		  <style type="text/css">\
			html{background:url(ad/2012.jpg) repeat-x 0 0;}\
			body{background:url(ad/2012_03.jpg) no-repeat top center;padding-top:0;margin-top:0;}\
			.topAD{background:#fff;}\
			#wrap{padding-top:0;margin-top:0;}\
		  </style>\
		  <div id="2008TopBar" style="clear:both;width:1003px;height:80px;margin:0 auto;padding:0;overflow:hidden;position:relative;">\
			<div id="2008TopBarClose" style="width:44px;height:18px;padding:0;margin:0;position:absolute;right:0;bottom:0;cursor:pointer;display:block;background:url(ad/jd90_03.gif) no-repeat;z-index:2;" title="关闭背景"></div>\
		  </div>\
		  <div id="2008TopBlank" style="clear:both;height:5px;line-height:0;font-size:0;overflow:hidden;display:none;"></div>\
		');

		$("2008TopBarClose").onclick = function(){
			document.documentElement.style.background = "none";
			document.body.style.background = "none";
			$("2008TopBar").style.display = "none";
			$("2008TopBlank").style.display = "block";
			setAdCookie("jd90year",0,24);
		};
	  }catch(e){}
	}

	 var cookie = getAdCookie("jd90year");
	 cookie = cookie==""?1:cookie;
	 if(cookie==1){init();}

})();
