(function(){var b="http://tuijian.yuntu.baidu.com";var a="http://rp.baidu.com";window.bdyt_ad=function(k,j){var i=Math.random().toString().substr(2);this.options={backend_url:b+"/yuntu_ad/index",container_id:k,ad_iframe_id:"bdyt_ad_"+i,extend_info:j||{}};this.options.extend_info.parent_url=encodeURIComponent(location.href)};window.bdyt_ad.prototype.renderNew=function(m){m=m||{};m=g(this.options.extend_info,m);var k=document.getElementById(this.options.ad_iframe_id);if(!k){var l=document.createElement("iframe");var i=document.getElementById(this.options.container_id);l.style.width="100%";l.style.height="100%";l.setAttribute("id",this.options.ad_iframe_id);l.setAttribute("allowTransparency","true");l.setAttribute("scrolling","no");l.setAttribute("frameBorder","0");l.onload=function(){this.style.display="block"};l.onreadystatechange=function(){if(l.readyState=="complete"){l.style.display="block"}};var j=m.req_type;if(j==3){document.body.setAttribute("data_url",location.href);this.onhashchange(l)}i.appendChild(l)}this.render(m)};window.bdyt_ad.prototype.onhashchange=function(m){function k(){var r=location.hash,s,q;r=r.replace(/^\#/,"");s=r.split(",");return s}var p=function(){if(m){var r=k(),q=r[0];m.style.height=q+"px"}};var n=j();(n==6||n==7)&&i();function j(){var s=navigator.userAgent,t=/msie ([67])/i,q;if(t.test(s)){if((q=t.exec(s))!=null){return q[1]}}return false}function o(){var r=document.body.getAttribute("data_url"),q=location.href;if(r!=q){p()}}function i(){var q=setInterval(o,20);document.body.setAttribute("data_timer",q)}function l(){clearInterval(document.body.getAttribute("data_timer"))}window.onhashchange=p};window.bdyt_ad.prototype.render=function(l){var m=this.options.backend_url+"?";var k=document.getElementById(this.options.ad_iframe_id);for(var j in l){m+=j+"="+l[j]+"&"}k.style.display="none";k.setAttribute("src",m)};var d=a+"/rpadroute/router";var f=b+"/yuntu_ad/displog";var c=b+"/yuntu_ad/clicklog";var h=function(j){var k="_rpLog-"+(new Date()).getTime(),i=new Image();window[k]=i;i.onload=i.onerror=function(){window[k]=null};i.src=j+"&_="+new Date()/1;i=null};var e=function(m,l){var j=m+"?";for(var k in l){j+=k+"="+l[k]+"&"}return j};var g=function(l,k){for(var j in k){l[j]=k[j]}return l};window.bdyt_ad.prototype.ad_click=function(j){j=j||{};j=g(this.options.extend_info,j);var i=e(c,j);h(i);i=e(d,j);window.open(i)};window.bdyt_ad.prototype.ad_change=function(j){j=j||{};j=g(this.options.extend_info,j);var i=e(f,j);h(i)}}());