10020

; var nowAdType = ; var adFlagStr = ; var timer; // var creativeHeightStr; function handleXmlRes(advXml) // back compatibility if (advXml == ) oldHeadAdProcess(); return; else headAd.remove(); // parse ad XML var xmlDoc = $.parseXML(advXml); var xml = $(xmlDoc); var clickMonitor = ; var clickImpression = ; if (typeof (xml.find(adtype)[0]) != undefined) var adtype = xml.find(adtype)[0].textContent.trim(); var newAdtypeStr = new String(adtype); if (typeof (xml.find(creative)[0]) != undefined) creative = xml.find(creative)[0].textContent.trim(); if (typeof (xml.find(adflag)[0]) != undefined) var adflag = xml.find(adflag)[0].textContent.trim(); var newAdflagStr = new String(adflag); if (typeof (xml.find(click)[0]) != undefined) var click = xml.find(click)[0].textContent.trim(); if (typeof (xml.find(Impression)[0]) != undefined) var impression = xml.find(Impression)[0].textContent; if (typeof (xml.find(clickMonitor)[0]) != undefined) clickMonitor = xml.find(clickMonitor)[0].textContent; if (typeof (xml.find(clickImpression)[0]) != undefined) clickImpression = xml.find(clickImpression)[0].textContent; if (typeof (xml.find(VideoURL)[0]) != undefined) videoURL = xml.find(VideoURL)[0].textContent.trim(); if dexOf([)

-1) var adTypeStr = newAdtypeStr.substr(1, 1); else var adTypeStr = newAdtypeStr.substr(0, 1); if (newAdflagStr.indexOf([)

-1) adFlagStr = newAdflagStr.substr(1, 1); else adFlagStr = newAdflagStr.substr(0, 1); if (click.replace(HTTP_PREFIX, ) == click.replace(HTTP_PREFIX, ) == ) click = javascript:;; picLink.removeAttr(target); picLink.addClass(defCur); if (typeof (xml.find(Cexpansion)[0]) != undefined) var cexpansion = xml.find(Cexpansion)[0].textContent.trim(); // xmlcreativeHeight if (typeof (xml.find(creativeHeight)[0]) != undefined) var creativeHeight = xml.find(creativeHeight)[0].textContent.trim(); creativeHeightStr = new String(creativeHeight); // configure top video ad vdLink.attr(href, click); if (video != null && videoURL != ) video.attr(src, httpToSlash(videoURL)); video.get(0).play(); // configure top pic ad picLink.attr(href, click); picImg.attr(src, httpToSlash(creative)); // ad flag logic if (adFlagStr == 0) cornLab.remove(); var clickAction = function () if (clickMonitor != ) clickMonitor = httpToSlash(clickMonitor); $.ajax( url: clickMonitor, cache: false, crossDomain: true, success: function (data) clickFuntion(data); ); ; function clickFuntion(src) src= httpToSlash(src); pyright).append(); // ad type logic if (cexpansion != 3) if (cexpansion == 0 cexpansion == 2) videoHeadAd.remove(); picHeadAd.show(); picHeadAd.append(cornLab[0]); picHeadAd.click(clickAction); else if (cexpansion == 1) picHeadAd.remove(); videoHeadAd.show(); videoHeadAd.click(clickAction); if (adFlagStr == 1) videoHeadAd.append(cornLab[0]); // invoke impression interface once user click video if (impression.trim() != ) impression = httpToSlash(impression); clickFuntion(impression); // if (typeof (xml.find(Cexpansion)[0]) != undefined) // if (cexpansion == 3) if (adTypeStr == 1) picHeadAd.remove(); videoHeadAd.show(); videoHeadAd.click(clickAction); if (adFlagStr == 1) videoHeadAd.append(cornLab[0]); if (creativeHeightStr) video.height(creativeHeightStr) if (adTypeStr == 0) videoHeadAd.remove(); picHeadAd.show(); picHeadAd.click(clickAction); if (adFlagStr == 1) picHeadAd.append(cornLab[0]); if (creativeHeightStr) picHeadAd.children().children().eq(0).children(img).height(creativeHeightStr) if (cexpansion == 2) creativeB = xml.find(creativeB)[0].textContent.trim(); nowAdType = pic; var cexpansion = xml.find(Cexpansion)[0].textContent.trim();// status = true; if (picHeadAd.css(display) != none) picHeadAd.children().children().eq(0).children(img).attr(src, creativeB); picHeadAd.children().children().eq(0).children(img).animate(height: 700px, 500, function () picHeadAd.children().find(.close_jumb).show(); nowAdType = pic; ) timer = setTimeout(function () picHeadAd.children().children().eq(0).children(img).attr(src, creative); picHeadAd.children().children().eq(0).children(img).animate(height: 120px, 500, function () videoHeadAd.children().find(.close_jumb).hide(); picHeadAd.children().find(.close_jumb).hide(); nowAdType = pic; ) clearTimeout(timer); , 5000) // if (cexpansion == 0) VideoURLB = xml.find(VideoURLB)[0].textContent.trim(); nowAdType = pic; var cexpansion = xml.find(Cexpansion)[0].textContent.trim(); status = true; if (picHeadAd.css(display) != none) var imgParentEle = picHeadAd.children().children().eq(0); imgParentEle.children(img).remove(); imgParentEle.append(videoStr); $(head_ad_video).attr(src, VideoURLB); picHeadAd.animate(height: 700px, 500, function () $(head_ad_video)[0].play(); picHeadAd.children().find(.close_jumb).show(); nowAdType = video; ) timer = setTimeout(function () imgParentEle.children(video).remove(); imgParentEle.append(); imgParentEle.children(img).attr(src, creative); imgParentEle.parent().parent().animate(height: 120px, 500, function () videoHeadAd.children().find(.close_jumb).hide(); picHeadAd.children().find(.close_jumb).hide(); nowAdType = pic; ) clearTimeout(timer); , 5000) // if (cexpansion == 1) VideoURLB = xml.find(VideoURLB)[0].textContent.trim(); var cexpansion = xml.find(Cexpansion)[0].textContent.trim(); status = true; if (videoHeadAd.children().children(a).children(video)[0].src != none) video.attr(src, VideoURLB); video.animate(height: 700px, 500, function () videoHeadAd.children().find(.close_jumb).show(); video[0].play(); ) timer = setTimeout(function () video.attr(src, videoURL); video.animate(height: 120px, 500, function () videoHeadAd.children().find(.close_jumb).hide(); video[0].play(); clearTimeout(timer); ) , 5000) // function closeJumb(id) clearTimeout(timer); if ($(id).css(height) == 700px) status = false; if (id == head_ad_video) var actSpan = $(id).parent().parent(); else var actSpan = $(id).children(); if (typeof actSpan != undefined) actSpan.find(.close_jumb).hide(); if ($(id).children().attr(class) == pic_head_ad) if (nowAdType == pic) $(id).children().children(a).children(img).animate(height: 120px, 500, function () $(id).children().children(a).children(img).attr(src, creative); nowAdType = pic; ); if (nowAdType == video) $(id).children().children(a).children(video).remove(); $(id).animate(height: 120px, 500, function () $(id).children().children(a).append(); if ($(id).children().children(a).find(img).length

1) var selEle = $(id).children().children(a).find(img) var length = selEle.length; selEle.eq(length – 1).remove() nowAdType = video; ); else if (actSpan.attr(class) == video_head_ad) if (typeof actSpan != undefined) actSpan.find(.close_jumb).hide(); actSpan.find(.open_jumb).show(); $(id).attr(src, videoURL); $(id).animate(height: 120px, 500, function () $(id)[0].play(); ); // // function httpToSlash(url) if (typeof (url) != undefined) if (url.indexOf(https:) === 0) url = url.replace(https:, ); else if (url.indexOf(http:) === 0) url = url.replace(http:, ); return url; function oldHeadAdProcess() picHeadAd.remove(); videoHeadAd.remove(); headAd.show(); return; function vNewsProcess() if (vTag == vNews) $(pic_head_ad).remove(); $(pic_head).remove(); $(body).prepend($(.head)); $(body).prepend($(.head_ad)); //$(topJsp).remove(); function initLoginRefact() // $.ajax( type:get, url: signup.jsp, timeout:30000, dataType:html, cache: true, success: function(dataHtml) //$(document).append(dataHtml) $(.login_refact_div).append(dataHtml) ); $(document).ready(function () // initLoginRefact(); if (status == true) var actSpan = $(video_head_ad) $(pic_head_ad); actSpan.find(.close_jumb).show(); $(search_key).on(click, function () $(searchResult).submit(); ); $(searchResult).submit(function(e) bsForm(searchResult); return true; ); // ad video process if (adVal != null && adVal != ) $.ajax( url: data: c= + adVal + &op=1, cache: false, crossDomain: true, success: function (xml) handleXmlRes(xml); , error: function () oldHeadAdProcess(); console.log(Head Ad request error!); return; ); vNewsProcess(); );

101810020

99500016300

1820

20012016100300

7 101850.02165000202199139920189910936355

201610101010

1820​​