window.d_h_={isGecko:false,isSupported:false,create:function(_1){var _2=this,UA=navigator.userAgent.toLowerCase(),_4=navigator.platform.toLowerCase(),_5=navigator.vendor||"";if(UA.match(/gecko/)||UA.match(/webkit/)){this.isGecko=true;this.isSupported=true;} else window.location.hash=window.location.hash;window.h_s.setup(_1);var _6=this.getCurrentLocation();this.currentLocation=_6;var _7=function(){_2.firstLoad=null;};this.addEventListener(window,"unload",_7);if(!h_s.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;h_s.put(this.PAGELOADEDSTRING,true);} else{this.ignoreLocationChange=false;this.fireOnNewListener=true;} setInterval(function(){_2.checkLocation();},100);},initialize:function(){},addListener:function(_9){this.listener=_9;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false;}},addEventListener:function(o,e,l){if(o.addEventListener){o.addEventListener(e,l,false);} else{if(o.attachEvent){o.attachEvent("on"+e,function(){l(window.event);});}}},add:function(_d,_e){var _f=this;var _10=function(){if(_f.currentWaitTime>0){_f.currentWaitTime=_f.currentWaitTime-_f.waitTime;} _d=_f.r_h(_d);h_s.put(_d,_e);_f.ignoreLocationChange=true;_f.currentLocation=_d;window.location.hash=_d;};window.setTimeout(_10,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime;},isFirstLoad:function(){return this.firstLoad;},getCurrentLocation:function(){return this.getCurrentHash();},getCurrentHash:function(){var r=window.location.href,i=r.indexOf("#");return (i>=0?r.substr(i+1):"");},PAGELOADEDSTRING:"d_h__pageLoaded",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,fireHistoryEvent:function(_25){var _26=h_s.get(_25);this.listener.call(null,_25,_26);},checkLocation:function(){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return;} var _27=this.getCurrentLocation();if(_27==this.currentLocation){return;} this.currentLocation=_27;this.fireHistoryEvent(_27);},r_h:function(_2a){var r;if(_2a===null||_2a===undefined){r=null;}else{if(_2a===""){r="";}else{if(_2a.length==1&&_2a.charAt(0)=="#"){r="";}else{if(_2a.length>1&&_2a.charAt(0)=="#"){r=_2a.substring(1);}else{r=_2a;}}}} return r;}};window.h_s={setup:function(_2e){if(typeof _2e!=="undefined"){if(_2e.debugMode){this.debugMode=_2e.debugMode;} if(_2e.toJSON){this.toJSON=_2e.toJSON;} if(_2e.fromJSON){this.fromJSON=_2e.fromJSON;}} var _2f="rshStorageForm",_30="rshStorageField",_31=this.debugMode?h_s.showStyles:h_s.hideStyles,_32=(h_s.debugMode?"width: 800px;height:80px;border:1px solid black;":h_s.hideStyles),_33="<form id=\""+_2f+"\" style=\""+_31+"\">"+"<textarea id=\""+_30+"\" style=\""+_32+"\"></textarea>"+"</form>";document.write(_33);this.storageField=document.getElementById(_30);},put:function(key,_35){this.assertValidKey(key);if(this.hasKey(key)){this.remove(key);} this.storageHash[key]=_35;this.saveHashTable();},get:function(key){this.assertValidKey(key);this.loadHashTable();var _37=this.storageHash[key];if(_37===undefined){_37=null;} return _37;},remove:function(key){this.assertValidKey(key);this.loadHashTable();delete this.storageHash[key];this.saveHashTable();},reset:function(){this.storageField.value="";this.storageHash={};},hasKey:function(key){this.assertValidKey(key);this.loadHashTable();return (typeof this.storageHash[key]!=="undefined");},isValidKey:function(key){return (typeof key==="string");},showStyles:"border:0;margin:0;padding:0;",hideStyles:"left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;",debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(key){var _3c=this.isValidKey(key);},loadHashTable:function(){if(!this.hashLoaded){var _3d=this.storageField.value;if(_3d!==""&&_3d!==null){this.storageHash=this.fromJSON(_3d);this.hashLoaded=true;}}},saveHashTable:function(){this.loadHashTable();var _3e=this.toJSON(this.storageHash);this.storageField.value=_3e;},toJSON:function(o){return o.toJSONString();},fromJSON:function(s){return s.parseJSON();}};window.d_h_.create({toJSON:function(o){return $.toJSON(o);},fromJSON:function(s){return $.parseJSON(s);}});var st_l=function(n_lo,historyData){d_lo(n_lo);};function m_v(n,v){var u=n.split("?"),l='',i,c='',p,k=1;p=u[0].split("/");if(p.length>0){for(i=0;i<p.length;i++){p[i]=trim(p[i]);if(p[i]==''||!p[i]||p[i]==undefined) continue;if(c!='') c+="&";c+=v+k+"="+p[i];k++;}};if(u[1]){u=u[1].split("&");for(i=0;i<u.length;i++){p=u[i].split("=");if(p[0]==''||p[0]==undefined||!p[0]) continue;if(p[1]==undefined||!p[1]) continue;if(c!='') c+="&";c+=p[0]+"="+p[1];}};return c;} function trim(str){str=str.replace(/^\s+/,'');for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}return str;} var g_c23,js_1,c_n23=0;function g_call(a,b,c,d){if(!d) d=1200;if(g_c23) g_c23.abort();if(!c.match("&ft")) c+="&ft_="+js_1;g_c23=$.ajax({url:a+".php",type:"GET",dataType:"json",data: c,success:function(data){b(data);},timeout:d,error:function(x,y){if(y=="timeout"){g_call(a,b,c,d*2.5);}}});} var c_23=new Array(),g_23,local_,is_cmd;function d_lo(n){if(n.length>0){var p=n.split("!/"),c='';c=m_v(p[1],"v");if(p.length==2){if(c_23[c]) rp(c_23[c]);else {g_23=1;g_call("/ajax/call_open",rp,c);}}} function rp(r){var t,l,d;if(r){local_=c;if(r.n_>=0){if(r.n_>c_n23){l=1;t=$("#r-loader");} else {l=0;t=$("#l-loader");} c_n23=r.n_;if(r.inner) t.html(r.inner);d_ws(t);if(r.fx){for(i=0;i<r.fx.length;i++){eval(r.fx[i]);}} mv_0(l);}}}} function g_ev(e){e=(e)?e:window.event;return e;} function d_ws(z){if(!z) z=$("body");$("a").unbind("click").click(function(ev){ev=g_ev(ev);if(this.target.length>2) return;ev=g_ev(ev);var y=d_h_.getCurrentLocation(),z,p='',i,x=$(this);y=window.location.href.replace("#"+y,'');z=this.href.replace(/(.*hupples.com\/)/,'');if(x.parents("#main-nav").length>0){ev.preventDefault();ev.stopPropagation();var k=this.href.replace(/(http:\/\/)?(.*)(hupples)(\.com)/,'');var k_=k.split("/");if(is_cmd==true) window.open("#!"+k);else{d_h_.add("#!"+k);$('#top-nav a[href^="/'+k_[1]+'"]').get(0).href=k;nav_2(this);} return false;} if(z.match(/^(hupples|aplicativos|parcerias)(\/)?/)){ev.preventDefault();ev.stopPropagation();var p="#!"+this.href.replace(/(http:\/\/)?(.*)(hupples)(\.com)/,'');if(is_cmd==true) window.open(p);else{d_h_.add(p);d_lo(p);}}});} function mv_0(a){var w=$(window).outerWidth();if(a_0==1) return false;a_0=1;var c=$("#middle-container"),d=c.children();if(a==1){c.animate({left:-w*2},600,'easeInOutSine',function(){var x=$(d.get(0)),y=$(d.get(1)),z=$(d.get(2));c.css({left:-w});y.html('');x.attr({id:"r-loader"}).appendTo(c);z.attr({id:"m-content"});y.attr({id:"l-loader"});a_0=0;});} else{c.animate({left:0},600,'easeInOutSine',function(){var x=$(d.get(0)),y=$(d.get(1)),z=$(d.get(2));c.css({left:-w});y.html('');z.attr({id:"l-loader"}).prependTo(c);x.attr({id:"m-content"});y.attr({id:"r-loader"});a_0=0;});} } function nav_2(a){if(a_0==1) return false;a_0=1;var a=$(a);var b=a.parents("ul");var d=$("#main-nav a").index(a);$("a",b).removeClass("selected");a.addClass("selected");var c=$("#main-content").children();var x0=$(c.get(d));var x1;c.each(function(){if(this.style.zIndex>0) x1=$(this);});if(x1.get(0)==x0.get(0)){a_0=0;return false;} x0.show().css({opacity:0});x0.animate({opacity:1},500,function(){$(this).css({zIndex:1});a_0=0;});x1.animate({opacity:0},400,function(){$(this).hide().css({zIndex:0});});}function nav_1(a){if(!a) return;var x=$("#main-content",a).children();x.css({display:"none",zIndex:0});$(x.get(0)).css({display:"block",zIndex:1});var s=0;$("#main-nav li",a).each(function(){s+=$(this).outerWidth()+4;});$("#main-nav",a).width(s);} var a_0;$(document).ready(function(){function mW(){var x_=$(window).outerWidth();$(".middle-unit").width(x_);$("#middle-container").css({left:-x_});} $(window).resize(mW);mW();d_ws();d_h_.initialize();d_h_.addListener(st_l);var n_=d_h_.getCurrentLocation();if(n_==""){n_="#!/aplicativos";d_h_.add("#!/aplicativos");} if(n_.length>0){d_lo(n_);}});jQuery.extend(jQuery.easing,{easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1) return c/2*t*t+b;return -c/2*((--t)*(t-2)-1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1) return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1) return c/2*t*t*t*t+b;return -c/2*((t-=2)*t*t*t-2)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1) return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInOutSine:function(x,t,b,c,d){return -c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInOutExpo:function (x,t,b,c,d){if(t==0) return b;if (t==d) return b+c;if((t/=d/2)<1) return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1) return -c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;}});
