var PlatJS_index_couplet_right ={
width: 120,
height: 300,
adsConf: {"57":{"id":57,"imageurl":"UploadFile\/Upfile\/gameImg\/201506\/201506121227383120.gif","ads_type":1,"target":"_blank","is_login":0,"tourl":"http:\/\/www.yaowan.com\/?m=platads&action=gettgtourl&key=index_couplet_right&tourl=http%3A%2F%2Fwztl.yaowan.com%2F&i="}},
host:'img.yaowan.com',
sign : 'index_couplet_right',
contentId : '',
curCarouselIndex : 0,
allCarousels : [],
init : function(){
var out_width = this.width;
var out_height = this.height + 20;
this.contentId = this.sign;
var initHTML = ' \
\
\

\
\
\
\
';
document.writeln(initHTML);
this.writeContent().showContent();
return this;
},
closeCouplet: function(){
$('#coupletPanel_'+this.sign).hide();
},
click: function(adsid){
var islogin = this.adsConf[adsid].is_login;
if(islogin && typeof is_user_logined == 'function'){
return is_user_logined();
}else{
return true;
}
},
writeImageContent: function(adsid){
var adsConf = this.adsConf[adsid];
var imageurl = 'http://'+this.host+'/'+adsConf.imageurl;
var html = '
';
return html;
},
writeFlashContent: function(adsid){
var adsConf = this.adsConf[adsid];
var tourl = escape(adsConf.tourl);
var imageurl = 'http://'+this.host+'/'+adsConf.imageurl+"?tourl="+tourl;
var html = ' ';
return html;
},
writeContent: function(){
var i = 0; var html = '';
for(adsid in this.adsConf){
if(this.adsConf[adsid].ads_type == 2){
html += this.writeFlashContent(adsid);
}else{
html += this.writeImageContent(adsid);
}
this.allCarousels[i++] = adsid;
}
document.getElementById(this.contentId).innerHTML=html;
return this;
},
show: function(second){
if(this.allCarousels.length <= 1) return this;
if(second <= 0) return this;
var i = setInterval(function(){
PlatJS_index_couplet_right.showContent();
}, second*1000);
return this;
},
showContent: function(){
var curIndex = this.curCarouselIndex % this.allCarousels.length;
this.curCarouselIndex++;
$('[ef=platSpread_'+this.sign+']').hide();
$("#imageSP"+this.allCarousels[curIndex]).show();
return this;
}
}.init().show(5);