jQuery(document).ready(function() {
	jQuery(".fade_out").delegate("li", "mouseover mouseout", function(e) {
		if (e.type == 'mouseover') {
		jQuery(".fade_out li").not(this).dequeue().animate({opacity: "0.3"}, 200);
    	} else {
		jQuery(".fade_out li").not(this).dequeue().animate({opacity: "1"}, 200);
   		}
	});

$('#slideshow img:first').fadeIn(1000, function() {
        $('#slides').cycle();
    });
	
	
 $('#slides').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		preload: true,
		preloadImage: 'img/loading.gif',
		play: 5000,
		pause: 2500
	});
	
$('#slideshow img:first').fadeIn(1000, function() {
        $('#large_slides').cycle();
    });
	
	
 $('#large_slides').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		preload: true,
		preloadImage: 'img/loading.gif',
		play: 6000,
		pause: 3500
	});
	
	
	
});

// JavaScript Stuff

$(document).ready(function(){	
	$(".imagetile").mouseenter(function(){
		$(this).find("div").clearQueue().animate({top: 85},200);
	});
	$(".imagetile").mouseleave(function(){
		$(this).find("div").clearQueue().animate({top: 135},200);
	});	
	
	// Tabs Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	// Tabs On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).show(); //Show the active content
		return false;
	});
	
	$("a[rel=gallery_one], a[rel=gallery_two]").fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
			
});

