/** * flipsnap.js * * @version 0.4.1 * @url http://pxgrid.github.com/js-flipsnap/ * * Copyright 2011 PixelGrid, Inc. * Licensed under the MIT License: * http://www.opensource.org/licenses/mit-license.php */ (function(e,t,n){function l(e,t){return this instanceof l?this.init(e,t):new l(e,t)}function c(e,t){return o.touch?e.changedTouches[0][t]:e[t]}function h(e){return m(e,function(e){return r.style[e]!==n})}function p(e,t,r){var o=s[t];o?e[o]=r:e[t]!==n?(s[t]=t,e[t]=r):m(i,function(i){var o=v(i)+v(t);if(e[o]!==n)return s[t]=o,e[o]=r,!0})}function d(e){if(r.style[e]!==n)return e;var t;return m(i,function(i){var s=v(i)+v(e);if(r.style[s]!==n)return t="-"+i+"-"+e,!0}),t}function v(e){return e.charAt(0).toUpperCase()+e.substr(1)}function m(e,t){for(var n=0,r=e.length;n0&&n--,n}(),e._distance=e.distance||e.element.scrollWidth/(e._maxPoint+1),e._maxX=-e._distance*e._maxPoint,e.moveToPoint()},l.prototype.hasNext=function(){var e=this;return e.currentPoint0},l.prototype.toNext=function(){var e=this;if(!e.hasNext())return;e.moveToPoint(e.currentPoint+1)},l.prototype.toPrev=function(){var e=this;if(!e.hasPrev())return;e.moveToPoint(e.currentPoint-1)},l.prototype.moveToPoint=function(e){var t=this,r=t.currentPoint;e===n&&(e=t.currentPoint),e<0?t.currentPoint=0:e>t._maxPoint?t.currentPoint=t._maxPoint:t.currentPoint=parseInt(e,10),o.cssAnimation?t._setStyle({transitionDuration:t.transitionDuration}):t.animation=!0,t._setX(-t.currentPoint*t._distance),r!==t.currentPoint&&g(t.element,"fsmoveend",!0,!1)},l.prototype._setX=function(e){var t=this;t.currentX=e,o.cssAnimation?t.element.style[s.transform]=t._getTranslate(e):t.animation?t._animate(e):t.element.style.left=e+"px"},l.prototype._touchStart=function(e){var t=this;if(t.disableTouch)return;o.touch||e.preventDefault(),o.cssAnimation?t._setStyle({transitionDuration:"0ms"}):t.animation=!1,t.scrolling=!0,t.moveReady=!1,t.startPageX=c(e,"pageX"),t.startPageY=c(e,"pageY"),t.basePageX=t.startPageX,t.directionX=0,t.startTime=e.timeStamp},l.prototype._touchMove=function(e){var t=this;if(!t.scrolling)return;var n=c(e,"pageX"),r=c(e,"pageY"),i,s,o,u;if(t.moveReady){e.preventDefault(),e.stopPropagation(),i=n-t.basePageX,s=t.currentX+i;if(s>=0||s0?-1:1}else o=Math.abs(n-t.startPageX),u=Math.abs(r-t.startPageY),o>5?(e.preventDefault(),e.stopPropagation(),t.moveReady=!0,t.element.addEventListener("click",t,!0)):u>5&&(t.scrolling=!1);t.basePageX=n},l.prototype._touchEnd=function(e){var t=this;if(!t.scrolling)return;t.scrolling=!1;var n=-t.currentX/t._distance;n=t.directionX>0?Math.ceil(n):t.directionX<0?Math.floor(n):Math.round(n),t.moveToPoint(n),setTimeout(function(){t.element.removeEventListener("click",t,!0)},200)},l.prototype._click=function(e){var t=this;e.stopPropagation(),e.preventDefault()},l.prototype._setStyle=function(e){var t=this,n=t.element.style;for(var r in e)p(n,r,e[r])},l.prototype._animate=function(e){var t=this,n=t.element,r=+(new Date),i=parseInt(n.style.left,10),s=e,o=350,u=function(e,t){return-(e/=t)*(e-2)},a=setInterval(function(){var e=new Date-r,t,f;e>o?(clearInterval(a),f=s):(t=u(e,o),f=t*(s-i)+i),n.style.left=f+"px"},10)},l.prototype.destroy=function(){var e=this;e.element.removeEventListener(u,e),e.element.removeEventListener(a,e),t.removeEventListener(f,e)},l.prototype._getTranslate=function(e){var t=this;return t.use3d?"translate3d("+e+"px, 0, 0)":"translate("+e+"px, 0)"},e.Flipsnap=l})(window,window.document); ;(function($){ var portraitWidth,landscapeWidth; $(window).bind("resize", function(){ if(Math.abs(window.orientation) === 0){ if(/Android/.test(window.navigator.userAgent)){ if(!portraitWidth)portraitWidth=$(window).width(); }else{ portraitWidth=$(window).width(); } $("html").css("zoom" , portraitWidth/640 ); }else{ if(/Android/.test(window.navigator.userAgent)){ if(!landscapeWidth)landscapeWidth=$(window).width(); }else{ landscapeWidth=$(window).width(); } $("html").css("zoom" , landscapeWidth/640 ); } }).trigger("resize"); })(jQuery); var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-28537059-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();