// You need to specify the size of your background image here (could be done automatically by some PHP code)
var FullscreenrOptions = {  width: 1400, height: 900, bgID: '#bgimg' };
// This will activate the full screen background!
jQuery.fn.fullscreenr(FullscreenrOptions);
$(document).ready(function() {
var options = {
  handleOversize: 'resize'
  ,animate: true
  ,displayNav: true
  ,overlayOpacity: 0.9
  ,handleUnsupported: 'remove'
  ,initialHeight:800
  ,initialWidth: 700
,continuous: true 
};
Shadowbox.init(options);


	jQuery('#content h1').each(function(index) {
		jQuery(this).html('<img src="render.php?name='+ jQuery(this).text() +' &tag=h1" alt="' + jQuery(this).text() + ' " />');
	});
	/*jQuery('#content h2').each(function(index) {
		jQuery(this).html('<img src="render.php?name='+ jQuery(this).text() +' &tag=h2" alt="' + jQuery(this).text() + ' " />');
	});
	jQuery('#content h3').each(function(index) {
		jQuery(this).html('<img src="render.php?name='+ jQuery(this).text() +' &tag=h3" alt="' + jQuery(this).text() + ' " />');
	});*/
	jQuery('#content .chulkduster').each(function(index) {
		jQuery(this).html('<img src="render.php?name='+ jQuery(this).text() +' &tag=chulkduster" alt="' + jQuery(this).text() + ' " />');
	});	
	
	jQuery('#left ul.nav1st a.level0').each(function(index) {
		jQuery(this).html('<img src="render.php?name='+ jQuery(this).text() +' &tag=navi" alt="' + jQuery(this).text() + ' " />');
	});
	jQuery('#left ul.nav1st ul a').each(function(index) {
		jQuery(this).html('<img src="render.php?name='+ jQuery(this).text() +' &tag=navi2" alt="' + jQuery(this).text() + ' " />');
	});

	jQuery('ul.rex-navi1 li ul.rex-navi2').not('ul.rex-navi1 li.rex-active ul.rex-navi2').not('ul.rex-navi1 li.rex-current ul.rex-navi2').hide();

	
	//jQuery('ul.rex-navi1 li.rex-current ul.rex-navi2').show();
	//jQuery('ul.rex-navi1 li.rex-current ul.rex-navi2').delay(100).slideDown(300);
	
	// jQuery('ul.rex-navi1 li').hover(  function () {  
		// jQuery('ul.rex-navi2').hide();
		// jQuery('ul.rex-navi1 li.rex-current').animate({"padding-left": "-=145px"}, "fast");
		// $( this ).css('border-bottom','1px solid #FFF');
		// $( this ).animate({"padding-left": "+=145px"}, "slow");
		// $( this ).children('ul.rex-navi2').show();
	// },function(){    
		 // $( this ).animate({"padding-left": "-=145px"}, "fast");
		 // $( this ).css('border-bottom','0px solid #FFF');
	// });
	
});


var active; 
function slideleft(id){
	
	if(active!=id){
		jQuery('ul.rex-navi2').hide();
		jQuery('ul.rex-navi1 li').css('border-bottom','0px solid #FFF').animate({"padding-left": "0px"}, 200);
		$( '#'+id ).animate({"padding-left": "+=150px"}, 150);
		$( '#'+id  ).css('border-bottom','1px solid #FFF');
		
		$( '#'+id + ' ul.rex-navi2' ).delay(400).slideDown(300, function(){
			window.open(jQuery( '#'+id ).children('a').attr('href'),'_self');	// bei onmouseover kein aufruf, rex_navigation
		});

	}
	active = id;
}












