
$(document).ready(function () {
	$('a.portfolio-item-zoom').each(function () {
		$(this).removeAttr('data-rel').attr('rel', 'prettyPhoto');
	});
});


$(document).ready(function () {
	$('a.portfolio-item-movie').each(function () {
		$(this).removeAttr('data-rel').attr('rel', 'prettyPhoto');
	});
});


$(document).ready(function ($) {
	$('ul#filterable a').click(function () {
		$(this).css('outline', 'none');
		$('ul#filterable .current').removeClass('current');
		$(this).parent().addClass('current');

		return false;
	});
});


$(document).ready(function () {
	$('.portfolio-img').each(function () {
		$(this).hover(

		function () {
			$(this).stop().animate({
				opacity: 0.2
			}, 400);
		}, function () {
			$(this).stop().animate({
				opacity: 1.0
			}, 700);
		})
	});
});


$(document).ready(function () {
	$('#slider-two-third').cycle({
		fx: 'fade',
		speedIn: 1000,
		speedOut: 1000,
		delay: 2000
	});
});


$(document).ready(function () {
	$("a[rel^='prettyPhoto']").prettyPhoto({
		opacity: 0.80,
		default_width: 500,
		default_height: 344,
		theme: 'light_rounded',
		hideflash: false,
		modal: false
	});
});


jQuery(document).ready(function ($) {
	var
	speed = 700,
		$wall = $('#portfolio_content').find('.portfolio-container ul');
	$wall.masonry({
		singleMode: true,
		itemSelector: '.one-fourth:not(.invis)',
		animate: true,
		animationOptions: {
			duration: speed,
			queue: false
		}
	});

	$('#filterable a').click(function () {
		var colorClass = '.' + $(this).attr('class');
		if (colorClass == '.all') {
			$wall.children('.invis').toggleClass('invis').fadeIn(speed);
		} else {
			$wall.children().not(colorClass).not('.invis').toggleClass('invis').fadeOut(speed);
			$wall.children(colorClass + '.invis').toggleClass('invis').fadeIn(speed);
		}
		$wall.masonry();
		return false;
	});
});
