

/* **** jQuery Simple TreeView Plugin **** */
$(document).ready(function() {
		$("ul.sitemap").simpletreeview({
		
		
			open:  "&nbsp;",	// HTML string to display for the opened handle
			close: "&nbsp;",	// HTML string to display for the closed handle 
			slide: false,		// Boolean flag to indicate if node should slide open/close
			speed: 'normal',	// Speed of the slide. Can be a string: 'slow', 'fast', or a number of milliseconds: 1000
			collapsed: false,	// Boolean to indicate if the tree should be collapsed on build
			collapse: null,		// A node to collapse on build. Can be a string with indexes: '0.1.2' or a jQuery ul: $("#tree ul:eq(1)")
			expand: null		// A node to expand on build. Can be a string with indexes: '0.1.2' or a jQuery ul: $("#tree ul:eq(1)")
		
		
		
		});
		
		
		
		
		
});





/* **** regulier das horizontale Scrollen **** */
$(window).scroll(function () { 	
	 
	 var documentWidth = $(document).width();
	 
	  if ( $.browser.msie  && parseInt($.browser.version, 10) >= 9) {
		  
		     if(documentWidth > 1300){
				 $("#mainHeader").css("width",documentWidth-17); 
			 } else {
				 $("#mainHeader").css("width",documentWidth); 
			 }
					  
	  } else {
			 $("#mainHeader").css("width",documentWidth);  
	  }
	  
	  if(documentWidth < 1000){
		 	 	  $('body').css('background', 'url()');
	  }

	 	 
});

$(window).resize(function() {
	 $("#mainHeader").css("width","100%");
	 
	 $('body').css('background', 'url(/basic/images/html-bg.png) no-repeat');
	 $('body').css('backgroundPosition', 'top center');
});
/* **** ******************************** **** */






/* **** Lightbox -> Fancybox **** */

$(document).ready(function() {

initLightbox();
initMultimedia();
})


function initLightbox(){



     if ( $("a.lightbox").length > 0 ) {
		$("a.lightbox").fancybox({
				//'width'				:parseInt($("a.lightbox").attr('rev').split('|')[0], 10),
				//'height'			:parseInt($("a.lightbox").attr('rev').split('|')[1], 10),
				//'overlayColor'		        : '#000000',
				//'overlayOpacity'	        : 0.5,
				//'titlePosition'	                : 'inside',
				//'autoScale'			: true

			});
     }

		
     if ( $("a.lightboxIframe").length > 0 ) {			
		$("a.lightboxIframe").each(function(){ 
		$(this).fancybox({
				'width'				:parseInt($(this).attr('rev').split('|')[0], 10),
				'height'			:parseInt($(this).attr('rev').split('|')[1], 10),
				'autoScale'			: false,
				'transitionIn'		        : 'none',
				'transitionOut'		        : 'none',
				'overlayColor'		        : '#000000',
				'overlayOpacity'	        : 0.5,
				//'titlePosition'	                : 'inside',
				'type'				: 'iframe'
			});
		});
     }			

     if ( $(".lightboxInline").length > 0 ) {
		$(".lightboxInline").fancybox({
				'titlePosition'		        : 'inside',
				'transitionIn'		        : 'none',
				'scrolling'                     :  'auto',
				'overlayColor'		        : '#000000',
				'overlayOpacity'	        : 0.5,
				'transitionOut'	            	: 'none'
			});
     }




    $('a[href$=".php#iframe"],a[href$=".asp#iframe"]').each(function(i){

             
            $(this).fancybox({
				'width'				:parseInt($(this).attr('rev').split('|')[0], 10),
				'height'			:parseInt($(this).attr('rev').split('|')[1], 10),
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'overlayColor'		: '#000000',
				'overlayOpacity'	: 0.5,
				'titlePosition'	    : 'inside',
				'type'				: 'iframe'

			});

    });
    



}

function initMultimedia(){



		
       /* Query Media Plugin => SWF-Player with MP3 */		
       $('a[href$=".mp3"]').each(function(i){

            if($(this).hasClass('lightbox')  ||  $(this).hasClass('lightboxIframe')  ||  $(this).hasClass('lightboxInline')){}else{

	          $(this).flash({
				'src':'/basic/swf/mediaplayer.swf' + '?file=' + $(this).attr('href'),
				'width':'250',
				'height':'20',
				'allowfullscreen':'false',
				'allowscriptaccess':'always',
				'wmode':'transparent',
				'flashvars': {}
		  });

           }


       });
	

       /* Query Media Plugin =>SWF-Player with FLV */		
       $('a[href$=".flv"]').each(function(i){

            if($(this).hasClass('lightbox')  ||  $(this).hasClass('lightboxIframe')  ||  $(this).hasClass('lightboxInline')){}else{

	          $(this).flash({
				'src':'/basic/swf/mediaplayer.swf' + '?file=' + $(this).attr('href'),
				'width'	:parseInt($(this).attr('rev').split('|')[0], 10),
				'height':parseInt($(this).attr('rev').split('|')[1], 10),
				'allowfullscreen':'false',
				'allowscriptaccess':'always',
				'wmode':'transparent',
				'flashvars': {}
		  });

           }


       });



       /* Query Media Plugin => SWF-Player with Flash */		
       $('a[href*=".swf"]').each(function(i){

            if($(this).hasClass('lightbox')  ||  $(this).hasClass('lightboxIframe')  ||  $(this).hasClass('lightboxInline')){}else{

	          $(this).flash({
				'src': $(this).attr('href'),
				'width'	:parseInt($(this).attr('rev').split('|')[0], 10),
				'height':parseInt($(this).attr('rev').split('|')[1], 10),
				'allowfullscreen':'false',
				'allowscriptaccess':'always',
				'wmode':'transparent',
				'flashvars': {}
		  });

           }



       });


}

/* **** *************************** **** */

