// JavaScript Document
$("document").ready(function() {
	$(".jqhide").each(function() {
		$(this).css("height", $(this).innerHeight()).hide();
		$(this).find("*").each(function() {
			$(this).hide();
		});
	});
});
function slide(obj) {
	$(obj + ":visible *").fadeOut("fast", function() {
		$(obj).slideUp("slow");
	});
	$(obj + ":hidden").slideDown("slow", function() {
		$(obj + " *").fadeIn("fast");
	});
}

$("document").ready(function() {
	var i = 0;
	$(".project").each(function() {
		i++;
	});
	$("#project_nav #num").text(i);
	$("#project_nav #active").text("1");
	$("#project_next").click(function() {
		project(0, +1, i);
	});
	$("#project_prev").click(function() {
		project(0, -1, i);
	});
	$("#project_nav").show();
});
function project(iActive, jump, max) {
	$("#project_next").unbind('click');
	$("#project_prev").unbind('click');
	var next = iActive+jump;
	if (next >= max) next = 0;
	if (next < 0) next = max-1;
	$("#project" + iActive).fadeOut("fast", function() {
		$("#project" + next).fadeIn("fast", function() {
			$("#project_nav #active").text(next+1);
			$("#project_next").click(function() {
				project(next, +1, max);
			});
			$("#project_prev").click(function() {
				project(next, -1, max);
			});
		});
	});
}

