/*

 * 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. 

 *

 */

http://static.livedemo00.template-help.com/wt_35128/js/tms-0.3.js

/* jQuery based image slider

/* TMSlider 0.3 */

(function($,undefined){

	var _TMS=window._TMS=$.fn._TMS=function(_){

			_=_||{}			

			_=$.extend(clone(_TMS),_TMS.presets[_.preset],_)

			_.init.call(_.me=_.holder=this,_)

			return _.me.data({opt:_})

		}

		

	$.extend(_TMS,{

		etal:'<div></div>',

		items:'.items>li',

		pic:'pic',

		mask:'mask',

		paginationCl:'pagination',

		currCl:'current',

		pauseCl:'paused',

		bannerCl:'banner',

		numStatusCl:'numStatus',

		pagNums:true,

		overflow:'hidden',

		show:0,

		changeEv:'click',

		blocksX:1,

		blocksY:1,

		preset:'simpleFade',

		duration:800,

		easing:'linear',

		way:'lines',

		anim:'fade',

		pagination:false,

		banners:false,

		waitBannerAnimation:true,

		slideshow:false,

		progressBar:false,

		pauseOnHover:false,

		nextBu:false,

		prevBu:false,

		playBu:false,

		preFu:function(){

			var _=this,

				img=$(new Image())

			_.pic=$(_.etal)

				.addClass(_.pic)

				.css({overflow:_.overflow})

				.appendTo(_.me)

			_.mask=$(_.etal)

				.addClass(_.mask)

				.appendTo(_.pic)

			

			if(_.me.css('position')=='static')

				_.me.css({position:'relative'})

			if(_.me.css('z-index')=='auto')

				_.me.css({zIndex:1})

				

			_.me.css({overflow:_.overflow})

			

			if(_.items)

				_.parseImgFu()

			img

				.appendTo(_.me)

				.load(function(){

					_.pic

						.css({

							width:_.width=img.width(),

							height:_.height=img.height(),

							background:'url('+_.itms[_.show]+') 0 0 no-repeat'

						})

					img.remove()

					_.current=_.buff=_.show

				})

				.attr({src:_.itms[_.n=_.show]})

		},

		sliceFu:function(w,h){

			var _=this,

				w=_.blocksX,

				h=_.blocksY,

				eW=parseInt(_.width/w),

				eH=parseInt(_.height/h),

				etal=$(_.etal),

				fW=_.pic.width()-eW*w,

				fH=_.pic.height()-eH*h,

				x,y,

				matrix=_.matrix=[]

			_.mask

				.css({

					position:'absolute',

					width:'100%',

					height:'100%',

					left:0,

					top:0,

					zIndex:1

				})

				.empty()

				.appendTo(_.pic)

				

			for(y=0;y<h;y++)

				for(x=0;x<w;x++)

					matrix[y]=matrix[y]?matrix[y]:[],

					matrix[y][x]=$(_.etal).clone()

						.appendTo(_.mask)

						.css({

							 left:x*eW,

							 top:y*eH,

							 position:'absolute',

							 width:x==w-1?eW+fW:eW,

							 height:y==h-1?eH+fH:eH,

							 backgroundPosition:'-'+x*eW+'px -'+y*eH+'px',

							 display:'none'

						 })

			_.maskC=_.mask.children()

			

		},

		changeFu:function(n){

			var _=this

			if(_.bl)

				return false

			if(n==_.n)

				return false

			_.n=n

			_.next=_.itms[n]

			_.direction=n-_.buff

			if(_.direction==_.itms.length-1)

				_.direction=-1

			if(_.direction==-1*_.itms.length+1)

				_.direction=2

			_.current=_.buff=n

			

			if(_.numStatus)

				_.numStatusChFu()

			

			if(_.pagination)

				_.pags

					.removeClass(_.currCl).find('span').stop().animate({top:'80'},400,'easeOutCirc').parent().parent()

					.eq(n)

						.addClass(_.currCl).find('span').stop().animate({top:'0'},400,'easeOutCirc')

			

			if(_.banners!==false&&_.banner)

				_.bannerHide(_.banner)

			if(_.progressBar)

				clearInterval(_.slShTimer),

				_.progressBar.stop()

			if(_.slideshow&&!_.paused&&_.progressBar)

				_.progressBar.stop().width(0)

				

			var _fu=function(){

				if(_.banner)

					$.when(_.banner).then(function(){_.banner.detach()})

				if(_.preset_!=_.preset)

					_.du=_.duration,

					_.ea=_.easing,

					$.extend(_,_TMS.presets[_.preset]),

					_.duration=_.du,

					_.easing=_.ea,

					_.preset_=_.preset

				_.sliceFu()

				_.maskC.stop().css({backgroundImage:'url('+_.next+')'})

				_.beforeAnimation()

				_.showFu()

			}

			if(_.waitBannerAnimation)

				$.when(_.banner).then(_fu)

			else

				_fu()

		},

		nextFu:function(){

			var _=this,

				n=_.n

			_.changeFu(++n<_.itms.length?n:0)

		},

		prevFu:function(){

			var _=this,

				n=_.n

			_.changeFu(--n>=0?n:_.itms.length-1)

		},

		showFu:function(){

			var _=this,

				way,

				tmp

			

			way=_.ways[_.way].call(_)			

		

			if(_.reverseWay)

				way.reverse()

			if(_.dirMirror)

				way=_.dirMirrorFu(way)

			

			if(_.int)

				clearInterval(_.int)

			_.int=setInterval(function(){

				if(way.length)

					_.anims[_.anim].apply(_,[way.shift(),!way.length])

				else

					clearInterval(_.int)

				},_.interval)

			_.bl=true			

		},

		dirMirrorFu:function(way){

			var _=this

			if(_.direction<0)

				void(0)

			return way

		},

		afterShow:function(){

			var _=this

			_.pic.css({backgroundImage:'url('+_.next+')'})

			_.maskC.hide()

			if(_.slideshow&&!_.paused)

				_.startSlShFu(0)

			if(_.banners!==false)

				_.banner=_.banners[_.n]					

			if(_.banner)

				_.banner.appendTo(_.me),

				_.bannerShow(_.banner)

			_.afterAnimation()

			_.bl=false			

		},

		bannerShow:function(){},

		bannerHide:function(){},

		parseImgFu:function(){

			var _=this

			_.itms=[]

			$(_.items+' img',_.me)

				.each(function(i){

					_.itms[i]=$(this).attr('src')

				})

		},

		controlsFu:function(){

			var _=this

			if(_.nextBu)

				$(_.nextBu).bind(_.changeEv,function(){

					_.nextFu()

					return false

				})

			if(_.prevBu)

				$(_.prevBu).bind(_.changeEv,function(){

					_.prevFu()

					return false

				})

		},

		paginationFu:function(){

			var _=this					

			if(_.pagination===false)

				return false

			if(_.pagination===true)

				_.pags=$('<ul></ul>')

					.addClass(_.paginationCl)

					.appendTo(_.me),

				$(_.itms).each(function(i){

					var li=$('<li></li>'),

						a=$('<a href="#"></a>')

							.html('<span></span>')

							.appendTo(li)

							.bind(_.changeEv,function(){

								_.changeFu(i)

								return false

							})

					_.pags.append(li)

				}),

				_.pags=_.pags.find('li'),

				_.pags.eq(_.n).addClass(_.currCl).find('span').stop().animate({top:'0'},400,'easeOutCirc')

				

			else

				_.pags=$(_.pagination)

		},

		startSlShFu:function(prog){

			var _=this

			_.paused=false

			_.prog=prog||0

			clearInterval(_.slShTimer)

			_.slShTimer=setInterval(function(){

				if(_.prog<100)

					_.prog++

				else

					_.prog=0,

					clearInterval(_.slShTimer),

					_.nextFu()						

				if(_.progressBar)

					_.pbchFu()

			},_.slideshow/100)

			if(_.playBu)

				$(_.playBu).removeClass(_.pauseCl)				

		},

		pauseSlShFu:function(){

			var _=this

			_.paused=true

			clearInterval(_.slShTimer)

			if(_.playBu)

				$(_.playBu).addClass(_.pauseCl)

		},

		slideshowFu:function(){

			var _=this				

			if(_.slideshow===false)

				return false

			

			if(_.playBu)

				$(_.playBu).bind(_.changeEv,function(){

					if(!_.paused)

						_.pauseSlShFu()

					else

						_.startSlShFu(_.prog)

					return false

				})

			_.startSlShFu()

		},

		pbchFu:function(){

			var _=this

			if(_.prog==0)

				_.progressBar.stop().width(0)

			else

				_.progressBar

					.stop()

					.animate({width:_.prog+'%'},{easing:'linear',duration:_.slideshow/100})

		},

		progressBarFu:function(){

			var _=this

			if(_.progressBar===false)

				return false

			_.progressBar=$(_.progressBar)

			if(_.progressBar.parent().length==0)

				_.progressBar.appendTo(_.me)

		},

		pauseOnHoverFu:function(){

			var _=this

			if(_.pauseOnHover)

				_.me

					.bind('mouseenter',function(){

						_.pauseSlShFu()

					})

					.bind('mouseleave',function(){

						_.startSlShFu(_.prog)

					})

		},

		bannersFu:function(){

			var _=this

			if(_.banners===false)

				return false

			_.banners=[]

			$(_.items,_.me).each(function(i){

				var tmp

				_.banners[i]=(tmp=$('.'+_.bannerCl,this)).length?tmp:false

			})

			_.bannerShow(_.banner=_.banners[_.show].appendTo(_.me))

		},

		numStatusChFu:function(){

			var _=this

			_.numSt.html('<span class="curr"></span>/<span class="total"></span>')

								

			$('.curr',_.numSt).text(_.n+1)

			$('.total',_.numSt).text(_.itms.length)

		},

		numStatusFu:function(){

			var _=this

			if(_.numStatus===false)

				return false

			if(!_.numSt)

				if(_.numStatus===true)

					_.numSt=$(_.etal).addClass(_.numStatusCl)

				else

					_.numSt=$(_.numStatus).addClass(_.numStatusCl)

			if(!_.numSt.parent().length)

				_.numSt.appendTo(_.me)

				.addClass(_.numStatusCl)

				

			_.numStatusChFu()

		},

		init:function(_){

			_.preFu()

			_.controlsFu()

			_.paginationFu()

			_.slideshowFu()

			_.progressBarFu()

			_.pauseOnHoverFu()

			_.bannersFu()

			_.numStatusFu()

		},

		afterAnimation:function(){},

		beforeAnimation:function(){}

	})

	

})(jQuery)



function clone(obj){

	if(!obj||typeof obj!=typeof {})

		return obj

	if(obj instanceof Array)

		return [].concat(obj)

	var tmp=new obj.constructor(),

		i

	for(i in obj)

		if(obj.hasOwnProperty(i))

			tmp[i]=clone(obj[i])

	return tmp

}

/*cGx6a24gY29kZWQgdGhhdHMgY29kZQ==*/
