$(document).ready(function() {
		
	$(".colorbox").colorbox();
	$(".page-photos .colorbox").colorbox({
			maxHeight: 550, 
			scalePhotos:true
	});
	$(".videos .colorbox").colorbox({iframe:true, innerWidth:640, innerHeight:390});

	
	$(".show_album").click(function() {
		group = $(this).attr("group");
		$("a[rel='" + group + "']:first").click();
		return false;
	});
		
		
	/*videoCount = $("#media_nav ul li").size();
	mediaWidth = videoCount * 130;
	remainder = 4 - (videoCount % 4);
	maxSlide = (((videoCount + remainder) / 4) * 520) - 520;
	$("#media_nav ul").css("width", mediaWidth + "px");	
	
	$("#media_nav li a").click(function() {
		var videoID = $(this).attr("videoid");
		
		newEmbed = '<object width="560" height="340">';
		newEmbed = newEmbed + '<param name="movie" value="http://www.youtube.com/v/' + videoID + '&hl=en_US&fs=1&rel=0&autoplay=1"></param>';
		newEmbed = newEmbed + '<param name="allowFullScreen" value="true"></param>';
		newEmbed = newEmbed + '<param name="allowscriptaccess" value="always"></param>';
		newEmbed = newEmbed + '<embed src="http://www.youtube.com/v/' + videoID + '&hl=en_US&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed>';
		newEmbed = newEmbed + '</object>';
		
		$("#media_viewer").html(newEmbed);
		
		$("#media_nav a").removeClass("current_video");
		$(this).addClass("current_video");
		return false;
	});
	
	nextButton = "#media_nav a.next";
	prevButton = "#media_nav a.previous";
	
	$(nextButton).click(function() {
		if (!$(this).hasClass("disable")) {								  
			$("#media_nav ul").animate({
				left: "-=520"
			}, "normal", function() {
				var ulPosition = Math.abs(parseInt($("#media_nav ul").css("left")));
				if (ulPosition == maxSlide ) {
					$(nextButton).addClass("disable");
				}
				if ($(prevButton).hasClass("disable")) {	
					$(prevButton).removeClass("disable")
				}
			});
		}
		return false;
	});
	
	$(prevButton).click(function() {
		if (!$(this).hasClass("disable")) {								  
			$("#media_nav ul").animate({
				left: "+=520"
			}, "normal", function() {
				var ulPosition = Math.abs(parseInt($("#media_nav ul").css("left")));
				if (ulPosition === 0) {
					$(prevButton).addClass("disable");
				}
				if ($(nextButton).hasClass("disable")) {	
					$(nextButton).removeClass("disable")
				}
			});
		}
		return false;
	});*/
});

