$(document).ready(function() {  
   		
   		//alert(navigator.appVersion);
   		
   		showHome();
		var contentBox = 1;
		var clientBox = 0;
		var marginState = 0;
		
		///////////////////////////////// Begin the main navigation effects//////////////////////////////////
		$("#homebutton").mousedown(function(){
			$("#PTNavslider").animate( { left:'85'}, 500, 'easeInOutQuart' , function()	{sliderUnder();});
		 	if (marginState == 1){
		 		$("#PTNavslider").animate( { marginTop:'22'}, 250, 'easeInBack');
		 		marginState = 0;
		 	}
		  	$("#PTContentcontainer").animate( {opacity:'0'}, 250 , function(){showHome();} );
		  	$("#PTContentcontainer").animate( {opacity:'1'}, 250 );
		  	contentBox = 1;
		  	
    	});
		
		$("#musicbutton").mousedown(function(){
		   if (contentBox != 2) {
		   		if (marginState == 0){
		   			$("#PTNavslider").animate( { marginTop:'0'}, 250, 'easeOutBack' , function(){sliderOnTop();} );
		   			marginState = 1;
		   		}
		  	 	$("#PTNavslider").animate( { left:'155'}, 500, 'easeInOutQuart' );
		   		$("#PTContentcontainer").animate( {opacity:'0'}, 250 , function(){showMusic();} );
		   		$("#PTContentcontainer").animate( {opacity:'1'}, 250 ); 
		   		contentBox = 2;
		 	}
		});
		
		$("#clientbutton").mousedown(function(){
			
			
			if (contentBox != 3) {
				if (marginState == 0){
					$("#PTNavslider").animate( { marginTop:'0'}, 250, 'easeOutBack' , function(){sliderOnTop();} );
					  marginState = 1;
				}
		 		$("#PTNavslider").animate( { left:'255'}, 500, 'easeInOutQuart' );
		    	$("#PTContentcontainer").animate( {opacity:'0'}, 250 , function(){showClient();} );
		   		$("#PTContentcontainer").animate( {opacity:'1'}, 250 );
		   		contentBox = 3; 
		 	}  		
		});
		
		$("#aboutbutton").mousedown(function(){
			if (contentBox != 4) {
				if (marginState == 0){
					$("#PTNavslider").animate( { marginTop:'0'}, 250, 'easeOutBack' , function(){sliderOnTop();} );
					marginState = 1;
				}
				$("#PTNavslider").animate( { left:'355'}, 500, 'easeInOutQuart' );
				$("#PTContentcontainer").animate( {opacity:'0'}, 250 , function(){showAbout();} );
		    	$("#PTContentcontainer").animate( {opacity:'1'}, 250 ); 
		    	contentBox = 4;
		    }
   		});
		
		$("#contactbutton").mousedown(function(){
		  	if (contentBox != 5) {
				if (marginState == 0){			  	
					$("#PTNavslider").animate( { marginTop:'0'}, 250, 'easeOutBack' , function(){sliderOnTop();} );
					marginState = 1;
				}
					
		  		$("#PTNavslider").animate( { left:'464'}, 500, 'easeInOutQuart' );
		 		$("#PTContentcontainer").animate( {opacity:'0'}, 250 , function(){showContact();} );
		 		$("#PTContentcontainer").animate( {opacity:'1'}, 250 );
		 		contentBox = 5; 
		  	}
		 });
		 
		/////////////////////////////////// End the main navigation effects//////////////////////////////////
	
		
		$(".musiclightbox").fancybox({
			'height'			: 425,
			'width'				: 500,
			'autoScale'         : false,
			'titleshow'			: true,
			'titlePosition' 	: 'inside',
			'type'				: 'iframe'
		})
		
		
		var container = document.getElementById ("PTAboutbodytext");
        var paragraphTags = container.getElementsByTagName ("p");
        var paragraphCount = 0;
		
		
		
		$("#PTAboutButtonUp").click(function(){
			if (paragraphCount > 0){
				paragraphCount -= 1;
				$("#PTAbout-holder").animate( {top: -(paragraphTags[paragraphCount].offsetTop)}, 1000, 'easeInOutBack');
			};
		  		
		  		
		});
		
		
		$("#PTAboutButtonDown").click(function(){
		

			if (paragraphCount < 4){
				paragraphCount += 1;
				$("#PTAbout-holder").animate( {top: -(paragraphTags[paragraphCount].offsetTop) }, 1000, 'easeInOutBack');
			};
				
				
		});
		
		
		$("#PTClientButtonUp").click(function(){
			if (clientBox < 0) {
				clientBox = (clientBox + 194);
		  		$("#PTClient-holder").animate( {top: clientBox}, 1000, 'easeInOutBack');
		  	}		
		});
		
		$("#PTClientButtonDown").click(function(){
			if (clientBox > -200) {
				clientBox = (clientBox - 194);
		  		$("#PTClient-holder").animate( {top: clientBox}, 1000, 'easeInOutBack');
		  	}		
		});
		
		    	

		
		
});	


	

		





function sliderUnder() {
    $("#PTNavslider").css('z-index', 1);
	$("#PTContent").css('z-index', 2);
}

function sliderOnTop() {
    $("#PTNavslider").css('z-index', 2);
	$("#PTContent").css('z-index', 1);
}


function showContact(){
	$("#PTHomepage").hide();
	$("#PTClientpage").hide();
	$("#PTMusicpage").hide();
	$("#PTAboutpage").hide();
	$("#PTContactpage").show();
}

function showMusic() {
	$("#PTHomepage").hide();
	$("#PTContactpage").hide();
	$("#PTAboutpage").hide();
	$("#PTClientpage").hide();
	$("#PTMusicpage").show();
}

function showAbout() {
	$("#PTHomepage").hide();
	$("#PTContactpage").hide();
	$("#PTClientpage").hide();
	$("#PTMusicpage").hide();
	$("#PTAboutpage").show();
}

function showClient() {
	$("#PTHomepage").hide();
	$("#PTContactpage").hide();
	$("#PTMusicpage").hide();
	$("#PTAboutpage").hide();
	$("#PTClientpage").show();
}

function showHome() {
	$("#PTContentcontainer").css("visibility", "visible");
	$("#warning").hide();
	$("#PTContactpage").hide();
	$("#PTMusicpage").hide();
	$("#PTAboutpage").hide();
	$("#PTClientpage").hide();
	$("#PTHomepage").show();
}


	
