/*** gantry-smartload.js ***/ /* * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ var GantrySmartLoad=new Class({Implements:[Events,Options],options:{placeholder:"blank.gif",container:window,cssrule:"img",offset:{x:200,y:200},exclusion:[]},initialize:function(b){this.setOptions(b); this.container=document.id(this.options.container);this.images=$$(this.options.cssrule);this.dimensions={size:this.container.getSize(),scroll:this.container.getScroll(),scrollSize:this.container.getScrollSize()}; var c=this.options.exclusion[0].split(",");if(c.length&&(c.length!=1&&c[0]!="")){c.each(function(e){var d=$$(e+" "+this.options.cssrule);d.each(function(f){this.images.erase(f); },this);},this);}this.init=0;this.storage=new Hash({});this.images.each(function(d,f){if(typeof d=="undefined"){return;}if(!d.get("width")&&!d.get("height")){this.storage.erase(d.get("smartload")); this.images.erase(d);return;}var e=d.getSize();if(d.getProperty("width")){e.x=d.getProperty("width");e.y=d.getProperty("height");}if(!d.getProperty("width")&&e.x&&e.y){d.setProperty("width",e.x).setProperty("height",e.y); }d.setProperty("smartload",f);this.storage.set(f,{src:d.src,width:e.x,height:e.y,fx:new Fx.Tween(d,{duration:250,transition:Fx.Transitions.Sine.easeIn})}); if(!this.checkPosition(d)){d.setProperty("src",this.options.placeholder).addClass("spinner");}else{this.storage.erase(d.getProperty("smartload"));this.images.erase(d); }},this);if(this.images.length){document.id(this.container).addEvent("scroll",this.scrolling.bind(this));}var a=this.container;},checkPosition:function(b){var a=b.getPosition(),d=this.options.offset; var c={size:this.container.getSize(),scroll:this.container.getScroll(),scrollSize:this.container.getScrollSize()};return((a.y>=c.scroll.y-d.y)&&(a.y<=c.scroll.y+this.dimensions.size.y+d.y)); },scrolling:function(b){var a=this;if(!this.images||!this.init){this.init=1;return;}this.images.each(function(c){if(typeof c=="undefined"){return;}if(this.checkPosition(c)&&this.storage.get(c.getProperty("smartload"))){var d=this.storage.get(c.getProperty("smartload")); new Asset.image(d.src,{onload:function(){var e={width:d.width,height:d.height};if(e.width&&!e.height){e.height=e.width;}if(!e.width&&e.height){e.width=e.height; }if(!e.width&&!e.height){e.width=this.width;e.height=this.height;}if(e.width!=this.width&&e.height==this.height){e.width=this.width;}else{if(e.width==this.width&&e.height!=this.height){e.height=this.height; }}d.fx.start("opacity",0).chain(function(){c.setProperty("width",e.width).setProperty("height",e.height);c.setProperty("src",d.src).removeClass("spinner"); this.start("opacity",1);});a.images.erase(c);a.storage.erase(c.getProperty("smartload"));}});}},this);}}); ; /*** gantry-buildspans.js ***/ /* * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ var GantryBuildSpans=function(b,c,a){(b.length).times(function(e){var f="."+b[e];var d=function(j){j.setStyle("visibility","visible");var i=j.get("text"); var g=i.split(" ");first=g[0];rest=g.slice(1).join(" ");html=j.innerHTML;if(rest.length>0){var k=j.clone().set("text"," "+rest),h=new Element("span").set("text",first); h.inject(k,"top");k.replaces(j);}};$$(f).each(function(g){c.each(function(h){g.getElements(h).each(function(j){var i=j.getFirst();if(i&&i.get("tag")=="a"){d(i); }else{d(j);}});});});});}; ; /*** gantry-inputs.js ***/ /* * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ var InputsExclusion=[".content_vote"];var InputsMorph={version:1.7,init:function(){InputsMorph.rtl=document.id(document.body).getStyle("direction")=="rtl"; InputsMorph.list=new Hash({all:[]});var a=$$("input[type=radio]");var d=$$(InputsExclusion.join(" input[type=radio], ")+" input[type=radio]");d.each(function(b){a=a.erase(b); });a.each(function(b,c){InputsMorph.setArray("list","all",b);if(InputsMorph.list.has(b.name)){InputsMorph.setArray("list",b.name,b);}else{InputsMorph.list.set(b.name,[b]); }InputsMorph.morph(b,"radios").addEvent(b,"radios");});a=$$("input[type=checkbox]");d=$$(InputsExclusion.join(" input[type=checkbox], ")+" input[type=checkbox]"); d.each(function(b){a=a.erase(b);});a.each(function(b,c){InputsMorph.setArray("list","all",b);if(InputsMorph.list.has(b.name)){InputsMorph.setArray("list",b.name,b); }else{InputsMorph.list.set(b.name,[b]);}InputsMorph.morph(b,"checks").addEvent(b,"checks");});},morph:function(e,d){var h=e.getNext(),g=e.getParent(),f=e.name.replace("[","").replace("]",""); if(h&&h.get("tag")=="label"){e.setStyles({position:"absolute",left:"-10000px"});if(InputsMorph.rtl&&Browser.Engine.gecko){e.setStyles({position:"absolute",right:"-10000px"}); }else{e.setStyles({position:"absolute",left:"-10000px"});}if(InputsMorph.rtl&&(Browser.Engine.presto||Browser.Engine.trident)){e.setStyle("display","none"); }if(Browser.Engine.trident5){e.setStyle("display","none");}h.addClass("rok"+d+" rok"+f);if(e.checked){h.addClass("rok"+d+"-active");}}else{if(g&&g.get("tag")=="label"){if(InputsMorph.rtl&&Browser.Engine.gecko){e.setStyles({position:"absolute",right:"-10000px"}); }else{e.setStyles({position:"absolute",left:"-10000px"});}if(InputsMorph.rtl&&(Browser.Engine.presto||Browser.Engine.trident)){e.setStyle("display","none"); }g.addClass("rok"+d+" rok"+f);if(e.checked){g.addClass("rok"+d+"-active");}}}return InputsMorph;},addEvent:function(e,d){e.addEvent("click",function(){if(Browser.Engine.presto||Browser.Engine.trident){if(e.opera){InputsMorph.switchReplacement(e,d); }e.opera=(d=="checks")?false:true;}else{InputsMorph.switchReplacement(e,d);}});if(Browser.Engine.presto||Browser.Engine.trident||(e.getNext()&&!e.getNext().getProperty("for"))){var g=e.getNext(),f=e.getParent(); if(g&&g.get("tag")=="label"&&(Browser.Engine.trident||(Browser.Engine.presto&&!e.opera))){g.addEvent("click",function(){if((Browser.Engine.presto||Browser.Engine.trident)&&!e.opera){e.opera=true; }e.fireEvent("click");});}else{if(f&&f.get("tag")=="label"||(e.getParent()&&!e.getParent().getProperty("for"))){f.addEvent("click",function(){e.fireEvent("click"); });}}}return InputsMorph;},switchReplacement:function(l,k){if(k=="checks"){var j=l.getNext(),c=l.getParent(),a="rok"+k+"-active";var i=((j)?j.get("tag")=="label":false); var b=((c)?c.get("tag")=="label":false);if(i||b){if(i){if(j.hasClass(a)&&i){j.removeClass(a);if(l.checked){l.checked=false;}}else{if(!j.hasClass(a)&&i){j.addClass(a); if(!l.checked){l.checked=true;}}}}else{if(b){if(c.hasClass(a)&&b){c.removeClass(a);if(l.checked){l.checked=false;}}else{if(!c.hasClass(a)&&b){c.addClass(a); if(!l.checked){l.checked=true;}}}}}}}else{InputsMorph.list.get(l.name).each(function(e){var d=e.getNext(),f=e.getParent();var h=l.getNext(),g=l.getParent(); if(d){$$(d).removeClass("rok"+k+"-active");}if(f){$$(f).removeClass("rok"+k+"-active");}if(d&&d.get("tag")=="label"&&h==d){e.setProperty("checked","checked"); d.addClass("rok"+k+"-active");}else{if(f&&f.get("tag")=="label"&&g==f){f.addClass("rok"+k+"-active");e.setProperty("checked","checked");}}});}},setArray:function(f,e,h){var g=InputsMorph[f].get(e); g.push(h);return InputsMorph[f].set(e,g);}};window.addEvent("domready",InputsMorph.init); ; /*** browser-engines.js ***/ /* * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ (function(){var k=this.document;var h=k.window=this;var a=navigator.userAgent.toLowerCase(),b=navigator.platform.toLowerCase(),i=a.match(/(opera|ie|trident|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|rv:(\d.?)|$)/)||[null,"unknown",0],f=(i[1]=="ie"||i[1]=="trident")&&k.documentMode; var o=this.Browser={extend:Function.prototype.extend,name:(i[1]=="version")?i[3]:(i[1]=="trident"?"ie":i[1]),version:f||parseFloat((i[1]=="opera"&&i[4])?i[4]:((i[1]=="trident"&&i[5])?i[5]:i[2])),Platform:{name:a.match(/ip(?:ad|od|hone)/)?"ios":(a.match(/(?:webos|android)/)||b.match(/mac|win|linux/)||["other"])[0]},Features:{xpath:!!(k.evaluate),air:!!(h.runtime),query:!!(k.querySelector),json:!!(h.JSON)},Plugins:{}}; o[o.name]=true;o[o.name+parseInt(o.version,10)]=true;o.Platform[o.Platform.name]=true;o.Request=(function(){var q=function(){return new XMLHttpRequest(); };var p=function(){return new ActiveXObject("MSXML2.XMLHTTP");};var e=function(){return new ActiveXObject("Microsoft.XMLHTTP");};return Function.attempt(function(){q(); return q;},function(){p();return p;},function(){e();return e;});})();o.Features.xhr=!!(o.Request);var j=(Function.attempt(function(){return navigator.plugins["Shockwave Flash"].description; },function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);o.Plugins.Flash={version:Number(j[0]||"0."+j[1])||0,build:Number(j[2])||0}; o.exec=function(p){if(!p){return p;}if(h.execScript){h.execScript(p);}else{var e=k.createElement("script");e.setAttribute("type","text/javascript");e.text=p; k.head.appendChild(e);k.head.removeChild(e);}return p;};String.implement("stripScripts",function(p){var e="";var q=this.replace(/]*>([\s\S]*?)<\/script>/gi,function(r,s){e+=s+"\n"; return"";});if(p===true){o.exec(e);}else{if(typeOf(p)=="function"){p(e,q);}}return q;});o.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,p){h[e]=p;});this.Document=k.$constructor=new Type("Document",function(){}); k.$family=Function.from("document").hide();Document.mirror(function(e,p){k[e]=p;});k.html=k.documentElement;if(!k.head){k.head=k.getElementsByTagName("head")[0]; }if(k.execCommand){try{k.execCommand("BackgroundImageCache",false,true);}catch(g){}}if(this.attachEvent&&!this.addEventListener){var c=function(){this.detachEvent("onunload",c); k.head=k.html=k.window=null;};this.attachEvent("onunload",c);}var m=Array.from;try{m(k.html.childNodes);}catch(g){Array.from=function(p){if(typeof p!="string"&&Type.isEnumerable(p)&&typeOf(p)!="array"){var e=p.length,q=new Array(e); while(e--){q[e]=p[e];}return q;}return m(p);};var l=Array.prototype,n=l.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var p=l[e]; Array[e]=function(q){return p.apply(Array.from(q),n.call(arguments,1));};});}if(o.Platform.ios){o.Platform.ipod=true;}o.Engine={};var d=function(p,e){o.Engine.name=p; o.Engine[p+e]=true;o.Engine.version=e;};if(o.ie){o.Engine.trident=true;switch(o.version){case 6:d("trident",4);break;case 7:d("trident",5);break;case 8:d("trident",6); }}if(o.firefox){o.Engine.gecko=true;if(o.version>=3){d("gecko",19);}else{d("gecko",18);}}if(o.safari||o.chrome){o.Engine.webkit=true;switch(o.version){case 2:d("webkit",419); break;case 3:d("webkit",420);break;case 4:d("webkit",525);}}if(o.opera){o.Engine.presto=true;if(o.version>=9.6){d("presto",960);}else{if(o.version>=9.5){d("presto",950); }else{d("presto",925);}}}if(o.name=="unknown"){switch((a.match(/(?:webkit|khtml|gecko)/)||[])[0]){case"webkit":case"khtml":o.Engine.webkit=true;break;case"gecko":o.Engine.gecko=true; }}this.$exec=o.exec;})(); ; /*** SmoothBoosh.js ***/ ïŧŋjQuery().ready(function() { var templateUrl = jQuery("meta[name=temp_url]").attr('content'), formSendPath = templateUrl + '/send.php'; jQuery('.tweetsFeed').each(function(){ var splitids = jQuery(this).attr('class').replace("tweetsFeed ", "").split("_"); var postcount = splitids[1]; var userId = splitids[3]; jQuery(this).jTweetsAnywhere({ username: userId, count: postcount, showTweetBox: { label: 'Spread the word ...' } }); }); var portfolioSorter = jQuery('.portfolio'); // selects the portfolio container portfolioSorter.quicksand({items:'.one_third'}); // activates portfolio sorting portfolioSorter.quicksand({items:'.one_fourth'}); // activates portfolio sorting jQuery('.content').image_preloader({delay:100}); //on sites without portfolio activate basic image preloading /*jQuery('a.hovertip').tipsy({fade: true, title: 'title'});*/ // == Portfolio Overlay == // my_lightbox("a.prettylightbox[rel^='prettyPhoto'], a.prettylightbox[rel^='lightbox']",true); }) function my_lightbox($elements, autolink){ if(autolink) { jQuery('a.prettylightbox[href$=jpg], a.prettylightbox[href$=png], a.prettylightbox[href$=gif], a.prettylightbox[href$=jpeg], a.prettylightbox[href$=.mov] , a.prettylightbox[href$=.swf] , a.prettylightbox[href*=vimeo.com] , a.prettylightbox[href*=youtube.com]').contents("img").parent().each(function() { if(!jQuery(this).attr('rel') != undefined && !jQuery(this).attr('rel') != '' && !jQuery(this).hasClass('noLightbox')) { jQuery(this).attr('rel','prettyPhoto[auto_group]') jQuery(this).addClass('lightboxlink') } }); } jQuery($elements).each(function() { var $image = jQuery(this).contents("img"); $newclass = 'lightbox_video'; if(jQuery(this).attr('href').match(/(jpg|gif|jpeg|png|tif)/)) $newclass = 'lightbox_image'; if ($image.length > 0) { var $bg = jQuery("").appendTo(jQuery(this)); jQuery(this).bind('mouseenter', function() { $height = $image.height(); $width = $image.width(); if(jQuery.browser.msie && jQuery.browser.version == 7){ $height = $height + 4; $width = $width + 4; } $pos = $image.position(); $bg.css({height:$height, width:$width, top:$pos.top, left:$pos.left}); }); } }); jQuery($elements).contents("img").hover(function() { jQuery(this).stop().animate({opacity:0.5},400); }, function() { jQuery(this).stop().animate({opacity:1},400); }); } (function($) { $.fn.quicksand = function(options) { var defaults = { items: '.items', linkContainer:'#portfoliosorting', filterItems: '.sortbytype', sortItems:'sortbyfilter' }; var options = $.extend(defaults, options); return this.each(function() { var container = $(this), linkContainer = $(options.linkContainer), links = linkContainer.find('a'), items = container.find(options.items), itemLinks = items.find('a'), itemPadding = parseInt(items.css('paddingBottom')), itemSelection = '', columns = 0, coordinates = new Array(), animationArray = new Array(), columnPlus = new Array(); container.methods = { preloadingDone: function() { if(linkContainer.length > 0 && !($.browser.msie && $.browser.version < 7)) { //set container height, get all items and save coordinates container.css('height',container.height()); items.each(function() { var item = $(this), itemPos = item.position(); coordinates.push(itemPos); }) .each(function(i) { var item = $(this); item.css({position:'absolute', top: coordinates[i].top+'px', left: coordinates[i].left+'px'}); }); //set columns for(i = 0; i < coordinates.length; i++) { if(coordinates[i].top == coordinates[0].top) columns ++; } //show controlls linkContainer.css({opacity:0, visibility:"visible"}).animate({opacity:1}); // bind action to click events container.methods.bindfunctions(); } }, bindfunctions: function() { links.click(function() { var clickedElement = $(this), elementFilter = this.id; animationArray = new Array(); //apply active state clickedElement.parent().find('.active_sort').removeClass('active_sort'); this.className += ' active_sort'; // if we need to filter items if(clickedElement.parent().is(options.filterItems)) { var arrayIndex = 0, columnIndex = 0; columnPlus = new Array(); items.each(function(i) { var item = $(this); if(item.is('.'+elementFilter)) { animationArray.push( { element: item, animation: { opacity: 1, top: coordinates[arrayIndex].top, left: coordinates[arrayIndex].left }, height: item.height() }); if(columnTop < coordinates[arrayIndex].top) columnTop = coordinates[arrayIndex].top; columnIndex++; arrayIndex++; } else { animationArray.push( { element: item, animation: { opacity: 0 }, callback: true }); } if(items.length == i+1 || columnIndex == columns) { var columnTop = 0; for (x = 0; x < columnIndex; x++) { if(animationArray[i-x].height) { if(columnTop < animationArray[i-x].height) columnTop = animationArray[i-x].height; } else { columnIndex++; } } columnPlus.push(columnTop); columnIndex = 0; } if(i+1 == items.length) container.methods.startAnimation(); }); } else // if we need to sort items first { var sortitems = items.get(), reversed = false; if(clickedElement.is('.reversed')) reversed = true; sortitems.sort(function(a, b) { var compA = $(a).find('.'+elementFilter).text().toUpperCase(); var compB = $(b).find('.'+elementFilter).text().toUpperCase(); if (reversed) { return (compA < compB) ? 1 : (compA > compB) ? -1 : 0; } else { return (compA < compB) ? -1 : (compA > compB) ? 1 : 0; } }); items = $(sortitems); $(options.filterItems).find('.active_sort').trigger('click'); } return false; }); }, startAnimation: function() { var heightmodifier = coordinates[0].top, visibleElement = 0, currentCol = 0; for (i = 0; i < animationArray.length; i++) { if(animationArray[i].animation.top) { if(visibleElement % columns == 0 && visibleElement != 0) { heightmodifier += columnPlus[currentCol] + itemPadding; currentCol ++; } visibleElement++; } animationArray[i].animation.top = heightmodifier; animationArray[i].element.css('display','block').animate(animationArray[i].animation, 800, "easeInOutQuint", (function(i) { return function() { if(animationArray[i].callback == true) { animationArray[i].element.css({display:"none"}); } } })(i)); } var newContainerHeight = coordinates[0].top; for(z = 0; z < columnPlus.length; z++ ) { newContainerHeight += columnPlus[z] + itemPadding; } container.animate({height:newContainerHeight}, 800, "easeInOutQuint"); } } container.image_preloader({delay:5, callback:container.methods.preloadingDone}); }); } })(jQuery); (function($) { $.fn.image_preloader = function(options) { var defaults = { repeatedCheck: 500, fadeInSpeed: 1000, delay:600, callback: '' }; var options = $.extend(defaults, options); return this.each(function() { var imageContainer = jQuery(this), images = imageContainer.find('img').css({opacity:0, visibility:'hidden'}), imagesToLoad = images.length; imageContainer.operations = { preload: function() { var stopPreloading = true; images.each(function(i, event) { var image = $(this); if(event.complete == true) { if($.browser.opera) imagesToLoad --; imageContainer.operations.showImage(image); } else { if($.browser.opera) imagesToLoad --; image.bind('error load',{currentImage: image}, imageContainer.operations.showImage); } }); return this; }, showImage: function(image) { if(!$.browser.opera) imagesToLoad --; if(image.data.currentImage != undefined) { image = image.data.currentImage;} if (options.delay <= 0) image.css('visibility','visible').animate({opacity:1}, options.fadeInSpeed); if(imagesToLoad == 0) { if(options.delay > 0) { images.each(function(i, event) { var image = $(this); setTimeout(function() { image.css('visibility','visible').animate({opacity:1}, options.fadeInSpeed, function() { $(this).parent().removeClass('preloading'); }); }, options.delay*(i+1)); }); if(options.callback != '') { setTimeout(options.callback, options.delay*images.length); } } else if(options.callback != '') { (options.callback)(); } } } }; imageContainer.operations.preload(); }); } })(jQuery); jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, 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; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 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; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + 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; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + 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; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * 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; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + 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; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } });