$(document).ready(function() {

	$('#juicyslide').hover(function() {
      $('#juicyslide').stop().animate({ opacity: 1, width: 500 }, 300 );
    }, function() {
      $('#juicyslide').stop().animate({ opacity: 0.5, width: 85 }, 300 );
    });

	$("img").hover(
	 function()
	 {
	  this.src = this.src.replace("_off","_on");
	 },
	 function()
	 {
	  this.src = this.src.replace("_on","_off");
	 }
	);
	
	$('#navbar li ul').hide();
	
    $('#navbar li').hoverIntent(
        function(){	
        	$(this).addClass('hover');
            $("ul", this).slideDown();
        },
        function(){
	        $(this).removeClass('hover');
            $("ul",this).slideUp();
        }
    );

    $(".latest_news.upcoming:even").addClass('odd');
    $(".latest_news.upcoming:odd").addClass('even');

    $(".latest_news.past:odd").addClass('even');
    $(".latest_news.past:even").addClass('odd');
    
    $(".latest_news:even").addClass('odd');
    $(".latest_news:odd").addClass('even');
    
    // business page
    
    $('#business_nav img').click(
    	function(){
    		$('#retail, #food, #service').show();
    		$('.businesses').removeClass('odd');
    		$('.left h1, h1.all').hide();
    	}
    );
    
    $('#retail').click(
    	function(){
    		$('.retail').show();
    		$('.food, .service').hide();
    		}
    );
    
    $('#food').click(
    	function(){
    		$('.food').show();
    		$('.retail, .service').hide();
	    	}
    );
    
    $('#service').click(
    	function(){
    		$('.service').show();
    		$('.retail, .food').hide();
	    	}
    );
	
	var clearMePrevious = '';
	
	// clear input on focus
	$('input[type=text]').focus(function()
	{
	if($(this).val()==$(this).attr('title'))
	{
	clearMePrevious = $(this).val();
	$(this).val('');
	}
	});
	
	// if field is empty afterward, add text again
	$('input[type=text]').blur(function()
	{
	if($(this).val()=='')
	{
	$(this).val(clearMePrevious);
	}
	});
});


