﻿;
(function ($) {
	var n = '2.25';
	var q = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
	function log() {
		if (window.console && window.console.log) window.console.log('[cycle] ' + Array.prototype.join.call(arguments, ''))
	};
	$.fn.cycle = function (m) {
		return this.each(function () {
			if (m === undefined || m === null) m = {};
			if (m.constructor == String) {
				switch (m) {
				case 'stop':
					if (this.cycleTimeout) clearTimeout(this.cycleTimeout);
					this.cycleTimeout = 0;
					$(this).data('cycle.opts', '');
					return;
				case 'pause':
					this.cyclePause = 1;
					return;
				case 'resume':
					this.cyclePause = 0;
					return;
				default:
					m = {
						fx: m
					}
				}
			} else if (m.constructor == Number) {
				var c = m;
				m = $(this).data('cycle.opts');
				if (!m) {
					log('options not found, can not advance slide');
					return
				}
				if (c < 0 || c >= m.elements.length) {
					log('invalid slide index: ' + c);
					return
				}
				m.nextSlide = c;
				if (this.cycleTimeout) {
					clearTimeout(this.cycleTimeout);
					this.cycleTimeout = 0
				}
				go(m.elements, m, 1, 1);
				return
			}
			if (this.cycleTimeout) clearTimeout(this.cycleTimeout);
			this.cycleTimeout = 0;
			this.cyclePause = 0;
			var d = $(this);
			var e = m.slideExpr ? $(m.slideExpr, this) : d.children();
			var f = e.get();
			if (f.length < 2) {
				log('terminating; too few slides: ' + f.length);
				return
			}
			var g = $.extend({},
			$.fn.cycle.defaults, m || {},
			$.metadata ? d.metadata() : $.meta ? d.data() : {});
			if (g.autostop) g.countdown = g.autostopCount || f.length;
			d.data('cycle.opts', g);
			g.container = this;
			g.elements = f;
			g.before = g.before ? [g.before] : [];
			g.after = g.after ? [g.after] : [];
			g.after.unshift(function () {
				g.busy = 0
			});
			if (g.continuous) g.after.push(function () {
				go(f, g, 0, !g.rev)
			});
			if (q && g.cleartype && !g.cleartypeNoBg) clearTypeFix(e);
			var h = this.className;
			g.width = parseInt((h.match(/w:(\d+)/) || [])[1]) || g.width;
			g.height = parseInt((h.match(/h:(\d+)/) || [])[1]) || g.height;
			g.timeout = parseInt((h.match(/t:(\d+)/) || [])[1]) || g.timeout;
			if (d.css('position') == 'static') d.css('position', 'relative');
			if (g.width) d.width(g.width);
			if (g.height && g.height != 'auto') d.height(g.height);
			if (g.random) {
				g.randomMap = [];
				for (var i = 0; i < f.length; i++) g.randomMap.push(i);
				g.randomMap.sort(function (a, b) {
					return Math.random() - 0.5
				});
				g.randomIndex = 0;
				g.startingSlide = g.randomMap[0]
			} else if (g.startingSlide >= f.length) g.startingSlide = 0;
			var j = g.startingSlide || 0;
			e.css({
				position: 'absolute',
				top: 0,
				left: 0
			}).hide().each(function (i) {
				var z = j ? i >= j ? f.length - (i - j) : j - i: f.length - i;
				$(this).css('z-index', z)
			});
			$(f[j]).css('opacity', 1).show();
			if ($.browser.msie) f[j].style.removeAttribute('filter');
			if (g.fit && g.width) e.width(g.width);
			if (g.fit && g.height && g.height != 'auto') e.height(g.height);
			if (g.pause) d.hover(function () {
				this.cyclePause = 1
			},
			function () {
				this.cyclePause = 0
			});
			var k = $.fn.cycle.transitions[g.fx];
			if ($.isFunction(k)) k(d, e, g);
			else if (g.fx != 'custom') log('unknown transition: ' + g.fx);
			e.each(function () {
				var a = $(this);
				this.cycleH = (g.fit && g.height) ? g.height: a.height();
				this.cycleW = (g.fit && g.width) ? g.width: a.width()
			});
			g.cssBefore = g.cssBefore || {};
			g.animIn = g.animIn || {};
			g.animOut = g.animOut || {};
			e.not(':eq(' + j + ')').css(g.cssBefore);
			if (g.cssFirst) $(e[j]).css(g.cssFirst);
			if (g.timeout) {
				if (g.speed.constructor == String) g.speed = {
					slow: 600,
					fast: 200
				} [g.speed] || 400;
				if (!g.sync) g.speed = g.speed / 2;
				while ((g.timeout - g.speed) < 250) g.timeout += g.speed
			}
			if (g.easing) g.easeIn = g.easeOut = g.easing;
			if (!g.speedIn) g.speedIn = g.speed;
			if (!g.speedOut) g.speedOut = g.speed;
			g.slideCount = f.length;
			g.currSlide = j;
			if (g.random) {
				g.nextSlide = g.currSlide;
				if (++g.randomIndex == f.length) g.randomIndex = 0;
				g.nextSlide = g.randomMap[g.randomIndex]
			} else g.nextSlide = g.startingSlide >= (f.length - 1) ? 0 : g.startingSlide + 1;
			var l = e[j];
			if (g.before.length) g.before[0].apply(l, [l, l, g, true]);
			if (g.after.length > 1) g.after[1].apply(l, [l, l, g, true]);
			if (g.click && !g.next) g.next = g.click;
			if (g.next) $(g.next).bind('click', function () {
				return advance(f, g, g.rev ? -1 : 1)
			});
			if (g.prev) $(g.prev).bind('click', function () {
				return advance(f, g, g.rev ? 1 : -1)
			});
			if (g.pager) buildPager(f, g);
			g.addSlide = function (a) {
				var b = $(a),
				s = b[0];
				if (!g.autostopCount) g.countdown++;
				f.push(s);
				if (g.els) g.els.push(s);
				g.slideCount = f.length;
				b.css('position', 'absolute').appendTo(d);
				if (q && g.cleartype && !g.cleartypeNoBg) clearTypeFix(b);
				if (g.fit && g.width) b.width(g.width);
				if (g.fit && g.height && g.height != 'auto') e.height(g.height);
				s.cycleH = (g.fit && g.height) ? g.height: b.height();
				s.cycleW = (g.fit && g.width) ? g.width: b.width();
				b.css(g.cssBefore);
				if (g.pager) $.fn.cycle.createPagerAnchor(f.length - 1, s, $(g.pager), f, g);
				if (typeof g.onAddSlide == 'function') g.onAddSlide(b)
			};
			if (g.timeout || g.continuous) this.cycleTimeout = setTimeout(function () {
				go(f, g, 0, !g.rev)
			},
			g.continuous ? 10 : g.timeout + (g.delay || 0))
		})
	};
	function go(a, b, c, d) {
		if (b.busy) return;
		var p = b.container,
		curr = a[b.currSlide],
		next = a[b.nextSlide];
		
		if(curr == next){
			activeURL();
		}
		
		if (p.cycleTimeout === 0 && !c) return;
		if (!c && !p.cyclePause && ((b.autostop && (--b.countdown <= 0)) || (b.nowrap && !b.random && b.nextSlide < b.currSlide))) {
			if (b.end) b.end(b);
			return
		}
		if (c || !p.cyclePause) {
			if (b.before.length) $.each(b.before, function (i, o) {
				o.apply(next, [curr, next, b, d])
			});
			var e = function () {
				if ($.browser.msie && b.cleartype) this.style.removeAttribute('filter');
				$.each(b.after, function (i, o) {
					o.apply(next, [curr, next, b, d])
				})
			};
			if (b.nextSlide != b.currSlide) {
				b.busy = 1;
				if (b.fxFn) b.fxFn(curr, next, b, e, d);
				else if ($.isFunction($.fn.cycle[b.fx])) $.fn.cycle[b.fx](curr, next, b, e);
				else $.fn.cycle.custom(curr, next, b, e, c && b.fastOnEvent)
			}
			if (b.random) {
				b.currSlide = b.nextSlide;
				if (++b.randomIndex == a.length) b.randomIndex = 0;
				b.nextSlide = b.randomMap[b.randomIndex]
			} else {
				var f = (b.nextSlide + 1) == a.length;
				b.nextSlide = f ? 0 : b.nextSlide + 1;
				b.currSlide = f ? a.length - 1 : b.nextSlide - 1
			}
			if (b.pager) $.fn.cycle.updateActivePagerLink(b.pager, b.currSlide)
		}
		if (b.timeout && !b.continuous) p.cycleTimeout = setTimeout(function () {
			go(a, b, 0, !b.rev)
		},
		b.timeout);
		else if (b.continuous && p.cyclePause) p.cycleTimeout = setTimeout(function () {
			go(a, b, 0, !b.rev)
		},
		10)
	};
	$.fn.cycle.updateActivePagerLink = function (a, b) {
		$(a).find('a').removeClass('activeSlide').filter('a:eq(' + b + ')').addClass('activeSlide')
	};
	function advance(a, b, c) {
		var p = b.container,
		timeout = p.cycleTimeout;
		if (timeout) {
			clearTimeout(timeout);
			p.cycleTimeout = 0
		}
		if (b.random && c < 0) {
			b.randomIndex--;
			if (--b.randomIndex == -2) b.randomIndex = a.length - 2;
			else if (b.randomIndex == -1) b.randomIndex = a.length - 1;
			b.nextSlide = b.randomMap[b.randomIndex]
		} else if (b.random) {
			if (++b.randomIndex == a.length) b.randomIndex = 0;
			b.nextSlide = b.randomMap[b.randomIndex]
		} else {
			b.nextSlide = b.currSlide + c;
			if (b.nextSlide < 0) {
				if (b.nowrap) return false;
				b.nextSlide = a.length - 1
			} else if (b.nextSlide >= a.length) {
				if (b.nowrap) return false;
				b.nextSlide = 0
			}
		}
		if (b.prevNextClick && typeof b.prevNextClick == 'function') b.prevNextClick(c > 0, b.nextSlide, a[b.nextSlide]);
		go(a, b, 1, c >= 0);
		return false
	};
	function buildPager(a, b) {
		var c = $(b.pager);
		$.each(a, function (i, o) {
			$.fn.cycle.createPagerAnchor(i, o, c, a, b)
		});
		$.fn.cycle.updateActivePagerLink(b.pager, b.startingSlide)
	};
	$.fn.cycle.createPagerAnchor = function (i, a, b, c, d) {
		var e = (typeof d.pagerAnchorBuilder == 'function') ? $(d.pagerAnchorBuilder(i, a)) : $('<a href="#">' + (i + 1) + '</a>');
		if (e.parents('body').length == 0) e.appendTo(b);
		e.bind(d.pagerEvent, function () {
			d.nextSlide = i;
			var p = d.container,
			timeout = p.cycleTimeout;
			if (timeout) {
				clearTimeout(timeout);
				p.cycleTimeout = 0
			}
			if (typeof d.pagerClick == 'function') d.pagerClick(d.nextSlide, c[d.nextSlide]);
			go(c, d, 1, d.currSlide < i);
			return false
		})
	};
	function clearTypeFix(b) {
		function hex(s) {
			var s = parseInt(s).toString(16);
			return s.length < 2 ? '0' + s: s
		};
		function getBg(e) {
			for (; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
				var v = $.css(e, 'background-color');
				if (v.indexOf('rgb') >= 0) {
					var a = v.match(/\d+/g);
					return '#' + hex(a[0]) + hex(a[1]) + hex(a[2])
				}
				if (v && v != 'transparent') return v
			}
			return '#ffffff'
		};
		b.each(function () {
			$(this).css('background-color', getBg(this))
		})
	};
	$.fn.cycle.custom = function (a, b, c, d, e) {
		var f = $(a),
		$n = $(b);
		$n.css(c.cssBefore);
		var g = e ? 1 : c.speedIn;
		var h = e ? 1 : c.speedOut;
		var i = e ? null: c.easeIn;
		var j = e ? null: c.easeOut;
		var k = function () {
			$n.animate(c.animIn, g, i, d)
		};
		f.animate(c.animOut, h, j, function () {
			if (c.cssAfter) f.css(c.cssAfter);
			if (!c.sync) k()
		});
		if (c.sync) k()
	};
	$.fn.cycle.transitions = {
		fade: function (a, b, c) {
			b.not(':eq(' + c.startingSlide + ')').css('opacity', 0);
			c.before.push(function () {
				$(this).show()
			});
			c.animIn = {
				opacity: 1
			};
			c.animOut = {
				opacity: 0
			};
			c.cssBefore = {
				opacity: 0
			};
			c.cssAfter = {
				display: 'none'
			}
		}
	};
	$.fn.cycle.ver = function () {
		return n
	};
	$.fn.cycle.defaults = {
		fx: 'fade',
		timeout: 4000,
		continuous: 0,
		speed: 1000,
		speedIn: null,
		speedOut: null,
		next: null,
		prev: null,
		prevNextClick: null,
		pager: null,
		pagerClick: null,
		pagerEvent: 'click',
		pagerAnchorBuilder: null,
		before: null,
		after: null,
		end: null,
		easing: null,
		easeIn: null,
		easeOut: null,
		shuffle: null,
		animIn: null,
		animOut: null,
		cssBefore: null,
		cssAfter: null,
		fxFn: null,
		height: 'auto',
		startingSlide: 0,
		sync: 1,
		random: 0,
		fit: 0,
		pause: 0,
		autostop: 0,
		autostopCount: 0,
		delay: 0,
		slideExpr: null,
		cleartype: 0,
		nowrap: 0,
		fastOnEvent: 0
	}
})(jQuery);
(function ($) {
	$.fn.cycle.transitions.scrollUp = function (d, e, f) {
		d.css('overflow', 'hidden');
		f.before.push(function (a, b, c) {
			$(this).show();
			c.cssBefore.top = b.offsetHeight;
			c.animOut.top = 0 - a.offsetHeight
		});
		f.cssFirst = {
			top: 0
		};
		f.animIn = {
			top: 0
		};
		f.cssAfter = {
			display: 'none'
		}
	};
	$.fn.cycle.transitions.scrollDown = function (d, e, f) {
		d.css('overflow', 'hidden');
		f.before.push(function (a, b, c) {
			$(this).show();
			c.cssBefore.top = 0 - b.offsetHeight;
			c.animOut.top = a.offsetHeight
		});
		f.cssFirst = {
			top: 0
		};
		f.animIn = {
			top: 0
		};
		f.cssAfter = {
			display: 'none'
		}
	};
	$.fn.cycle.transitions.scrollLeft = function (d, e, f) {
		d.css('overflow', 'hidden');
		f.before.push(function (a, b, c) {
			$(this).show();
			c.cssBefore.left = b.offsetWidth;
			c.animOut.left = 0 - a.offsetWidth
		});
		f.cssFirst = {
			left: 0
		};
		f.animIn = {
			left: 0
		}
	};
	$.fn.cycle.transitions.scrollRight = function (d, e, f) {
		d.css('overflow', 'hidden');
		f.before.push(function (a, b, c) {
			$(this).show();
			c.cssBefore.left = 0 - b.offsetWidth;
			c.animOut.left = a.offsetWidth
		});
		f.cssFirst = {
			left: 0
		};
		f.animIn = {
			left: 0
		}
	};
	$.fn.cycle.transitions.scrollHorz = function (f, g, h) {
		f.css('overflow', 'hidden').width();
		h.before.push(function (a, b, c, d) {
			$(this).show();
			var e = a.offsetWidth,
			nextW = b.offsetWidth;
			c.cssBefore = d ? {
				left: nextW
			}: {
				left: -nextW
			};
			c.animIn.left = 0;
			c.animOut.left = d ? -e: e;
			g.not(a).css(c.cssBefore)
		});
		h.cssFirst = {
			left: 0
		};
		h.cssAfter = {
			display: 'none'
		}
	};
	$.fn.cycle.transitions.scrollVert = function (f, g, h) {
		f.css('overflow', 'hidden');
		h.before.push(function (a, b, c, d) {
			$(this).show();
			var e = a.offsetHeight,
			nextH = b.offsetHeight;
			c.cssBefore = d ? {
				top: -nextH
			}: {
				top: nextH
			};
			c.animIn.top = 0;
			c.animOut.top = d ? e: -e;
			g.not(a).css(c.cssBefore)
		});
		h.cssFirst = {
			top: 0
		};
		h.cssAfter = {
			display: 'none'
		}
	};
	$.fn.cycle.transitions.slideX = function (d, e, f) {
		f.before.push(function (a, b, c) {
			$(a).css('zIndex', 1)
		});
		f.onAddSlide = function (a) {
			a.hide()
		};
		f.cssBefore = {
			zIndex: 2
		};
		f.animIn = {
			width: 'show'
		};
		f.animOut = {
			width: 'hide'
		}
	};
	$.fn.cycle.transitions.slideY = function (d, e, f) {
		f.before.push(function (a, b, c) {
			$(a).css('zIndex', 1)
		});
		f.onAddSlide = function (a) {
			a.hide()
		};
		f.cssBefore = {
			zIndex: 2
		};
		f.animIn = {
			height: 'show'
		};
		f.animOut = {
			height: 'hide'
		}
	};
	$.fn.cycle.transitions.shuffle = function (g, h, j) {
		var w = g.css('overflow', 'visible').width();
		h.css({
			left: 0,
			top: 0
		});
		j.before.push(function () {
			$(this).show()
		});
		j.speed = j.speed / 2;
		j.random = 0;
		j.shuffle = j.shuffle || {
			left: -w,
			top: 15
		};
		j.els = [];
		for (var i = 0; i < h.length; i++) j.els.push(h[i]);
		for (var i = 0; i < j.startingSlide; i++) j.els.push(j.els.shift());
		j.fxFn = function (a, b, c, d, e) {
			var f = e ? $(a) : $(b);
			f.animate(c.shuffle, c.speedIn, c.easeIn, function () {
				e ? c.els.push(c.els.shift()) : c.els.unshift(c.els.pop());
				if (e) for (var i = 0, len = c.els.length; i < len; i++) $(c.els[i]).css('z-index', len - i);
				else {
					var z = $(a).css('z-index');
					f.css('z-index', parseInt(z) + 1)
				}
				f.animate({
					left: 0,
					top: 0
				},
				c.speedOut, c.easeOut, function () {
					$(e ? this: a).hide();
					if (d) d()
				})
			})
		};
		j.onAddSlide = function (a) {
			a.hide()
		}
	};
	$.fn.cycle.transitions.turnUp = function (d, e, f) {
		f.before.push(function (a, b, c) {
			$(this).show();
			c.cssBefore.top = b.cycleH;
			c.animIn.height = b.cycleH
		});
		f.onAddSlide = function (a) {
			a.hide()
		};
		f.cssFirst = {
			top: 0
		};
		f.cssBefore = {
			height: 0
		};
		f.animIn = {
			top: 0
		};
		f.animOut = {
			height: 0
		};
		f.cssAfter = {
			display: 'none'
		}
	};
	$.fn.cycle.transitions.turnDown = function (d, e, f) {
		f.before.push(function (a, b, c) {
			$(this).show();
			c.animIn.height = b.cycleH;
			c.animOut.top = a.cycleH
		});
		f.onAddSlide = function (a) {
			a.hide()
		};
		f.cssFirst = {
			top: 0
		};
		f.cssBefore = {
			top: 0,
			height: 0
		};
		f.animOut = {
			height: 0
		};
		f.cssAfter = {
			display: 'none'
		}
	};
	$.fn.cycle.transitions.turnLeft = function (d, e, f) {
		f.before.push(function (a, b, c) { 
			$(this).show();
			c.cssBefore.left = b.cycleW;
			c.animIn.width = b.cycleW
		});
		f.onAddSlide = function (a) {
			a.hide()
		};
		f.cssBefore = {
			width: 0
		};
		f.animIn = {
			left: 0
		};
		f.animOut = {
			width: 0
		};
		f.cssAfter = {
			display: 'none'
		}
	};
	$.fn.cycle.transitions.turnRight = function (d, e, f) {
		f.before.push(function (a, b, c) {
			$(this).show();
			c.animIn.width = b.cycleW;
			c.animOut.left = a.cycleW
		});
		f.onAddSlide = function (a) {
			a.hide()
		};
		f.cssBefore = {
			left: 0,
			width: 0
		};
		f.animIn = {
			left: 0
		};
		f.animOut = {
			width: 0
		};
		f.cssAfter = {
			display: 'none'
		}
	};
	$.fn.cycle.transitions.zoom = function (d, e, f) {
		f.cssFirst = {
			top: 0,
			left: 0
		};
		f.cssAfter = {
			display: 'none'
		};
		f.before.push(function (a, b, c) {
			$(this).show();
			c.cssBefore = {
				width: 0,
				height: 0,
				top: b.cycleH / 2,
				left: b.cycleW / 2
			};
			c.cssAfter = {
				display: 'none'
			};
			c.animIn = {
				top: 0,
				left: 0,
				width: b.cycleW,
				height: b.cycleH
			};
			c.animOut = {
				width: 0,
				height: 0,
				top: a.cycleH / 2,
				left: a.cycleW / 2
			};
			$(a).css('zIndex', 2);
			$(b).css('zIndex', 1)
		});
		f.onAddSlide = function (a) {
			a.hide()
		}
	};
	$.fn.cycle.transitions.fadeZoom = function (d, e, f) {
		f.before.push(function (a, b, c) {
			c.cssBefore = {
				width: 0,
				height: 0,
				opacity: 1,
				left: b.cycleW / 2,
				top: b.cycleH / 2,
				zIndex: 1
			};
			c.animIn = {
				top: 0,
				left: 0,
				width: b.cycleW,
				height: b.cycleH
			}
		});
		f.animOut = {
			opacity: 0
		};
		f.cssAfter = {
			zIndex: 0
		}
	};
	$.fn.cycle.transitions.blindX = function (d, e, f) {
		var w = d.css('overflow', 'hidden').width();
		e.show();
		f.before.push(function (a, b, c) {
			$(a).css('zIndex', 1)
		});
		f.cssBefore = {
			left: w,
			zIndex: 2
		};
		f.cssAfter = {
			zIndex: 1
		};
		f.animIn = {
			left: 0
		};
		f.animOut = {
			left: w
		}
	};
	$.fn.cycle.transitions.blindY = function (d, e, f) {
		var h = d.css('overflow', 'hidden').height();
		e.show();
		f.before.push(function (a, b, c) {
			$(a).css('zIndex', 1)
		});
		f.cssBefore = {
			top: h,
			zIndex: 2
		};
		f.cssAfter = {
			zIndex: 1
		};
		f.animIn = {
			top: 0
		};
		f.animOut = {
			top: h
		}
	};
	$.fn.cycle.transitions.blindZ = function (d, e, f) {
		var h = d.css('overflow', 'hidden').height();
		var w = d.width();
		e.show();
		f.before.push(function (a, b, c) {
			$(a).css('zIndex', 1)
		});
		f.cssBefore = {
			top: h,
			left: w,
			zIndex: 2
		};
		f.cssAfter = {
			zIndex: 1
		};
		f.animIn = {
			top: 0,
			left: 0
		};
		f.animOut = {
			top: h,
			left: w
		}
	};
	$.fn.cycle.transitions.growX = function (d, e, f) {
		f.before.push(function (a, b, c) {
			c.cssBefore = {
				left: this.cycleW / 2,
				width: 0,
				zIndex: 2
			};
			c.animIn = {
				left: 0,
				width: this.cycleW
			};
			c.animOut = {
				left: 0
			};
			$(a).css('zIndex', 1)
		});
		f.onAddSlide = function (a) {
			a.hide().css('zIndex', 1)
		}
	};
	$.fn.cycle.transitions.growY = function (d, e, f) {
		f.before.push(function (a, b, c) {
			c.cssBefore = {
				top: this.cycleH / 2,
				height: 0,
				zIndex: 2
			};
			c.animIn = {
				top: 0,
				height: this.cycleH
			};
			c.animOut = {
				top: 0
			};
			$(a).css('zIndex', 1)
		});
		f.onAddSlide = function (a) {
			a.hide().css('zIndex', 1)
		}
	};
	$.fn.cycle.transitions.curtainX = function (d, e, f) {
		f.before.push(function (a, b, c) {
			c.cssBefore = {
				left: b.cycleW / 2,
				width: 0,
				zIndex: 1,
				display: 'block'
			};
			c.animIn = {
				left: 0,
				width: this.cycleW
			};
			c.animOut = {
				left: a.cycleW / 2,
				width: 0
			};
			$(a).css('zIndex', 2)
		});
		f.onAddSlide = function (a) {
			a.hide()
		};
		f.cssAfter = {
			zIndex: 1,
			display: 'none'
		}
	};
	$.fn.cycle.transitions.curtainY = function (d, e, f) {
		f.before.push(function (a, b, c) {
			c.cssBefore = {
				top: b.cycleH / 2,
				height: 0,
				zIndex: 1,
				display: 'block'
			};
			c.animIn = {
				top: 0,
				height: this.cycleH
			};
			c.animOut = {
				top: a.cycleH / 2,
				height: 0
			};
			$(a).css('zIndex', 2)
		});
		f.onAddSlide = function (a) {
			a.hide()
		};
		f.cssAfter = {
			zIndex: 1,
			display: 'none'
		}
	};
	$.fn.cycle.transitions.cover = function (e, f, g) {
		var d = g.direction || 'left';
		var w = e.css('overflow', 'hidden').width();
		var h = e.height();
		g.before.push(function (a, b, c) {
			c.cssBefore = c.cssBefore || {};
			c.cssBefore.zIndex = 2;
			c.cssBefore.display = 'block';
			if (d == 'right') c.cssBefore.left = -w;
			else if (d == 'up') c.cssBefore.top = h;
			else if (d == 'down') c.cssBefore.top = -h;
			else c.cssBefore.left = w;
			$(a).css('zIndex', 1)
		});
		if (!g.animIn) g.animIn = {
			left: 0,
			top: 0
		};
		if (!g.animOut) g.animOut = {
			left: 0,
			top: 0
		};
		g.cssAfter = g.cssAfter || {};
		g.cssAfter.zIndex = 2;
		g.cssAfter.display = 'none'
	};
	$.fn.cycle.transitions.uncover = function (e, f, g) {
		var d = g.direction || 'left';
		var w = e.css('overflow', 'hidden').width();
		var h = e.height();
		g.before.push(function (a, b, c) {
			c.cssBefore.display = 'block';
			if (d == 'right') c.animOut.left = w;
			else if (d == 'up') c.animOut.top = -h;
			else if (d == 'down') c.animOut.top = h;
			else c.animOut.left = -w;
			$(a).css('zIndex', 2);
			$(b).css('zIndex', 1)
		});
		g.onAddSlide = function (a) {
			a.hide()
		};
		if (!g.animIn) g.animIn = {
			left: 0,
			top: 0
		};
		g.cssBefore = g.cssBefore || {};
		g.cssBefore.top = 0;
		g.cssBefore.left = 0;
		g.cssAfter = g.cssAfter || {};
		g.cssAfter.zIndex = 1;
		g.cssAfter.display = 'none'
	};
	$.fn.cycle.transitions.toss = function (d, e, f) {
		var w = d.css('overflow', 'visible').width();
		var h = d.height();
		f.before.push(function (a, b, c) {
			$(a).css('zIndex', 2);
			c.cssBefore.display = 'block';
			if (!c.animOut.left && !c.animOut.top) c.animOut = {
				left: w * 2,
				top: -h / 2,
				opacity: 0
			};
			else c.animOut.opacity = 0
		});
		f.onAddSlide = function (a) {
			a.hide()
		};
		f.cssBefore = {
			left: 0,
			top: 0,
			zIndex: 1,
			opacity: 1
		};
		f.animIn = {
			left: 0
		};
		f.cssAfter = {
			zIndex: 2,
			display: 'none'
		}
	};
	$.fn.cycle.transitions.wipe = function (o, p, q) {
		var w = o.css('overflow', 'hidden').width();
		var h = o.height();
		q.cssBefore = q.cssBefore || {};
		var s;
		if (q.clip) {
			if (/l2r/.test(q.clip)) s = 'rect(0px 0px ' + h + 'px 0px)';
			else if (/r2l/.test(q.clip)) s = 'rect(0px ' + w + 'px ' + h + 'px ' + w + 'px)';
			else if (/t2b/.test(q.clip)) s = 'rect(0px ' + w + 'px 0px 0px)';
			else if (/b2t/.test(q.clip)) s = 'rect(' + h + 'px ' + w + 'px ' + h + 'px 0px)';
			else if (/zoom/.test(q.clip)) {
				var t = parseInt(h / 2);
				var l = parseInt(w / 2);
				s = 'rect(' + t + 'px ' + l + 'px ' + t + 'px ' + l + 'px)'
			}
		}
		q.cssBefore.clip = q.cssBefore.clip || s || 'rect(0px 0px 0px 0px)';
		var d = q.cssBefore.clip.match(/(\d+)/g);
		var t = parseInt(d[0]),
		r = parseInt(d[1]),
		b = parseInt(d[2]),
		l = parseInt(d[3]);
		q.before.push(function (g, i, j) {
			if (g == i) return;
			var k = $(g).css('zIndex', 2);
			var m = $(i).css({
				zIndex: 3,
				display: 'block'
			});
			var n = 1,
			count = parseInt((j.speedIn / 13)) - 1;
			function f() {
				var a = t ? t - parseInt(n * (t / count)) : 0;
				var c = l ? l - parseInt(n * (l / count)) : 0;
				var d = b < h ? b + parseInt(n * ((h - b) / count || 1)) : h;
				var e = r < w ? r + parseInt(n * ((w - r) / count || 1)) : w;
				m.css({
					clip: 'rect(' + a + 'px ' + e + 'px ' + d + 'px ' + c + 'px)'
				});
				(n++<=count) ? setTimeout(f, 13) : k.css('display', 'none')
			}
			f()
		});
		q.cssAfter = {};
		q.animIn = {
			left: 0
		};
		q.animOut = {
			left: 0
		}
	}
})(jQuery);
