// <script>
// <![CDATA[

(function($) {
	$.fn.btn = function(options) {
////////////////////////////////////////////////////////////////////////////
// Properties
////////////////////////////////////////////////////////////////////////////
		settings = jQuery.extend({
			effect: 'fade',
			attack: 200,
			decay: 600
		}, options);

////////////////////////////////////////////////////////////////////////////
// Events
////////////////////////////////////////////////////////////////////////////
		if (settings.effect == 'fade') {
			$(this).hover(function() {
				$(this).children(':first').stop(true).fadeTo(settings.attack, 0);
			}, function() {
				$(this).children(':first').stop(true).fadeTo(settings.decay, 1);
				if (!$.support.opacity) { this.style.removeAttribute("filter", false); };
			});
		} else if (settings.effect == 'slide') {
			$(this).hover(function() {$(this).children(':last').stop(true).slideUp(settings.attack);}, function() {$(this).children(':last').stop(true).slideDown(settings.decay);});
		}

////////////////////////////////////////////////////////////////////////////
// Initialization
////////////////////////////////////////////////////////////////////////////
		$(this).each(function() {
			var bgHeight = $(this).innerHeight();
			var bgWidth = $(this).width();

			$(this).css({
				'position': 'relative',
				'overflow': 'hidden'
			}).children(':first').css({
				'position': 'relative'
			}).clone().css({
				'height': bgHeight+'px',
				'width': bgWidth+'px',
				'padding': '0',
				'position': 'absolute',
				'top': '0',
				'left': '0'
			}).not('img').text('').end().prependTo(this).next().css({
				'background-image': 'none',
				'background-color': 'transparent'
			});
		});
	}
})(jQuery);

////////////////////////////////////////////////////////////////////////////
// Call Plug-Ins
////////////////////////////////////////////////////////////////////////////
$(function() {
	$('.nav li').not('.nav .current').btn();
	$('.icon-left, .icon-up, .icon-right').btn();
});

$(window).load(function() {
	$('.bar-1 .gallery').cycle({
		fx: 'scrollLeft',
		easeIn: 'easeOutExpo',
		easeOut: 'easeInExpo',
		delay: -3000,
		timeout: 6000,
		speed: 1500,
		sync: 0
	});
});
// ]]>
// </script>
