function CMSADV(PID) {
this.ID = PID;
this.PosID = 0;
this.PosInfo = "";
this.ADContent = "";
this.PaddingLeft = 0;
this.PaddingRight = 0;
this.PaddingTop = 0;
this.PaddingBottom = 0;
this.Width = 0;
this.Height = 0;
this.ExtCss="";
this.IsHitCount = "N";
this.UploadFilePath = "";
this.Step = 1;
this.Delay= 20;
this.WindowHeight = 0;
this.WindowWidth = 0;
this.Yon = 0;
this.Xon = 0;
this.Pause = true;
this.Interval = null;
this.URL = "";
this.SiteID = 0;
this.ShowAD = showADContent;
this.Start = doStart;
this.Stat = statAD;
}
function statAD() {
var new_element = document.createElement("script");
new_element.type = "text/javascript";
new_element.src="/adv/stat/" + this.PosID;
document.body.appendChild(new_element);
}
function showADContent() {
var content = this.ADContent;
if(content == null){
return false;
}
var pos_content = this.PosInfo;
var str = "
";
document.write(str);
}
function changePos(float) {
float.WindowWidth = document.compatMode == "BackCompat" ? document.body.clientWidth : document.documentElement.clientWidth;
float.WindowHeight = document.compatMode == "BackCompat" ? document.body.clientHeight : document.documentElement.clientHeight;
document.getElementById("CMSADV_"+float.PosID).style.left = (float.PaddingLeft + (Math.max(document.documentElement.scrollLeft, document.body.scrollLeft)))+"px";
document.getElementById("CMSADV_"+float.PosID).style.top = (float.PaddingTop + (Math.max(document.documentElement.scrollTop, document.body.scrollTop)))+"px";
if (float.Yon){
float.PaddingTop = float.PaddingTop + float.Step;
}else{
float.PaddingTop = float.PaddingTop - float.Step;
}
if (float.PaddingTop < 0){
float.Yon = 1;
float.PaddingTop = 0;
}
if (float.PaddingTop >= (float.WindowHeight - float.Height)){
float.Yon = 0;float.PaddingTop = (float.WindowHeight - float.Height);
}
if (float.Xon){
float.PaddingLeft = float.PaddingLeft + float.Step;
}else{
float.PaddingLeft = float.PaddingLeft - float.Step;
}
if (float.PaddingLeft < 0){
float.Xon = 1;
float.PaddingLeft = 0;
}
if (float.PaddingLeft >= (float.WindowWidth - float.Width)){
float.Xon = 0;
float.PaddingLeft = (float.WindowWidth - float.Width);
}
}
function doStart(float){
return function(){
changePos(float);
}
}
function cmsAD_2_pause_resume(){if(cmsAD_2.Pause){clearInterval(cmsAD_2.Interval);cmsAD_2.Pause = false;}else {cmsAD_2.Interval = setInterval(cmsAD_2.Start(cmsAD_2),cmsAD_2.Delay);cmsAD_2.Pause = true;}}
var cmsAD_2 = new CMSADV('cmsAD_2');
cmsAD_2.PosID = 2;
cmsAD_2.PosInfo = {"id":"2","site_id":"1","adv_position_type_id":"3","name":"\u6d6e\u52a8\u5e7f\u544a","width":"200","height":"150","left_padding":"0","right_padding":"0","top_padding":"0","bottom_padding":"0","css_setting":"","remark":"","create_time":"2020-02-20 09:21:03","update_time":"2021-08-12 14:25:56","status":"1","adv_position_type_info":{"id":"3","name":"float","title":"\u6f02\u6d6e\u79fb\u52a8","tpl_path":"","is_config_size":"1","is_config_position":"1","is_config_style":"1","adv_show_type":"2","adv_type":"1,3","number":"1","status":"1","create_time":"2017-06-22 14:27:15","update_time":"2017-06-22 15:11:35"},"adv_info":[{"id":"1","site_id":"1","title":"\u516c\u4f17\u53f7","type":"1","adv_position_id":"2","start_time":"2020-09-17 21:12:44","end_time":null,"content":"[{\"file\":{\"id\":\"1467\",\"user_id\":\"1\",\"name\":\"\\u672a\\u6807\\u9898-1.jpg\",\"savename\":\"613ad8e507930.jpg\",\"savepath\":\"20210910\\\/\",\"path\":\"\\\/Uploads\\\/image\\\/20210910\\\/613ad8e507930.jpg\",\"url\":\"http:\\\/\\\/sgedu.org.cn\\\/Uploads\\\/image\\\/20210910\\\/613ad8e507930.jpg\",\"ext\":\"jpg\",\"mime\":\"image\\\/jpeg\",\"size\":\"38326\",\"md5\":\"bce7f479abb68576508984e70dfe6a13\",\"sha1\":\"3bc3617722bfe8f66e2e9009970ea05eb2b7e11a\",\"location\":\"0\",\"create_time\":\"2021-09-10 12:02:45\",\"update_time\":\"2021-09-10 12:02:45\",\"status\":\"1\",\"share\":\"0\",\"share_time\":null,\"folder_id\":\"0\",\"ip\":\"124.235.97.231\",\"remark\":\"\",\"file_type\":\"1\",\"download_is_login\":\"0\"},\"des\":\"\",\"link\":\"http:\\\/\\\/www.sgedu.org.cn\\\/show\\\/937\"}]","create_time":"2020-09-17 21:13:02","update_time":"2021-10-28 12:22:49","css_setting":"","sort":"0","click":"0","status":"0"}]};
cmsAD_2.ADContent = [{"id":"1","site_id":"1","title":"\u516c\u4f17\u53f7","type":"1","adv_position_id":"2","start_time":"2020-09-17 21:12:44","end_time":null,"content":"[{\"file\":{\"id\":\"1467\",\"user_id\":\"1\",\"name\":\"\\u672a\\u6807\\u9898-1.jpg\",\"savename\":\"613ad8e507930.jpg\",\"savepath\":\"20210910\\\/\",\"path\":\"\\\/Uploads\\\/image\\\/20210910\\\/613ad8e507930.jpg\",\"url\":\"http:\\\/\\\/sgedu.org.cn\\\/Uploads\\\/image\\\/20210910\\\/613ad8e507930.jpg\",\"ext\":\"jpg\",\"mime\":\"image\\\/jpeg\",\"size\":\"38326\",\"md5\":\"bce7f479abb68576508984e70dfe6a13\",\"sha1\":\"3bc3617722bfe8f66e2e9009970ea05eb2b7e11a\",\"location\":\"0\",\"create_time\":\"2021-09-10 12:02:45\",\"update_time\":\"2021-09-10 12:02:45\",\"status\":\"1\",\"share\":\"0\",\"share_time\":null,\"folder_id\":\"0\",\"ip\":\"124.235.97.231\",\"remark\":\"\",\"file_type\":\"1\",\"download_is_login\":\"0\"},\"des\":\"\",\"link\":\"http:\\\/\\\/www.sgedu.org.cn\\\/show\\\/937\"}]","create_time":"2020-09-17 21:13:02","update_time":"2021-10-28 12:22:49","css_setting":"","sort":"0","click":"0","status":"0"}];
cmsAD_2.URL = "";
cmsAD_2.SiteID = 1;
cmsAD_2.PaddingLeft = 0;
cmsAD_2.PaddingRight = 0;
cmsAD_2.PaddingTop = 0;
cmsAD_2.PaddingBottom = 0;
cmsAD_2.Width = 200;
cmsAD_2.Height = 150;
cmsAD_2.ExtCss = "";
cmsAD_2.UploadFilePath = "";
cmsAD_2.ShowAD();
var isIE=!!window.ActiveXObject;
if (isIE){
if (document.readyState=="complete"){
//cmsAD_2.Stat();
} else {
document.onreadystatechange=function(){
//if(document.readyState=="complete") cmsAD_2.Stat();
}
}
} else {
//cmsAD_2.Stat();
}
if(cmsAD_2.ADContent != null){
document.getElementById('CMSADV_2').visibility = 'visible';
cmsAD_2.Interval = setInterval(cmsAD_2.Start(cmsAD_2),cmsAD_2.Delay);
}