jQuery(document).ready(function($){
	
	
	
	$("#social a").each(
		function(){
			var $img = $(this).find('img:first');
			$img.stop().animate({opacity:0.4},100);		
		}
	);
	
	
	$("#social a").hover(
		// OVER
		function(){
			var $img = $(this).find('img:first');
			$img.stop().animate({opacity:0.9},200);	
		},
		
		// OUT
		function(){
			var $img = $(this).find('img:first');
			$img.stop().animate({opacity:0.4},200);		
		}
	);
	
	// prev slide
	$('a.prev').click(function() {
		return $('#thumbs').prevSlide();
	});

	// next slide
	$('a.next').click(function() {
		return $('#thumbs').nextSlide();
	});
	
	$("#next").hover(
		// OVER
		function(){
			var $imgcount = $(this).find('.imagecount');
			$imgcount.stop().animate({left: -40},200);	
		},
		
		// OUT
		function(){
			var $imgcount = $(this).find('.imagecount');
			$imgcount.stop().animate({left: 0},200);		
		}
	);

	$("#prev").hover(
		// OVER
		function(){
			var $imgcount = $(this).find('.imagecount');
			$imgcount.stop().animate({left: 40},200);	
		},
		
		// OUT
		function(){
			var $imgcount = $(this).find('.imagecount');
			$imgcount.stop().animate({left: 0},200);		
		}
	);
	
	
	if ($("#thumbs a").length < 2 )
	{
		$('#prev').hide();
		$('#next').hide();
	}
	
	
	/*$('a.toggle-btn').click(showContent);*/
	
	$('a.toggle-btn').click(function(event) {
		event.preventDefault();
		showContent();
	});
	
	$('.toggle-txt').html("close");
	
});



// Image Count
function showImage(img) {
	var totalImages = $("#thumbs a").length;
	$('.count').html(img + ' / ' + totalImages);
	$("#preloader").hide();
}


function hideImage() {
	var xpos = ($(window).width() * 0.5) - 12;
	var ypos = $(window).height() - 32;
	$("#preloader").css({'top': ypos, 'left': xpos});
	$("#preloader").show();
}

function initPreloader() {
	var xpos = ($(window).width() * 0.5) - 12;
	var ypos = $(window).height() - 32;
	$("#preloader").css({'top': ypos, 'left': xpos});
}


// Toggling Content
var contentOpen = true;

function showContent()
{
	var contentHeight = $('#content-wrapper').height() - 74; // 40px + 34px (toggle button height) = 74
	
	if(contentOpen) {
		//$('#content-wrapper').stop().animate({bottom:-contentHeight},{"duration":500},{"easing": "easeInOutExpo"});
		$('#content-wrapper').stop().animate({bottom:-contentHeight},400);
		$('.toggle-txt').html("open");
		contentOpen = false;
		return;
	} else {
		//$('#content-wrapper').stop().animate({bottom:0},{"duration":300},{"easing": "easeOutExpo"});
		$('#content-wrapper').stop().animate({bottom:0},400);
		$('.toggle-txt').html("close");
		contentOpen = true;
	}
	return false;
}



window.onload = function() {
	// PRELOAD

}
