(function(a){a.jQTouch=function(e){a.support.WebKitCSSMatrix=(typeof WebKitCSSMatrix=="object");a.support.touch=(typeof Touch=="object");a.support.WebKitAnimationEvent=(typeof WebKitTransitionEvent=="object");var v,q=a("head"),k=[],i=0,m={},j,x,d,b=RegExp(" Mobile/").test(navigator.userAgent),f=true,w=0,F=[],s={},u=351,E=a.jQTouch.prototype.extensions,G=["slide","flip","slideup","swap","cube","pop","dissolve","fade","back"],o=[],h="";y(e);function y(K){var N={addGlossToIcon:true,backSelector:".back, .cancel, .goback",cacheGetRequests:true,cubeSelector:".cube",dissolveSelector:".dissolve",fadeSelector:".fade",fixedViewport:true,flipSelector:".flip",formSelector:"form",fullScreen:true,fullScreenClass:"fullscreen",icon:null,touchSelector:"a, .touch",popSelector:".pop",preloadImages:false,slideSelector:"#jqt > * > ul li a, .slide",slideupSelector:".slideup",startupScreen:null,statusBar:"default",submitSelector:".submit",swapSelector:".swap",useAnimations:true,useFastTouch:true};m=a.extend({},N,K);if(m.preloadImages){for(var L=m.preloadImages.length-1;L>=0;L--){(new Image()).src=m.preloadImages[L]}}if(m.icon){var M=(m.addGlossToIcon)?"":"-precomposed";h+=''}if(m.startupScreen){h+=''}if(m.fixedViewport){h+=''}if(m.fullScreen){h+='';if(m.statusBar){h+=''}}if(h){q.prepend(h)}a(document).ready(function(){for(var Q in E){var R=E[Q];if(a.isFunction(R)){a.extend(s,R(s))}}for(var Q in G){var P=G[Q];var O=m[P+"Selector"];if(typeof(O)=="string"){A({name:P,selector:O})}}F.push("input");F.push(m.touchSelector);F.push(m.backSelector);F.push(m.submitSelector);a(F.join(", ")).css("-webkit-touch-callout","none");a(m.backSelector).tap(n);a(m.submitSelector).tap(r);v=a("#jqt");if(m.fullScreenClass&&window.navigator.standalone==true){v.addClass(m.fullScreenClass+" "+m.statusBar)}v.bind("touchstart",I).bind("orientationchange",C).trigger("orientationchange").submit(p);if(m.useFastTouch&&a.support.touch){v.click(function(T){var U=(new Date()).getTime()-w;if(U>u){var S=a(T.target);if(S.attr("nodeName")!=="A"&&S.attr("nodeName")!=="AREA"&&S.attr("nodeName")!=="INPUT"){S=S.closest("a, area")}if(S.isExternalLink()){return true}}return false});v.mousedown(function(S){var T=(new Date()).getTime()-w;if(T .current").length==0){x=a("#jqt > *:first")}else{x=a("#jqt > .current:first");a("#jqt > .current").removeClass("current")}a(x).addClass("current");location.hash="#"+a(x).attr("id");t(x);scrollTo(0,0);B()})}function J(O){if(k.length<=1){window.history.go(-2)}var N=Math.min(parseInt(O||1,10),k.length-1),M=k[0];if(isNaN(N)&&typeof(O)==="string"&&O!="#"){for(var K=1,L=k.length;K1){k.splice(0,N);g(M.page,k[0].page,M.animation,M.reverse===false)}else{location.hash="#"+M.id}return s}function H(M,N,K){var O=k[0].page;if(typeof(N)==="string"){for(var L=o.length-1;L>=0;L--){if(o[L].name===N){N=o[L];break}}}if(typeof(M)==="string"){nextPage=a(M);if(nextPage.length<1){z(M,{animation:N});return}else{M=nextPage}}if(g(O,M,N,K)){t(M,N,K);return s}else{console.error("Could not animate pages.");return false}}function l(){return d}function n(P){var L=a(P.target);if(L.attr("nodeName")!=="A"&&L.attr("nodeName")!=="AREA"){L=L.closest("a, area")}var O=L.attr("target"),N=L.attr("hash"),M=null;if(f==false||!L.length){console.warn("Not able to tap element.");return false}if(L.isExternalLink()){L.removeClass("active");return true}for(var K=o.length-1;K>=0;K--){if(L.is(o[K].selector)){M=o[K];break}}if(O=="_webapp"){window.location=L.attr("href")}else{if(L.is(m.backSelector)){J(N)}else{if(L.attr("href")=="#"){L.unselect();return true}else{if(N&&N!="#"){L.addClass("active");H(a(N).data("referrer",L),M,a(this).hasClass("reverse"))}else{L.addClass("loading active");z(L.attr("href"),{animation:M,callback:function(){L.removeClass("loading");setTimeout(a.fn.unselect,250,L)},$referrer:L})}}}}return false}function t(N,M,L){var K=N.attr("id");k.unshift({page:N,animation:M,reverse:L||false,id:K})}function g(O,M,N,L){if(M.length===0){a.fn.unselect();console.error("Target element is missing.");return false}if(M.hasClass("current")){a.fn.unselect();console.error("Target element is the current page.");return false}a(":focus").blur();M.css("top",window.pageYOffset);var P=function K(R){O[0].removeEventListener("webkitTransitionEnd",P);O[0].removeEventListener("webkitAnimationEnd",P);if(N){M.removeClass("start in "+N.name);O.removeClass("start out current "+N.name);if(L){M.toggleClass("reverse");O.toggleClass("reverse")}M.css("top",0)}else{O.removeClass("current")}M.trigger("pageAnimationEnd",{direction:"in",reverse:L});O.trigger("pageAnimationEnd",{direction:"out",reverse:L});clearInterval(j);x=M;location.hash="#"+x.attr("id");B();var Q=M.data("referrer");if(Q){Q.unselect()}w=(new Date()).getTime();f=true};O.trigger("pageAnimationStart",{direction:"out"});M.trigger("pageAnimationStart",{direction:"in"});if(a.support.WebKitAnimationEvent&&N&&m.useAnimations){f=false;if(L){M.toggleClass("reverse");O.toggleClass("reverse")}O[0].addEventListener("webkitTransitionEnd",P);O[0].addEventListener("webkitAnimationEnd",P);M.addClass(N.name+" in current");O.addClass(N.name+" out");setTimeout(function(){M.addClass("start");O.addClass("start")},0)}else{M.addClass("current");P()}return true}function D(){var K=x.attr("id");if(location.hash!="#"+K){clearInterval(j);J(location.hash)}else{if(location.hash==""){location.hash="#"+K}}}function B(){j=setInterval(D,100)}function c(K,L){var M=null;a(K).each(function(O,P){var N=a(this);if(!N.attr("id")){N.attr("id","page-"+(++i))}v.trigger("pageInserted",{page:N.appendTo(v)});if(N.hasClass("current")||!M){M=N}});if(M!==null){H(M,L);return M}else{return false}}function z(K,L){var N={data:null,method:"GET",animation:null,callback:null,$referrer:null};var M=a.extend({},N,L);if(K!="#"){a.ajax({url:K,data:M.data,type:M.method,success:function(O,Q){var P=c(O,M.animation);if(P){if(M.method=="GET"&&m.cacheGetRequests===true&&M.$referrer){M.$referrer.attr("href","#"+P.attr("id"))}if(M.callback){M.callback(true)}}},error:function(O){if(M.$referrer){M.$referrer.unselect()}if(M.callback){M.callback(false)}}})}else{if(M.$referrer){M.$referrer.unselect()}}}function p(L,M){var K=(typeof(L)==="string")?a(L).eq(0):(L.target?a(L.target):a(L));if(K.length&&K.is(m.formSelector)){z(K.attr("action"),{data:K.serialize(),method:K.attr("method")||"POST",animation:o[0]||null,callback:M});return false}return true}function r(M){var L=a(this).closest("form");if(L.length){var K=a.Event("submit");K.preventDefault();L.trigger(K);return false}return true}function A(K){if(typeof(K.selector)=="string"&&typeof(K.name)=="string"){o.push(K);a(K.selector).tap(n);F.push(K.selector)}}function C(){d=Math.abs(window.orientation)==90?"landscape":"portrait";v.removeClass("portrait landscape").addClass(d).trigger("turn",{orientation:d})}function I(S){var W=a(S.target);if(!a(S.target).is(F.join(", "))){var T=a(S.target).closest("a, area");if(T.length&&T.is(F.join(", "))){W=T}else{return}}if(S){var K=null,Q=event.changedTouches[0].clientX,P=event.changedTouches[0].clientY,L=(new Date).getTime(),O=0,M=0,R=0;W.bind("touchmove",N).bind("touchend",U);K=setTimeout(function(){W.makeActive()},100)}function N(Z){V();var Y=Math.abs(O);var X=Math.abs(M);if(Y>X&&(Y>35)&&R<1000){W.trigger("swipe",{direction:(O<0)?"left":"right",deltaX:O,deltaY:M}).unbind("touchmove",N).unbind("touchend",U)}else{if(X>1){W.removeClass("active")}}clearTimeout(K)}function U(){V();if(M===0&&O===0){W.makeActive();W.trigger("tap")}else{W.removeClass("active")}W.unbind("touchmove",N).unbind("touchend",U);clearTimeout(K)}function V(){var X=event.changedTouches[0]||null;O=X.pageX-Q;M=X.pageY-P;R=(new Date).getTime()-L}}a.fn.unselect=function(K){if(K){K.removeClass("active")}else{a(".active").removeClass("active")}};a.fn.makeActive=function(){return a(this).addClass("active")};a.fn.swipe=function(K){if(a.isFunction(K)){return a(this).live("swipe",K)}else{return a(this).trigger("swipe")}};a.fn.tap=function(L){if(a.isFunction(L)){var K=(m.useFastTouch&&a.support.touch)?"tap":"click";return a(this).live(K,L)}else{return a(this).trigger("tap")}};a.fn.isExternalLink=function(){var K=a(this);return(K.attr("target")=="_blank"||K.attr("rel")=="external"||K.is('input[type="checkbox"], input[type="radio"], a[href^="http://maps.google.com"], a[href^="mailto:"], a[href^="tel:"], a[href^="javascript:"], a[href*="youtube.com/v"], a[href*="youtube.com/watch"]'))};s={getOrientation:l,goBack:J,goTo:H,addAnimation:A,submitForm:p};return s};a.jQTouch.prototype.extensions=[];a.jQTouch.addExtension=function(b){a.jQTouch.prototype.extensions.push(b)}})(jQuery);(function(a){a.fn.transition=function(c,b){return this.each(function(){var e=a(this);var h={speed:"300ms",callback:null,ease:"ease-in-out"};var g=a.extend({},h,b);if(g.speed===0){e.css(c);window.setTimeout(g.callback,0)}else{if(a.browser.safari){var f=[];for(var d in c){f.push(d)}e.css({webkitTransitionProperty:f.join(", "),webkitTransitionDuration:g.speed,webkitTransitionTimingFunction:g.ease});if(g.callback){e.one("webkitTransitionEnd",g.callback)}setTimeout(function(i){i.css(c)},0,e)}else{e.animate(c,g.speed,g.callback)}}})}})(jQuery);var SpinningWheel={cellHeight:44,friction:0.003,slotData:[],handleEvent:function(a){if(a.type=="touchstart"){this.lockScreen(a);if(a.currentTarget.id=="sw-cancel"||a.currentTarget.id=="sw-done"){this.tapDown(a)}else{if(a.currentTarget.id=="sw-frame"){this.scrollStart(a)}}}else{if(a.type=="touchmove"){this.lockScreen(a);if(a.currentTarget.id=="sw-cancel"||a.currentTarget.id=="sw-done"){this.tapCancel(a)}else{if(a.currentTarget.id=="sw-frame"){this.scrollMove(a)}}}else{if(a.type=="touchend"){if(a.currentTarget.id=="sw-cancel"||a.currentTarget.id=="sw-done"){this.tapUp(a)}else{if(a.currentTarget.id=="sw-frame"){this.scrollEnd(a)}}}else{if(a.type=="webkitTransitionEnd"){if(a.target.id=="sw-wrapper"){}else{this.backWithinBoundaries(a)}}else{if(a.type=="orientationchange"){this.onOrientationChange(a)}else{if(a.type=="scroll"){this.onScroll(a)}}}}}}},onOrientationChange:function(a){window.scrollTo(0,0);this.swWrapper.style.top=window.innerHeight+window.pageYOffset+"px";this.calculateSlotsWidth()},onScroll:function(a){this.swWrapper.style.top=window.innerHeight+window.pageYOffset+"px"},lockScreen:function(a){a.preventDefault();a.stopPropagation()},reset:function(){this.slotEl=[];this.activeSlot=null;this.swWrapper=undefined;this.swSlotWrapper=undefined;this.swSlots=undefined;this.swFrame=undefined},calculateSlotsWidth:function(){var b=this.swSlots.getElementsByTagName("div");for(var a=0;a
';document.body.appendChild(e);this.swWrapper=e;this.swSlotWrapper=document.getElementById("sw-slots-wrapper");this.swSlots=document.getElementById("sw-slots");this.swFrame=document.getElementById("sw-frame");for(a=0;a"}c.innerHTML=b;e=document.createElement("div");e.className=this.slotData[a].style;e.appendChild(c);this.swSlots.appendChild(e);c.slotPosition=a;c.slotYPosition=0;c.slotWidth=0;c.slotMaxScroll=this.swSlotWrapper.clientHeight-c.clientHeight-86;c.style.webkitTransitionTimingFunction="cubic-bezier(0, 0, 0.2, 1)";this.slotEl.push(c);if(this.slotData[a].defaultValue){this.scrollToValue(a,this.slotData[a].defaultValue)}}this.calculateSlotsWidth();document.addEventListener("touchmove",this,false);window.addEventListener("orientationchange",this,true);window.addEventListener("scroll",this,true);document.getElementById("sw-done").addEventListener("touchstart",this,false);this.swFrame.addEventListener("touchstart",this,false)},open:function(){this.create();this.swWrapper.style.webkitTransitionTimingFunction="ease-out";this.swWrapper.style.webkitTransitionDuration="400ms";this.swWrapper.style.webkitTransform="translate3d(0, -210px, 0)"},destroy:function(){this.swWrapper.removeEventListener("webkitTransitionEnd",this,false);this.swFrame.removeEventListener("touchstart",this,false);document.getElementById("sw-done").removeEventListener("touchstart",this,false);document.removeEventListener("touchmove",this,false);window.removeEventListener("orientationchange",this,true);window.removeEventListener("scroll",this,true);this.slotData=[];this.cancelAction=function(){return false};this.cancelDone=function(){return true};this.reset();document.body.removeChild(document.getElementById("sw-wrapper"))},close:function(){this.swWrapper.style.webkitTransitionTimingFunction="ease-in";this.swWrapper.style.webkitTransitionDuration="400ms";this.swWrapper.style.webkitTransform="translate3d(0, 0, 0)";this.swWrapper.addEventListener("webkitTransitionEnd",this,false)},addSlot:function(b,d,a){if(!d){d=""}d=d.split(" ");for(var c=0;c0){this.setPosition(d,0)}else{if(this.slotEl[d].slotYPosition0||this.slotEl[this.activeSlot].slotYPosition80){this.scrollStartY=this.slotEl[this.activeSlot].slotYPosition;this.scrollStartTime=b.timeStamp}},scrollEnd:function(f){this.swFrame.removeEventListener("touchmove",this,false);this.swFrame.removeEventListener("touchend",this,false);if(this.slotEl[this.activeSlot].slotYPosition>0||this.slotEl[this.activeSlot].slotYPosition0?0:this.slotEl[this.activeSlot].slotMaxScroll);return false}var b=this.slotEl[this.activeSlot].slotYPosition-this.scrollStartY;if(b-this.cellHeight/1.5){if(this.slotEl[this.activeSlot].slotYPosition%this.cellHeight){this.scrollTo(this.activeSlot,Math.round(this.slotEl[this.activeSlot].slotYPosition/this.cellHeight)*this.cellHeight,"100ms")}return false}var g=f.timeStamp-this.scrollStartTime;var a=(2*b/g)/this.friction;var d=(this.friction/2)*(a*a);if(a<0){a=-a;d=-d}var c=this.slotEl[this.activeSlot].slotYPosition+d;if(c>0){c/=2;a/=3;if(c>this.swSlotWrapper.clientHeight/4){c=this.swSlotWrapper.clientHeight/4}}else{if(c0||this.slotEl[c].slotYPosition0?0:a.target.slotMaxScroll,"150ms");return false},tapDown:function(a){a.currentTarget.addEventListener("touchmove",this,false);a.currentTarget.addEventListener("touchend",this,false);a.currentTarget.className="sw-pressed"},tapCancel:function(a){a.currentTarget.removeEventListener("touchmove",this,false);a.currentTarget.removeEventListener("touchend",this,false);a.currentTarget.className=""},tapUp:function(a){this.tapCancel(a);if(a.currentTarget.id=="sw-cancel"){this.cancelAction()}else{this.doneAction()}},setCancelAction:function(a){this.cancelAction=a},setDoneAction:function(a){this.doneAction=a},cancelAction:function(){return false},cancelDone:function(){return true}};(function(){var o=this;var j=Array();var p=Array();function f(u,v){for(var t in v){u[t]=v[t]}}function h(v,t,u){v.style.width=t.toString()+"px";v.style.height=u.toString()+"px"}function s(u,t,v){u.style.left=Math.round(t).toString()+"px";u.style.top=Math.round(v).toString()+"px"}TrayController=function(){return this};TrayController.prototype.init=function(t){this.currentX=0;this.elem=t};TrayController.prototype.touchstart=function(t){this.startX=t.touches[0].pageX-this.currentX;this.touchMoved=false;window.addEventListener("touchmove",this,true);window.addEventListener("touchend",this,true);this.elem.style.webkitTransitionDuration="0s"};TrayController.prototype.touchmove=function(t){this.touchMoved=true;this.lastX=this.currentX;this.lastMoveTime=new Date();this.currentX=event.touches[0].pageX-this.startX;this.delegate.update(this.currentX)};TrayController.prototype.touchend=function(u){window.removeEventListener("touchmove",this,true);window.removeEventListener("touchend",this,true);this.elem.style.webkitTransitionDuration="0.4s";if(this.touchMoved){var v=this.currentX-this.lastX;var t=(new Date())-this.lastMoveTime+1;this.currentX=this.currentX+v*200/t;this.delegate.updateTouchEnd(this)}else{this.delegate.clicked(this.currentX)}};TrayController.prototype.handleEvent=function(t){this[t.type](t);t.preventDefault()};const e=150;const n=e/2;const d=70;const a=n/2;const g=e;const b=e/3;const k="rotateY("+(-d)+"deg)";const c="rotateY("+d+"deg)";const i="translateZ("+g+"px)";FlowDelegate=function(){this.cells=new Array();this.transforms=new Array()};FlowDelegate.prototype.init=function(t){this.elem=t};FlowDelegate.prototype.updateTouchEnd=function(t){this.lastFocus=undefined;var u=this.getFocusedCell(t.currentX);t.currentX=-u*n;this.update(t.currentX)};FlowDelegate.prototype.clicked=function(u){var v=-Math.round(u/n);var t=this.cells[v];galleryCell=v};FlowDelegate.prototype.getFocusedCell=function(t){var u=-Math.round(t/n);return Math.min(Math.max(u,0),this.cells.length-1)};FlowDelegate.prototype.transformForCell=function(u,w,y){var t=(w*n);var v=t+y;if((v=-a)){return i+" translateX("+t+"px)"}else{if(v>0){return"translateX("+(t+b)+"px) "+k}else{return"translateX("+(t-b)+"px) "+c}}};FlowDelegate.prototype.setTransformForCell=function(t,v,u){if(this.transforms[v]!=u){t.style.webkitTransform=u;this.transforms[v]=u}};FlowDelegate.prototype.update=function(u){this.elem.style.webkitTransform="translateX("+(u)+"px)";for(var v in this.cells){var t=this.cells[v];this.setTransformForCell(t,v,this.transformForCell(t,v,u));v+=1}};var l=new TrayController();var q=new FlowDelegate();o.zflow=function(v,u){var x=document.querySelector(u);l.init(x);q.init(x);l.delegate=q;var t={top:Math.round(-e*0.65)+"px",left:Math.round(-e/2)+"px",width:e+"px",height:Math.round(e*1.5)+"px",opacity:0,};var w=0;function y(){var z=document.createElement("div");var D=document.createElement("img");var B=document.createElement("canvas");var C=document.createElement("a");var A=document.createElement("caption");z.className="cell";z.appendChild(C);C.appendChild(D);z.appendChild(B);z.appendChild(A);D.src=v[w];j[w]=v[w];C.href="show_image?fName="+v[w];C.className="slide-right";o.afnc=function(){var E=D.width;var H=D.height;var F=Math.min(e/H,e/E);E*=F;H*=F;h(D,E,H);f(z.style,t);s(D,(e-E)/2,e-H);s(B,(e-E)/2,e);s(A,(e-E)/2,e+10);m(D,E,H,B);var G=v[w].match(/(.*)[\/\\]([^\/\\]+)\.\w+$/)[2];G=G.replace(/_/g," ");G=G.replace(/(^|\s)([a-z])/g,function(I,K,J){return K+J.toUpperCase()});p[w]=G;r(A,E,w);q.setTransformForCell(z,q.cells.length,q.transformForCell(z,q.cells.length,l.currentX));q.cells.push(z);x.appendChild(z);z.style.opacity=1;if(w<(v.length-1)){w++;y()}else{window.setTimeout(function(){window.scrollTo(0,0)},100);galleryInit=1}};D.addEventListener("load",afnc,true)}y();x.addEventListener("touchstart",l,false)};o.zflowCleanup=function(t){var u=document.querySelector(t);if(u){if(u.childNodes.length>0){q.transforms.length=0;q.cells.length=0;while(u.hasChildNodes()){var v=u.childNodes[0].childNodes[0].childNodes[0];v.removeEventListener("load",afnc,true);u.removeChild(u.childNodes[0])}var w=document.getElementById("gallery");if(w){w.parentNode.removeChild(w);galleryInit=0;galleryCell=0}}}};o.zflowGetImageSource=function(t,u){var v=document.querySelector(t);var w="";if(v){if(v.childNodes.length>0){while(v.hasChildNodes()){w=v.childNodes[0].childNodes[0].childNodes[u].src}}}return w};function r(u,t,v){u.width=t;u.innerHTML=p[v]}function m(x,u,y,v){v.width=u;v.height=y/2;var t=v.getContext("2d");t.save();t.translate(0,y-1);t.scale(1,-1);t.drawImage(x,0,0,u,y);t.restore();t.globalCompositeOperation="destination-out";var w=t.createLinearGradient(0,0,0,y/2);w.addColorStop(1,"rgba(255, 255, 255, 1.0)");w.addColorStop(0,"rgba(255, 255, 255, 0.5)");t.fillStyle=w;t.fillRect(0,0,u,y/2)}})();var now=new Date();var url_month="month";var url_event="events.htm";function getCalendar(e,c,b){url_month=e;url_event=c;var f=b.getDate();var a=b.getMonth()+1;var g=b.getFullYear();$.get(url_month,{month:a,year:g},function(d){$("#ical").empty();$(d).appendTo("#ical");setBindings();setToday();setSelectedAndLoadEvents(b)})}function getEvents(b){var c=b.getDate();var a=b.getMonth()+1;var e=b.getFullYear();$.get(url_event,{day:c,month:a,year:e},function(d){$("#ical .events").empty();$(d).appendTo("#ical .events")})}function getNoEvents(){var a="
  • No Events
  • ";$("#ical .events").empty();$(a).appendTo("#ical .events")}function setBindings(){$("#ical td").bind("click",function(){var b=$(this).attr("class");var a=getClickedDate($(this));RemoveSelectedCell();setToday();if(b.indexOf("date_has_event")!=-1||b.indexOf("today_date_has_event")!=-1){$(this).attr("class","selected_date_has_event");getEvents(a)}if(b==""||b.indexOf("today")!=-1){$(this).attr("class","selected");getNoEvents()}if(b.indexOf("prevmonth")!=-1||b.indexOf("nextmonth")!=-1){getCalendar(url,a)}});$("#ical .bottom-bar .bottom-bar-today").bind("click",function(){getCalendar(url_month,url_event,now)});$("#ical .goto-prevmonth").bind("click",function(){loadPrevNextMonth(-1)});$("#ical .goto-nextmonth").bind("click",function(){loadPrevNextMonth(1)})}function RemoveSelectedCell(){$("#ical .selected_date_has_event").removeClass("selected_date_has_event");$("#ical .selected").removeClass("selected")}function getClickedDate(b){var c=$(b).find("input").val();var a=getDateFromHiddenField(c);return a}function loadPrevNextMonth(c){var b=$("#ical .selected").text();if(b==""){b=$("#ical .selected_date_has_event").text()}var a=parseInt($("#ical > #month").val());var e=$("#ical > #year").val();var d=new Date(e,a-1,b);if(c==1){d.nextMonth()}else{d.prevMonth()}getCalendar(url_month,url_event,d)}function setToday(){$("#ical :hidden").each(function(c){var a=getDateFromHiddenField($(this).val());if(!isNaN(a)){var h=now;var j=now.getDate();var i=a.getDate();var g=now.getMonth();var f=a.getMonth();var e=now.getFullYear();var d=a.getFullYear();if(now.getDate()==a.getDate()&&now.getMonth()==a.getMonth()&&now.getFullYear()==a.getFullYear()){var b=$(this).closest("td");if($(b).attr("class")=="date_has_event"){$(b).attr("class","today_date_has_event")}else{$(b).attr("class","today")}}}})}function getDateFromHiddenField(c){var b=c.split("-");return new Date(b[0],b[1]-1,b[2])}function setSelectedAndLoadEvents(a){RemoveSelectedCell();$("#ical td").each(function(c){var d=$(this).attr("class");var b=getClickedDate($(this));if((d!="prevmonth"&&d!="nextmonth")&&a.getDate()==b.getDate()&&a.getMonth()==b.getMonth()&&a.getFullYear()==b.getFullYear()){if(d=="date_has_event"){$(this).attr("class","selected_date_has_event");getEvents(a)}else{$(this).attr("class","selected");getNoEvents()}}});setToday()}function trim(b,a){return ltrim(rtrim(b,a),a)}function ltrim(b,a){a=a||"\\s";return b.replace(new RegExp("^["+a+"]+","g"),"")}function rtrim(b,a){a=a||"\\s";return b.replace(new RegExp("["+a+"]+$","g"),"")}function dateAddExtention(c,a){var b=new String();c=c.toLowerCase();if(isNaN(a)){throw"The second parameter must be a number. \n You passed: "+a;return false}a=new Number(a);switch(c.toLowerCase()){case"yyyy":this.setFullYear(this.getFullYear()+a);break;case"q":this.setMonth(this.getMonth()+(a*3));break;case"m":this.setMonth(this.getMonth()+a);break;case"y":case"d":case"w":this.setDate(this.getDate()+a);break;case"ww":this.setDate(this.getDate()+(a*7));break;case"h":this.setHours(this.getHours()+a);break;case"n":this.setMinutes(this.getMinutes()+a);break;case"s":this.setSeconds(this.getSeconds()+a);break;case"ms":this.setMilliseconds(this.getMilliseconds()+a);break;default:throw"The first parameter must be a string from this list: \nyyyy, q, m, y, d, w, ww, h, n, s, or ms. You passed: "+c;return false}return this}Date.prototype.dateAdd=dateAddExtention;function prevMonth(){var a=this.getMonth();this.setMonth(a-1);if(this.getMonth()!=a-1&&(this.getMonth()!=11||(a==11&&this.getDate()==1))){this.setDate(0)}}function nextMonth(){var a=this.getMonth();this.setMonth(a+1);if(this.getMonth()!=a+1&&this.getMonth()!=0){this.setDate(0)}}Date.prototype.nextMonth=nextMonth;Date.prototype.prevMonth=prevMonth;(function(c){c.fn.drag=function(f,e,d){if(e){this.bind("dragstart",f)}if(d){this.bind("dragend",d)}return !f?this.trigger("mousedown",{which:1}):this.bind("drag",e?e:f)};var b=c.event.special.drag={distance:0,setup:function(d){d=c.extend({distance:b.distance},d||{});c.event.add(this,"mousedown",b.handler,d)},teardown:function(){c.event.remove(this,"mousedown",b.handler);if(this==b.dragging){b.dragging=b.proxy=null}a(this,true)},handler:function(e){var d;if(e.data.elem){e.dragTarget=e.data.elem;e.dragProxy=b.proxy||e.dragTarget;e.cursorOffsetX=e.data.x-e.data.left;e.cursorOffsetY=e.data.y-e.data.top;e.offsetX=e.pageX-e.cursorOffsetX;e.offsetY=e.pageY-e.cursorOffsetY}switch(e.type){case !b.dragging&&e.which==1&&"mousedown":c.extend(e.data,c(this).offset(),{x:e.pageX,y:e.pageY,elem:this,dist2:Math.pow(e.data.distance,2)});c.event.add(document.body,"mousemove mouseup",b.handler,e.data);a(this,false);return false;case !b.dragging&&"mousemove":if(Math.pow(e.pageX-e.data.x,2)+Math.pow(e.pageY-e.data.y,2)=c.L&&(d[0]||d.R)<=c.R&&(d[1]||d.T)>=c.T&&(d[1]||d.B)<=c.B)},modes:{intersect:function(d,c,e){return this.contains(e,[d.pageX,d.pageY])?e:this.modes.overlap.apply(this,arguments)},overlap:function(d,c,e){e.overlap=Math.max(0,Math.min(e.B,c.B)-Math.max(e.T,c.T))*Math.max(0,Math.min(e.R,c.R)-Math.max(e.L,c.L));if(e.overlap>((this.best||{}).overlap||0)){this.best=e}return null},fit:function(d,c,e){return this.contains(e,c)?e:null},middle:function(d,c,e){return this.contains(e,[c.L+c.W/2,c.T+c.H/2])?e:null}}}})(jQuery);var _target=null,_dragx=null,_dragy=null,_rotate=null,_resort=null;var _dragging=false,_sizing=false,_animate=false;var _rotating=0,_width=0,_height=0,_left=0,_top=0,_xspeed=0,_yspeed=0;var _zindex=1000;jQuery.fn.touch=function(a){a=jQuery.extend({animate:true,sticky:false,dragx:true,dragy:true,rotate:false,resort:true,scale:false},a);var b=[];b=$.extend({},$.fn.touch.defaults,a);this.each(function(){this.opts=b;this.ontouchstart=touchstart;this.ontouchend=touchend;this.ontouchmove=touchmove;this.ongesturestart=gesturestart;this.ongesturechange=gesturechange;this.ongestureend=gestureend})};function touchstart(a){_target=this.id;_dragx=this.opts.dragx;_dragy=this.opts.dragy;_resort=this.opts.resort;_animate=this.opts.animate;_xspeed=0;_yspeed=0;$(a.changedTouches).each(function(){var c=($("#"+_target).css("left")=="auto")?this.pageX:parseInt($("#"+_target).css("left"));var b=($("#"+_target).css("top")=="auto")?this.pageY:parseInt($("#"+_target).css("top"));if(!_dragging&&!_sizing){_left=(a.pageX-c);_top=(a.pageY-b);_dragging=[_left,_top];if(_resort){_zindex=($("#"+_target).css("z-index")==_zindex)?_zindex:_zindex+1;$("#"+_target).css({zIndex:_zindex})}}})}function touchmove(c){if(_dragging&&!_sizing&&_animate){var a=(isNaN(parseInt($("#"+_target).css("left"))))?0:parseInt($("#"+_target).css("left"));var b=(isNaN(parseInt($("#"+_target).css("top"))))?0:parseInt($("#"+_target).css("top"))}$(c.changedTouches).each(function(){c.preventDefault();_left=(this.pageX-(parseInt($("#"+_target).css("width"))/2));_top=(this.pageY-(parseInt($("#"+_target).css("height"))/2));if(_dragging&&!_sizing){if(_animate){_xspeed=Math.round((_xspeed+Math.round(_left-a))/1.5);_yspeed=Math.round((_yspeed+Math.round(_top-b))/1.5)}if(_dragx||_dragy){$("#"+_target).css({position:"absolute"})}if(_dragx){$("#"+_target).css({left:_left+"px"})}if(_dragy){$("#"+_target).css({top:_top+"px"})}$("#"+_target).css({backgroundColor:"#4B880B"});$("#"+_target+" b").text("WEEEEEEEE!!!!")}})}function touchend(a){$(a.changedTouches).each(function(){if(!a.targetTouches.length){_dragging=false;if(_animate){_left=($("#"+_target).css("left")=="auto")?this.pageX:parseInt($("#"+_target).css("left"));_top=($("#"+_target).css("top")=="auto")?this.pageY:parseInt($("#"+_target).css("top"));var c=(_dragx)?(_left+_xspeed)+"px":_left+"px";var b=(_dragy)?(_top+_yspeed)+"px":_top+"px";if(_dragx||_dragy){$("#"+_target).animate({left:c,top:b},"fast")}}}});$("#"+_target+" b").text("I am sad :(");$("#"+_target).css({backgroundColor:"#0B4188"});setTimeout(changeBack,5000,_target)}function gesturestart(a){_sizing=[$("#"+this.id).css("width"),$("#"+this.id).css("height")]}function gesturechange(a){if(_sizing){_width=(this.opts.scale)?Math.min(parseInt(_sizing[0])*a.scale,300):_sizing[0];_height=(this.opts.scale)?Math.min(parseInt(_sizing[1])*a.scale,300):_sizing[1];_rotate=(this.opts.rotate)?"rotate("+((_rotating+a.rotation)%360)+"deg)":"0deg";$("#"+this.id).css({width:_width+"px",height:_height+"px",webkitTransform:_rotate});$("#"+this.id+" b").text("TRANSFORM!");$("#"+this.id).css({backgroundColor:"#4B880B"})}}function gestureend(a){_sizing=false;_rotating=(_rotating+a.rotation)%360}function changeBack(a){$("#"+a+" b").text("Touch Me :)");$("#"+a).css({backgroundColor:"#999"})}(function(a){if(a.jQTouch){a.jQTouch.addExtension(function b(e){var d=".toolbar h1";a(function(){a("#jqt").bind("pageAnimationStart",function(i,g){if(g.direction==="in"){var f=a(d,a(i.target));var h=a(i.target).data("referrer");if(f.length&&h){f.html(h.text())}}})});function c(f){d=f}return{setTitleSelector:c}})}})(jQuery);(function(a){if(a.jQTouch){a.jQTouch.addExtension(function b(d){function c(g){if(g==null){g=0}var f=e(g);a("body > *").css("min-height",f+"px !important");a("body.fullscreen > *").css("min-height",f+"px !important");a("body.fullscreen.black-translucent > *").css("min-height",f+"px !important");a("body.landscape > *").css("min-height",f+"px !important")}function e(g){var f=0;if(typeof(window.innerWidth)=="number"){f=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){f=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){f=document.body.clientHeight}}}if(f tag.")}window.addEventListener("updateready",function(i){if(c[d.status]!="idle"){d.swapCache();console.log("Swapped/updated the Cache Manifest.")}},false);function e(){d.update()}function g(){setInterval(function(){d.update()},10000)}return{isOnline:h,checkForUpdates:e,autoCheckForUpdates:g}})}})(jQuery);(function(b){b.fn.scalable=function(c){return this.each(function(){new a(this,c)})};if(b.jQTouch){b.jQTouch.addExtension(function(d){function c(g,f){f.page.find(".scalable").scalable()}b(document.body).bind("pageInserted",c);b(function(){b("body > *").each(function(){c({},{page:b(this)})})});return{}});function a(d,c){var e=this;this.numberOfTouches=2;this.element=d;this.scale(1);this.refresh();this.scaleLessThanOne=false;d.style.webkitTransitionTimingFunction="cubic-bezier(0, 0, 0.2, 1)";d.addEventListener("touchstart",this,false);d.addEventListener("touchmove",this,false);d.addEventListener("touchend",this,false);window.addEventListener("unload",function(){d.removeEventListener("touchstart",e,false);d.removeEventListener("touchmove",e,false);d.removeEventListener("touchend",e,false);this.removeEventListener("unload",arguments.callee,false)},false);if(c){b.extend(this,c)}}a.prototype={handleEvent:function(c){switch(c.type){case"touchstart":return this.onTouchStart(c);break;case"touchmove":return this.onTouchMove(c);break;case"touchend":return this.onTouchEnd(c);break}},scale:function(c){if(c!==undefined){this._scale=c;this.element.style.webkitTransform="scale("+c+")";return}return this._scale},refresh:function(){this.element.style.webkitTransitionDuration="0"},onTouchStart:function(c){if(c.targetTouches.length!=this.numberOfTouches){return}this.refresh();this.moved=false;this.startDistance=Math.sqrt(Math.pow((c.targetTouches[1].clientX-c.targetTouches[0].clientX),2)+Math.pow((c.targetTouches[1].clientX-c.targetTouches[0].clientX),2));return false},onTouchMove:function(f){if(f.targetTouches.length!=this.numberOfTouches){return}f.preventDefault();this.moved=true;this.refresh();var c=Math.sqrt(Math.pow((f.targetTouches[1].clientX-f.targetTouches[0].clientX),2)+Math.pow((f.targetTouches[1].clientY-f.targetTouches[0].clientY),2)),g=c-this.startDistance,d=(g/this.startDistance)/2;this.scale(this.scale()+(this.scale()*d));this.startDistance=c;return false},onTouchEnd:function(d){var c,f;if(!this.moved){c=d.target;if(c.nodeType==3){c=c.parentNode}f=document.createEvent("MouseEvents");f.initEvent("click",true,true);c.dispatchEvent(f);return}d.preventDefault();d.stopPropagation();if(!this.scaleLessThanOne&&this.scale()<1){this.element.style.webkitTransitionDuration="200ms";this.scale(1)}return false},scaleTo:function(c,d){this.element.style.webkitTransitionDuration=d?d:"300ms";this.scale(c?c:0)}}}})(jQuery);(function(a){a.fn.scrollVertically=function(d){return this.each(function(){new c(this,d)})};a.fn.scrollHorizontally=function(d){return this.each(function(){new b(this,d)})};if(a.jQTouch){a.jQTouch.addExtension(function(e){function d(i,h){var f=h.page.find(".horizontal-scroll > table"),g=h.page.find(".vertical-scroll > div");f.scrollHorizontally({acceleration:Number(f.attr("scrollspeed")||0.009)});g.scrollVertically({acceleration:Number(g.attr("scrollspeed")||0.009)})}a(document.body).bind("pageInserted",d);a(function(){a("body > *").each(function(){d({},{page:a(this)})})});return{}});function c(e,d){var f=this;this.numberOfTouches=1;this.element=e;this.position(0);this.refresh();e.style.webkitTransitionTimingFunction="cubic-bezier(0, 0, 0.2, 1)";this.acceleration=0.009;e.addEventListener("touchstart",this,false);window.addEventListener("unload",function(){e.removeEventListener("touchstart",f,false);window.removeEventListener("unload",arguments.callee,false)},false);if(d){a.extend(this,d)}}c.prototype={handleEvent:function(d){switch(d.type){case"touchstart":this.onTouchStart(d);break;case"touchmove":this.onTouchMove(d);break;case"touchend":this.onTouchEnd(d);break;case"webkitTransitionEnd":this.onTransitionEnd(d);break}},position:function(d){if(d!==undefined){this._position=d;this.element.style.webkitTransform="translate3d(0, "+d+"px, 0)";return}return this._position},refresh:function(){this.element.style.webkitTransitionDuration="0";if(this.element.offsetHeight0||this.position()100){this.scrollStartY=this.position();this.scrollStartTime=f.timeStamp}},onTouchEnd:function(j){this.element.removeEventListener("touchmove",this,false);this.element.removeEventListener("touchend",this,false);j.preventDefault();var g,i,k,f,l,d,h;if(this.position()>0||this.position()0?0:this.maxScroll);return}if(!this.moved){i=j.target;if(i.nodeType==3){i=i.parentNode}k=document.createEvent("MouseEvents");k.initEvent("click",true,true);i.dispatchEvent(k);return false}f=this.position()-this.scrollStartY;l=j.timeStamp-this.scrollStartTime;d=(2*f/l)/this.acceleration;h=(this.acceleration/2)*(d*d);if(d<0){d=-d;h=-h}g=this.position()+h;if(g>this.element.parentNode.clientHeight/2){g=this.element.parentNode.clientHeight/2}else{if(g>0){g/=1.5}else{if(g0?0:this.maxScroll)},scrollTo:function(d,e){this.element.style.webkitTransitionDuration=e?e:"300ms";this.position(d?d:0);if(this.position()>0||this.position()0||this.position()100){this.scrollStartX=this.position();this.scrollStartTime=f.timeStamp}},onTouchEnd:function(j){this.element.removeEventListener("touchmove",this,false);this.element.removeEventListener("touchend",this,false);j.preventDefault();var g,i,k,f,l,d,h;if(!this.moved){i=j.target;if(i.nodeType==3){i=i.parentNode}k=document.createEvent("MouseEvents");k.initEvent("click",true,true);i.dispatchEvent(k);return false}f=this.position()-this.scrollStartX;l=j.timeStamp-this.scrollStartTime;d=(2*f/l)/this.acceleration;h=(this.acceleration/2)*(d*d);if(d<0){d=-d;h=-h}g=this.position()+h;if(g>this.element.parentNode.clientWidth/2){g=this.element.parentNode.clientWidth/2}else{if(g0?0:this.maxScroll)},scrollTo:function(d,e){this.element.style.webkitTransitionDuration=e?e:"300ms";this.position(d?d:0);if(this.position()>0||this.position() table"),g=h.page.find(".vertical-slide > div");f.slideHorizontally({acceleration:Number(f.attr("slidespeed")||500)||null});g.slideVertically({acceleration:Number(g.attr("slidespeed")||500)})}c(document.body).bind("pageInserted",d);c(function(){c("body > *").each(function(){d({},{page:c(this)})})});return{}});function b(e,d){var f=this;this.numberOfTouches=1;this.acceleration=500;this.element=e;this.position(0);this.refresh();e.style.webkitTransitionTimingFunction="cubic-bezier(0, 0, 0.2, 1)";e.addEventListener("touchstart",this,false);window.addEventListener("unload",function(){e.removeEventListener("touchstart",f,false);window.removeEventListener("unload",arguments.callee,false)},false);if(d){c.extend(this,d)}}b.prototype={handleEvent:function(d){switch(d.type){case"touchstart":this.onTouchStart(d);break;case"touchmove":this.onTouchMove(d);break;case"touchend":this.onTouchEnd(d);break;case"webkitTransitionEnd":this.onTransitionEnd(d);break}},position:function(d){if(d!==undefined){this._position=d;this.element.style.webkitTransform="translate3d(0, "+d+"px, 0)";return}return this._position},refresh:function(){this.element.style.webkitTransitionDuration="0";if(this.element.offsetHeight0||this.position()0||d0?0:this.maxSlide);return}if(!this.moved){g=h.target;if(g.nodeType==3){g=g.parentNode}i=document.createEvent("MouseEvents");i.initEvent("click",true,true);g.dispatchEvent(i);return false}if(d>0){f=0}else{if(d0?0:this.maxSlide)},slideTo:function(d,e){this.element.style.webkitTransitionDuration=e?e:this.acceleration+"ms";this.position(d?d:0);if(this.position()>0||this.position()=j){return !e?-h[g].offsetTop:-(h[g-1]||h[0]||{offsetTop:f}).offsetTop}}}return f}};function a(e,d){var f=this;this.numberOfTouches=1;this.acceleration=500;this.element=e;this.position(0);this.refresh();e.style.webkitTransitionTimingFunction="cubic-bezier(0, 0, 0.2, 1)";this.acceleration=null;e.addEventListener("touchstart",this,false);window.addEventListener("unload",function(){e.removeEventListener("touchstart",f,false);window.removeEventListener("unload",arguments.callee,false)},false);if(d){c.extend(this,d)}}a.prototype={handleEvent:function(d){switch(d.type){case"touchstart":this.onTouchStart(d);break;case"touchmove":this.onTouchMove(d);break;case"touchend":this.onTouchEnd(d);break;case"webkitTransitionEnd":this.onTransitionEnd(d);break}},position:function(d){if(d!==undefined){this._position=d;this.element.style.webkitTransform="translateX("+d+"px)";return}return this._position},refresh:function(){this.element.style.webkitTransitionDuration="0";if(this.element.offsetWidth0||this.position()0?0:this.maxSlide);return}if(!this.moved){j=k.target;if(j.nodeType==3){j=j.parentNode}l=document.createEvent("MouseEvents");l.initEvent("click",true,true);j.dispatchEvent(l);return false}h=this.position()+((this.startX-this.slideStartX)/2);if(h>0){h=0}else{if(hthis.position())}}this.slideTo(h,this.acceleration+"ms");return false},onTransitionEnd:function(){this.element.removeEventListener("webkitTransitionEnd",this,false);this.slideTo(this.position()>0?0:this.maxScroll)},slideTo:function(d,e){this.element.style.webkitTransitionDuration=e?e:this.acceleration+"ms";this.position(d?d:0);if(this.position()>0||this.position()=j){return !e?-h[g].offsetLeft:-(h[g-1]||h[0]||{offsetLeft:f}).offsetLeft}}}return f}}}})(jQuery);