//<![CDATA[
Cufon.replace('h1', { fontFamily: 'artbrush' });
Cufon.replace('h3', { fontFamily: 'chunk' });
$(document).ready(function(){
$('.infiniteCarousel').infiniteCarousel();
//$(document).pngFix(); 
$('#nav img')
	.mouseover(function(){
		$(this).parent().next().children().stop().fadeOut('100')
		$(this).parent().next().children().css({opacity:"0"})
	})
	.mouseout(function(){
		$(this).parent().next().children().stop().fadeIn('100')
		$(this).parent().next().children().css({opacity:"1"})
	})
$('#nav-home img')
	.mouseover(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(115px 0)"}, {duration:300})
	})
	.mouseout(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(80px 0)"}, {duration:200})
	})
$('#nav-looknsee img')
	.mouseover(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(128px -62px)"}, {duration:300})
	})
	.mouseout(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(93px -62px)"}, {duration:200})
	})
$('#nav-services img')
	.mouseover(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(128px -124px)"}, {duration:300})
	})
	.mouseout(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(93px -124px)"}, {duration:200})
	})
$('#nav-about img')
	.mouseover(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(113px -186px)"}, {duration:300})
	})
	.mouseout(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(80px -186px)"}, {duration:200})
	})
$('#nav-contact img')
	.mouseover(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(125px -248px)"}, {duration:300})
	})
	.mouseout(function(){
		$(this).parent().next().stop().animate({backgroundPosition:"(85px -248px)"}, {duration:200})
	})
$('a.giddyup span')
	.mouseover(function(){
		$(this).stop().fadeTo(500, 0)
	})
	.mouseout(function(){
		$(this).stop().fadeTo(500, 1)
	})
$('a.project-scroller span')
	.mouseover(function(){
		$(this).stop().fadeTo(500, 0)
	})
	.mouseout(function(){
		$(this).stop().fadeTo(500, 1)
	})
	
$("form input").focus(function(){
	if(($(this).attr("id") == "your-name") && ($(this).val() == "Your Name")){															 
		$(this).val('');															 
	} else if(($(this).attr("id") == "your-subject") && ($(this).val() == "Subject")){															 
		$(this).val('');															 
	} else if((($(this).attr("id") == "your-email") || ($(this).attr("id") == "email")) && ($(this).val() == "Your email, please :)")){															 
		$(this).val('');															 
	} else if(($(this).attr("id") == "your-phone") && ($(this).val() == "Your Phone")){															 
		$(this).val('');															 
	}
});

//Remember user's comment area
var comment = $("#commentHolder").val();
$("#comments").val(comment);

//limit characters in tiny contact textarea
$("#contact-tiny textarea").textlimit('span#counter',160);


$("#tweets p:not(:first)").css({borderTop: '2px dotted #999', paddingTop: '1.2em'});			

//set sidebar height to equal content area
$h = $("#content-background").height();
if($("body").hasClass("page-id-14")){
	$h -= 12;
} else {
	$h -= 4;
}
$("#sidebar").css({height: $h});

$(".wrapper a").click(function(){
	$li = $(this).parent().prevAll().length;
	$pointer = $li - 2;
	$position = ($pointer * -598)+"px";
	$("#projectScroll").animate({top: $position}); //position the projectScroll div
	if($(this).prev('div').hasClass("selected")){
		return false;
	} else {
		$(".wrapper div.selected").removeClass("selected")
		$(this).prev('div').addClass("selected")
		return false;
	}
});

if($("body.blog")){
	$("h1:first").css({marginTop: '0'});
	//$("<br />").insertBefore("a.more-link");
	
};


});
//]]>
