/* Some or all contents Copyright (c) 2010 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()})();