$(document).ready(function() {

	// scroll nav in project pages
	if($("#prj-info").length > 0 && navigator.platform.indexOf("iPhone") == -1 && navigator.platform.indexOf("iPod") != -1)	{
		var d = $("#prj-info"),
	            g = $(window),
	            f = d.offset(),
	            c = 55,
	            a, e = $("#prj-visuals").outerHeight() - d.outerHeight() - 76;
	            
	    $(window).scroll(function () {
	        if (g.scrollTop() > f.top) {
	            a = g.scrollTop() - f.top + c;
	            if (a > e) {
	                a = e
	            }
	            d.stop(true).animate({
	                marginTop: a
	            }, 250)
	        } else {
	            d.stop(true).animate({
	                marginTop: 0
	            }, 250)
	        }
	    });
    }
        

	// scrolling
	$("#menu li a[href^='#']").click(function(event) {
		event.preventDefault();
		$.scrollTo($(this).attr("href"), 1000);
	});
	$(".hire a").click(function(event)	{
		event.preventDefault();
		$.scrollTo("#contact", 1000);
		$("#field-name").focus();
	});
	
	// inline labels
	$("#contact label").inFieldLabels();

	// konami
	$(window).konami(function() { 
		if($("h2.hi").length > 0) {
			$("h2.hi").html("It's the best day of the year giiiirl..."); 
		}
	});
});

