(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=sina.com.cn;expires="+z.toGMTString()+";";
	
};

//构造函数
this.init = function(){
  try{
    document.write('\
      <style type="text/css">\
        body{background:url(images/HH2a.jpg) no-repeat top center;padding-top:0;margin-top:0;}\
      </style>\
      <div id="guanbiBar" style="clear:both;width:990px;height:50px;margin:0 auto;padding:0; no-repeat;overflow:hidden;position:relative;">\
        <div id="img_guanbi" style="width:40px;height:18px;padding:0;margin:0;position:absolute;right:0;bottom:0;cursor:pointer;display:block;background:url(images/guanbi01.jpg) no-repeat;z-index:2;" title="关闭背景"></div>\
      </div>\
      <div id="guanbiBlank" style="clear:both;height:5px;line-height:0;font-size:0;overflow:hidden;display:none;"></div>\
    ');

    var tmpImg = document.createElement("img");
    tmpImg.src="guanbi02.jpg";

    pthis.$("img_guanbi").onmouseover = function(){pthis.$("img_guanbi").style.background = "url(images/guanbi02.jpg) no-repeat";};
    pthis.$("img_guanbi").onmouseout = function(){pthis.$("img_guanbi").style.background = "url(images/guanbi01.jpg) no-repeat";};
    pthis.$("img_guanbi").onclick = function(){
		document.body.style.background = "none";
		pthis.$("guanbiBar").style.display = "none";
		pthis.$("guanbiBlank").style.display = "block";
	    pthis.setAdCookie("img_guanbiCookie",0,1440);
	};
  }catch(e){}
}

 var cookie = pthis.getAdCookie("img_guanbiCookie");
 cookie = cookie==""?1:cookie;
 if(cookie==1){pthis.init();}

})();
