(function(){window._zubibu_config={default_host:"shops.zubibu.com"}}).call(this),function(){var a,b;try{a=function(a){var b,c,d;b=this._parse_src(),d=b[0],c=b[1],this.host=a.host||d,this.account_id=a.account_id||c,this.config=a.config,this.account_url=this._account_url();return this},a.prototype.mobilize=function(){if(!this.is_valid())return null;return this._requested_format()!=="html"?this._redirect_for(this._format()):null},a.prototype.is_valid=function(){var a,b;return typeof (a=this.host)!="undefined"&&a!==null&&(this._is_custom_host()||typeof (b=this.account_id)!="undefined"&&b!==null)},a.prototype._format=function(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("applewebkit")>-1&&a.match(/(iphone|ipod|skyfire|android)/)||a.indexOf("fennec")>-1||a.indexOf("series60/5.")>-1||a.match(/symbianos\/9.[4-9]/)||a.indexOf("opera mobi")>-1||a.indexOf("Googlebot-Mobile")>-1)return"iphone";return"html"},a.prototype._redirect_for=function(a){if(a!=="html"){window.location=this._url_for(a);return window.location}},a.prototype._url_for=function(a){return this.account_url+"?referrer="+window.location.href},a.prototype._account_url=function(){return this._is_custom_host()?"http://"+this.host+"/":"http://"+this.config.default_host+"/a/"+this.account_id},a.prototype._is_custom_host=function(){return this.host!=this.config.default_host&&this.host!="www.zubibu.com"&&this.host!="app.zubibu.com"&&this.host!="assets.zubibu.com"&&this.host!="zubibu.com"},a.prototype._requested_format=function(){this._get_param("zf")!==""?this._set_cookie("zf",this._get_param("zf")):null;return this._get_cookie("zf")},a.prototype._set_cookie=function(a,b){document.cookie=a+"="+b+"; path=/";return document.cookie},a.prototype.clear_cookies=function(){return this._set_cookie("zf","")},a.prototype._get_cookie=function(a){var b;b=document.cookie.match("(^|;)?"+a+"=([^;]*)(;|$)");return b===null?"":b[2].replace(/\+/g," ")},a.prototype._get_param=function(a){var b,c,d;a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),c="[\\?&]"+a+"=([^&#]*)",b=new RegExp(c),d=b.exec(window.location.href);return d===null?"":d[1]},a.prototype._parse_src=function(){var a,b,c,d,e,f,g,h,i;a=[],c=document.getElementsByTagName("script");for(b=0,d=c.length;b<d;b++){h=c[b];if(/\/mobilize.*?\.js.*?(#.+)?$/.test(h.src)){e=h.src.split("#"),i=e[0],f=e[1],g=i.match(/https?:\/\/(.[^\/]+)/)[1];return[g,f]}}return a}}catch(c){}b={host:this._zubibu_host,account_id:this._zubibu_account_id,config:this._zubibu_config};try{this.zubibu=new a(b),this.zubibu.mobilize()}catch(c){typeof console=="object"&&console.log(c)}}()
