$(document).ready(function() {


	// ===========================================================
	// VERTICAL CENTRE
/*
	$(".Box") 
	.livequery(function(){ 
		$(this).center({vertical: true, horizontal: false});
	});

	$(".leftBox") 
	.livequery(function(){ 
		$(this).center({vertical: true, horizontal: false});
	});

	$(".rightBox") 
	.livequery(function(){ 
		$(this).center({vertical: true, horizontal: false});
	});

	$(".oldLeftBox") 
	.livequery(function(){ 
		$(this).center({vertical: true, horizontal: false});
	});

	$(".oldRightBox") 
	.livequery(function(){ 
		$(this).center({vertical: true, horizontal: false});
	});
	*/
	// ===========================================================
	// ZEBRA STRIPE
	$("table.dates").each(function(){
			$("tr:odd", this).not(".even").addClass("odd");
			$("tr:even", this).not(".odd").addClass("even");
	});
	
	
	// ===========================================================
	// IMAGE FADES

	$('.fade2').animate({"opacity" : 1}, 100);

	$('.fade') 
    .livequery(function(){ 

		$(this).hover(function(){ 
			$(this).animate({"opacity" : 1}, 200);
		}, function() {
			$(this).animate({"opacity" : 0.9}, 400);
		});
	});

	$('.fadeOut') 
    .livequery(function(){ 

		$(this).hover(function(){ 
			$(this).animate({"opacity" : 0.7}, 200);
		}, function() {
			$(this).animate({"opacity" : 1}, 400);
		});
	});
	
	$('.fade2') 
    .livequery(function(){ 

		$(this).hover(function(){ 
			$(this).stop().animate({"opacity" : 0.4}, 200);
		}, function() {
			$(this).stop().animate({"opacity" : 1}, 400);
		});
	});

	
	// ===========================================================
	// MENU SLIDER
	
	$(function(){
		$("#open").click(function(){
			$("#header").animate({height: "500px"}, "swing").animate({height: "480px"}, "fast");
			return false;
		});
		$("#open")
			.hover(function() {
			   $("#header").stop().animate({height: "126px"}, "fast").animate({height: "120px"}, "fast")
		});
		
		
		
	$("#close").click(function(){
			$("#header").animate({height: "500px"}, "swing").animate({height: "120px"}, "fast");
			return false;
		});
	});
	
	$("#toggle a").click(function () {
		$("#toggle a").toggle();
	});
	
	$(".socical_links a").hover(function() {
		$(this).stop().animate({ top: 0 }, 100);
		}, function() {
		$(this).stop().animate({ top: 10 }, 200);
	});	
	

	// ===========================================================
	// TIP TIP
	
	$(function(){
		$(".toolTip").tipTip({
			activation: "hover",
			keepAlive: false,
			maxWidth: "200px",
			edgeOffset: -10,
			defaultPosition: "tip_left ",
			delay: 200,
			fadeIn: 200,
			fadeOut: 200,
			attribute: "title",
			content: false, // HTML or String to fill TipTIp with
		  	enter: function(){},
		  	exit: function(){}
		});
		$(".termsTip").tipTip({
			activation: "hover",
			keepAlive: false,
			maxWidth: "500px",
			edgeOffset: 1,
			defaultPosition: "top",
			delay: 100,
			fadeIn: 200,
			fadeOut: 200,
			attribute: "title",
			content: "<strong>TERMS &amp; CONDITIONS</strong><br />The winning artists Stereopticon design is created and provided by the entrant to Red Bull, the entrant hereby grants to Red Bull the irrevocable worldwide, perpetual, non-exclusive, transferable and unlimited rights to display the material in any known or yet unknown kind of media. This includes the reproduction and distribution of such material and its communication to the public e.g. by public installation, presentation, broadcasting, making available on the Internet. Red Bull shall not use these rights for the direct promotion and/or endorsement of products or activities that are not in any way related to or supported by Red Bull or by affiliated companies of Red Bull.", // HTML or String to fill TipTIp with
		  	enter: function(){},
		  	exit: function(){}
		});
	});	
	
	$(function() {
		$(window).scroll(function() {
			var top = $('#top');
			if($(this).scrollTop() > 99) {
				top.css({'position': 'fixed', 'top': '-99px'});
			} 
			else {
				top.css({'position': 'absolute', 'top': '0px'});
			}
		});
	});
	
	
});


