// JavaScript Document

$(document).ready(function(){
						   
	$('#left-transition').hide();
						   
	$('#left-transition').fadeIn(2000);
	
	$('#right-transition').hide();
						   
	$('#right-transition').fadeIn(4000);

	$('a.opacity').hover(function(){
		$(this).addClass("hovered");
		$('a.opacity:not(.hovered)').children('img').stop().animate({'opacity': 0.5});
	}, function(){
		$(this).removeClass("hovered");
		$('a.opacity:not(.hovered)').children('img').stop().animate({'opacity': 1});
	});

	$('.qhover').hover(function(){
		$(this).children('img').stop(true, true).animate({'opacity': 0});
	   }, function(){
		$(this).children('img').stop(true, true).animate({'opacity': 1});
	   });	
	
	

	$('.scroll-down').click(function(e){
									 e.preventDefault();
			var totalHeight =63 * $('li.events-item').size();
			var singleHeight = 63;
			var top = $('ul#events').css('top').replace('px','');
			var count = $('li.events-item').size();
			if(top > -(totalHeight - (singleHeight*2)) || top == 'auto') 
			{
			
			
							
				$('ul#events').stop(true,true).animate
				({
					'top':'-=' + '126px'
				});
				
			}
			
			 
		});
	
	$('.scroll-up').click(function(e){
			e.preventDefault();
			var top = $('ul#events').css('top').replace('px','');
			
			if(top != 0)
			{
			
			$('ul#events').stop(true,true).animate
				({
					'top':'+=' + '126px'
				});
			}
		});	

});
