/* Author: 

*/

$(document).ready(function(){
	
	$('#about-ex,#ent-ex,#support-ex,#guide-ex,#cal-ex').children('a').addClass('tosub');
	
	$('nav li.current').removeAttr('id');
	
	$('#ent-ex,#support-ex,#cal-ex').mouseenter(function(){
		$(this).children('a').css({'color':'#FFF','border-radius':'5px 5px 0 0','background-color':'#6AA9C1','background-image':'url(../images/nav_more1.png) no-repeat right 14px'});
		$('#dm').slideDown(200);
	});
	$('#ent-ex,#support-ex,#cal-ex').mouseleave(function(){
		$(this).children('a').css({'color':'#065F83','border-radius':'0','background-color':'#FFF','background-image':'url(../images/nav_more1.png) no-repeat right 14px'});
		$('#dm').slideUp(50);
	});
	$('#about-ex').mouseenter(function(){
		$(this).children('a').css({'color':'#FFF','border-radius':'5px 5px 0 0','background-color':'#6AA9C1','background-image':'url(../images/nav_more1.png) no-repeat right 14px'});
		$('#dma').slideDown(200);
	});
	$('#about-ex').mouseleave(function(){
		$(this).children('a').css({'color':'#065F83','border-radius':'0','background-color':'#FFF','background-image':'url(../images/nav_more1.png) no-repeat right 14px'});
		$('#dma').slideUp(50);
	});
	$('#guide-ex').mouseenter(function(){
		$(this).children('a').css({'color':'#FFF','border-radius':'5px 5px 0 0','background-color':'#6AA9C1','background-image':'url(../images/nav_more1.png) no-repeat right 14px'});
		$('#dmg').slideDown(250);
	});
	$('#guide-ex').mouseleave(function(){
		$(this).children('a').css({'color':'#065F83','border-radius':'0','background-color':'#FFF','background-image':'url(../images/nav_more1.png) no-repeat right 14px'});
		$('#dmg').slideUp(50);
	});
	
	$.localScroll();

	/*$('#sponsors a').each(function(){
		var sponH = $(this).height();
		$(this).css({'margin-top': 50 - sponH/2});
	});*/

	$('#featured').slides({
				preload: true,
				preloadImage: 'img/loading.gif',
				play: 5000,
				pause: 3000,
				slideSpeed: 800,
				hoverPause: true,
				animationStart: function(current){
					$('.caption').animate({
						bottom:-80
					},100);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationStart on slide: ', current);
					};
				},
				animationComplete: function(current){
					$('.caption').animate({
						bottom:0
					},200);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationComplete on slide: ', current);
					};
				},
				slidesLoaded: function() {
					$('.caption').animate({
						bottom:0
					},200);
				}
			});
			
	$('a.fb')
		.css( {backgroundPosition: "0 -22"} )
		.mouseover(function(){
			$(this).stop().animate(
				{backgroundPosition:"(0 0)"}, 
				{duration:200})
			})
		.mouseout(function(){
			$(this).stop().animate(
				{backgroundPosition:"(0 -22)"}, 
				{duration:100})
			});
	$('a.tw')
		.css( {backgroundPosition: "-22 -22"} )
		.mouseover(function(){
			$(this).stop().animate(
				{backgroundPosition:"(-22 0)"}, 
				{duration:200})
			})
		.mouseout(function(){
			$(this).stop().animate(
				{backgroundPosition:"(-22 -22)"}, 
				{duration:100})
			});
	
	

});
