var pause_switching = false;
function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

$(document).ready(function(){
  $("#mooptown").mouseover(function(){
return;
    $(this).find("img").attr("src", "/images/SDFoodBankHover.png");
  }).mouseout(function(){
return;
     $(this).find("img").attr("src","/images/SDFoodBank.png");
  });
});



 
 
 $(document).ready(function(){
	mainmenu();
	
	$('.sec_drop').hover(
		function(){
			$(this).find('.sec_down').fadeIn(500);
		}, 
		function() {
			$(this).find('.sec_down').hide();  
		}
	);
   
        $('.sub_menu').hover(function() {
          $(this).parent().addClass('active'); 
          Cufon.replace('#menu ul li a', { fontFamily: 'MrsEaves', fontWeight: 700, hover: true});         
         },
         function() {
           $(this).parent().removeClass('active');
           Cufon.replace('#menu ul li a', { fontFamily: 'MrsEaves', fontWeight: 700, hover: true});          
        });

  $(".hover_image").hover(function(){
        var img1 = [  "banner_img.jpg",  "BarsHome.jpg", "BrittleBitesHome.jpg", "SquaresHome.jpg", "BestSellersHome.jpg",  "ShopByPriceHome.jpg"];
        var nx = $(".hover_image").index(this);
        pause_switching = true;  
        $(".banner_left img").attr("src", "images/" + img1[nx]);
   },
   function(){
    pause_switching = false;
   });
   $("#banner_details h3 cufon").css("margin-left","-4px");
   Cufon.replace('#banner_container .banner_details h3', { fontFamily: 'MrsEaves', fontWeight: 700, left: '-5px' });
   $("#banner_container .banner_details cufon").css("margin-left","-5px");
           if (pause_switching) return;
            var indx = 0;
            var which = 0;  
    setInterval(function(){
           var images = [ "banner_img.jpg",  "SquaresHome.jpg", "ShopByPriceHome.jpg", "BrittleBitesHome.jpg", "BestSellersHome.jpg", "BarsHome.jpg", "banner_img.jpg" ];
           
           $(".banner_left img").eq(which).attr("src","images/" + images[indx]).fadeIn(1500);
           if (which == 0)
               which = 1;
           else
               which = 0;
           $(".banner_left img").eq(which).fadeOut(1500);
           indx = indx + 1;
            if(indx > 5) indx = 0;
           
    }, 4800)

});
