// jQuery Stuff
	
	
$(document).ready(function($) {	
	// blog heading hover effect	
	$('#content h2.postTitle a').hover(
			function() {
				$(this).parent().addClass('hover');
			},
			function() {
				$(this).parent().removeClass('hover');
			});
	
	$('#content h2.linkTitle a').hover(
			function() {
				$(this).parent().addClass('hover');
			},
			function() {
				$(this).parent().removeClass('hover');
			});
	
	 
	$('a[rel*=lightbox]').fancybox();
	
	/*
	$('div.bandInfo').hide();
	
	$('div.bandSummary h2 > a').click(
			function(event) {
				event.preventDefault();
				if($(this).parent().parent().find('div.bandInfo:visible').length) {					
					$(this).parent().parent().find('div.bandInfo').slideUp();
				}
				else {
					$('div.bandInfo').slideUp();
					$(this).parent().parent().find('div.bandInfo').slideDown();
				}
			});
	
	*/
	/*
	$('div.bandInfo').hide();
	$('div.bandSummary h2 > a').hoverIntent(
			function() {
				$('div.bandInfo').slideUp();
				$(this).parent().parent().find('div.bandInfo').slideDown();
			},
			function() {		
			});
	*/
	/*
	$('div.bandSummary').hover(
			function() {
			},
			function() {
				$(this).find('div.bandInfo').slideUp();
			});
	 */
	
	function updateBandCheckinFormBand() {
		for(i = 0; i < $(this).val(); i++) {
			$('#row_band_'+i).show();
			$('#row_guest_'+i).show();
		}
		for(i = $(this).val(); i < 10; i++) {					
			$('#BandCheckinForm_BandCheckinForm_BandMemberVorname' + i).val("");
			$('#BandCheckinForm_BandCheckinForm_BandMemberNachname' + i).val("");
			$('#BandCheckinForm_BandCheckinForm_Instrument' + i).val("");
			$('#BandCheckinForm_BandCheckinForm_Vegetarier' + i).val("Ohne");
			$('#row_band_'+i).hide();
			$('#BandCheckinForm_BandCheckinForm_GuestVorname' + i).val("");
			$('#BandCheckinForm_BandCheckinForm_GuestNachname' + i).val("");
			$('#row_guest_'+i).hide();
		}
	}
	
	function updateBandCheckinFormBackstage() {
		for(i = 0; i < $(this).val(); i++) {
			$('#row_backstage_'+i).show();
		}
		for(i = $(this).val(); i < 10; i++) {					
			$('#BandCheckinForm_BandCheckinForm_BackstageVorname' + i).val("");
			$('#BandCheckinForm_BandCheckinForm_BackstageNachname' + i).val("");
			$('#BandCheckinForm_BandCheckinForm_Funktion' + i).val("");
			$('#BandCheckinForm_BandCheckinForm_BackstageVegetarier' + i).val("Ohne");
			$('#row_backstage_'+i).hide();
		}
	}
	
	$('#BandCheckinForm_BandCheckinForm_NumBandmitglieder').change(
				updateBandCheckinFormBand
			);
	
	$('#BandCheckinForm_BandCheckinForm_NumBackstage').change(
				updateBandCheckinFormBackstage
			);
	
	$("#BandCheckinForm_BandCheckinForm_NumBandmitglieder").change();
	$("#BandCheckinForm_BandCheckinForm_NumBackstage").change();
	
	
	$("a.flvmovie").click(function(event) {
		
		  event.preventDefault();
		  var movie = $(this).attr('href');
		  
		  		  
			Shadowbox.open({
				handleOversize: "resize",
				content:    '/themes/trafficjam/thirdparty/nonver/NonverBlaster.swf?mediaUrl=' + movie + '&autoPlay=true&crop=true',
				player:     "swf",
				width:     792,
				height:      432
			});
	});
	
});

// slider
$(window).load(function() {
	
    // set up all anchor elements with a "movie" class to work with Shadowbox
    Shadowbox.setup("a.movie", {
        gallery:            "My Movies",
        autoplayMovies:     true
    });
	
	if (jQuery('#slider').length != 0) {
		jQuery('#slider').nivoSlider({
				animSpeed:1000				
		});
	}
});