$(document).ready(function(){

		function gotoStart(){
			$("#ajax-content").fadeOut("300", function() {
			$(this).load("start.php", function() {
			$(this).fadeIn("300");
			});
			});
			
			removeClass();
			return false;
		}

		function gotoJulia(){
			$("#ajax-content").fadeOut("300", function() {
			$("#ajax-content").load("julia.php", function() {
			$("#ajax-content").fadeIn("300");
			$(".scroll-pane").jScrollPane({dragMaxHeight:150, dragMinHeight:100, wheelSpeed:50});
			});
			});
			
			removeClass();
			$('.goto_julia').addClass('goto_julia_now');
			return false;
		}

		function gotoFoto(){
			$("#ajax-content").fadeOut("300", function() {
			$(this).load("foto.php?c=&s=0", function() {
			$(this).fadeIn("300");
			});
			});
			
			removeClass();
			$('.goto_foto').addClass('goto_foto_now');
			return false;
		}

		function gotoHund(){
			$("#ajax-content").fadeOut("300", function() {
			$("#ajax-content").load("hund.php", function() {
			$("#ajax-content").fadeIn("300");
			$(".scroll-pane").jScrollPane({dragMaxHeight:150, dragMinHeight:50, wheelSpeed:50, scrollbarOnLeft:true});
			});
			});
			
			removeClass();
			$('.goto_hund').addClass('goto_hund_now');
			return false;
		}

		
		$('.goto_start').live("click",gotoStart);
		$('.goto_julia').live("click",gotoJulia);
		$('.goto_foto').live("click",gotoFoto);
		$('.goto_hund').live("click",gotoHund);	

		
		function removeClass(){
			$('.goto_julia').removeClass('goto_julia_now');
			$('.goto_foto').removeClass('goto_foto_now');
			$('.goto_hund').removeClass('goto_hund_now');
			return false;
		}	
		
		
		gotoStart();

});


	function loadContent(s,c) {
	$("#ajax-content").fadeOut("300", function() {
	$(this).load("foto.php?c="+c+"&s="+s+"", function() {
	$(this).fadeIn("300");
	});
	});
	}
	
	
	//----------------------------------------------------------------------------------------------------------------------------------
	function externalLinks() {
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
	var anchor = anchors[i]; 
	if (anchor.getAttribute("href") && 
	anchor.getAttribute("rel") == "external") 
	anchor.target = "_blank"; 
	}
	}
	window.onload = externalLinks;
//----------------------------------------------------------------------------------------------------------------------------------


