$(document).ready(function() {

//external links
$("a[class='external']").click(function(){this.target = "_blank";});

//link projects from index
   $(".projectlink a").click(function(){
		$(".count").hide();
		$("#menu a").removeClass("selected");
		$(".projectlink a").removeClass("selected");
		$(this).addClass("selected");
		$(".category").show();
		return false; 
   });
   $(".category a.categorylink").click(function(){
		$("ul.projecttitle").hide();
		$(".category a.categorylink").removeClass("selected");						   
		$(this).addClass("selected");
		$(this).parent().children("ul").show();	
		return false; 
 	});
   $(".projecttitle a").hover(function(){				   
		$(this).parent().children(".thumbnail").show();
			},function(){
   			$(".thumbnail").hide();	
 		});
	$(".capturebg").fadeTo(0, 0);	
 //Show caption   
	$(".imageholder").hover(function(){
		$(".capture").fadeTo("slow", 1);
		$(".capturebg").fadeTo("slow", 0.5);
			},function(){
			$(".capture").fadeTo("fast", 0);
			$(".capturebg").fadeTo("fast", 0);
	});
		
 
    function resizeit(){
        if ($(window).height()<640){
				  $("#outer").css("position","relative");
				  $("#outer").css("top","0px");
				  $("#outer").css("margin-top","0px");
			}
   		if ($(window).height()>640){
				  $("#outer").css("position","absolute");
				  $("#outer").css("top","50%");
				  $("#outer").css("margin-top","-320px");
		}
	}

	resizeit();					   

	$(window).resize(function(){
		resizeit();					   
	});
 
});

