jQuery(function($) {

	// this initialises the demo scollpanes on the page.
	$('#contentRightInner').jScrollPane({showArrows:true, scrollbarWidth:12, scrollbarMargin:6});
	$('#contentLeftInner').jScrollPane({showArrows:true, scrollbarWidth:12, scrollbarMargin:6});
	
	//$('#pane3, #pane4').jScrollPane({scrollbarWidth:20, scrollbarMargin:10,bottomCapHeight:3});


	if($("#mainBg ul li").length > 1){
  		$("#mainBg ul").innerfade({
			speed: 3000,
  			timeout: 7000
  			//containerheight: '250px'
  		});
  	}
  	
  	if($("#grundriss a").is("#grundrissLink")){

  		$("#grundriss a").css("visibility", "visible");
  		$("#contentLeftInner").css("margin-top", "460px");
		
		$("#grundriss a").click(function(event){
			  	event.preventDefault();
			  	if($("#contentLeftInner").children().is("#out")){
  					$("#contentLeftInner").animate({ 
        							marginTop: "460px"
      					}, 1500, 'swing' );
      					$("div#out").remove();
      				}else{
  					$("#contentLeftInner").animate({ 
        							marginTop: "0px"
      					}, 1500, 'swing' );
      					$("div#contentLeftInner").append('<div id="out">&nbsp;</div>');
      				}
  		});
  	}
  	/*
  	$("#bildergalerieLink a").click(function(){

  		var toLoad = $(this).attr('href')+' #contentLeftInner'; 
  		$('#contentLeft').fadeOut('normal',loadContent);  
  		$('#load').remove();
  		$('#load').fadeIn('normal');
  		function loadContent() {  
         		$('#contentLeft').load(toLoad,'',showNewContent());
     		}
  		function showNewContent() {  
	        	$('#contentLeft').fadeIn('normal', hideLoader()); 
	     	}  
     		function hideLoader() {  
     			
         		$('#load').fadeOut('normal');  
     		}  
     		return false;  
       
  	});
  	*/
  	
  	/*
  	if($("#bildergalerie:has(a)")){
  		var URL = 'http://p115181.mittwaldserver.info/' + $("#bildergalerie a:first").attr("href");

  		tb_show('Titel', URL, false);
  		//$("#bildergalerie a:first").trigger('click', this);

  	}
  	*/

  		  		
});
