(function(){

var pthis = this;

//获取对象
this.$ = function(id){if(document.getElementById){return eval('document.getElementById("'+id+'")')}else{return eval('document.all.'+id)}};

//获取cookie
this.getCookie = function(l){var i="",I=l+"=";if(document.cookie.length>0){var offset=document.cookie.indexOf(I);if(offset!=-1){offset+=I.length;var end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;i=unescape(document.cookie.substring(offset,end))}};return i};

//设置cookie
this.setCookie = function(O,o,l,I){var i="",c="";if(l!=null){i=new Date((new Date).getTime()+l*3600000);i="; expires="+i.toGMTString()};if(I!=null){c=";domain="+I};document.cookie=O+"="+escape(o)+i+c};

//构造函数
this.init = function(){
	try{
		document.write('\
		<style type="text/css">\
		html{background:url(http://i0.sinaimg.cn/dy/deco/2010/0206/newyear_01.gif) repeat-x 0 0 #ff9400;}\
		body{background:url(http://i2.sinaimg.cn/dy/deco/2010/0208/newyear_02.jpg) no-repeat 50% 0;padding-top:0;margin-top:0;}\
		.topAD{background:#fff;}\
		#wrap{padding-top:0;margin-top:0;}\
		#page{background:#fff;}\
		</style>\
		<div id="2010TopBar" style="clear:both;width:950px;height:30px;margin:0 auto;padding:0;overflow:hidden;position:relative;">\
		<div id="2010Btncls" style="width:40px;height:18px;padding:0;margin:0;position:absolute;right:0;bottom:0;cursor:pointer;display:block;background:url(http://i2.sinaimg.cn/dy/deco/2010/0206/newyear_03.gif) no-repeat;z-index:2;" title="关闭背景"></div>\
		</div>\
		<div id="2010TopBlank" style="clear:both;height:5px;line-height:0;font-size:0;overflow:hidden;display:none;"></div>\
		');

		pthis.$("2010Btncls").onclick = function(){
			document.documentElement.style.background = '#fff';
			document.body.style.background = "#fff";
			pthis.$("2010TopBar").style.display = "none";
			pthis.$("2010TopBlank").style.display = "block";
			var cookie = parseInt(pthis.getCookie("newyeaebg"));
			cookie = isNaN(cookie)?0:cookie;
			pthis.setCookie("newyeaebg",cookie+1,24);
		};
		}catch(e){}
	}

	var cookie = parseInt(pthis.getCookie("newyeaebg"));
	cookie = isNaN(cookie)?0:cookie;
	if(cookie<2){pthis.init();}
})();
