var baidu=baidu||{version:"1-2-0"};baidu.guid="$BAIDU$";window[baidu.guid]=window[baidu.guid]||{};baidu.browser=baidu.browser||{};if(/firefox\/(\d+\.\d)/i.test(navigator.userAgent)){baidu.browser.firefox=parseFloat(RegExp["\x241"])}baidu.url=baidu.url||{};baidu.url.escapeSymbol=function(a){return String(a).replace(/\%/g,"%25").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/\ /g,"%20").replace(/\//g,"%2F").replace(/\#/g,"%23").replace(/\=/g,"%3D")};baidu.url.jsonToQuery=function(e,d){var b=[],a=0,c,g,f;d=d||function(h){return baidu.url.escapeSymbol(h)};for(c in e){if(e.hasOwnProperty(c)){g=e[c];if(Object.prototype.toString.call(g)=="[object Array]"){f=g.length;while(f--){b[a++]=c+"="+d(g[f],c)}}else{b[a++]=c+"="+d(g,c)}}}return b.join("&")};baidu.page=baidu.page||{};baidu.page.getHeight=function(){var d=document,a=d.body,c=d.documentElement,b=d.compatMode=="BackCompat"?a:d.documentElement;return Math.max(c.scrollHeight,a.scrollHeight,b.clientHeight)};baidu.dom=baidu.dom||{};baidu.dom.g=function(a){if("string"==typeof a||a instanceof String){return document.getElementById(a)}else{if(a&&a.nodeName&&(a.nodeType==1||a.nodeType==9)){return a}}return null};baidu.g=baidu.G=baidu.dom.g;var bdjs=bdjs||{version:"1.0"};bdjs.config={error_log:"/log",proxy_url:"/proxy",iframe_name:"iframe_canvas",debug:true,app_root:"app_content_",app_container:"app_container",href_regex:/^(?:https?|mailto|ftp|aim|irc|itms|gopher|\/|#)/,canvas_pos:""};bdjs.init=function(b,a){var a=a||bdjs.config.container;return new sandbox(b,a)};bdjs.config.loader_deactive_timer=3000;bdjs.app_callback=function(c,b){var a={resize:"resize_iframe",location:"jump_location",time:"cal_load_time",loaded:"hide_loading",stats:"stats",loader:"set_loader_active"};bdjs[a[c]](b)};bdjs._sendStats=function(b){delete b.method;var f="log_"+(new Date()).getTime();var e=window[f]=new Image();e.onload=(e.onerror=function(){window[f]=null});var d=[];for(var a in b){d.push(a+"="+b[a])}d=d.join("&");e.src="http://app.baidu.com/static/appstore/images/w.gif?&id="+bdjs.config.app_id+"&t="+(+new Date())+"&"+d;e=null};bdjs.set_loader_active=function(){bdjs.config.is_loader_active=true};bdjs.stats=function(a){bdjs._sendStats(a)};bdjs.hide_loading=function(){baidu.g("mask")&&(baidu.g("mask").style.display="none")};setTimeout(function(){if(!bdjs.config.is_loader_active){bdjs.hide_loading()}},bdjs.config.loader_deactive_timer);bdjs.cal_load_time=function(c){if(bdjs.startTimer){var b=c.time;var a=b-bdjs.startTimer;bdjs._sendStats({tp:301,lt:a})}};bdjs.jump_location=function(a){location.href=decodeURIComponent(a.url)};bdjs.resize_iframe=function(b){var c=document.getElementsByName(bdjs.config.iframe_name)[0];var a=baidu.g("mask");if(c){c.style.height=parseInt(b.height)+"px";a&&(a.style.height=parseInt(b.height)+"px")}else{bdjs_log.log("iframe "+bdjs.config.iframe_id+" is not exist")}};bdjs.auto_height_last_height=0;bdjs.auto_height=function(){function a(b){setInterval(function(){if(baidu.g(bdjs.config.app_container)){var c=baidu.g(bdjs.config.app_container).offsetHeight}else{var c=baidu.page.getHeight()}if(c!=bdjs.auto_height_last_height){bdjs.auto_height_last_height=c;b(c)}},100)}a(function(b){var c={method:"resize",height:b};bdjs.call_cantainer_function(c)})};bdjs.call_cantainer_function=function(d){var a={www:"http://www.baidu.com/aladdin/app/www_relay.html",fe:"http://fe.baidu.com/~nwind/app/fe_relay.html",xapp:"http://xapp.baidu.com/apps/common/lib/appstore/appstore_relay.html"};function c(e){var f=document.createElement("iframe");f.src=e+"#"+baidu.url.jsonToQuery(d);f.style.visibility="hidden";f.style.width=f.style.height="0px";f.style.position="absolute";document.body.appendChild(f)}function b(){try{if("app_callback" in parent){parent.app_callback[d.method](d)}}catch(f){}}if(bdjs.config.host&&bdjs.config.host!=""){c(a[bdjs.config.host]);return}if(bdjs.config.canvas_pos=="search"){if(bdjs.config.app_debug=="1"){b()}else{c(a.www)}}else{if(bdjs.config.canvas_pos=="platform"){b()}}};