(function(){

var pthis = this;

//获取对象
this.$ = function(id){if(document.getElementById){return eval('document.getElementById("'+id+'")')}else{return eval('document.all.'+id)}};

//获取cookie
this.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
this.setAdCookie = function(N,V,Q){
	var L=new Date();
	var z=new Date(L.getTime()+Q*60000);

	//document.cookie=N+"="+escape(V)+";path=/;expires="+z.toGMTString()+";";
	document.cookie=N+"="+escape(V)+";path=/;domain=hbsszx.com;expires="+z.toGMTString()+";";

};

//构造函数
this.init = function(){
	try{
		document.write('\
		<style type="text/css">\
		html{background:url(/images/background_all.gif) repeat-x 0 0;}\
		body{background:url(/images/long_bj_201201.png) no-repeat 50% 0;padding-top:0;margin-top:0;}\
		</style>\
		<div id="TopBar" style="clear:both;width:950px;height:30px;margin:0 auto;padding:0;overflow:hidden;position:relative;">\
		<a href="/index.html" target="_self" style="position:absolute;left:0;top:0;height:30px;padding:0;margin:0;cursor:pointer;width:950px;z-index:1;"></a>\
		<div id="Btncls" style="width:44px;height:17px;padding:0;margin:0;position:absolute;right:0;bottom:0;cursor:pointer;display:block;background:url(/images/close_btn.gif) no-repeat;z-index:2;" title="关闭背景"></div>\
		</div>\
		<div id="TopBlank" style="clear:both;height:0px;line-height:0;font-size:0;overflow:hidden;display:none;padding-top:0;margin-top:0;"></div>\
		');

		pthis.$("Btncls").onclick = function(){
			document.documentElement.style.background = '#fff';
			document.body.style.background = "#fff";
			pthis.$("TopBar").style.display = "none";
			pthis.$("TopBlank").style.display = "block";
			pthis.setAdCookie("topbackground",0,1440);
		};
		}catch(e){}
	}

	var cookie = pthis.getAdCookie("topbackground");
	cookie = cookie==""?1:cookie;
	//if(cookie==1){pthis.init();}
	pthis.init();
})();
