
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
    log.history = log.history || [];   // store logs to an array for reference
    log.history.push(arguments);
    arguments.callee = arguments.callee.caller;  
    if(this.console) console.log( Array.prototype.slice.call(arguments) );
};
// make it safe to use console.log always
(function(b){
    function c(){}
    for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c
        })(window.console=window.console||{});


/**
 * Storage plugin
 * Provides a simple interface for storing data such as user preferences.
 * Storage is useful for saving and retreiving data from the user's browser.
 * For newer browsers, localStorage is used.
 * If localStorage isn't supported, then cookies are used instead.
 * Retrievable data is limited to the same domain as this file.
 *
 * Usage:
 * This plugin extends jQuery by adding itself as a static method.
 * $.Storage - is the class name, which represents the user's data store, whether it's cookies or local storage.
 *             <code>if ($.Storage)</code> will tell you if the plugin is loaded.
 * $.Storage.set("name", "value") - Stores a named value in the data store.
 * $.Storage.set({"name1":"value1", "name2":"value2", etc}) - Stores multiple name/value pairs in the data store.
 * $.Storage.get("name") - Retrieves the value of the given name from the data store.
 * $.Storage.remove("name") - Permanently deletes the name/value pair from the data store.
 *
 * @author Dave Schindler
 *
 * Distributed under the MIT License
 *
 * Copyright (c) 2010 Dave Schindler
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
(function(g){function h(a,d){var b;if(typeof a==="string"&&typeof d==="string")return localStorage[a]=d,!0;else if(typeof a==="object"&&typeof d==="undefined"){for(b in a)a.hasOwnProperty(b)&&(localStorage[b]=a[b]);return!0}return!1}function f(a,d){var b,c;b=new Date;b.setTime(b.getTime()+31536E6);b="; expires="+b.toGMTString();if(typeof a==="string"&&typeof d==="string")return document.cookie=a+"="+d+b+"; path=/",!0;else if(typeof a==="object"&&typeof d==="undefined"){for(c in a)if(a.hasOwnProperty(c))document.cookie=
c+"="+a[c]+b+"; path=/";return!0}return!1}function i(a){return localStorage[a]}function j(a){var d,b,c;a+="=";d=document.cookie.split(";");for(b=0;b<d.length;b++){for(c=d[b];c.charAt(0)===" ";)c=c.substring(1,c.length);if(c.indexOf(a)===0)return c.substring(a.length,c.length)}return null}function k(a){return delete localStorage[a]}function l(a){return f(a,"",-1)}var e=typeof window.localStorage!=="undefined";g.extend({Storage:{set:e?h:f,get:e?i:j,remove:e?k:l}})})(jQuery);

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
jQuery.cookie=function(e,b,a){if(arguments.length>1&&String(b)!=="[object Object]"){a=jQuery.extend({},a);if(b===null||b===void 0)a.expires=-1;if(typeof a.expires==="number"){var d=a.expires,c=a.expires=new Date;c.setDate(c.getDate()+d)}b=String(b);return document.cookie=[encodeURIComponent(e),"=",a.raw?b:encodeURIComponent(b),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}a=b||{};c=a.raw?function(a){return a}:
decodeURIComponent;return(d=RegExp("(?:^|; )"+encodeURIComponent(e)+"=([^;]*)").exec(document.cookie))?c(d[1]):null};

/* 
Robert Penner's original easing equations modified for JQuery animate method, Jamie Lemon 2009 lemonsanver.com

Below are easing equations based on Robert Penner's work, modified for JQuery
The "In" part of an animation is the start of it, the "Out" part is the end of it
If you apply "easing" at the "In" or the "Out" then the supplied animation curve is most apparent at that point
Enjoy the animation curves!

usage: $(".myImageID").animate({"left": "+=100"},{queue:false, duration:500, easing:"bounceEaseOut"});

function list:
back 
bounce
circ
cubic
elastic
expo
quad
quart
quint
sine


Note in JQuey's native animate function the supplied parameters are supplied as follows:

easingAlgorythmEaseType: function( p, n, firstNum, diff )

@param p The time phase between 0 and 1
@param n Not sure what this is :), in any case its not used
@param firstNum The first number in the transform
@param diff The difference in in pixels required

*/

/*
Disclaimer for Robert Penner's Easing Equations license:

TERMS OF USE - EASING EQUATIONS

Open source under the BSD License.

Copyright Â© 2001 Robert Penner
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
jQuery.extend(jQuery.easing, {backEaseIn:function(a,d,b,c){return(b+c)*(a/=1)*a*(2.70158*a-1.70158)+b},backEaseOut:function(a,d,b,c){return(b+c)*((a=a/1-1)*a*(2.70158*a+1.70158)+1)+b},backEaseInOut:function(a,d,b,c){d=b+c;c=1.70158;return(a/=0.5)<1?d/2*a*a*(((c*=1.525)+1)*a-c)+b:d/2*((a-=2)*a*(((c*=1.525)+1)*a+c)+2)+b},bounceEaseIn:function(a,d,b,c){d=b+c;a=this.bounceEaseOut(1-a,1,0,c);return d-a+b},bounceEaseOut:function(a,d,b,c){d=b+c;return a<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+
0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},circEaseIn:function(a,d,b,c){return-(b+c)*(Math.sqrt(1-(a/=1)*a)-1)+b},circEaseOut:function(a,d,b,c){return(b+c)*Math.sqrt(1-(a=a/1-1)*a)+b},circEaseInOut:function(a,d,b,c){d=b+c;return(a/=0.5)<1?-d/2*(Math.sqrt(1-a*a)-1)+b:d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},cubicEaseIn:function(a,d,b,c){return(b+c)*(a/=1)*a*a+b},cubicEaseOut:function(a,d,b,c){return(b+c)*((a=a/1-1)*a*a+1)+b},cubicEaseInOut:function(a,d,
b,c){d=b+c;return(a/=0.5)<1?d/2*a*a*a+b:d/2*((a-=2)*a*a+2)+b},elasticEaseIn:function(a,d,b,c){c=b+c;if(a==0)return b;if(a==1)return c;d=c;d<Math.abs(c)?(d=c,c=0.0625):c=0.25/(2*Math.PI)*Math.asin(c/d);return-(d*Math.pow(2,10*(a-=1))*Math.sin((a*1-c)*2*Math.PI/0.25))+b},elasticEaseOut:function(a,d,b,c){d=b+c;if(a==0)return b;if(a==1)return d;c=d;c<Math.abs(d)?(c=d,b=0.0625):b=0.25/(2*Math.PI)*Math.asin(d/c);return-(c*Math.pow(2,-10*a)*Math.sin((a*1-b)*2*Math.PI/0.25))+d},expoEaseIn:function(a,d,b,
c){d=b+c;return a==0?b:d*Math.pow(2,10*(a-1))+b-d*0.001},expoEaseOut:function(a,d,b,c){return a==1?b+c:c*1.001*(-Math.pow(2,-10*a)+1)+b},expoEaseInOut:function(a,d,b,c){d=b+c;if(a==0)return b;if(a==1)return d;return(a/=0.5)<1?d/2*Math.pow(2,10*(a-1))+b-d*5.0E-4:d/2*1.0005*(-Math.pow(2,-10*--a)+2)+b},quadEaseIn:function(a,d,b,c){return(b+c)*(a/=1)*a+b},quadEaseOut:function(a,d,b,c){return-(b+c)*(a/=1)*(a-2)+b},quadEaseInOut:function(a,d,b,c){d=b+c;return(a/=0.5)<1?d/2*a*a+b:-d/2*(--a*(a-2)-1)+b},quartEaseIn:function(a,
d,b,c){return(b+c)*(a/=1)*a*a*a+b},quartEaseOut:function(a,d,b,c){return-(b+c)*((a=a/1-1)*a*a*a-1)+b},quartEaseInOut:function(a,d,b,c){d=b+c;return(a/=0.5)<1?d/2*a*a*a*a+b:-d/2*((a-=2)*a*a*a-2)+b},quintEaseIn:function(a,d,b,c){return(b+c)*(a/=1)*a*a*a*a+b},quintEaseOut:function(a,d,b,c){return(b+c)*((a=a/1-1)*a*a*a*a+1)+b},quintEaseInOut:function(a,d,b,c){d=b+c;return(a/=0.5)<1?d/2*a*a*a*a*a+b:d/2*((a-=2)*a*a*a*a+2)+b},sineEaseIn:function(a,d,b,c){d=b+c;return-d*Math.cos(a*(Math.PI/2))+d+b},sineEaseOut:function(a,
d,b,c){return(b+c)*Math.sin(a*(Math.PI/2))+b},sineEaseInOut:function(a,d,b,c){return-(b+c)/2*(Math.cos(Math.PI*a)-1)+b}});

