

$(document).ready(function () {

$(function() {

		if(!window.location.hash || window.location.hash == '#home') {	
			//alert('about');
			//$("#home").removeClass('cp');
			$('#home').addClass('cp');
			$("#clients").css("display","none");
			$("#contact").css("display","none");				
		}
		
		if(window.location.hash == '#contact') {
			//alert('contact');	
			$("#home").removeClass('cp');
			$('#contact').addClass('cp');
			
 		 	$("#home").css("display","none");
			$("#clients").css("display","none");
		 }		
  
 		if(window.location.hash == '#clients'){
			//alert('clients');
			$("#home").removeClass('cp');
			$('#clients').addClass('cp');
			
			$("#home").css("display","none");
			$("#contact").css("display","none");	
		}	
		/**/	
		
		$("#nav a").click(function() {
			//alert('nav');
			$page = $(this).attr('title'); //  link name you just clicked
			$id = $('#'+$page);  //  Adds a # to the link name

			$checker = $(".cp").attr('title');  //  Gets the link name marked current page.
			
			if($checker!=$page && $page!=("photography")&& $page!=("design")&& $page!=("blog")) {
				$(".cp").fadeOut(100, function() {					
					$(this).removeClass();
					$id.addClass("cp").fadeIn(200, function() {});									
				});			
			}			
		});
	
});});
