// remap jQuery to $
(function($){})(window.jQuery);


/* trigger when page is ready */
$(document).ready(function (){
	
	// sets up some list styles – used for padding on homepage image list.
	$(document).ready(function(){
		$('#proj-intro-list')
		.find('>li')
			.filter(':last')
			.addClass('last')
		.end()
			.filter(':first')
			.addClass('first')
		.end()				
	});
	
	// fade in content
	$(function() {
			$('ul a.fade-in img').hide().fadeTo("500", 0.5);
			$('#intro-images ul li.intro .postImage img').hide().fadeTo("500", 0.5);
			// $('.title').hide().fadeTo("500", 0.75);
	});
	
	// block navigation
	$('.proj-block li').hover(
	
	//Mouseover, fadeIn the hidden hover class	
	function() {
		//$(this).children('div.caption').fadeTo("100", 0.5);
	}, 
	
	//Mouseout, fadeOut the hover class
	function() {
		//$(this).children('div.caption').fadeTo("300", 1)
				
	}).click (function () {
	//Add selected class if user clicked on it
	$(this).addClass('selected');
	}); // close block navigation
	
	// FADE OUT BLOCK LINK
	$('a.fade-block').hover(
		
	//Mouseover, fadeIn the hidden hover class	
	function() {
		// $(this).parent().css('background-color', 'grey');
		$(this).parent().fadeTo("100", 0.5);
	}, 
	
		//Mouseout, fadeOut the hover class
		function() {
			$(this).parent().fadeTo("100", 1);
	});
	// CLOSE FADE OUT
	
	// FADE OUT IMAGE
	$('a.fade-out').hover(
		
	//Mouseover, fadeIn the hidden hover class	
	function() {
		$(this).children('img').fadeTo("100", 0.5);
	}, 
	
		//Mouseout, fadeOut the hover class
		function() {
			$(this).children('img').fadeTo("100", 1);
	}).click (function () {
	
		//Add selected class if user clicked on it
		$(this).addClass('selected');
	});
	// CLOSE FADE OUT IMAGE
	
	// FADE IN IMAGE
	$('a.fade-in').hover(
		
	//Mouseover, fadeIn the hidden hover class	
	function() {
		$(this).children('img').fadeTo("100", 1);
		$(this).addClass('hover');
	}, 
	
		//Mouseout, fadeOut the hover class
		function() {
			$(this).children('img').fadeTo("100", 0.5);
			$(this).removeClass('hover');
	}).click (function () {
	
		//Add selected class if user clicked on it
		$(this).addClass('selected');
	});
	// CLOSE FADE IN IMAGE
	
		// FADE IN HOMPAGE
	$('a.fade-in-index').hover(
		
	//Mouseover, fadeIn the hidden hover class	
	function() {
		// $(this).parent(".intro").css("background", "yellow");
		$(this).children('.postImage').children('img').stop(true,true).fadeTo("100", 1);
		$(this).parent(".intro").children('.intro-proj-para').stop(true,true).fadeTo("5000", 1);
		$(this).addClass('hover');
	}, 
	
		//Mouseout, fadeOut the hover class
		function() {
			$(this).children('.postImage').children('img').stop(true,true).fadeTo("100", 0.5);
			$(this).parent(".intro").children('.intro-proj-para').stop(true,true).fadeTo("100", 0);
			$(this).removeClass('hover');
	}).click (function () {
	
		//Add selected class if user clicked on it
		$(this).addClass('selected');
	});
	// CLOSE FADE IN IMAGE
		
}); // close doc ready

$(document).ready(function(){
	
			//Examples of how to assign the ColorBox event to elements
			$(".photos").colorbox({rel:'photos', opacity:"0.75", speed:"350", scrolling:"false", });
						
			// $(".video").colorbox({iframe:true, innerWidth:425, innerHeight:344});
						
});


/* optional triggers

$(window).load(function() {
	
});

$(window).resize(function() {
	
});

*/
