function animatePointer(pos){
	$("#pageMenu").stop().animate({
		backgroundPosition: pos + "px 52px"
	}, 500)
}

	
$(document).ready(function(){

	// remove focus outline on all links when clicked
  $("a").focus(function(){
    $(this).blur();
  })
	
	var rtnpos = 5;
	if ($("body").attr("id") == "aboutPage") rtnpos = "115";
	if ($("body").attr("id") == "servicesPage") rtnpos = "225";
	if ($("body").attr("id") == "contactPage") rtnpos = "337";
	
	$("#pageMenu").css("backgroundPosition",rtnpos + "px 52px");
	
	$("#homeLink").hover(function(){
		animatePointer(5);
	},function(){
		animatePointer(rtnpos);
	})
	
	$("#aboutLink").hover(function(){
		animatePointer(115);
	},function(){
		animatePointer(rtnpos);
	})
	
	$("#servicesLink").hover(function(){
		animatePointer(225);
	},function(){
		animatePointer(rtnpos);
	})
	
	$("#contactLink").hover(function(){
		animatePointer(337);
	},function(){
		animatePointer(rtnpos);
	})

})