define("ajax.shared",["require","exports"],function(n,t){function r(n){var r=keyMap[n]?keyMap[n]:keyMap.Prefix+n,i=document.getElementById(r),t;return!i&&document.getElementsByClassName&&(t=document.getElementsByClassName(r),i=t&&t.length?t[0]:null),i}function u(n){var f=sj_ce("a"),t,r,u;return f.href=n,t=f.pathname,t[0]!=="/"&&(t="/"+t),t=t.replace(i,"/"),r="",t==="/"?r=t:(u=n.indexOf(t),r=u>-1?n.substr(u):""),r}function f(n,t,i){for(;n&&n!==document;n=n.parentNode){if(n[t]===i)return n;if(n===undefined)break}}var i=/^(\/)(\1+)/;t.useSetBag=!1;t.ajaxUrlBag="";t.getPlaceholder=r;t.getRelativeUrl=u;t.getParentContainer=f});define("ajax.cache.mm",["require","exports"],function(n,t){function a(n,t){e[n]=t}function v(n,t,i,r){if(n>=0){var u=p(n);switch(t){case"Script":u.ScriptHolder.push(r);break;case"Style":u.Style+=r;break;case"EOS":u.Script=u.ScriptHolder;delete u.ScriptHolder;u[t]=r;h(i,u);break;default:u[t]=r}}}function y(n){if(sessionStorage){var t=sessionStorage.getItem(u+n);return t?JSON.parse(t):null}return null}function h(n,t){if(sessionStorage)try{var f=sessionStorage.getItem(s+n);f=f?parseInt(f)+1:1;sessionStorage.setItem(s+n,f);(i!="/search"||f>1)&&(sessionStorage.setItem(u+n,JSON.stringify(t)),r[i]&&e[i]&&(r[i].push(n),r[i].length>e[i]&&(sessionStorage.removeItem(r[i][0]),r[i].shift())))}catch(o){}t={}}function p(n){while(n>=f.length)f.push({Style:"",SearchForm:"",Content:"",ScriptHolder:[]});return f[n]}function c(){var e,r,f,s,n,t,a;if(sessionStorage){for(e in sessionStorage)e.indexOf(u)===0&&sessionStorage.removeItem(e);var v="",y=document.body.getElementsByTagName("style"),p=l.getCssHolder();for(n=0;n0?f.push({Content:t.text}):t.src.length>0&&f.push({Content:t.src,Method:"reference"}));a=window.location.href.substr(window.location.href.indexOf(i));h(a,{Style:v,SearchForm:_G.SRF,Content:_G.CNT,Script:f,IG:_G.IG,Title:document.title,Url:a,EOS:1});o.unbind("onP1",c)}}var o=n("event.custom"),l=n("dom"),i=location.pathname,s="bingc#",u="bing#",f=[],e={},r={"/videos/search":[],"/images/search":[]};t.setQuota=a;t.cacheItem=v;t.fetch=y;o.bind("onP1",c,!0)});define("ajax.history.mm",["require","exports"],function(n,t){function f(n){history.pushState(i,i,n)}function e(n){history.replaceState(i,i,n)}function o(){var n=window.location.href,t=n.indexOf(u),i;t>=0?(i=n.substr(t),r.fire("ajax.state",i)):window.location.assign(n)}var r=n("event.custom"),u=location.pathname,i="";t.pushState=f;t.replaceState=e;window.addEventListener("popstate",o,!1)});define("ajax.framework.mm",["require","exports","ajax.cache.mm","ajax.history.mm"],function(n,t,i,r){function fr(n){for(var t=0;t<\/div>"+r;break;case"IG":_G.IG=r;break;case"Title":bt.innerHTML=r;document.title=bt.value;break;case"EOS":e.ajaxPerf?ar(i):(fi(),ht(),hi(),si(i),ei());break;case"HBop":u=document.createElement("div");document.getElementById(keyMap.Content).appendChild(u);u.outerHTML=r;break;case"RmsDefer":case"EmbDivs":f=e.getPlaceholder(t);f||(f=document.createElement("div"),document.body.appendChild(f));f.outerHTML=r;break;case"Content":ui(t,r);tt!==null&&(sb_ct(tt),tt=null);break;case"LangSwitch":case"MarketSwitch":u=document.createElement("div");document.body.appendChild(u);u.outerHTML=r;break;default:ui(t,r)}}function ar(n){if(u){var t=u.onload,i=sb_st(function(){lt(n);u.onload=function(){}},1e3);u.onload=function(){sb_ct(i);lt(n);t&&t()}}else lt(n)}function lt(n){l.performance=u&&u.contentWindow&&u.contentWindow.performance;fi();ht();hi();si(n);ei()}function ui(n,t){var i=e.getPlaceholder(n);i&&(i.outerHTML=t)}function fi(){_G.PPS=!1;si_PP(new Date)}function vr(){f.fire("ajax.unload");pt&&li(!1);rt.clear();d.forEach(vi,function(n){window.hasOwnProperty(n)&&(window[n]=nt,delete window[n])});d.forEach(yi,function(n){for(var i,r=document.getElementsByClassName(n),t=0;twi){at(n,"PageExpired",o,t);return}y=n;v=t;ut=!0;vr();o=nr;kr(n,t,i)}catch(u){var f=o===dt&&!document.getElementById(c)?!1:!0,r=""+u;f?at(n,r,o,t):oi(r,o)}}function kr(n,r,f){var p,e,a,w,y,b;ft.indexOf(n)===-1&&(t.enableLocalCache&&r===s.history&&(p=i.fetch(n))?(o=dt,l.fromCache=!0,ti(p,-1,n)):(l.fromCache=!1,e=window.AjaxCB.length,o=tr,ft.push(n),a=k.get("_SS","SID"),a&&(h=a),w=n+(n.indexOf("&sid=")===-1?"&sid="+h:"")+"&format="+yt+"&jsoncbid="+e,u&&u.parentNode&&u.parentNode.removeChild(u),u=document.createElement("iframe"),u.style.display="none",document.body.appendChild(u),window.AjaxCB.push(function(t){ti(t,e,n)}),di=new Date,y=function(t,i){return function(){document.getElementById(c)&&at(n,"FailedRequest",t,i)}},u.onload=y(gt,v),b=window.location.protocol+"//"+window.location.host+w,u.contentWindow.location.assign(b),tt=rt.setTimeout(y(rr,v),t.timeout),o=ir,pr(f)))}function at(n,t,i,r){oi(t,i);n=n+ur+i;var u="assign";r===s.history&&(u="replace");rt.setTimeout(function(){return window.location[u](n)},pi)}function oi(n,t){if(t1){var t=b(n[1]),i=b(y);if(et!=null&&et(t,i))return;t&&t!==i&&it(t,s.history)}}function gr(n){n&&n.length>1&&n[1]&&(y=e.getRelativeUrl(n[1]))}function nu(n,t){var i=e.getRelativeUrl(n);i.indexOf(g)===0&&(ot==null||ot(n))?(i=b(i),it(i,t)):window.location.assign(n)}function b(n){if(!n)return n;var t=n.indexOf("#");return t===-1?n:n.substring(0,t)}function tu(){var n,i,t;ut&&(n=a.getCssHolder(),n.id="ajaxStylesBackup",i=a.getCssHolder(),t=n.nextSibling,t&&n.parentNode.insertBefore(i,t),ut=!1)}function hi(){var n=document.getElementById("ajaxStylesBackup");n&&n.parentNode.removeChild(n)}function iu(n,t){var i=t&&t.action?t.action:g;return e.getRelativeUrl(i)+"?q="+encodeURIComponent(n)}function ru(n){for(var r="",i=n.getElementsByTagName("input"),t=0;t-1){i=u[t].pos;break}return i}function b(n,t,i,u,e){var c=!1,s,h;switch(t){case"EOS":f=i;r.renderItem(n,t,i,u);s="";h=0;e==r.Origin.history&&(o=h=a(i),s="if(typeof (_w.LateLoad) != 'undefined') _w.LateLoad.updateImages()");s="if(typeof (_w.VideoDenseResult) != 'undefined') _w.VideoDenseResult.init("+h+");"+s;w.includeScript(s);c=!0}return c}function k(n,t,i,u,s){var h=!1;switch(t){case"EOS":f=i;r.renderItem(n,t,i,u);e(i)||s==r.Origin.history&&(o=a(i));h=!0}return h}function d(){if(s=="/images/search")r.registerRenderCallback(k);else if(s=="/videos/search")r.registerRenderCallback(b);else return;r.enableLocalCache=!1;r.timeout=keyMap.Timeout;r.setHistoryChangeCallback(rt);r.setLocationChangeCallback(ut);r.setContentMaskCallback(ft);r.setBeforeLoadCallback(it)}function h(n,t){if(t)if(v(t)){if(y(t)||!n||!v(n)||y(n))return!1}else if(!e(t)&&n&&e(n)||e(t)&&n&&!e(n))return!1;return!0}function e(n){return n.match(/\/images\/search.*[?&]view=detailv2\b/i)!=null}function v(n){return n.match(/\/videos\/search.*[?&]view=detail\b/i)!=null}function y(n){return/\?.+\bvrth=1\b/.test(n)}function g(n){return n&&n.getAttribute("data-ajax-allowed")==="1"}function nt(n,t,i){for(;n&&n!==document;n=n.parentNode){if(n[t]&&n[t].indexOf(i)!==-1)return n;if(n===undefined)break}}function tt(n,t){if(!n||!t)return!1;for(var i=0;i-1||p(n)||p(t)||!h(n,t))&&(i=!0),i}function p(n){return n&&n.indexOf("ajaxhist=0")>-1}function ut(n){return h(n,window.location.href)}function ft(n){if(n&&l.getParentContainer(n,"id","mmvm_car")!==undefined)return document.getElementById(keyMap.VideoMaskContent);var t=document.getElementById(keyMap.ImageDetailMaskContent);return t?t:document.getElementById(keyMap.Content)}function et(){o=_w.pageYOffset||Math.max(sb_de.scrollTop,sj_b.scrollTop)}function ot(){f===undefined&&(f=window.location.href.substr(window.location.href.indexOf(s)));for(var n=0;n