// tab specific JS
jQuery(document).ready(function() {
  //Default Action
  $("#browsesec").load("browsefor.php?type=jobs", function() {
  getTabs();
});
  // Dynamically change section
  $("#b_candidates").click(function(){
      $("#browsesec").load("browsefor.php?type=candidates", function() {
  getTabs();
});
});
  $("#b_jobs").click(function(){
      $("#browsesec").load("browsefor.php?type=jobs", function() {
  getTabs();
});
});
  $("#b_projects").click(function(){
      $("#browsesec").load("browsefor.php?type=projects", function() {
  getTabs();
});
});  
function getTabs(){
  $(".tab_content").hide(); //Hide all content
  $("ul.tabs li:first").addClass("active").show(); //Activate first tab
  $(".tab_content:first").show(); //Show first tab content
 
  //On Click Event
  $("ul.tabs li").click(function() {
      $(".tab_content").hide(); //Hide all tab content
      $("ul.tabs li").removeClass("active"); //Remove any "active" class
      $(this).addClass("active"); //Add "active" class to selected tab
      var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
      $(activeTab).show(); //Fade in the active content
 
      return false;
  });   
}
       
  $(".tab_content").hide(); //Hide all content
  $("ul.tabs li:first").addClass("active").show(); //Activate first tab
  $(".tab_content:first").show(); //Show first tab content
 
  //On Click Event
  $("ul.tabs li").click(function() {
      $(".tab_content").hide(); //Hide all tab content
      $("ul.tabs li").removeClass("active"); //Remove any "active" class
      $(this).addClass("active"); //Add "active" class to selected tab
      var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
      $(activeTab).show(); //Fade in the active content
      return false;
  });
});
