// EXTERNAL LINKS (as target is not allowed in xhtml strict)

$(function() {
	$('a[rel*=external]').click( function() {
		window.open(this.href);
		return false;
	});
});


// ###################################################################



// FADE WHEN HOVERING


$(document).ready(function(){
	$("#nav img").fadeTo("slow", 0.7);
	$("#nav img").hover(function(){
	$(this).fadeTo("slow", 1.0);
	},function(){
	$(this).fadeTo("slow", 0.7);
	});
});

$(document).ready(function(){
	$("#side_panel img").fadeTo("fast", 0.6);
	$("#side_panel img").hover(function(){
	$(this).fadeTo("fast", 1.0);
	},function(){
	$(this).fadeTo("fast", 0.6);
	});
});


// ###################################################################


// CYCLE (slideshow)


$(document).ready(
function(){
$('#slideshow').cycle({ 
    fx: 'fade',
    cleartypeNoBg: true,
    speed: 3000,
    timeout: 5000
 });
});



$(document).ready(
function(){
$('#sponsor_slideshow').cycle({ 
    fx: 'fade',
    cleartypeNoBg: true,
    next: '#next_sponsors', 
    prev: '#prev_sponsors'
 });
});


// ###################################################################



// NAVIGATION



$(document).ready(function(){

	$("#competition").get(0).style.display = "none";
	$("#event").get(0).style.display = "none";
	$("#experience").get(0).style.display = "none";
	$("#contact").get(0).style.display = "none";

	$("#home_button").click(function() {
		$("#competition").hide();
		$("#event").hide();
		$("#experience").hide();
		$("#contact").hide();
		$("#home").slideDown('slow');
	});

	$("#competition_button").click(function() {
		$("#home").hide();
		$("#event").hide();
		$("#experience").hide();
		$("#contact").hide();
		$("#competition").slideDown('slow');
	});

	$("#event_button").click(function() {
		$("#home").hide();
		$("#competition").hide();
		$("#experience").hide();
		$("#contact").hide();
		$("#event").slideDown('slow');
	});

	$("#experience_button").click(function() {
		$("#home").hide();
		$("#competition").hide();
		$("#event").hide();
		$("#contact").hide();
		$("#experience").slideDown('slow');
	});

	$("#contact_button").click(function() {
		$("#home").hide();
		$("#competition").hide();
		$("#event").hide();
		$("#experience").hide();
		$("#contact").slideDown('slow');
	});


});

