var leftImageLoaded = false;
var centerImageLoaded = false;
var rightImageLoaded = false;


$(function(){

	initScrollbar = function() {
		$('.scroll-pane').jScrollPane();
	}
	
	
	 showContent = function() {
			$('#left').show("slide", {}, 2500, initScrollbar);
			$('#center').show("blind", {}, 2500);
			$('#right').show("slide", {direction: "right"}, 2500, initScrollbar);
	}
	
	if ($('#start-left').length > 0 ) {
	
		$('#content-wrapper').css('padding', '0').css('height', '417px');
			
		if ($('#start-left')[0].complete)
			leftImageLoaded = true;
		
		if ($('#start-center')[0].complete)
			centerImageLoaded = true;
			
		if ($('#start-right')[0].complete)
			rightImageLoaded = true;
			
		if (leftImageLoaded && centerImageLoaded && rightImageLoaded) {
			showContent();
		} else {
		
			$('#start-left').load(function() { 
				leftImageLoaded = true;
				if (leftImageLoaded && centerImageLoaded && rightImageLoaded) {
					showContent();
				}});
			
			$('#start-center').load(function() { 
				centerImageLoaded = true;
				if (leftImageLoaded && centerImageLoaded && rightImageLoaded) {
					showContent();
				}});
		   
		   $('#start-right').load(function() { 
				rightImageLoaded = true;
				if (leftImageLoaded && centerImageLoaded && rightImageLoaded) {
					showContent();
				}});
		}
	   
	} else {
		showContent();	
   }
   
   $('#navi-left ul li, #navi-right ul li').hover(
	  function () {
	   	$(this).children('img.arrow-left').animate({left:"-61px"}, "fast");
	  	$(this).children('span').animate({left:"30px", top:"40px", fontSize:"1.3em"}, "fast")
	    $(this).children('img.arrow-right').animate({right:"0px"}, "fast");
	  },
	  function () {
	  	$(this).children('img.arrow-left').animate({left:"0px"}, "fast");
	  	$(this).children('span').animate({left:"70px", top:"45px", fontSize:"1em"}, "fast")
	    $(this).children('img.arrow-right').animate({right:"-61px"}, "fast");
	  }
	);
   
});




