(function(aN){var aE,az,ax,aK,ao,aI,av,ar,aq,aC=0,aL={},aB=[],aD=0,aM={},aH=[],an=null,aA=new Image,al=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,R=/[^\.]\.(swf)\s*$/i,ak,aj=1,aG,aF,aJ=false,aw=aN.extend(aN("<div/>")[0],{prop:0}),ay=0,ad=!aN.support.opacity&&!window.XMLHttpRequest,ai=function(){az.hide();aA.onerror=aA.onload=null;an&&an.abort();aE.empty()},ac=function(){aN.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})},ah=function(){return[aN(window).width(),aN(window).height(),aN(document).scrollLeft(),aN(document).scrollTop()]},w=function(){var c=ah(),j={},h=aM.margin,i=aM.autoScale,e=(20+h)*2,b=(20+h)*2,g=aM.padding*2;if(aM.width.toString().indexOf("%")>-1){j.width=c[0]*parseFloat(aM.width)/100-40;i=false}else{j.width=aM.width+g}if(aM.height.toString().indexOf("%")>-1){j.height=c[1]*parseFloat(aM.height)/100-40;i=false}else{j.height=aM.height+g}if(i&&(j.width>c[0]-e||j.height>c[1]-b)){if(aL.type=="image"||aL.type=="swf"){e+=g;b+=g;i=Math.min(Math.min(c[0]-e,aM.width)/aM.width,Math.min(c[1]-b,aM.height)/aM.height);j.width=Math.round(i*(j.width-g))+g;j.height=Math.round(i*(j.height-g))+g}else{j.width=Math.min(j.width,c[0]-e);j.height=Math.min(j.height,c[1]-b)}}j.top=c[3]+(c[1]-(j.height+40))*0.5;j.left=c[2]+(c[0]-(j.width+40))*0.5;if(aM.autoScale===false){j.top=Math.max(c[3]+h,j.top);j.left=Math.max(c[2]+h,j.left)}return j},t=function(b){if(b&&b.length){switch(aM.titlePosition){case"inside":return b;case"over":return'<span id="fancybox-title-over">'+b+"</span>";default:return'<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+b+'</span><span id="fancybox-title-right"></span></span>'}}return false},r=function(){var b=aM.title,e=aF.width-aM.padding*2,c="fancybox-title-"+aM.titlePosition;aN("#fancybox-title").remove();ay=0;if(aM.titleShow!==false){b=aN.isFunction(aM.titleFormat)?aM.titleFormat(b,aH,aD,aM):t(b);if(!(!b||b==="")){aN('<div id="fancybox-title" class="'+c+'" />').css({width:e,paddingLeft:aM.padding,paddingRight:aM.padding}).html(b).appendTo("body");switch(aM.titlePosition){case"inside":ay=aN("#fancybox-title").outerHeight(true)-aM.padding;aF.height+=ay;break;case"over":aN("#fancybox-title").css("bottom",aM.padding);break;default:aN("#fancybox-title").css("bottom",aN("#fancybox-title").outerHeight(true)*-1);break}aN("#fancybox-title").appendTo(ao).hide()}}},o=function(){aN(document).unbind("keydown.fb").bind("keydown.fb",function(b){if(b.keyCode==27&&aM.enableEscapeButton){b.preventDefault();aN.fancybox.close()}else{if(b.keyCode==37){b.preventDefault();aN.fancybox.prev()}else{if(b.keyCode==39){b.preventDefault();aN.fancybox.next()}}}});if(aN.fn.mousewheel){aK.unbind("mousewheel.fb");aH.length>1&&aK.bind("mousewheel.fb",function(b,c){b.preventDefault();aJ||c===0||(c>0?aN.fancybox.prev():aN.fancybox.next())})}if(aM.showNavArrows){if(aM.cyclic&&aH.length>1||aD!==0){ar.show()}if(aM.cyclic&&aH.length>1||aD!=aH.length-1){aq.show()}}},f=function(){var b,c;if(aH.length-1>aD){b=aH[aD+1].href;if(typeof b!=="undefined"&&b.match(al)){c=new Image;c.src=b}}if(aD>0){b=aH[aD-1].href;if(typeof b!=="undefined"&&b.match(al)){c=new Image;c.src=b}}},ag=function(){aI.css("overflow",aM.scrolling=="auto"?aM.type=="image"||aM.type=="iframe"||aM.type=="swf"?"hidden":"auto":aM.scrolling=="yes"?"auto":"visible");if(!aN.support.opacity){aI.get(0).style.removeAttribute("filter");aK.get(0).style.removeAttribute("filter")}aN("#fancybox-title").show();aM.hideOnContentClick&&aI.one("click",aN.fancybox.close);aM.hideOnOverlayClick&&ax.one("click",aN.fancybox.close);aM.showCloseButton&&av.show();o();aN(window).bind("resize.fb",aN.fancybox.center);aM.centerOnScroll?aN(window).bind("scroll.fb",aN.fancybox.center):aN(window).unbind("scroll.fb");aN.isFunction(aM.onComplete)&&aM.onComplete(aH,aD,aM);aJ=false;f()},af=function(b){var h=Math.round(aG.width+(aF.width-aG.width)*b),e=Math.round(aG.height+(aF.height-aG.height)*b),g=Math.round(aG.top+(aF.top-aG.top)*b),c=Math.round(aG.left+(aF.left-aG.left)*b);aK.css({width:h+"px",height:e+"px",top:g+"px",left:c+"px"});h=Math.max(h-aM.padding*2,0);e=Math.max(e-(aM.padding*2+ay*b),0);aI.css({width:h+"px",height:e+"px"});if(typeof aF.opacity!=="undefined"){aK.css("opacity",b<0.5?0.5:b)}},d=function(b){var c=b.offset();c.top+=parseFloat(b.css("paddingTop"))||0;c.left+=parseFloat(b.css("paddingLeft"))||0;c.top+=parseFloat(b.css("border-top-width"))||0;c.left+=parseFloat(b.css("border-left-width"))||0;c.width=b.width();c.height=b.height();return c},ab=function(){var b=aL.orig?aN(aL.orig):false,c={};if(b&&b.length){b=d(b);c={width:b.width+aM.padding*2,height:b.height+aM.padding*2,top:b.top-aM.padding-20,left:b.left-aM.padding-20}}else{b=ah();c={width:1,height:1,top:b[3]+b[1]*0.5,left:b[2]+b[0]*0.5}}return c},ae=function(){az.hide();if(aK.is(":visible")&&aN.isFunction(aM.onCleanup)){if(aM.onCleanup(aH,aD,aM)===false){aN.event.trigger("fancybox-cancel");aJ=false;return}}aH=aB;aD=aC;aM=aL;aI.get(0).scrollTop=0;aI.get(0).scrollLeft=0;if(aM.overlayShow){ad&&aN("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});ax.css({"background-color":aM.overlayColor,opacity:aM.overlayOpacity}).unbind().show()}aF=w();r();if(aK.is(":visible")){aN(av.add(ar).add(aq)).hide();var b=aK.position(),c;aG={top:b.top,left:b.left,width:aK.width(),height:aK.height()};c=aG.width==aF.width&&aG.height==aF.height;aI.fadeOut(aM.changeFade,function(){var e=function(){aI.html(aE.contents()).fadeIn(aM.changeFade,ag)};aN.event.trigger("fancybox-change");aI.empty().css("overflow","hidden");if(c){aI.css({top:aM.padding,left:aM.padding,width:Math.max(aF.width-aM.padding*2,1),height:Math.max(aF.height-aM.padding*2-ay,1)});e()}else{aI.css({top:aM.padding,left:aM.padding,width:Math.max(aG.width-aM.padding*2,1),height:Math.max(aG.height-aM.padding*2,1)});aw.prop=0;aN(aw).animate({prop:1},{duration:aM.changeSpeed,easing:aM.easingChange,step:af,complete:e})}})}else{aK.css("opacity",1);if(aM.transitionIn=="elastic"){aG=ab();aI.css({top:aM.padding,left:aM.padding,width:Math.max(aG.width-aM.padding*2,1),height:Math.max(aG.height-aM.padding*2,1)}).html(aE.contents());aK.css(aG).show();if(aM.opacity){aF.opacity=0}aw.prop=0;aN(aw).animate({prop:1},{duration:aM.speedIn,easing:aM.easingIn,step:af,complete:ag})}else{aI.css({top:aM.padding,left:aM.padding,width:Math.max(aF.width-aM.padding*2,1),height:Math.max(aF.height-aM.padding*2-ay,1)}).html(aE.contents());aK.css(aF).fadeIn(aM.transitionIn=="none"?0:aM.speedIn,ag)}}},am=function(){aE.width(aL.width);aE.height(aL.height);if(aL.width=="auto"){aL.width=aE.width()}if(aL.height=="auto"){aL.height=aE.height()}ae()},a=function(){aJ=true;aL.width=aA.width;aL.height=aA.height;aN("<img />").attr({id:"fancybox-img",src:aA.src,alt:aL.title}).appendTo(aE);ae()},ap=function(){ai();var c=aB[aC],i,g,h,e,b;aL=aN.extend({},aN.fn.fancybox.defaults,typeof aN(c).data("fancybox")=="undefined"?aL:aN(c).data("fancybox"));h=c.title||aN(c).title||aL.title||"";if(c.nodeName&&!aL.orig){aL.orig=aN(c).children("img:first").length?aN(c).children("img:first"):aN(c)}if(h===""&&aL.orig){h=aL.orig.attr("alt")}i=c.nodeName&&/^(?:javascript|#)/i.test(c.href)?aL.href||null:aL.href||c.href||null;if(aL.type){g=aL.type;if(!i){i=aL.content}}else{if(aL.content){g="html"}else{if(i){if(i.match(al)){g="image"}else{if(i.match(R)){g="swf"}else{if(aN(c).hasClass("iframe")){g="iframe"}else{if(i.match(/#/)){c=i.substr(i.indexOf("#"));g=aN(c).length>0?"inline":"ajax"}else{g="ajax"}}}}}else{g="inline"}}}aL.type=g;aL.href=i;aL.title=h;if(aL.autoDimensions&&aL.type!=="iframe"&&aL.type!=="swf"){aL.width="auto";aL.height="auto"}if(aL.modal){aL.overlayShow=true;aL.hideOnOverlayClick=false;aL.hideOnContentClick=false;aL.enableEscapeButton=false;aL.showCloseButton=false}if(aN.isFunction(aL.onStart)){if(aL.onStart(aB,aC,aL)===false){aJ=false;return}}aE.css("padding",20+aL.padding+aL.margin);aN(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){aN(this).replaceWith(aI.children())});switch(g){case"html":aE.html(aL.content);am();break;case"inline":aN('<div class="fancybox-inline-tmp" />').hide().insertBefore(aN(c)).bind("fancybox-cleanup",function(){aN(this).replaceWith(aI.children())}).bind("fancybox-cancel",function(){aN(this).replaceWith(aE.children())});aN(c).appendTo(aE);am();break;case"image":aJ=false;aN.fancybox.showActivity();aA=new Image;aA.onerror=function(){ac()};aA.onload=function(){aA.onerror=null;aA.onload=null;a()};aA.src=i;break;case"swf":e='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+aL.width+'" height="'+aL.height+'"><param name="movie" value="'+i+'"></param>';b="";aN.each(aL.swf,function(k,j){e+='<param name="'+k+'" value="'+j+'"></param>';b+=" "+k+'="'+j+'"'});e+='<embed src="'+i+'" type="application/x-shockwave-flash" width="'+aL.width+'" height="'+aL.height+'"'+b+"></embed></object>";aE.html(e);am();break;case"ajax":c=i.split("#",2);g=aL.ajax.data||{};if(c.length>1){i=c[0];if(typeof g=="string"){g+="&selector="+c[1]}else{g.selector=c[1]}}aJ=false;aN.fancybox.showActivity();an=aN.ajax(aN.extend(aL.ajax,{url:i,data:g,error:ac,success:function(j){if(an.status==200){aE.html(j);am()}}}));break;case"iframe":aN('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" scrolling="'+aL.scrolling+'" src="'+aL.href+'"></iframe>').appendTo(aE);ae();break}},au=function(){if(az.is(":visible")){aN("div",az).css("top",aj*-40+"px");aj=(aj+1)%12}else{clearInterval(ak)}},at=function(){if(!aN("#fancybox-wrap").length){aN("body").append(aE=aN('<div id="fancybox-tmp"></div>'),az=aN('<div id="fancybox-loading"><div></div></div>'),ax=aN('<div id="fancybox-overlay"></div>'),aK=aN('<div id="fancybox-wrap"></div>'));if(!aN.support.opacity){aK.addClass("fancybox-ie");az.addClass("fancybox-ie")}ao=aN('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(aK);ao.append(aI=aN('<div id="fancybox-inner"></div>'),av=aN('<a id="fancybox-close"></a>'),ar=aN('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),aq=aN('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));av.click(aN.fancybox.close);az.click(aN.fancybox.cancel);ar.click(function(b){b.preventDefault();aN.fancybox.prev()});aq.click(function(b){b.preventDefault();aN.fancybox.next()});if(ad){ax.get(0).style.setExpression("height","document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");az.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");ao.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}}};aN.fn.fancybox=function(b){aN(this).data("fancybox",aN.extend({},b,aN.metadata?aN(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!aJ){aJ=true;aN(this).blur();aB=[];aC=0;c=aN(this).attr("rel")||"";if(!c||c==""||c==="nofollow"){aB.push(this)}else{aB=aN("a[rel="+c+"], area[rel="+c+"]");aC=aB.index(this)}ap();return false}});return this};aN.fancybox=function(b,g){if(!aJ){aJ=true;g=typeof g!=="undefined"?g:{};aB=[];aC=g.index||0;if(aN.isArray(b)){for(var c=0,e=b.length;c<e;c++){if(typeof b[c]=="object"){aN(b[c]).data("fancybox",aN.extend({},g,b[c]))}else{b[c]=aN({}).data("fancybox",aN.extend({content:b[c]},g))}}aB=jQuery.merge(aB,b)}else{if(typeof b=="object"){aN(b).data("fancybox",aN.extend({},g,b))}else{b=aN({}).data("fancybox",aN.extend({content:b},g))}aB.push(b)}if(aC>aB.length||aC<0){aC=0}ap()}};aN.fancybox.showActivity=function(){clearInterval(ak);az.show();ak=setInterval(au,66)};aN.fancybox.hideActivity=function(){az.hide()};aN.fancybox.next=function(){return aN.fancybox.pos(aD+1)};aN.fancybox.prev=function(){return aN.fancybox.pos(aD-1)};aN.fancybox.pos=function(b){if(!aJ){b=parseInt(b,10);if(b>-1&&aH.length>b){aC=b;ap()}if(aM.cyclic&&aH.length>1&&b<0){aC=aH.length-1;ap()}if(aM.cyclic&&aH.length>1&&b>=aH.length){aC=0;ap()}}};aN.fancybox.cancel=function(){if(!aJ){aJ=true;aN.event.trigger("fancybox-cancel");ai();aL&&aN.isFunction(aL.onCancel)&&aL.onCancel(aB,aC,aL);aJ=false}};aN.fancybox.close=function(){function b(){ax.fadeOut("fast");aK.hide();aN.event.trigger("fancybox-cleanup");aI.empty();aN.isFunction(aM.onClosed)&&aM.onClosed(aH,aD,aM);aH=aL=[];aD=aC=0;aM=aL={};aJ=false}if(!(aJ||aK.is(":hidden"))){aJ=true;if(aM&&aN.isFunction(aM.onCleanup)){if(aM.onCleanup(aH,aD,aM)===false){aJ=false;return}}ai();aN(av.add(ar).add(aq)).hide();aN("#fancybox-title").remove();aK.add(aI).add(ax).unbind();aN(window).unbind("resize.fb scroll.fb");aN(document).unbind("keydown.fb");aI.css("overflow","hidden");if(aM.transitionOut=="elastic"){aG=ab();var c=aK.position();aF={top:c.top,left:c.left,width:aK.width(),height:aK.height()};if(aM.opacity){aF.opacity=1}aw.prop=1;aN(aw).animate({prop:0},{duration:aM.speedOut,easing:aM.easingOut,step:af,complete:b})}else{aK.fadeOut(aM.transitionOut=="none"?0:aM.speedOut,b)}}};aN.fancybox.resize=function(){var b,c;if(!(aJ||aK.is(":hidden"))){aJ=true;b=aI.wrapInner("<div style='overflow:auto'></div>").children();c=b.height();aK.css({height:c+aM.padding*2+ay});aI.css({height:c});b.replaceWith(b.children());aN.fancybox.center()}};aN.fancybox.center=function(){aJ=true;var b=ah(),e=aM.margin,c={};c.top=b[3]+(b[1]-(aK.height()-ay+40))*0.5;c.left=b[2]+(b[0]-(aK.width()+40))*0.5;c.top=Math.max(b[3]+e,c.top);c.left=Math.max(b[2]+e,c.left);aK.css(c);aJ=false};aN.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};aN(document).ready(function(){at()})})(jQuery);if(typeof renderTwitters!="function"){(function(){var e=(function(){var j=navigator.userAgent.toLowerCase();return{webkit:/(webkit|khtml)/.test(j),opera:/opera/.test(j),msie:/msie/.test(j)&&!(/opera/).test(j),mozilla:/mozilla/.test(j)&&!(/(compatible|webkit)/).test(j)}})();var d=0;var c=[];var b=false;var a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];window.ify=function(){var j={'"':"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"};return{link:function(k){return k.replace(/[a-z]+:\/\/[a-z0-9-_]+\.[a-z0-9-_:~%&\?\/.=]+[^:\.,\)\s*$]/ig,function(n){return'<a href="'+n+'">'+((n.length>25)?n.substr(0,24)+"...":n)+"</a>"})},at:function(k){return k.replace(/(^|[^\w]+)\@([a-zA-Z0-9_]{1,15})/g,function(o,p,n){return p+'@<a href="http://twitter.com/'+n+'">'+n+"</a>"})},hash:function(k){return k.replace(/(^|[^\w'"]+)\#([a-zA-Z0-9_]+)/g,function(o,p,n){return p+'#<a href="http://search.twitter.com/search?q=%23'+n+'">'+n+"</a>"})},clean:function(k){return this.hash(this.at(this.link(k)))}}}();window.renderTwitters=function(u,t){function m(s){return document.createElement(s)}function w(s){return document.createTextNode(s)}var q=document.getElementById(t.twitterTarget);var p=null;var o=m("ul"),v,k,j,n,r=u.length>t.count?t.count:u.length;for(n=0;n<r&&u[n];n++){p=l(u[n]);if(t.ignoreReplies&&u[n].text.substr(0,1)=="@"){r++;continue}v=m("li");if(t.template){v.innerHTML=t.template.replace(/%([a-z_\-\.]*)%/ig,function(s,y){var z=p[y]+""||"";if(y=="text"&&t.enableLinks){z=ify.clean(z)}return z})}else{k=m("span");k.className="twitterStatus";j=m("span");j.className="twitterTime";k.innerHTML=u[n].text;if(t.enableLinks==true){k.innerHTML=ify.clean(k.innerHTML)}j.innerHTML=g(u[n].created_at);if(t.prefix){var x=m("span");x.className="twitterPrefix";x.innerHTML=t.prefix.replace(/%(.*?)%/g,function(s,y){return u[n].user[y]});v.appendChild(x);v.appendChild(w(" "))}v.appendChild(k);v.appendChild(w(" "));v.appendChild(j)}if(t.newwindow){v.innerHTML=v.innerHTML.replace(/<a href/gi,'<a target="_blank" href')}o.appendChild(v)}if(t.clearContents){while(q.firstChild){q.removeChild(q.firstChild)}}q.appendChild(o);if(typeof t.callback=="function"){t.callback()}};window.getTwitters=function(n,m,k,j){d++;if(typeof m=="object"){j=m;m=j.id;k=j.count}if(!k){k=1}if(j){j.count=k}else{j={}}if(!j.timeout&&typeof j.onTimeout=="function"){j.timeout=10}if(typeof j.clearContents=="undefined"){j.clearContents=true}if(j.withFriends){j.withFriends=false}j.twitterTarget=n;if(typeof j.enableLinks=="undefined"){j.enableLinks=true}window["twitterCallback"+d]=function(o){if(j.timeout){clearTimeout(window["twitterTimeout"+d])}renderTwitters(o,j)};i((function(p,o){return function(){if(!document.getElementById(p.twitterTarget)){return}var r="http://www.twitter.com/statuses/"+(p.withFriends?"friends_timeline":"user_timeline")+"/"+m+".json?callback=twitterCallback"+o+"&count=20&cb="+Math.random();if(p.timeout){window["twitterTimeout"+o]=setTimeout(function(){if(p.onTimeoutCancel){window["twitterCallback"+o]=function(){}}p.onTimeout.call(document.getElementById(p.twitterTarget))},p.timeout*1000)}var q=document.createElement("script");q.setAttribute("src",r);document.getElementsByTagName("head")[0].appendChild(q)}})(j,d))};h();function l(k){var j=k,m;for(m in k.user){j["user_"+m]=k.user[m]}j.time=g(k.created_at);return j}function i(j){if(!b){c.push(j)}else{j.call()}}function f(){b=true;var j;while(j=c.shift()){j.call()}}function h(){if(document.addEventListener&&!e.webkit){document.addEventListener("DOMContentLoaded",f,false)}else{if(e.msie){document.write("<script id=__ie_init defer=true src=//:><\/script>");var k=document.getElementById("__ie_init");if(k){k.onreadystatechange=function(){if(this.readyState!="complete"){return}this.parentNode.removeChild(this);f.call()}}k=null}else{if(e.webkit){var j=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(j);j=null;f.call()}},10)}}}}function g(o){var n=o.split(" "),m=Date.parse(n[1]+" "+n[2]+", "+n[5]+" "+n[3]),k=new Date(m),t=(arguments.length>1)?arguments[1]:new Date(),p=parseInt((t.getTime()-m)/1000),j="";function s(u){var r=u.getHours(),w=u.getMinutes()+"",v="AM";if(r==0){r=12}else{if(r==12){v="PM"}else{if(r>12){r-=12;v="PM"}}}if(w.length==1){w="0"+w}return r+":"+w+" "+v}function q(u){var r=u.toDateString().split(/ /),x=a[u.getMonth()],v=u.getDate()+"",A=parseInt(v),w=u.getFullYear(),z=(new Date()).getFullYear(),y="th";if((A%10)==1&&v.substr(0,1)!="1"){y="st"}else{if((A%10)==2&&v.substr(0,1)!="1"){y="nd"}else{if((A%10)==3&&v.substr(0,1)!="1"){y="rd"}}}if(v.substr(0,1)=="0"){v=v.substr(1)}return x+" "+v+y+(z!=w?", "+w:"")}p=p+(t.getTimezoneOffset()*60);if(p<5){j="less than 5 seconds ago"}else{if(p<30){j="half a minute ago"}else{if(p<60){j="less than a minute ago"}else{if(p<120){j="1 minute ago"}else{if(p<(45*60)){j=(parseInt(p/60)).toString()+" minutes ago"}else{if(p<(2*90*60)){j="about 1 hour ago"}else{if(p<(24*60*60)){j="about "+(parseInt(p/3600)).toString()+" hours ago"}else{if(p<(48*60*60)){j=s(k)+" yesterday"}else{j=s(k)+" "+q(k)}}}}}}}}return j}})()}var networkTimeout=30000,clockTimer,cache=[];function preloadImages(){var c=arguments.length,b,a;for(b=c;b--;){a=document.createElement("img");a.src=arguments[b];cache.push(a)}}function contact(b){b.preventDefault();$('#contact input[type="text"], #contact input[type="email"], #contact textarea').each(function(d,e){removePlaceholder(e)});$("#contact").data("already-submitted",1);var c=[],a;if(!validateRequired("#contact_name")){c.push(tps_strings.yourName)}if(!validateEmail("#contact_email")){c.push(tps_strings.aValidEmail)}if(!validateRequired("#contact_message","#contact_message")){c.push(tps_strings.aMessage)}if(c.length>0){$('#contact input[type="text"], #contact input[type="email"], #contact textarea').each(function(d,e){addPlaceholder(e)});a=c.pop();alert(tps_strings.pleaseType+" "+(c.length>0?c.join(", ")+tps_strings.and:"")+a+".");return false}else{$("#contact_submit").val(tps_strings.pleaseWait).attr("disabled","disabled").addClass("disable");$.ajax({type:"POST",url:"/send_it.php",data:{locale:tps_locale,email:$("#contact_email").val(),name:$("#contact_name").val(),subject:$("#contact_subject").val(),message:$("#contact_message").val()},success:contact_sent,error:function(){contact_error(tps_strings.networkError)},timeout:networkTimeout,dataType:"json"});return true}}function contact_sent(a){if(a.error=="0"){$("#contact-container").fadeOut("fast",function(){$("#contact-container").html(a.description);$("#contact-container").fadeIn("fast")});return true}else{contact_error(a.description);return false}}function contact_error(a){$('#contact input[type="text"], #contact input[type="email"], #contact textarea').each(function(b,c){addPlaceholder(c)});$("#contact_submit").val(tps_strings.send).attr("disabled","").removeClass("disable");alert(a)}function subscribe(a){a.preventDefault();removePlaceholder($("#newsletter_email"));if(!validateNews()){addPlaceholder($("#newsletter_email"));alert(tps_strings.pleaseType+" "+tps_strings.aValidEmail);return false}$("#newsletter_submit").val(tps_strings.pleaseWait).attr("disabled","disabled").addClass("disable");$.ajax({type:"POST",url:"/add_subscriber.php",data:{locale:tps_locale,email:$("#newsletter_email").val()},success:subscribed,error:function(){subscribe_error(tps_strings.networkError)},timeout:networkTimeout,dataType:"json"});return true}function subscribed(a){if(a.error=="0"){$("#newsletter").fadeOut("fast",function(){$("#newsletter").html(a.description);$("#newsletter").fadeIn("fast")});return true}else{subscribe_error(a.description);return false}}function subscribe_error(a){$("#newsletter_submit").val(tps_strings.subscribe).attr("disabled","").removeClass("disable");alert(a)}function isValidEmailAddress(b){var a=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return a.test(b)}function validateNews(){var a=$("#newsletter_email").data("placeholder");if(isValidEmailAddress($("#newsletter_email").val())&&(!a||$("#newsletter_email").val()!=a)){return true}return false}function validateEmail(b){var a=$(b).parent(),c=$(b).data("placeholder");if(isValidEmailAddress($(b).val())&&(!c||$(b).val()!=c)){a.removeClass("warning");return true}else{if($("#contact").data("already-submitted")){a.addClass("warning")}return false}}function validateRequired(c,a){var b,d=$(c).data("placeholder");if(a){b=$(a)}else{b=$(c).parent()}if($(c).val()&&(!d||$(c).val()!=d)){b.removeClass("warning");return true}else{if($("#contact").data("already-submitted")){b.addClass("warning")}return false}}function selectPlaceholder(a){if($(a).val()){$(a).removeClass("placeholder")}else{$(a).addClass("placeholder")}}function addPlaceholder(a){var b=$(a).data("placeholder");if(b&&(!$(a).val()||b==$(a).val())){$(a).val(b);$(a).addClass("placeholder")}}function removePlaceholder(a){var b=$(a).data("placeholder");if(b&&$(a).val()==b){$(a).val("");$(a).removeClass("placeholder");$(a).removeClass("warning");$(a).parent().removeClass("warning")}}function initFormElement(a){addPlaceholder(a);$(a).blur(function(){addPlaceholder(a)});$(a).focus(function(){removePlaceholder(a)})}function initForms(){$("#contact_name").data("placeholder",tps_strings.name).blur(function(){validateRequired(this)});$("#contact_email").data("placeholder",tps_strings.email).blur(function(){validateEmail(this)});$("#contact_message").data("placeholder",tps_strings.typeYourMessage).blur(function(){validateRequired(this,this)});$("#newsletter_email").data("placeholder",tps_strings.typeYourEmail);$("#contact_subject").change(function(){selectPlaceholder(this)});$("#newsletter").submit(subscribe);$("#contact").submit(contact);selectPlaceholder($("#contact_subject"));$("#contact_submit").attr("disabled","").removeClass("disable");$("#newsletter_submit").attr("disabled","").removeClass("disable");$('input[type="text"], input[type="email"], textarea').each(function(a,b){initFormElement(b)})}function loadVideo(a){if(a){a.preventDefault()}$("#iphone-content").addClass("loading");if(is_iPad()){$("#iphone-content").html('<video scale="aspect" postdomevents="true" width="240" height="345" loop="true" src="/videos/app1/app1.mov" id="iphone-video"></video>');$("#iphone-video").get(0).play()}else{$("#iphone-content").html(videoTag("app1/app1","240","345","11652400"));document.getElementById("ivideo").play()}$("#iphone-home").click(function(b){unloadVideo(b)}).removeClass("nodisplay")}function loadiPadVideo(){unloadVideo();$("#ipad-content").addClass("loading");var a;a=videoTag("app1/app1-ipad","560","409","11652166");$("#ipad-content").html(a);$("#ipad-home").click(function(b){b.preventDefault();$.fancybox.close()})}function unloadiPadVideo(){$("#ipad-content").removeClass("loading");$("#ipad-content").empty();$("#ipad-home").unbind()}function unloadVideo(a){if(a){a.preventDefault()}$("#iphone-content").html('<a href="#" id="iphone-app1"><img src="/videos/app1/app1.jpg" alt="'+tps_strings.watchDemo+'" /></a>');$("#iphone-app1").click(function(b){loadVideo(b)});$("#iphone-home").addClass("nodisplay").unbind()}function videoTag(d,c,a,b){return'<video id="ivideo" autoplay="true" bgcolor="black" scale="aspect" postdomevents="true" width="'+c+'" height="'+a+'" controller="false" loop="true"><source src="/videos/'+d+'.mov" type="video/mp4"></source><source src="/videos/'+d+'.ogv" type="video/ogg"></source><object width="'+c+'" height="'+a+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='+b+'&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=3eb1ba&amp;fullscreen=1&amp;autoplay=1&loop=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id='+b+'&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=3eb1ba&amp;fullscreen=1&amp;autoplay=1&loop=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+c+'" height="'+a+'"></embed></object></video>'}function clock(){clearTimeout(clockTimer);var a=new Date(),c=a.getHours()+":"+pad(a.getMinutes()),b=60500-(parseInt(a.getSeconds())*1000)-(parseInt(a.getMilliseconds()));$(".clock").html(c);clockTimer=setTimeout(clock,b)}function pad(a){if(parseInt(a)<10){return"0"+a}else{return a}}function smoothScroll(){$("a#about-link").click(function(a){$("html, body").animate({scrollTop:$($(this).attr("href")).offset().top+"px"},{duration:500,easing:"swing"});a.preventDefault();return false})}function is_iPhone(){return(navigator.platform.indexOf("iPhone")>-1)}function is_iPad(){return(navigator.platform.indexOf("iPad")>-1)}function getTwitter(){getTwitters("twitter-feed",{id:"tapush",count:1,enableLinks:true,ignoreReplies:true,clearContents:true,template:'<p>"%text%"</p> <div class="time"><!--<a href="http://twitter.com/%user_screen_name%/statuses/%id%/">%time%</a> | <a href="http://twitter.com/tapush">siga-nos no twitter</a>--></div>'})}$(function(){if(is_iPhone()){$("#iphone-app1").attr("href","../videos/app1/app1.mov");$("#ipad-switch").attr("href","../videos/app1/app1-ipad.mov")}else{$("#iphone-app1").click(function(a){loadVideo(a)});if(is_iPad()){$("#ipad-switch").attr("href","../videos/app1/app1-ipad.mov")}else{$("#ipad-switch").fancybox({padding:0,margin:0,autoScale:false,overlayOpacity:0.9,overlayColor:"#000",titleShow:false,transitionIn:"fade",transitionOut:"fade",showNavArrows:false,onStart:loadiPadVideo,onCleanup:unloadiPadVideo})}}getTwitter();initForms();smoothScroll();preloadImages("/images/background_stub.jpg","/images/loader.gif","/images/loader_big.gif","/images/fancybox/fancy_close.png","/images/warning_form.png");if(!is_iPhone()&&!is_iPad()){preloadImages("/images/ipad_frame.png")}clock()});
