$(document).ready(function() {

	// Transparent PNG in IE 5.5 and 6.
	$(document).pngFix(); 

	// Gehele panel als link
	$('.panel').each(function() {
		$(this).click(function() {
			window.open($(this).find('a').attr('href')); return false;
		});
	});

	// Reisaanbod
	if (window.location.pathname != '/') {
		$('#reizen_content, #specials_content, #vervoer_content, #accomodaties_content, #sport_content').hide();

		// Tussen pagina's
		$('#reizen_titel a').click(function() {
			if ($('#reizen_content').is(":visible")) {
				var url = $('#reizen_titel').find('a').attr('href');
				window.location = url;
			}
		});

		$('#specials_titel a').click(function() {
			if ($('#specials_content').is(":visible")) {
				var url = $('#specials_titel').find('a').attr('href');
				window.location = url;
			}
		});
		
		$('#vervoer_titel a').click(function() {
			if ($('#vervoer_content').is(":visible")) {
				var url = $('#vervoer_titel').find('a').attr('href');
				window.location = url;
			}
		});
		
		$('#accomodaties_titel a').click(function() {
			if ($('#accomodaties_content').is(":visible")) {
				var url = $('#accomodaties_titel').find('a').attr('href');
				window.location = url;
			}
		});

		$('#sport_titel a').click(function() {
			if ($('#sport_content').is(":visible")) {
				var url = $('#sport_titel').find('a').attr('href');
				window.location = url;
			}
		});

		// Submenu
		$('#reizen_titel').toggle(
			function() {
	 			$('#reizen_content').slideDown(500);
	 		},
			function() {
	 			$('#reizen_content').slideUp(500);
	 		} 		
		);
	
		$('#specials_titel').toggle(
			function() {
	 			$('#specials_content').slideDown(500);
	 		},
			function() {
	 			$('#specials_content').slideUp(500);
	 		} 		
		);
		
		$('#vervoer_titel').toggle(
			function() {
	 			$('#vervoer_content').slideDown(500);
	 		},
			function() {
	 			$('#vervoer_content').slideUp(500);
	 		} 		
		);
		
		$('#accomodaties_titel').toggle(
			function() {
	 			$('#accomodaties_content').slideDown(500);
	 		},
			function() {
	 			$('#accomodaties_content').slideUp(500);
	 		} 		
		);		
	
		$('#sport_titel').toggle(
			function() {
	 			$('#sport_content').slideDown(500);
	 		},
			function() {
	 			$('#sport_content').slideUp(500);
	 		} 		
		);
	}

	// Extra tekst
	$('#extra_tekst').hide();
	
	$('#meer').toggle(
		function() {
			$('#extra_tekst').show();
			$('#meer').text('Minder informatie');
		},
		function() {
			$('#extra_tekst').hide();
			$('#meer').text('Meer informatie');
		} 
	);
	
	// Aanbieders
	$('#extra_aanbieders_links, #extra_aanbieders_rechts').hide();	
	
	$('#aanbieders_meer').toggle(
		function() {
			$('#extra_aanbieders_links, #extra_aanbieders_rechts').show();
			$('#aanbieders_meer').hide();
		},
		function() {
			$('#extra_aanbieders_links, #extra_aanbieders_rechts').hide();
		} 
	);

	// Reset default values
	$('#zoeken, #nieuwsbrief').resetvalue();
	
	// Ezelsoor
	$('#ezelsoor').hover(function() { //On hover...
		$('#ezelsoor img, .msg_block').stop()
			.animate({
				width: '307px',
				height: '319px'
			}, 500);
		} , function() {
		$('#ezelsoor img').stop()
			.animate({
				width: '50px',
				height: '52px'
			}, 220);
		$('.msg_block').stop()
			.animate({
				width: '50px',
				height: '50px'
			}, 200);
	});	
});