/* Some or all contents Copyright (c) 2010-2011 Meraki, Inc., all rights reserved */
(function(){function C(){if(parent!=self){return}if(!document||!document.body||!document.body.firstChild){setTimeout(C,100);return}else{E()}}var M=null;var r=null;var g=null;var F=false;var w=null;var O=null;var e=null;var k=null;var i=null;var x=-1;var m=null;var B=null;var o=null;var q=null;var v=null;var b=null;var I=null;var H=null;var N=null;var G=null;var t=null;var L=null;function f(){return new RegExp(["spreadsheets.google.com","picasaweb.google.com","login.yahoo.com","google.com/m/translate","mail.google.com","snapfish.com","apple.com","google.com/reader","resorts-interactive.com","espn.com","me.com","webmail.aol.com","joost.com","cbs.com/video","plurk.com","mlxchange.com","justanswer.com","wikipedia.org","bizjournals.com","tumblr.com","leadpagegenerator.com","junaiten.no","okcupid.com","hotmail.com","live.com","comcast.net","dishnetwork.com","sibelius.com","picasaweb.google.com","tiffany.com","investors.com","weebly.com","whirled.com","www.rnw.nl","ineeka.com","mlxchange.com","http://[a-zA-Z-]+.meraki/","mail.yahoo.com/","office.microsoft.com/","cnn.com/","rhap-app-.+.real.com/","meebo.com/","kaplan.com","spreadsheets.google.com/","localhost/","file:///","medschool.ucsf.edu","email.secureserver.net","docs?.google.com","facebook.com","ebay.com","nysdmv.com","myleague.com","fotolog.com","worldwinner.com","marketlinx.com","unr.edu","suddenlink.net","campfirenow.com"].join("|"))}function c(Q){var P=Q.split(".");return parseInt(P[1]<<16)+parseInt(P[2]<<8)+parseInt(P[3])}function J(){var P=document.createElement("div");P.style.position="absolute";P.style.left="1em";P.style.top="1em";P.style.visibility="hidden";document.body.insertBefore(P,document.body.firstChild);em_size=P.offsetLeft;document.body.removeChild(P)}function D(Q,R){var S="";if(document.defaultView&&document.defaultView.getComputedStyle){R=R.replace(/[A-Z]/g,function(T){return"-"+T.toLowerCase()});var P=document.defaultView.getComputedStyle(Q,"");if(P){S=P.getPropertyValue(R)}}else{if(Q.currentStyle){R=R.replace(/\-(\w)/g,function(T,U){return U.toUpperCase()
});S=Q.currentStyle[R]}}return S}function d(P,Q){if(P.match(/([\.\d]+)px/)){return(parseFloat(RegExp.$1)+Q)+"px"}else{if(P.match(/([\.\d]+)em/)){return(parseFloat(RegExp.$1)+(Q/em_size))+"em"}}return Q+"px"}function y(P,Q){if(l(P,Q)){setTimeout(function(){y(P,Q)},1000)}}function l(R,T){if(R.nodeType!=1){return false}var V=D(R,"position");if(!V){return false}var S=(V!="static")?true:T;var Q=R.merakiMarked?false:true;if(Q&&((!T&&V=="absolute")||V=="fixed")){var P=D(R,"top");if(P){R.style.top=d(P,m)}}R.merakiMarked=true;for(var U=R.firstChild;U;U=U.nextSibling){Q=l(U,S)||Q}return Q}function E(){if(document.title=="Meraki Toolbar"){return}if(window!=top){return}if(f().test(window.location.href)){return}var U=document.childNodes.length;for(var S=0;S<U;S++){if(document.childNodes[S]&&document.childNodes[S].tagName&&document.childNodes[S].tagName.match(/^html$/i)){O=document.childNodes[S];break}}if(!O){return}var aa,U=O.childNodes.length;for(var S=0;S<U;S++){if(O.childNodes[S]&&O.childNodes[S].tagName){aa=O.childNodes[S].tagName;if(aa.match(/^head$/i)){k=O.childNodes[S]}else{if(aa.match(/^body$/i)){e=aa;break}}if(aa.match(/^frameset$/i)){return}}}if(!e||!k){return}var T,Q;U=k.childNodes.length;for(var R=0;R<U;R++){if(k.childNodes[R]&&k.childNodes[R].tagName){aa=k.childNodes[R].tagName;if(aa.match(/^script$/i)&&k.childNodes[R].src.match(/toolbar2\/javascript/)){Q=k.childNodes[R].src.match(/^http:\/\/(.*)toolbar2\/javascript\/([^\/]*)\/([^\/]*)\/([^\/]*)$/i);T=k.childNodes[R].src.match(/^http:\/\/(.*)toolbar2\/javascript\/([^\/]*)\/([^\/]*)\/([^\/]*)\/([^\/]*)\/([^\/]*)$/i);if(!T){T=k.childNodes[R].src.match(/^http:\/\/(.*)toolbar2\/javascript\/([^\/]*)\/([^\/]*)\/([^\/]*)\/([^\/]*)$/i)}if(T){var V=T[2];var X=T[3];var P=T[4];var Z=T[5];G="http://"+T[1]+"toolbar2/javascript/"+[V,X,P,Z].join("/")}else{if(Q){var V=T[2];var P=T[3];var Z=T[4];G="http://"+T[1]+"toolbar2/javascript/"+[V,P,Z].join("/")}}}}}if(!G){return}var W=c(Z);var Y=[{position:"top",size:"single",adselect_oo:true},{position:"top",size:"single",adselect_oo:false},{position:"top",size:"double",adselect_oo:true},{position:"top",size:"double",adselect_oo:false}][W%4];
i=Y.position=="top"?true:false;m=Y.size=="single"?30:40;B=new RegExp("Firefox|Iceweasel|Safari|MSIE 8").test(navigator.userAgent);o=true;q=false;v=45000;b=q;I=W;H=!navigator.userAgent.match(/Firefox|Iceweasel|MSIE 7|MSIE 8|Safari|Opera/)||navigator.userAgent.match(/iPhone|iPod|iPad/);N=-1;j();if(!H){if(o){a()}u();window.onresize=u}}function h(){return F}function p(P){F=P}function s(){if(x==-1){x=0}else{if(x==1){g.style.display="none"}else{g.style.display="block"}x=!x}}function u(){if(w){window.clearTimeout(w)}w=window.setTimeout(K,1000);if(navigator.userAgent.match(/MSIE/)){M.style.width=document.body.clientWidth}}function K(){if(!h()){return}var P=0,Q=0;if(typeof(window.innerWidth)=="number"){P=window.innerWidth;Q=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){P=document.documentElement.clientWidth;Q=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){P=document.body.clientWidth;Q=document.body.clientHeight}}}if(P<800||Q<450){M.style.display="none"}else{M.style.display=t}}function a(){var P=function(){var R=null;var S=false;var T=0;var Q=function(U){S=U;T++};return function(){if(!S){Q(true)}clearTimeout(R);R=setTimeout(function(){Q(false)},v)}}();if(document.attachEvent){document.attachEvent("onmousemove",P);document.attachEvent("onkeydown",P);document.attachEvent("onclick",P)}else{document.addEventListener("mousemove",P,false);document.addEventListener("keydown",P,false);document.addEventListener("click",P,false)}}function A(R){var P=G.replace(/javascript/,R);var Q=new Array();if(N){Q.push("v="+N)}if(Q.length>0){P+="?"+Q.join("&")}return P}function z(){var P=document.documentElement.scrollTop;if(P==0){P=document.body.scrollTop}if(i){M.style.top=P+"px"}else{M.style.bottom=-P+"px"}}function n(){if(i==false){return}for(var R=0;R<document.childNodes.length;R++){if(document.childNodes[R].localName&&document.childNodes[R].localName.toLowerCase()=="html"){var Q=D(document.childNodes[R],"marginTop")||"0px";
document.childNodes[R].style.marginTop=d(Q,m);return true}}var S=i?"padding-top":"padding-bottom";var P=D(document.body,S);var T=d(P,m);document.body.style.cssText+=";"+S+": "+T+" !important;";y(document.body,false)}function j(){r=document.createElement("iframe");base_url=A("toolbar");if(i){base_url+="&top=1"}else{base_url+="&top=0"}if(H){r.style.width="0";r.style.height="0"}else{r.style.width="100%";r.style.height=m+"px"}r.src=base_url;r.setAttribute("frameBorder",0);r.style.margin="0";r.style.padding="0";r.id="toolbar_iframe";r.name="toolbar_iframe";r.merakiMarked=true;if(!H){M=document.createElement("div");t=M.style.display;if(i){M.style.top="0"}else{M.style.bottom="0"}M.style.left="0";M.style.width="100%";M.style.height=m+"px";M.style.position=B?"fixed":"absolute";M.style.zIndex="1000000";M.style.backgroundColor="#ffffff";M.style.display="none";M.style.fontSize="12px";M.style.margin="0";M.style.padding="0";M.style.border="0";M.merakiMarked=true;g=document.createElement("iframe");g.src="";g.id="popup_iframe";g.name="popup_iframe";g.allowTransparency="false";g.style.bgcolor="#ffffff";g.style.width="100%";g.style.height="450px";g.style.position="fixed";g.style.top="0";g.style.left="0";g.style.zIndex="1000000";g.style.display="none";g.onload=s;g.merakiMarked=true;M.appendChild(r);M.appendChild(g);document.body.insertBefore(M,document.body.firstChild);J();n();if(!B){var P=false;if(M.style&&M.style.setExpression){P=true}if(P){try{M.style.setExpression("top","eval(document.body.scrollTop || document.documentElement.scrollTop)");document.recalc(true)}catch(Q){P=false}}if(!P){window.onscroll=z}}p(true)}else{document.body.insertBefore(r,document.body.firstChild)}}C()})();
