jQuery(document).ready(function($){
	$("#social a, #menu-main li:not('.current-menu-item') a").css('opacity','.7');
	$(".project-img a").hide();
	$("#social a, #menu-main li:not('.current-menu-item') a").hover(function(){
			$(this).stop().fadeTo("fast", 1.0);
		},
		function(){
			$(this).fadeTo("fast", 0.7);
	});
	$(".project-img").hover(function(){
			$(this).fadeTo("fast", 0.7).find('a').show();
			//$(this).find('a').show();
		},
		function(){
			$(this).fadeTo("fast", 1.0).find('a').hide();
	});
	
	$('.ngg-gallery-thumbnail img').each(function(index) {
		var title = $(this).attr("title");
		//console.log(title);
		$(this).parent().append('<span>' + title + '</span>');
	});
	
	//tweets
	$(".tweet").tweet({
		username: ["Graham_Sheldon"],
		join_text: " - ",
		count: 2,
		//auto_join_text_default: "we said,",
		//auto_join_text_ed: "we",
		//auto_join_text_ing: "we were",
		//auto_join_text_reply: "we replied to",
		//auto_join_text_url: "we were checking out",
		loading_text: "loading tweets..."
 			}).bind("loaded",function(){$(this).find("a").attr("target","_blank");});


//Set default open/close settings for accordion
$('.ac-container').hide(); //Hide/close all containers
$('.ac-trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
$('.ac-container ul li:odd').css('background','#494949');

//On Click
$('.ac-trigger').click(function(){
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.ac-trigger').removeClass('active').next().slideUp(); //Remove all "active" state and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add "active" state to clicked trigger and slide down the immediate next container
	}
	return false; //Prevent the browser jump to the link anchor
});

//home-slideshow cycle
//	$('#featured-photos').cycle({
//		timeout: 5000,
//		pause: 1,
//		prev: '.slide-prev',
//		next: '.slide-next',
//		cleartype: 1,
//		after: addTitle,
//		before: fadeTitle,
//		fx: 'fade'
//	});
//	
//	function fadeTitle() {
//		$(".slide-title").slideUp(200);
//	}
//	
//	function addTitle() {
//    	var info = $(this).attr('title');
//    	$('.slide-title').text(info).slideDown(200);
//	}
//	
//	$("#featured-photos").hover(function(){
//			$(".slide-title").slideUp(200);
//		}, function() {
//			$(".slide-title").slideDown(200);
//		});

});

