function PCMSAD(PID) { this.ID = PID; this.PosID = 0; this.ADID = 0; this.ADType = ""; this.ADName = ""; this.ADContent = ""; this.PaddingLeft = 0; this.PaddingTop = 0; this.Width = 0; this.Height = 0; this.IsHitCount = "N"; this.UploadFilePath = ""; this.URL = ""; this.SiteID = 0; this.ShowAD = showADContent; this.Stat = statAD; } function statAD(id) { var sp = document.createElement("SCRIPT"); sp.type = "text/javascript"; sp.src = "http://www.hanyouwang.com/index.php?m=poster&c=index&a=show&siteid="+this.SiteID+"&id="+id+"&spaceid="+this.PosID; document.body.appendChild(sp); } function showADContent() { var content = this.ADContent; var isIE=!!window.ActiveXObject; var str = ""; var AD = eval('('+content+')'); var count = 0; if(AD.ADImage.length){ count = AD.ADImage.length; } function randomsort(a, b) { return Math.random()>.5 ? -1 : 1;//用Math.random()函数生成0~1之间的随机数与0.5比较,返回-1或1 } AD.ADImage.sort(randomsort); for(var i=0;i"+AD.ADImage[i].imgADAlt+""; } document.write(str); } var cmsAD_195 = new PCMSAD('cmsAD_195'); cmsAD_195.PosID = 11; cmsAD_195.ADID = 195; cmsAD_195.ADType = "images"; cmsAD_195.ADName = "【广告】中国银联"; cmsAD_195.ADContent = "{'ADImage':[ {'imgID':'195','imgADLinkUrl':'http%3A%2F%2Fcn.galleria-dfs.com%2Fevent%2FeventDetail.idf%3Finput_event_no%3Dshuang11_17%26ck%3DP_CM_01_S00_B002','imgADAlt':'银联卡','ImgPath':'http://img.hanyouwang.com/2017/1103/20171103021909566.jpg','imgADLinkTarget':'New','showAlt':'Y'} , {'imgID':'101','imgADLinkUrl':'http%3A%2F%2Fwww.hanyouwang.com%2Fspecial%2Ffashion.html','imgADAlt':'潮流时尚专题','ImgPath':'http://img.hanyouwang.com/2017/0418/20170418024338325.jpg','imgADLinkTarget':'New','showAlt':'Y'} , {'imgID':'11','imgADLinkUrl':'http%3A%2F%2Fwww.hanyouwang.com%2Fspecial%2Ftraffic.html','imgADAlt':'韩国交通','ImgPath':'http://img.hanyouwang.com/2017/0208/20170208114233490.png','imgADLinkTarget':'New','showAlt':'Y'} ]}"; cmsAD_195.URL = "http://www.hanyouwang.com/index.php?m=poster&c=index&a=poster_click"; cmsAD_195.SiteID = 1; cmsAD_195.Width = 304; cmsAD_195.Height = 152; cmsAD_195.UploadFilePath = ""; cmsAD_195.ShowAD();