'; document.getElementById('breakAdv').innerHTML = inserthtml; //logo值为1或者2挑选对于的logo图片,1为银色,2为朱红色 var logoHtml = ''; //headerTxtType值为1或者2挑选对于的顶部右侧文字颜色,1为白色,2为灰色 window.headerTxtType = 1; document.getElementById('logo').innerHTML = logoHtml; $bgImg = document.getElementById("j-imgAdv"); var classVal = document.body.getAttribute('class'); classVal = classVal.concat(' login_ad'); document.body.setAttribute('class', classVal); initImageJson(); } //登录页效果 document.getElementById('login').style.display = 'block'; document.getElementById('login').style.opacity = 1; //设置时间 showTime(); function showTime() { showLeftTime(); function showLeftTime() { var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); if (hours > 6 && hours < 18) { $dayicon[0].className = 'icon-morning'; } else { $dayicon[0].className = 'icon-night'; } if (hours > 12) { hours = hours - 12; $daytype[0].innerText = "PM"; if (hours < 10) { hours = "0" + hours; } } else { $daytype[0].innerText = "AM"; } if (minutes < 10) { minutes = "0" + minutes; } $nowtime.innerText = hours + ":" + minutes; var timeID = setTimeout(showLeftTime, 10000); } } //下一张 document.getElementById('j-itemLeft').onclick = function () { changeImage('left'); }; document.getElementById('j-itemRight').onclick = function () { changeImage('right'); }; function changeImage(type) { if (type === "right") { window.auto++; } if (type === 'left') { window.auto--; } setImgSrc(auto); } function setImgSrc(index) { var min = 0, max = 3; if (index < min) { index = max; window.auto = index; } if (index > max) { index = min; window.auto = index; } if (window.isSingle === false) { //替换多张轮播广告 链接与图片出自 $mtip.setAttribute('title', window.Linkset.urllist[parseInt(index)].msg); $multiAdv.setAttribute('href', window.Linkset.urllist[parseInt(index)].url); //控制时间模块 if (window.Linkset.urllist[parseInt(index)].isAdver) { $time_con.style.visibility = 'hidden'; } else { $time_con.style.visibility = 'visible'; } if (window.Linkset.urllist[parseInt(index)].url.indexOf("javascript:") > -1) { $multiAdv.style.cursor = 'default'; $multiAdv.setAttribute('target', '_self'); } else { $multiAdv.style.cursor = 'pointer'; $multiAdv.setAttribute('target', '_blank'); } } $bgImg.style.opacity = 1; if (window.interruptAdv == undefined || window.interruptAdv == '') { $bgImg.setAttribute('src', window.defaultImgSource[index]); } else if (window.isdefault) { $bgImg.setAttribute('src', window.defaultImgSource[index]); } else { $bgImg.setAttribute('src', window.imgSource[index]); } FullScreenBackground({ width: 1920, height: 980, $this: $bgImg }); } //初始化开始事 if (window.isSingle === true) { //单张图片广告 单张广告html代码上改 var srcString = $singleAdv.getAttribute("href"); if (srcString.indexOf("javascript") >= 0 && srcString.indexOf("http") < 0) { $singleAdv.style.cursor = "default"; } $box_left.style.display = 'none'; } else if (window.isSingle === false) { //多张轮播 $mtip.setAttribute('title', window.Linkset.urllist[parseInt(window.auto)].msg); $multiAdv.setAttribute('href', window.Linkset.urllist[parseInt(window.auto)].url); if (window.Linkset.urllist[parseInt(window.auto)].isAdver) { $time_con.style.visibility = 'hidden'; } else { $time_con.style.visibility = 'visible'; } if (window.Linkset.urllist[parseInt(window.auto)].url.indexOf("javascript:") > -1) { $multiAdv.style.cursor = 'default'; $multiAdv.setAttribute('target', '_self'); } else { $multiAdv.style.cursor = 'pointer'; $multiAdv.setAttribute('target', '_blank'); } } //初始随机插入图片 function initImageJson() { function myRandom(iFrist, iLast) { var iLengh = iLast - iFrist + 1; return Math.floor(Math.random() * iLengh + iFrist); } window.auto = myRandom(0, window.defaultImgSource.length - 1); /*一开始,随机图片*/ if (window.interruptAdv == undefined || window.interruptAdv == '') { $bgImg.setAttribute('src', window.defaultImgSource[window.auto] + '?' + Math.random()); } else if (window.isdefault) { $bgImg.setAttribute('src', window.defaultImgSource[window.auto] + '?' + Math.random()); } else { $bgImg.setAttribute('src', window.imgSource[window.auto] + '?' + Math.random()); } $bgImg.style.opacity = 1; FullScreenBackground({ width: 1920, height: 980, $this: $bgImg }); } //挂公告 setIndexNotify(); function setIndexNotify() { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var responseString = xmlhttp.responseText; try { var res = JSON.parse(responseString); if (res.code === 0 && res.data.length > 0) { $dealError.innerText = res.data[0].content; $dealError.style.display = "block"; } } catch (error) { console.log(error); } } } xmlhttp.open("GET", "/w2/indexNotify/getList.do?time=" + ((new Date()).valueOf()) + (Math.random() * 1000), true); xmlhttp.send(); } if (window.headerTxtType !== undefined && window.headerTxtType == 2) { $headerInfo.setAttribute("class", "header_login_info info-c"); } loadSetSize(); })