$(document).ready(function()
{

	$("#header ul li a").hover(
		function() {
			$(this).stop().animate({ backgroundColor: "#f13821" }, 200);
		},
		function() {
			$(this).stop().animate({ backgroundColor: "#da301b" }, 200);
		}
	);
  
    $('#header ul li').hover(
        function () {
            //show its submenu
            $('ul', this).slideDown(100);
 
        }, 
        function () {
            //hide its submenu
            $('ul', this).fadeOut(100);         
        }
    );
    
     $('#header>ul>li>a').click(
        function(event) {
        
        	if(!$(this).hasClass('homeicon'))     
        		event.preventDefault();
        
        	// be nice to iOS with the dropdowns <3
        
        	if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) 
        	{
        	
        		if($(this).parent('li').find('ul').is(":visible"))
        			$(this).parent('li').mouseleave();
        		else
            		$(this).parent('li').mouseenter();
			
			}
			
			//else
			//{
		
				//event.preventDefault();
			
			//}

        }
     );
     
    

	
	$("ul#newsticker").liScroll({travelocity: 0.10});
	
	$('.frontbox').hover( function() {

			$(this).animate({opacity: 1}, {queue: false, duration: 'fast'});
	
		},
		
		function () {
           
        	$(this).animate({opacity: 0.8}, {queue: false, duration: 'fast'});
                 
        }
	);
	
	$('.frontbox').css('opacity', 0);
	$('.frontbox').animate({opacity: 0.8}, {queue: false, duration: 'slow'});
	$('.frontbox').animate({ top: "130px" }, 'slow');
	
	$('.slideshow').cycle({
		fx: 'fade',
		timeout: 8000
	});
	
});
