$(function (){  
        $("#bandKeuze").change(function(e) {
            window.location.href = $(this).val();
        });
    });

this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	
	
	$(".preview").hover(function(e){
		var idFoto = $(this).attr('id');
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='../../assets/bands/band_"+idFoto+"_big.jpg' alt='Image preview' />"+ c +"</p>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$(".preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function(){
	
	tooltip();
	imagePreview();
	
	$(".band").css("cursor","pointer");
	$(".band").click(function() {
		window.location = $(this).find('a').attr('href');
	});
	
	$(".logo_header1").css("cursor","pointer");
	$(".logo_header1").click(function() {
		window.location = $(this).find('a').attr('href');
	});
	$(".logo_header2").css("cursor","pointer");
	$(".logo_header2").click(function() {
		window.location = $(this).find('a').attr('href');
	});
	$(".logo_header3").css("cursor","pointer");
	$(".logo_header3").click(function() {
		window.location = $(this).find('a').attr('href');
	});

	
	//Bandlist Funcionaliteit Buttons
	$(".bandbox").click(function() {
		window.location = $(this).find('a').attr('href');
	});
	
	
	
	$(".bandbox").css("cursor","pointer");
	
	$(".bandbox").mouseover(function() {
		 $(this).children('.bandnaam').css({'background-color' : '#95c011', 'margin-top' : '-100px' , 'height' : '156px', 'position' : 'relative'});
		 
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#000'}) 
		 $(this).find("h2 a").css({'background-color' : '#fff'});
	});
	
	$(".bandbox").mouseout(function() {
		 $(this).children('.bandnaam').css({'background-color' : '#000', 'margin-top' : '0px' , 'height' : '56px', 'position' : 'relative'});
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#fff'})
		 $(this).find("h2 a").css({'background-color' : '#000'}); 
	});
	// Einde Bandlist
	
	//Programma pagina functionaliteit
	$("#programma_container_vr").hide(); 
	$("#programma_container_za").hide();
	$("#programma_container_vr").show();
	
	$("#btn_vr").css({'background-color' : '#000'});
	var programmaDagId = "btn_vr";  
	
	$(".preview").css("cursor","pointer");
	
	$(".preview").mouseover(function() {
		$(this).children('.leesmeer').show();
	});
	$(".preview").mouseout(function() {
		$(this).children('.leesmeer').hide();
	});
	$('.preview').click( function() {
   		 window.location = $(this).find('a').attr('href');
  	});
	
	$(".programma_btn").click(function() {
		
		$("#btn_vr").css({'background-color' : '#ccc'});
		$("#btn_za").css({'background-color' : '#ccc'});
		
		if($(this).attr('id') == "btn_pr"){
		}else{
		
		$(this).css({'background-color' : '#000'});
		
			if($(this).attr('id') != programmaDagId){
				$("#programma_container_vr").toggle();
				$("#programma_container_za").toggle();
				
				programmaDagId = $(this).attr('id');
				
				if(programmaDagId == "btn_za"){
					$(".pijl3").css({'height' : '220px'});
				}else{
					$(".pijl3").css({'height' : '140px'});
				}
			}
		}
		
	});
	//Einde Programma
	
	

	
	Cufon('.social_media_link h2 a', {
	hover: {
	color: '#fff'
	}
	});
	
	Cufon('.foto_archief_namen li h2 a', {
	hover: {
	color: '#fff'
	}
	});
	
	Cufon('.nieuws_archief_list_box ul li h2 a', {
	hover: {
	color: '#fff'
	}
	});
	
	Cufon('.band_social_links h2 a', {
	hover: {
	color: '#5c5c5c'
	}
	});
		
	Cufon('.archief_item_link h2 a', {
	hover: {
	color: '#4d4d4d'
	}
	});
	
	Cufon('.footer_list_box ul h2 a', {
	hover: {
	color: '#a7a7a7'
	}
	});
	
	$("#quicklinks ul li").mouseover(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#000'}) 
		 $(this).find("h2 a").css({'background-color' : '#fff'});
	});
	$("#quicklinks ul li").mouseout(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#fff'}) 
		 $(this).find("h2 a").css({'background-color' : 'transparent'});
	});
	
	$("#bands_link").mouseover(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#000'}) 
		 $(this).find("h2 a").css({'background-color' : '#fff'});
	});
	$("#bands_link").mouseout(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#fff'}) 
		 $(this).find("h2 a").css({'background-color' : 'transparent'});
	});
	
	$("#foto_archief_lijst ul li").mouseover(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#fff'}) 
		 $(this).find("h2 a").css({'background-color' : '#000'});
	});
	$("#foto_archief_lijst ul li").mouseout(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#000'}) 
		 $(this).find("h2 a").css({'background-color' : '#95c011'});
	});
	
	$(".nieuws_box_split ul li").mouseover(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#000'}) 
		 $(this).find("h2 a").css({'background-color' : '#fff'});
	});
	$(".nieuws_box_split ul li").mouseout(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#fff'}) 
		 $(this).find("h2 a").css({'background-color' : '#000'});
	});
	
	$("#festival_tips li").mouseover(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#fff'}) 
		 $(this).find("h2 a").css({'background-color' : '#000'});
	});
	$("#festival_tips li").mouseout(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#000'}) 
		 $(this).find("h2 a").css({'background-color' : '#95c011'});
	});
	
	$(".andereBandnaam").mouseover(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#000'}) 
		 $(this).find("h2 a").css({'background-color' : '#95c011'});
	});
	$(".andereBandnaam").mouseout(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#fff'}) 
		 $(this).find("h2 a").css({'background-color' : '#000'});
	});
	$("#submenu_bereikbaarheid ul li").mouseover(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#fff'}) 
		 $(this).find("h2 a").css({'background-color' : '#000'});
	});
	$("#submenu_bereikbaarheid ul li").mouseout(function() {
		 var h2 = $(this).find("h2");
		 Cufon.replace(h2, {'color' : '#000'}) 
		 $(this).find("h2 a").css({'background-color' : '#95c011'});
	});
	
	
		

	Cufon.replace('h1', { fontFamily: 'Geosans' }, {hover: 'true'});
	Cufon.replace('h2', { fontFamily: 'ConduitITC' }, {hover: 'true'});
	Cufon.replace('h3', { fontFamily: 'Geosans' }, {hover: 'true'});
	Cufon.replace('.band_body h3', { fontFamily: 'ConduitITC' }, {hover: 'true'});
	Cufon.now();
	
	jQuery('#mycarousel').jcarousel();
	
	 $('#fotoContainer a').lightBox();
	
	
	

});




