/**
 * @author SB
 *
 */
$(document).ready(function() {
	$('.hgr-switch').toggle(function(){
		$('#head-navi-wrap').fadeOut(900);
		$('#main-content-wrapper').fadeOut(600); //site-content head-navi-wrap
		$('#footer').fadeOut(300);
		$('#nav-wrap').fadeOut(1200);
	}, function(){
		$('#head-navi-wrap').fadeIn(300);
		$('#main-content-wrapper').fadeIn(600);
		$('#footer').fadeIn(900);
		$('#nav-wrap').fadeIn(1200);
	}); 
});


$(document).ready(function(){

    //redefine
    $.getaScript = function(url, callback, cache){
        $.ajax({
            type: "GET",
            url: url,
            success: callback,
            dataType: "script",
            cache: true
        });
    };
    
    //videos
    if ($(".video-link").length > 0) {
		$.getScript("files/js/ytChromeless/swfobject.js");
        $.getScript("files/js/ytChromeless/jquery.ytchromeless.min.js", function(){
            setTimeout(function(){
                $("a.video-link").ytchromeless({
						videoWidth: '710',
						videoHeight: '530'
				});
            }, 400);  
        });
    };
	
	//adressen
	if ($(".tooltrigger").length > 0) {
        $.getScript("files/js/jquery.tools.min.js", function(){
            setTimeout(function(){
                $(".tooltrigger").tooltip({
					
				});
            }, 300);  
        });
    };
    
	//ticketlink
	if ($(".ticketlink").length > 0) {
        $.getScript("files/js/jquery.tools.min.js", function(){
            setTimeout(function(){
                //$(".ticketlink").fancybox({
					
				//});
            }, 300);  
        });
    };

	//bilder
	if ($(".fancybox").length > 0) {
        $.getScript("files/js/fancybox/jquery.fancybox-1.3.4.pack.js", function(){
            setTimeout(function(){
                $(".fancybox").fancybox({
					'speedIn'		:	600, 
					'speedOut'		:	200, 
					'overlayShow'	:	true,
					'titleShow'		:	true,
					'titlePosition'	:	'inside'
				});
            }, 200);  
        });
    };
	//carousel
	if ($(".slideshow").length > 0) {
        $.getScript("files/js//jcarousel/jquery.jcarousel.min.js", function(){
            setTimeout(function(){
                $(".slideshow").jcarousel({
			        scroll: 1,
			        auto: 6,
			        visible: 1,
			        wrap: 'last'
				});
            }, 200);  
        });
    };

	
});
