/*
 INJOY jQuery Functions
*/

/* Subnavi-Links */
$(document).ready(function (){
 $("#content-subnavi li a").hover(function() {
    $(this).hoverFlow('mouseenter', {
	    left: '-=8px'
		}, 200);
  }, function() {
    $(this).hoverFlow('mouseleave', {
	    left: '+=8px'
		}, 300);
  });
});

/* Media-List */
$(document).ready(function (){
 $("#media-list li:odd").css("background-color", "#f7f7f7");
});

/* Opening animation (Box -> Slider) */
$(document).ready(function ()
{
    var height = $('.openings .data').css('height');

	$(".openings .data").animate({ top: '-='+height+'' }, 20000);
});


/* Token */
function show_token ()
{
	//alert('test');
 $("#wrapper_site").prepend('<div id="site-shadow" onclick="close_token();"></div>');
 $("#site-shadow").fadeIn("slow");
 $("#site-shadow").prepend('<div id="token"></div>');
 $("#token").fadeIn("slow").animate({opacity: 1, top: "50px"}, 1000 );
 $("#token").load("token.inc.php");
	//alert('test');
}

function close_token (){
 $("#token").animate({top: "-50px"}, 1500 ).fadeOut("slow");
 $("#site-shadow").fadeOut("slow");
}

function close_map (){
 $("#new-token").animate({top: "-50px"}, 1500 ).fadeOut("slow");
 $("#site-shadow").fadeOut("slow");
}
