/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Â© 2008 George McGinley Smith
 * 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. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
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;
	}
});

/*
 *
 * 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 Plugin to obtain touch gestures from iPhone, iPod Touch and iPad, should also work with Android mobile phones (not tested yet!)
 * Common usage: wipe images (left and right to show the previous or next image)
 * 
 * @author Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
 * @version 1.1.1 (9th December 2010) - fix bug (older IE's had problems)
 * @version 1.1 (1st September 2010) - support wipe up and wipe down
 * @version 1.0 (15th July 2010)
 */
(function($){$.fn.touchwipe=function(settings){var config={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:true};if(settings)$.extend(config,settings);this.each(function(){var startX;var startY;var isMoving=false;function cancelTouch(){this.removeEventListener('touchmove',onTouchMove);startX=null;isMoving=false}function onTouchMove(e){if(config.preventDefaultEvents){e.preventDefault()}if(isMoving){var x=e.touches[0].pageX;var y=e.touches[0].pageY;var dx=startX-x;var dy=startY-y;if(Math.abs(dx)>=config.min_move_x){cancelTouch();if(dx>0){config.wipeLeft()}else{config.wipeRight()}}else if(Math.abs(dy)>=config.min_move_y){cancelTouch();if(dy>0){config.wipeDown()}else{config.wipeUp()}}}}function onTouchStart(e){if(e.touches.length==1){startX=e.touches[0].pageX;startY=e.touches[0].pageY;isMoving=true;this.addEventListener('touchmove',onTouchMove,false)}}if('ontouchstart'in document.documentElement){this.addEventListener('touchstart',onTouchStart,false)}});return this}})(jQuery);




/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);



/*
* Piwik - Web Analytics
*
* JavaScript tracking client
*
* @link http://piwik.org
* @source http://dev.piwik.org/trac/browser/trunk/js/piwik.js
* @license http://www.opensource.org/licenses/bsd-license.php Simplified BSD
*/
if(!this.JSON2){this.JSON2={}}(function(){function d(f){return f<10?"0"+f:f}function l(n,m){var f=Object.prototype.toString.apply(n);if(f==="[object Date]"){return isFinite(n.valueOf())?n.getUTCFullYear()+"-"+d(n.getUTCMonth()+1)+"-"+d(n.getUTCDate())+"T"+d(n.getUTCHours())+":"+d(n.getUTCMinutes())+":"+d(n.getUTCSeconds())+"Z":null}if(f==="[object String]"||f==="[object Number]"||f==="[object Boolean]"){return n.valueOf()}if(f!=="[object Array]"&&typeof n.toJSON==="function"){return n.toJSON(m)}return n}var c=new RegExp("[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]","g"),e='\\\\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]',i=new RegExp("["+e,"g"),j,b,k={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},h;
function a(f){i.lastIndex=0;return i.test(f)?'"'+f.replace(i,function(m){var n=k[m];return typeof n==="string"?n:"\\u"+("0000"+m.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function g(s,p){var n,m,t,f,q=j,o,r=p[s];if(r&&typeof r==="object"){r=l(r,s)}if(typeof h==="function"){r=h.call(p,s,r)}switch(typeof r){case"string":return a(r);case"number":return isFinite(r)?String(r):"null";case"boolean":case"null":return String(r);case"object":if(!r){return"null"}j+=b;o=[];if(Object.prototype.toString.apply(r)==="[object Array]"){f=r.length;for(n=0;n<f;n+=1){o[n]=g(n,r)||"null"}t=o.length===0?"[]":j?"[\n"+j+o.join(",\n"+j)+"\n"+q+"]":"["+o.join(",")+"]";j=q;return t}if(h&&typeof h==="object"){f=h.length;for(n=0;n<f;n+=1){if(typeof h[n]==="string"){m=h[n];t=g(m,r);if(t){o.push(a(m)+(j?": ":":")+t)}}}}else{for(m in r){if(Object.prototype.hasOwnProperty.call(r,m)){t=g(m,r);if(t){o.push(a(m)+(j?": ":":")+t)}}}}t=o.length===0?"{}":j?"{\n"+j+o.join(",\n"+j)+"\n"+q+"}":"{"+o.join(",")+"}";j=q;
return t}}if(typeof JSON2.stringify!=="function"){JSON2.stringify=function(o,m,n){var f;j="";b="";if(typeof n==="number"){for(f=0;f<n;f+=1){b+=" "}}else{if(typeof n==="string"){b=n}}h=m;if(m&&typeof m!=="function"&&(typeof m!=="object"||typeof m.length!=="number")){throw new Error("JSON.stringify")}return g("",{"":o})}}if(typeof JSON2.parse!=="function"){JSON2.parse=function(o,f){var n;function m(s,r){var q,p,t=s[r];if(t&&typeof t==="object"){for(q in t){if(Object.prototype.hasOwnProperty.call(t,q)){p=m(t,q);if(p!==undefined){t[q]=p}else{delete t[q]}}}}return f.call(s,r,t)}o=String(o);c.lastIndex=0;if(c.test(o)){o=o.replace(c,function(p){return"\\u"+("0000"+p.charCodeAt(0).toString(16)).slice(-4)})}if((new RegExp("^[\\],:{}\\s]*$")).test(o.replace(new RegExp('\\\\(?:["\\\\/bfnrt]|u[0-9a-fA-F]{4})',"g"),"@").replace(new RegExp('"[^"\\\\\n\r]*"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?',"g"),"]").replace(new RegExp("(?:^|:|,)(?:\\s*\\[)+","g"),""))){n=eval("("+o+")");
return typeof f==="function"?m({"":n},""):n}throw new SyntaxError("JSON.parse")}}}());var _paq=_paq||[],Piwik=Piwik||(function(){var m,w={},d=document,j=navigator,v=screen,H=window,h=false,C=[],e=H.encodeURIComponent,I=H.decodeURIComponent,G,D;function b(i){return typeof i!=="undefined"}function a(i){return typeof i==="function"}function n(i){return typeof i==="object"}function q(i){return typeof i==="string"||i instanceof String}function z(J){var i=J.shift();if(q(i)){G[i].apply(G,J)}else{i.apply(G,J)}}function t(L,K,J,i){if(L.addEventListener){L.addEventListener(K,J,i);return true}if(L.attachEvent){return L.attachEvent("on"+K,J)}L["on"+K]=J}function g(K,N){var J="",M,L;for(M in w){if(Object.prototype.hasOwnProperty.call(w,M)){L=w[M][K];if(a(L)){J+=L(N)}}}return J}function B(){var i;g("unload");if(m){do{i=new Date()}while(i.getTime()<m)}}function k(){var J;if(!h){h=true;g("load");for(J=0;J<C.length;J++){C[J]()}}return true}function x(){var J;if(d.addEventListener){t(d,"DOMContentLoaded",function i(){d.removeEventListener("DOMContentLoaded",i,false);
k()})}else{if(d.attachEvent){d.attachEvent("onreadystatechange",function i(){if(d.readyState==="complete"){d.detachEvent("onreadystatechange",i);k()}});if(d.documentElement.doScroll&&H===H.top){(function i(){if(!h){try{d.documentElement.doScroll("left")}catch(K){setTimeout(i,0);return}k()}}())}}}if((new RegExp("WebKit")).test(j.userAgent)){J=setInterval(function(){if(h||/loaded|complete/.test(d.readyState)){clearInterval(J);k()}},10)}t(H,"load",k,false)}function f(){var i="";try{i=H.top.document.referrer}catch(K){if(H.parent){try{i=H.parent.document.referrer}catch(J){i=""}}}if(i===""){i=d.referrer}return i}function A(i){var K=new RegExp("^([a-z]+):"),J=K.exec(i);return J?J[1]:null}function y(i){var K=new RegExp("^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)"),J=K.exec(i);return J?J[1]:i}function p(K,J){var N=new RegExp("^(?:https?|ftp)(?::/*(?:[^?]+)[?])([^#]+)"),M=N.exec(K),L=new RegExp("(?:^|&)"+J+"=([^&]*)"),i=M?L.exec(M[1]):0;return i?I(i[1]):""}function s(O,L,K,N,J,M){var i;if(K){i=new Date();
i.setTime(i.getTime()+K)}d.cookie=O+"="+e(L)+(K?";expires="+i.toGMTString():"")+";path="+(N?N:"/")+(J?";domain="+J:"")+(M?";secure":"")}function F(K){var i=new RegExp("(^|;)[ ]*"+K+"=([^;]*)"),J=i.exec(d.cookie);return J?I(J[2]):0}function r(i){return unescape(e(i))}function u(Z){var L=function(W,i){return(W<<i)|(W>>>(32-i))},aa=function(ag){var af="",ae,W;for(ae=7;ae>=0;ae--){W=(ag>>>(ae*4))&15;af+=W.toString(16)}return af},O,ac,ab,K=[],S=1732584193,Q=4023233417,P=2562383102,N=271733878,M=3285377520,Y,X,V,U,T,ad,J,R=[];Z=r(Z);J=Z.length;for(ac=0;ac<J-3;ac+=4){ab=Z.charCodeAt(ac)<<24|Z.charCodeAt(ac+1)<<16|Z.charCodeAt(ac+2)<<8|Z.charCodeAt(ac+3);R.push(ab)}switch(J&3){case 0:ac=2147483648;break;case 1:ac=Z.charCodeAt(J-1)<<24|8388608;break;case 2:ac=Z.charCodeAt(J-2)<<24|Z.charCodeAt(J-1)<<16|32768;break;case 3:ac=Z.charCodeAt(J-3)<<24|Z.charCodeAt(J-2)<<16|Z.charCodeAt(J-1)<<8|128;break}R.push(ac);while((R.length&15)!==14){R.push(0)}R.push(J>>>29);R.push((J<<3)&4294967295);for(O=0;O<R.length;
O+=16){for(ac=0;ac<16;ac++){K[ac]=R[O+ac]}for(ac=16;ac<=79;ac++){K[ac]=L(K[ac-3]^K[ac-8]^K[ac-14]^K[ac-16],1)}Y=S;X=Q;V=P;U=N;T=M;for(ac=0;ac<=19;ac++){ad=(L(Y,5)+((X&V)|(~X&U))+T+K[ac]+1518500249)&4294967295;T=U;U=V;V=L(X,30);X=Y;Y=ad}for(ac=20;ac<=39;ac++){ad=(L(Y,5)+(X^V^U)+T+K[ac]+1859775393)&4294967295;T=U;U=V;V=L(X,30);X=Y;Y=ad}for(ac=40;ac<=59;ac++){ad=(L(Y,5)+((X&V)|(X&U)|(V&U))+T+K[ac]+2400959708)&4294967295;T=U;U=V;V=L(X,30);X=Y;Y=ad}for(ac=60;ac<=79;ac++){ad=(L(Y,5)+(X^V^U)+T+K[ac]+3395469782)&4294967295;T=U;U=V;V=L(X,30);X=Y;Y=ad}S=(S+Y)&4294967295;Q=(Q+X)&4294967295;P=(P+V)&4294967295;N=(N+U)&4294967295;M=(M+T)&4294967295}ad=aa(S)+aa(Q)+aa(P)+aa(N)+aa(M);return ad.toLowerCase()}function o(K,i,J){if(K==="translate.googleusercontent.com"){if(J===""){J=i}i=p(i,"u");K=y(i)}else{if(K==="cc.bingj.com"||K==="webcache.googleusercontent.com"||K.slice(0,5)==="74.6."){i=d.links[0].href;K=y(i)}}return[K,i,J]}function l(J){var i=J.length;if(J.charAt(--i)==="."){J=J.slice(0,i)}if(J.slice(0,2)==="*."){J=J.slice(1)
}return J}function E(aF,aD){var ao=o(d.domain,H.location.href,f()),aa=l(ao[0]),W=ao[1],aG=ao[2],L="GET",ad=aF||"",aZ=aD||"",aR,aY=d.title,aj="7z|aac|ar[cj]|as[fx]|avi|bin|csv|deb|dmg|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|ms[ip]|od[bfgpst]|og[gv]|pdf|phps|png|ppt|qtm?|ra[mr]?|rpm|sea|sit|tar|t?bz2?|tgz|torrent|txt|wav|wm[av]|wpd||xls|xml|z|zip",aH=[aa],P=[],aI=[],aN=[],ac=500,K,am,an,aA,at=["pk_campaign","piwik_campaign","utm_campaign","utm_source","utm_medium"],aC=["pk_kwd","piwik_kwd","utm_term"],aJ="_pk_",S,aE,M,ax,a0=63072000000,ag=1800000,ab=15768000000,aW=d.location.protocol==="https",aO=false,U=100,aL=5,aq={},aw=false,T=false,Z,aV,au,aQ=u,aB,al;function aS(a1){var a2;if(an){a2=new RegExp("#.*");return a1.replace(a2,"")}return a1}function ai(a3,a1){var a4=A(a1),a2;if(a4){return a1}if(a1.slice(0,1)==="/"){return A(a3)+"://"+y(a3)+a1}a3=aS(a3);if((a2=a3.indexOf("?"))>=0){a3=a3.slice(0,a2)}if((a2=a3.lastIndexOf("/"))!==a3.length-1){a3=a3.slice(0,a2+1)}return a3+a1
}function av(a4){var a2,a1,a3;for(a2=0;a2<aH.length;a2++){a1=l(aH[a2].toLowerCase());if(a4===a1){return true}if(a1.slice(0,1)==="."){if(a4===a1.slice(1)){return true}a3=a4.length-a1.length;if((a3>0)&&(a4.slice(a3)===a1)){return true}}}return false}function i(a1){var a2=new Image(1,1);a2.onLoad=function(){};a2.src=ad+(ad.indexOf("?")<0?"?":"&")+a1}function Y(a1){try{var a3=H.XDomainRequest?new H.XDomainRequest():H.XMLHttpRequest?new H.XMLHttpRequest():H.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;a3.open("POST",ad,true);a3.onreadystatechange=function(){if(this.readyState===4&&this.status!==200){i(a1)}};a3.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");a3.send(a1)}catch(a2){i(a1)}}function aU(a3,a2){var a1=new Date();if(!M){if(L==="POST"){Y(a3)}else{i(a3)}m=a1.getTime()+a2}}function Q(a1){return aJ+a1+"."+aZ+"."+aB}function az(){var a1=Q("testcookie");if(!b(j.cookieEnabled)){s(a1,"1");return F(a1)==="1"?"1":"0"}return j.cookieEnabled?"1":"0"
}function ak(){aB=aQ((S||aa)+(aE||"/")).slice(0,4)}function X(){var a2=Q("cvar"),a1=F(a2);if(a1.length){a1=JSON2.parse(a1);if(n(a1)){return a1}}return{}}function aK(){if(aO===false){aO=X()}}function R(a1){var a2=new Date();Z=a2.getTime()}function N(a5,a2,a1,a4,a3){s(Q("id"),a5+"."+a2+"."+a1+"."+a4+"."+a3,a0,aE,S,aW)}function O(){var a2=new Date(),a1=Math.round(a2.getTime()/1000),a4=F(Q("id")),a3;if(a4){a3=a4.split(".");a3.unshift("0")}else{if(!al){al=aQ((j.userAgent||"")+(j.platform||"")+JSON2.stringify(aq)+a1).slice(0,16)}a3=["1",al,a1,0,a1,""]}return a3}function aM(){var a1=F(Q("ref"));if(a1.length){try{a1=JSON2.parse(a1);if(n(a1)){return a1}}catch(a2){}}return["","",0,""]}function ap(a3,bn,bo){var bl,a2=new Date(),a9=Math.round(a2.getTime()/1000),bq,bm,a5,bf,bi,a8,a6,bk,a4=1024,br,bc,bh=aO,be=Q("id"),ba=Q("ses"),bb=Q("ref"),bs=Q("cvar"),bg=O(),bd=F(ba),bj=aM(),bp=aR||W,a7,a1;if(M){s(be,"",-1,aE,S);s(ba,"",-1,aE,S);s(bs,"",-1,aE,S);s(bb,"",-1,aE,S);return""}bq=bg[0];bm=bg[1];bf=bg[2];
a5=bg[3];bi=bg[4];a8=bg[5];a7=bj[0];a1=bj[1];a6=bj[2];bk=bj[3];if(!bd){a5++;a8=bi;if(!ax||!a7.length){for(bl in at){if(Object.prototype.hasOwnProperty.call(at,bl)){a7=p(bp,at[bl]);if(a7.length){break}}}for(bl in aC){if(Object.prototype.hasOwnProperty.call(aC,bl)){a1=p(bp,aC[bl]);if(a1.length){break}}}}br=y(aG);bc=bk.length?y(bk):"";if(br.length&&!av(br)&&(!ax||!bc.length||av(bc))){bk=aG}if(bk.length||a7.length){a6=a9;bj=[a7,a1,a6,aS(bk.slice(0,a4))];s(bb,JSON2.stringify(bj),ab,aE,S,aW)}}a3+="&idsite="+aZ+"&rec=1&rand="+Math.random()+"&h="+a2.getHours()+"&m="+a2.getMinutes()+"&s="+a2.getSeconds()+"&url="+e(aS(bp))+"&urlref="+e(aS(aG))+"&_id="+bm+"&_idts="+bf+"&_idvc="+a5+"&_idn="+bq+"&_rcn="+e(a7)+"&_rck="+e(a1)+"&_refts="+a6+"&_viewts="+a8+"&_ref="+e(aS(bk.slice(0,a4)));for(bl in aq){if(Object.prototype.hasOwnProperty.call(aq,bl)){a3+="&"+bl+"="+aq[bl]}}if(bn){a3+="&data="+e(JSON2.stringify(bn))}else{if(aA){a3+="&data="+e(JSON2.stringify(aA))}}if(aO){a3+="&_cvar="+e(JSON2.stringify(aO));
for(bl in bh){if(Object.prototype.hasOwnProperty.call(bh,bl)){if(aO[bl][0]===""||aO[bl][1]===""){delete aO[bl]}}}s(bs,JSON2.stringify(aO),ag,aE,S,aW)}N(bm,bf,a5,a9,a8);s(ba,"*",ag,aE,S,aW);a3+=g(bo);return a3}function J(a4,a5){var a1=new Date(),a3=ap("action_name="+e(a4||aY),a5,"log");aU(a3,ac);if(K&&am&&!T){T=true;t(d,"click",R);t(d,"mouseup",R);t(d,"mousedown",R);t(d,"mousemove",R);t(d,"mousewheel",R);t(H,"DOMMouseScroll",R);t(H,"scroll",R);t(d,"keypress",R);t(d,"keydown",R);t(d,"keyup",R);t(H,"resize",R);t(H,"focus",R);t(H,"blur",R);Z=a1.getTime();setTimeout(function a2(){var a6=new Date(),a7;if((Z+am)>a6.getTime()){if(K<a6.getTime()){a7=ap("ping=1",a5,"ping");aU(a7,ac)}setTimeout(a2,am)}},am)}}function aT(a1,a4,a3){var a2=ap("idgoal="+a1+(a4?"&revenue="+a4:""),a3,"goal");aU(a2,ac)}function ah(a2,a1,a4){var a3=ap(a1+"="+e(aS(a2)),a4,"link");aU(a3,ac)}function ay(a3,a2){var a4,a1="(^| )(piwik[_-]"+a2;if(a3){for(a4=0;a4<a3.length;a4++){a1+="|"+a3[a4]}}a1+=")( |$)";return new RegExp(a1)
}function aX(a4,a1,a5){if(!a5){return"link"}var a3=ay(aI,"download"),a2=ay(aN,"link"),a6=new RegExp("\\.("+aj+")([?&#]|$)","i");return a2.test(a4)?"link":(a3.test(a4)||a6.test(a1)?"download":0)}function V(a6){var a4,a2,a1;while(!!(a4=a6.parentNode)&&((a2=a6.tagName)!=="A"&&a2!=="AREA")){a6=a4}if(b(a6.href)){var a7=a6.hostname||y(a6.href),a8=a7.toLowerCase(),a3=a6.href.replace(a7,a8),a5=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript):","i");if(!a5.test(a3)){a1=aX(a6.className,a3,av(a8));if(a1){ah(a3,a1)}}}}function ae(a1){var a2,a3;a1=a1||H.event;a2=a1.which||a1.button;a3=a1.target||a1.srcElement;if(a1.type==="click"){if(a3){V(a3)}}else{if(a1.type==="mousedown"){if((a2===1||a2===2)&&a3){aV=a2;au=a3}else{aV=au=null}}else{if(a1.type==="mouseup"){if(a2===aV&&a3===au){V(a3)}aV=au=null}}}}function aP(a2,a1){if(a1){t(a2,"mouseup",ae,false);t(a2,"mousedown",ae,false)}else{t(a2,"click",ae,false)}}function ar(a2){if(!aw){aw=true;var a3,a1=ay(P,"ignore"),a4=d.links;if(a4){for(a3=0;
a3<a4.length;a3++){if(!a1.test(a4[a3].className)){aP(a4[a3],a2)}}}}}function af(){var a1,a2,a3={pdf:"application/pdf",qt:"video/quicktime",realp:"audio/x-pn-realaudio-plugin",wma:"application/x-mplayer2",dir:"application/x-director",fla:"application/x-shockwave-flash",java:"application/x-java-vm",gears:"application/x-googlegears",ag:"application/x-silverlight"};if(j.mimeTypes&&j.mimeTypes.length){for(a1 in a3){if(Object.prototype.hasOwnProperty.call(a3,a1)){a2=j.mimeTypes[a3[a1]];aq[a1]=(a2&&a2.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&b(j.javaEnabled)&&j.javaEnabled()){aq.java="1"}if(a(H.GearsFactory)){aq.gears="1"}aq.res=v.width+"x"+v.height;aq.cookie=az()}af();ak();return{getVisitorId:function(){return(O())[1]},getVisitorInfo:function(){return O()},getAttributionInfo:function(){return aM()},getAttributionCampaignName:function(){return aM()[0]},getAttributionCampaignKeyword:function(){return aM()[1]},getAttributionReferrerTimestamp:function(){return aM()[2]
},getAttributionReferrerUrl:function(){return aM()[3]},setTrackerUrl:function(a1){ad=a1},setSiteId:function(a1){aZ=a1},setCustomData:function(a1,a2){if(n(a1)){aA=a1}else{if(!aA){aA=[]}aA[a1]=a2}},getCustomData:function(){return aA},setCustomVariable:function(a2,a1,a3){aK();if(a2>0&&a2<=aL){aO[a2]=[a1.slice(0,U),a3.slice(0,U)]}},getCustomVariable:function(a2){var a1;aK();a1=aO[a2];if(a1&&a1[0]===""){return}return aO[a2]},deleteCustomVariable:function(a1){if(this.getCustomVariable(a1)){this.setCustomVariable(a1,"","")}},setLinkTrackingTimer:function(a1){ac=a1},setDownloadExtensions:function(a1){aj=a1},addDownloadExtensions:function(a1){aj+="|"+a1},setDomains:function(a1){aH=q(a1)?[a1]:a1;aH.push(aa)},setIgnoreClasses:function(a1){P=q(a1)?[a1]:a1},setRequestMethod:function(a1){L=a1||"GET"},setReferrerUrl:function(a1){aG=a1},setCustomUrl:function(a1){aR=ai(W,a1)},setDocumentTitle:function(a1){aY=a1},setDownloadClasses:function(a1){aI=q(a1)?[a1]:a1},setLinkClasses:function(a1){aN=q(a1)?[a1]:a1
},setCampaignNameKey:function(a1){at=q(a1)?[a1]:a1},setCampaignKeywordKey:function(a1){aC=q(a1)?[a1]:a1},discardHashTag:function(a1){an=a1},setCookieNamePrefix:function(a1){aJ=a1;aO=X()},setCookieDomain:function(a1){S=l(a1);ak()},setCookiePath:function(a1){aE=a1;ak()},setVisitorCookieTimeout:function(a1){a0=a1*1000},setSessionCookieTimeout:function(a1){ag=a1*1000},setReferralCookieTimeout:function(a1){ab=a1*1000},setConversionAttributionFirstReferrer:function(a1){ax=a1},setDoNotTrack:function(a1){M=a1&&j.doNotTrack},addListener:function(a2,a1){aP(a2,a1)},enableLinkTracking:function(a1){if(h){ar(a1)}else{C.push(function(){ar(a1)})}},setHeartBeatTimer:function(a3,a2){var a1=new Date();K=a1.getTime()+a3*1000;am=a2*1000},killFrame:function(){if(H.location!==H.top.location){H.top.location=H.location}},redirectFile:function(a1){if(H.location.protocol==="file:"){H.location=a1}},trackGoal:function(a1,a3,a2){aT(a1,a3,a2)},trackLink:function(a2,a1,a3){ah(a2,a1,a3)},trackPageView:function(a1,a2){J(a1,a2)
}}}function c(){return{push:z}}t(H,"beforeunload",B,false);x();G=new E();for(D=0;D<_paq.length;D++){z(_paq[D])}_paq=new c();return{addPlugin:function(i,J){w[i]=J},getTracker:function(i,J){return new E(i,J)},getAsyncTracker:function(){return G}}}()),piwik_track,piwik_log=function(b,f,d,g){function a(h){try{return eval("piwik_"+h)}catch(i){}return}var c,e=Piwik.getTracker(d,f);e.setDocumentTitle(b);e.setCustomData(g);if(!!(c=a("tracker_pause"))){e.setLinkTrackingTimer(c)}if(!!(c=a("download_extensions"))){e.setDownloadExtensions(c)}if(!!(c=a("hosts_alias"))){e.setDomains(c)}if(!!(c=a("ignore_classes"))){e.setIgnoreClasses(c)}e.trackPageView();if((a("install_tracker"))){piwik_track=function(i,k,j,h){e.setSiteId(k);e.setTrackerUrl(j);e.trackLink(i,h)};e.enableLinkTracking()}};



(function ($) {

	$.fn.slider = function(options) {
		
			/**

			Ideal markup

			<div class="slideshow">
				<div class="slides">
					<div class="slide" style="background:red;"></div>
					<div class="slide" style="background:blue;"></div>
					<div class="slide" style="background:green;"></div>
				</div>
				<div class="pager"></div>
				<a class="prev">Previous</a>
				<a class="next">Next</a>
			</div>

			 CSS

			.slideshow { width: 500px; height: 300px; position:relative; overflow:hidden; }
			.slideshow .slides { position:absolute; height: 300px; width: 500px; }
			.slideshow .slides .slide { position:absolute; width: 500px; height: 300px; display:none; }
			.slideshow .slides .slide:first-child { display:block; }
			.slideshow .pager { position:absolute; }
			.slideshow .pager a.active { color:purple; }

			$('.slideshow').slider({
				easing : 'easeOutCubic',
				speed : 400,
				timer : true,
				pre_change : function (curr_slide, next_slide) {},
				post_change : function (old_slide, new_slide) {},			
			});		

			**/

		function step_to(x, idx, force_continuity) {

			if (!settings[x].IS_ANIMATING && settings[x].CURR_IDX !== idx) {

				settings[x].IS_ANIMATING = true;

				var direction = (idx > settings[x].CURR_IDX) ? 'left' : 'right'; // which way are we sliding
				direction = force_continuity || direction;

				var curr_slide = $(settings[x].index[settings[x].CURR_IDX].slide);				
				var curr_slide_pos = parseInt($(curr_slide).css('left'), 10) || 0; // resolve to zero if it can't parse
				var curr_container_pos = parseInt($(settings[x].slides_container).css('left'), 10) || 0; // resolve to zero if it can't parse
				
				
				/*
				* @param new_slide_pos
				* Place the next slide either to the right or left of the current slide
				*/

				var new_slide_pos = (direction === "left" ) ? curr_slide_pos+settings[x].SCROLL_DIST : curr_slide_pos-settings[x].SCROLL_DIST;
				var next_slide = $(settings[x].index[idx].slide)
					.css({ left : new_slide_pos }) // posoition the slide
					.show(); // show it, bc it's prob hidden. 

				// Fire user callback
				if (settings[x].PRE_CHANGE_CALLBACK) {
					settings[x].pre_change.call(this, curr_slide, next_slide);
				}

				/*
				* @param new_container_pos
				* Using the current position of the slide container, prepare to shift it to the left or right
				* Pretty much width agnostic
				*/

				var new_container_pos = (direction === "left" ) ? curr_container_pos-settings[x].SCROLL_DIST : curr_container_pos+settings[x].SCROLL_DIST;

				if (settings[x].HAS_PAGER) {
					$(settings[x].index[settings[x].CURR_IDX].anchor).removeClass(settings[x].active_class);
					$(settings[x].index[idx].anchor).addClass(settings[x].active_class);
				}

				// Fire user callback
				if (settings[x].POST_CHANGE_CALLBACK) {
					settings[x].post_change.call(this, curr_slide, next_slide);
				}
				
				$(settings[x].slides_container).stop().animate({
					left : new_container_pos
				}, settings[x].speed, settings[x].easing, function () {
					curr_slide.hide(); // hide the slide we just navigated away from
					settings[x].CURR_IDX = idx; // set the current index this slide
					settings[x].IS_ANIMATING = false; // signal that we're ready for another animation=
				});
				
				// Fire user callback
				if (settings[x].POST_CHANGE_CALLBACK) {
					settings[x].post_change.call(this, curr_slide, next_slide);
				}
				
			}

			return false;

		}

		function next(x) {				
			var step = (settings[x].CURR_IDX === settings[x].LAST_IDX) ? 0 : settings[x].CURR_IDX + 1;
			var force_continuity = (settings[x].CURR_IDX === settings[x].LAST_IDX) ? 'left' : false;
			step_to(x, step, force_continuity);
			return false;
		}

		function prev(x) {
			var step = (settings[x].CURR_IDX === 0) ? settings[x].LAST_IDX : settings[x].CURR_IDX - 1;
			var force_continuity = (settings[x].CURR_IDX === 0) ? 'right' : false;
			step_to(x, step, force_continuity);
			return false;
		}

		function set_timer(x) {				
			if (settings[x].timer) {
				settings[x].TIMER_OBJ = setInterval(function () { next(x); }, settings[x].timer_interval);
			}
		}

		function kill_timer(x) {
			if (settings[x].timer) {
				clearInterval(settings[x].TIMER_OBJ);
			}
		}
		
		function test_user_interacted(x) {
			
			if (!settings[x].USER_INTERACTED && settings[x].FIRST_INTERACTION_CALLBACK) {
				settings[x].first_interaction.call(this, settings[x].slides);
				settings[x].USER_INTERACTED = true;
			}
			
		}

		function build_index(x) {

			$(settings[x].slides).each(function (idx, e) {

				/*
				* If this is the first slide, make sure it's positioned properly
				*/

				if (idx === 0) {
					$(e).css({
						left: 0
					}).show();
				}

				var anchor;

				if (settings[x].HAS_PAGER) {
					
					anchor = $('<a />', {
						'class' : (idx === 0) ? settings[x].active_class + ' png_bg' : 'png_bg'
						//text: idx // TODO make this blank /// 
						// Cycle exposes this as a callback and supplies idx as one of the arguments
					}).bind('click', function () {
						test_user_interacted(x);
						kill_timer(x);
						step_to(x, idx);		
						return false;
					}).appendTo(settings[x].pager);

				}		

				settings[x].index.push({slide : $(e), anchor : anchor});	

				if (idx === settings[x].LAST_IDX) { // parsing the last slide

					if (settings[x].next.size()) {
						//console.log('   Binding NEXT --->');
						$(settings[x].next).bind('click', function (e) {
							test_user_interacted(x);
							kill_timer(x);
							next(x);
							e.preventDefault();
						});
					}

					if (settings[x].prev.size()) {
						//console.log('   Binding PREV --->');
						$(settings[x].prev).bind('click', function (e) {
							test_user_interacted(x);
							kill_timer(x);
							prev(x);
							e.preventDefault();
						});
					}
					
					$(settings[x].base).touchwipe({
				     wipeLeft: function() { kill_timer(x); next(x); },
				     wipeRight: function() { kill_timer(x); prev(x); }
					});
					
					set_timer(x);

				}

			});

		}
		
		var settings = [];
		
		return this.each(function (x) {
						
			//console.log('Slideshow INIT ----------------------> ');

			settings[x] = {
				base : this,
				slides_container : '.slides',
				slides : '.slide',
				pager : '.pager', 
				easing : 'easeOutCubic', 
				speed : 400,
				timer_interval : 3000,
				timer : true,
				delay : 200, 
				active_class : 'active',
				next : '.next',
				prev : '.prev',
				pre_change : null,
				post_change : null,
				first_interaction : null
			};

			if (options) { 
				$.extend(settings[x], options);
			}

			var pre_pager = $(settings[x].pager, this); // Used to calculate the presence of a pager
			settings[x].slides_container = $(settings[x].slides_container, this);
			settings[x].slides = $(settings[x].slides, this);
			settings[x].pager = (pre_pager.size()) ? pre_pager : null;
			settings[x].next = $(settings[x].next, this);
			settings[x].prev = $(settings[x].prev, this);
			settings[x].TIMER_OBJ = null;
			settings[x].index = [];
			settings[x].SCROLL_DIST = $(this).width();
			settings[x].CURR_IDX = 0;
			settings[x].IS_ANIMATING = false;
			settings[x].HAS_PAGER = (settings[x].pager) ? true : false;
			settings[x].LAST_IDX = $(settings[x].slides).size() - 1;
			settings[x].PRE_CHANGE_CALLBACK = (typeof settings[x].pre_change === "function") || false;
			settings[x].POST_CHANGE_CALLBACK = (typeof settings[x].post_change === "function") || false;
			settings[x].FIRST_INTERACTION_CALLBACK = (typeof settings[x].first_interaction === "function") || false;
			settings[x].slideshow_ref = $(this).attr('id');
			settings[x].USER_INTERACTED = false;

			$(settings[x].slides_container).css({
				width: settings[x].SCROLL_DIST,
				left: 0
			});

			if (settings[x].slides.size() > 2) {
				build_index(x);
			} else {
				$(settings[x].next).hide();
				$(settings[x].prev).hide();
			}
			
		});
	
	};

}(jQuery));

(function ($) {

	$.fn.dropdown_selector = function(options) {
	
		function hide(x) {

			if (!$(selector[x].choices).is(":hidden")) {
			
				if (selector[x].less_ie9) {
					$(selector[x].choices).stop(true, true).delay(selector[x].delay).hide();
				} else {
					$(selector[x].choices).stop(true, true).delay(selector[x].delay).fadeOut();
				}		
				
				$('.caret', selector[x].trigger).removeClass('active');
				
			}

		}

		function toggle(x) {
						
			if (!$(selector[x].choices).is(":hidden")) {
				
				hide(x);
				
			} else {
			
				if (selector[x].less_ie9) {				
					$(selector[x].choices).stop().delay(selector[x].delay).show();
				} else {
					$(selector[x].choices).stop().delay(selector[x].delay).fadeIn(selector[x].fx_speed);
				}
				
				$('.caret', selector[x].trigger).addClass('active');
				
			}
			
		}
		
		function init(x) {
		
			$(selector[x].trigger).bind('click', function () { 
				toggle(x);
			});
			
			var event = (Modernizr.touch) ? "touchstart" : "click";
			var outer = (Modernizr.touch) ? "#container" : "body";
						
			$(outer).bind(event, function (e) {				
				if (!$(e.target).closest($(selector[x].base)).size()) {
					hide(x);
				}
			});
		
		}
		
		var selector = [];
	
		return $(this).each(function(x) {
			
			selector[x] = {
				base : $(this),
				less_ie9 : ($("html").hasClass("ie6") || $("html").hasClass("ie7") || $("html").hasClass("ie8")) ? true : false,
				trigger : $(".trigger", this),
				choices : $(".selector", this),
				delay : 50,
				fx_speed : 250
			};			
			
			if (options) { 
				$.extend(selector[x], options);
			}
			
			init(x);
			
		});
	
	};

}(jQuery));
