$(document).ready(function(){
	
	/**
	*	Home Page Banner Cycle
	*/
	$('#slideshow').cycle({ 
	    fx:     'fade', 
	    timeout: 7000, 
	    delay:   500,
	    pager: '#slide-nav',
	    pagerAnchorBuilder: function(idx, slide) { 
        	return '<a href="#"></a>'; 
    	} 
	});
	
	$('#slide-nav a').click(function(){
		$('#slideshow').cycle('pause');
	});
	
	/**
	*	Home Page Recent Post Cycle
	*/
	$('#news-items').cycle({
		fx:		'fade',
		timeout: 5000,
		delay:	 1000
	});
	
	
	
	/**
	*	Drop Down Menus
	*/
	if ($.browser.msie && $.browser.version <= 6 ){
		$('.main-menu li').hover(function(){
			$(this).find('ul.sub-menu').addClass('over');
		}, function(){
			/* $(this).find('ul.sub-menu').removeClass('over'); */
		});
	}
	
	/**
	*	Tabbed Content Why use M&M
	*/
	// When a link is clicked  
    $("a.tab").click(function () {  
  
        // switch all tabs off  
        $(".active").removeClass("active");  
  
        // switch this tab on  
        $(this).addClass("active");  
  
        // slide all elements with the class 'content' up  
        $(".content").hide();  
  
        // Now figure out what the 'title' attribute value is and find the element with that id.  Then slide that down.  
        var content_show = $(this).attr("title");  
        $("#"+content_show).show();  
  		
  		return false;
    });
    
    /**
    *	Form Plugin to make the form look nice.
    *
    */
	$("input[type=file]").filestyle({ 
     	image: "/wp-content/themes/mmspec/images/browse.jpg",
     	imageheight : 29,
     	imagewidth : 90,
     	width : 235
 	});


 	/* Home Page Tabbed Content */
 	if($("#primecontent").length){
		$( "#primecontent" ).tabs();
	}

	
});
