/**
 *
 * This is the custom jQuery/JavaScript file for the Koteckis Basis Child Theme
 *
 */

// all jQuery gets wrapped in the ready function
$(document).ready(function() {
  
  // setup our ajax calls to never cache
  $.ajaxSetup({cache:false});
  
  // style the menus nav
  $("dd:not(:first)").hide();
  $("dt a").click(function(event){
    event.preventDefault();
    $("dd:visible").slideUp('medium');
    $(this).parent().next().slideDown('medium');
  });
  
  // hijack the menu links to return posts via ajax
	$("dd a").click(function(event){
    event.preventDefault();
		var post_id = $(this).attr("rel");
    $("#menus-content").fadeOut('slow');
		$("#menus-content").load("/ajax/",{id:post_id}).fadeIn('slow');
		$('dd a').removeClass('selected');
		$(this).addClass('selected');
	});
  
});

