$(function() {
	
	$('#navi a').mouseover(function() {
		
		if(!$(this).hasClass('current'))
		{
			var src = $(this).children().attr('src');
			var ext = src.substr(src.length - 3);
			src = src.substr(0, src.length - 4) + '_h.' + ext;
			$(this).children().attr('src', src);
		}
	})
	.mouseout(function() {
		
		if(!$(this).hasClass('current'))
		{
			var src = $(this).children().attr('src');
			var ext = src.substr(src.length - 3);
			src = src.substr(0, src.length - 6) + '.' + ext;
			$(this).children().attr('src', src);
		}
	});
	
	$('.portfolio .thumbs.left a').click(function(e) {
		
		e.preventDefault();
		
		$(this).parent().find('a').addClass('inactive');
		$(this).removeClass('inactive');
		
		var src = $(this).children().attr('src');
		var ext = src.substr(src.length - 3);
		src = src.substr(0, src.length - 10);
		bigSrc = src + '_big.' + ext;
		src = src + '.' + ext;
		$(this).parent().next().children().attr('href', bigSrc);
		$(this).parent().next().children().children().attr('src', src);
	})
	.mouseover(function() {
		
		$(this).addClass('hover');
	})
	.mouseout(function() {
		
		$(this).removeClass('hover');
	});
	
	$('.social a').mouseover(function() {
		
		$(this).addClass('hover');
	})
	.mouseout(function() {
		
		$(this).removeClass('hover');
	});
	
	$("div#content .portfolio .thumbs.right a:has(img)").fancybox({
		
		'opacity': true,
		'overlayShow': false,
		'transitionIn': 'elastic',
		'transitionOut': 'elastic'
	});
});
