/* Jquery -> Background Image anpassen  */ 
$(document).ready(function(){
	$(document).bgStretcher({
		images: ['/basic/images/berge-bg.jpg'],
		imageWidth: 1024, imageHeight: 768
	});
});



/* **** 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)")
			
	 });
					
});







/* **** jQuery Lightbox für Reiterliste rechts oben **** */
$(document).ready(function() {
	
		$("#reiterliste a").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'
			});
		});
    	
});




 //Regionsnavigation
$(document).ready(function(){

     $('#kaunertal').mouseover(function() {
       $('#regionContainer').css({backgroundPosition: '0px -31px'});
     }); 
     $('#pitztal').mouseover(function() {
       $('#regionContainer').css({backgroundPosition: '0px -62px'});
     });
     $('#soelden').mouseover(function() {
       $('#regionContainer').css({backgroundPosition: '0px -93px'});
     });
     $('#stubai').mouseover(function() {
       $('#regionContainer').css({backgroundPosition: '0px -124px'});
     });
     $('#hintertux').mouseover(function() {
       $('#regionContainer').css({backgroundPosition: '0px -155px'});
     });
     $('#regionContainer').mouseout(function() {
       $('#regionContainer').css({backgroundPosition: '0px 0px'});
     });

});





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

$(document).ready(function() {

initLightbox();
initMultimedia();
})


function initLightbox(){



     if ( $("a.lightbox").length > 0 ) {
		$("a.lightbox").fancybox({
	    });
     }

		
     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"]').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'

			});

    });
    



    $('a[href$="seekda.php"]').each(function(i){

             
            $(this).fancybox({
				'width'				:  860,
				'height'			:  700,
				'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': {}
		  });

           }



       });


}

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

