

function getAjaxData(){
	
	//alert(gotoPath);


    $.ajax({
        url: gotoPath,
        cache: true,
        success: function(response){
       		if(gotoPart == 'mainNav'){
       			
       			var newData = $("div#main", response).html();
            
            	$("#main").html(newData);
       
            	setTimeout('showMain()',500);
       		}
       		
       		
       		if(gotoPart == 'subNav'){
       			
       			var newData = $("div#mainRight", response).html();
            	$("#mainRight").html(newData);
       
            	//setTimeout('showContent()',500);
       		}
       
       		$("#galleryNavTyp1").css("z-index", "1000");
       	
       		$.unblockUI();
       		
       		initHistory();
            
        }
    });
    
    
}



function showMain(){

	//$("#left").css('background-image','url(images/mythos/basics/streifen.jpg)'); 
	
    //$("#left").animate({ 
	//	opacity: 1
	//}, 1000);
	
	//$("#main").animate({ 
	//	opacity: 1
	//}, 1000);
	
	//$(".galleryPager").show();
	//$(".galleryPager").animate({ 
	//	opacity: 1
	//}, 500);
 
}


function initGalleryTabs(){

	// Player ausblenden
	hidePlayer();
	
	// Ersten Player wieder einblenden
	showPlayer('slideshowTyp3_1');

	$(".galleryNavTyp1").css("top","150px");
	$(".galleryPager").show();
	$(".galleryPager").animate({ 
		opacity: 'show'
	}, 500);
	

	$("#slideshowTyp3_1").animate({ 
			opacity: 'show'
	}, 1);


	$("#slideshowTyp3_2").animate({ 
			opacity: 'hide'
	}, 1);
	$("#slideshowTyp3_2").hide();


	$("#slideshowTyp3_3").animate({ 
			opacity: 'hide'
	}, 1);
	$("#slideshowTyp3_3").hide();
	

	$("#slideshowTyp3_2").cycle({
		fx: "fade",
		timeout: 0,
		next: ".nextImg", 
    	prev: ".prevImg" 
	});
	
		
	
	$("#slideshowTyp3_3").cycle({
		fx: "fade",
		timeout: 0,
		next: ".nextImg", 
    	prev: ".prevImg" 
	});
					

	$('#slideshowTyp3_1').cycle({
		speed:  2000,
		timeout:6000,
		next: ".nextImg", 
    	prev: ".prevImg" 
		
	}); 

	activeGallery = 'slideshowTyp3_1';

	
	$("#tabNavItem1").removeClass("redBG").addClass('darkGrayBG'); 
	

	$("#startGalleryTab1").click(function () { 

		stopPlayer();

	
		$("#tabNavItem1").removeClass("redBG").addClass('darkGrayBG'); 
		$("#tabNavItem2").removeClass("darkGrayBG").addClass('redBG'); 
		$("#tabNavItem3").removeClass("darkGrayBG").addClass('redBG'); 
		
		$('#' + activeGallery).cycle('pause'); 
		     	
     	$("#" + activeGallery).animate({ 
			opacity: 'hide'
		}, 1000);
	
     	
     	showPlayer('slideshowTyp3_1');
     	
     	//$("#slideshowTyp3_1").show();
     	$("#slideshowTyp3_1").animate({ 
			opacity: 'show'
		}, 1000);
     	     	
     	$('#slideshowTyp3_1').cycle({
			speed:  2000,
			timeout: 6000
		
		}); 
     	
     	activeGallery = 'slideshowTyp3_1';
    });


	$("#startGalleryTab2").click(function () { 
	
		stopPlayer();
				

		$("#tabNavItem1").removeClass("darkGrayBG").addClass('redBG'); 
		$("#tabNavItem2").removeClass("redBG").addClass('darkGrayBG'); 
		$("#tabNavItem3").removeClass("darkGrayBG").addClass('redBG'); 
		
		$('#' + activeGallery).cycle('pause'); 
		     	
     	$("#" + activeGallery).animate({ 
			opacity: 'hide'
		}, 1000);
		
		$("#" + activeGallery).hide();
	
	
     	
		showPlayer('slideshowTyp3_2');
		
     	$("#slideshowTyp3_2").animate({ 
			opacity: 'show'
		}, 1000);
     	     	
     	$('#slideshowTyp3_2').cycle({
			speed:  2000,
			timeout:6000
		
		}); 
     	
     	activeGallery = 'slideshowTyp3_2';
    });


	$("#startGalleryTab3").click(function () { 

		stopPlayer();

		$("#tabNavItem1").removeClass("darkGrayBG").addClass('redBG'); 
		$("#tabNavItem2").removeClass("darkGrayBG").addClass('redBG'); 
		$("#tabNavItem3").removeClass("redBG").addClass('darkGrayBG'); 
		
		$('#' + activeGallery).cycle('pause'); 
		     	
     	$("#" + activeGallery).animate({ 
			opacity: 'hide'
		}, 1000);
	
		$("#" + activeGallery).hide();
     	
     	
     	showPlayer('slideshowTyp3_3');
     	
     	//$("#slideshowTyp3_3").show();
     	$("#slideshowTyp3_3").animate({ 
			opacity: 'show'
		}, 1000);
     	     	
     	$('#slideshowTyp3_3').cycle({
			speed:  2000,
			timeout:6000
		
		}); 
     	
     	activeGallery = 'slideshowTyp3_3';
    });


}

function showPlayer(id){

	$("#" + id).find("embed").show();
	$("#" + id).find("object").show();

}

function hidePlayer(){

	jQuery("embed").each(function(i) { 
		$(this).hide();
	});
		
	jQuery("object").each(function(i) { 
		$(this).hide();
	});


}

function stopPlayer(){

	jQuery("embed").each(function(i) { 
		if($(this).is(':visible')){
			this.sendEvent('STOP','true');
			$(this).hide();
		}
	});
		
	jQuery("object").each(function(i) { 
		if($(this).is(':visible')){
			this.sendEvent('STOP','true');
			$(this).hide();
		}
	});


}
