JOO.setMode('static');
JOO.apply('Couplet', {
	setting: {
		showad : true,
		Toppx : 220,//上端位置
		AdDivW : 120,//宽度
		AdDivH : 430,//高度
		PageWidth : 960,//页面多少宽度象素下正好不出现左右滚动条
		MinScreenW : 1200,//显示广告的最小屏幕宽度象素
		AdLeftHtml : '<a href="http://plus.5pk.com/5pk/hhfsj/affairs3_index/index.html?qq&followed" target="_blank"><img src="http://res.5pk.com/public/templates/images/couplet_nzj.jpg" width="120" height="430" border="0"></a>',
		AdRightHtml : '<a href="http://plus.5pk.com/5pk/hhfsj/affairs4_index/index.html?qq&followed" target="_blank"><img src="http://res.5pk.com/public/templates/images/couplet_yds.jpg" width="120" height="430" border="0"></a>'
	},
	show : function (){
		var Z = this, S = Z.setting;
		document.write ('<div id="LeftDiv" style="position: absolute;z-index:1000;width:'+S.AdDivW+'px;height:'+S.AdDivH+'px;top:0px;left:0px;display:none;"><div style="position: absolute;z-index:2000;"><img src="http://res.5pk.com/public/templates/images/close_01.jpg" width="120" height="28" style="cursor:pointer" onclick="Couplet.hideLeft()"></div><div><div>'+S.AdLeftHtml+'</div></div></div>');
		document.write ('<div id="RightDiv" style="position: absolute;z-index:1000;width:'+S.AdDivW+'px;height:'+S.AdDivH+'px;top:0px;left:0px;display:none;"><div style="position: absolute;z-index:2000;"><img src="http://res.5pk.com/public/templates/images/close_01.jpg" width="120" height="28" style="cursor:pointer" onclick="Couplet.hideRight()"></div><div><div>'+S.AdRightHtml+'</div></div></div>');
		this.scall();
	},
	scall : function (){
		var Z = this, S = Z.setting;
		if(!S.showad){
			return;
		}
		if (document.body.clientWidth<=S.MinScreenW){
			//alert("临时提示：\n\n显示器分辨率宽度小于"+S.MinScreenW+",不显示广告");
			S.showad = false;
			$("#LeftDiv").hide();
			$("#RightDiv").hide();
			return;
		}

		var Borderpx = ((document.body.clientWidth-S.PageWidth)/2-S.AdDivW)/2;
		$("#LeftDiv").show();
		$("#LeftDiv").css('top',document.documentElement.scrollTop+S.Toppx);
		$("#LeftDiv").css('left',Borderpx);
		$("#RightDiv").show();
		$("#RightDiv").css('top',document.documentElement.scrollTop+S.Toppx);
		$("#RightDiv").css('left',document.body.clientWidth-$("#RightDiv").attr("offsetWidth")-Borderpx);
	},
	hideLeft : function (){
		var Z = this, S = Z.setting;
		S.showad = false;
		$("#LeftDiv").hide();
	},
	hideRight : function(){
		var Z = this, S = Z.setting;
		S.showad = false;
		$("#RightDiv").hide();
	}
})
Couplet.show();

window.onscroll=function(){
	Couplet.scall()
	};
window.onresize=function(){
	Couplet.scall()
	};
