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.Wspaceidth = 0; this.Height = 0; this.IsHitCount = "N"; this.UploadFilePath = ""; this.URL = ""; this.SiteID = 0; this.ShowAD = showADContent; this.Stat = statAD; } function statAD() { var new_element = document.createElement("script"); new_element.type = "text/javascript"; new_element.src="{APP_PATH}index.php?m=poster&c=index&a=show&siteid="+this.SiteID+"&id="+this.ADID+"&spaceid="+this.PosID; document.body.appendChild(new_element); } function showADContent() { var content = this.ADContent; var str = ""; var AD = eval('('+content+')'); if (this.ADType == "images") { if (AD.Images[0].imgADLinkUrl) str += ""; str += ""; if (AD.Images[0].imgADLinkUrl) str += ""; }else if(this.ADType == "flash"){ str += ""; str += ""; str += ""; str += ""; str += ""; str += ""; } str += ""; document.write(str); } var cmsAD_{$spaceid} = new PCMSAD('cmsAD_{$spaceid}'); cmsAD_{$spaceid}.PosID = {$spaceid}; cmsAD_{$spaceid}.ADID = {$p_id}; cmsAD_{$spaceid}.ADType = "{$p_type}"; cmsAD_{$spaceid}.ADName = "{$p_name}"; cmsAD_{$spaceid}.ADContent = "{'Images':[{'imgADLinkUrl':'{urlencode($p_setting[1]['linkurl'])}','imgADAlt':'{$p_setting[1]['alt']}','ImgPath':''}],'imgADLinkTarget':'New','Count':'1','showAlt':'Y'}"; cmsAD_{$spaceid}.URL = "{APP_PATH}index.php?m=poster&c=index"; cmsAD_{$spaceid}.SiteID = {$siteid}; cmsAD_{$spaceid}.Width = {$width}; cmsAD_{$spaceid}.Height = {$height}; cmsAD_{$spaceid}.UploadFilePath = ''; cmsAD_{$spaceid}.ShowAD(); var isIE=!!window.ActiveXObject; if (isIE){ if (document.readyState=="complete"){ cmsAD_{$spaceid}.Stat(); } else { document.onreadystatechange=function(){ if(document.readyState=="complete") cmsAD_{$spaceid}.Stat(); } } } else { cmsAD_{$spaceid}.Stat(); }