// Load this script when page loads
$(document).ready(function(){

 // Set up a listener so that when anything with a class of 'tab' 
 // is clicked, this function is run.
 $('.tab').click(function () {

  // Remove the 'active' class from the active tab.
  $('#tabs_container > .tabs > li.active')
	  .removeClass('active');
	  
  // Add the 'active' class to the clicked tab.
  $(this).parent().addClass('active');

  // Remove the 'tab_contents_active' class from the visible tab contents.
  $('#tabs_container > .tab_contents_container > div.tab_contents_active')
	  .removeClass('tab_contents_active');

  // Add the 'tab_contents_active' class to the associated tab contents.
  $(this.rel).addClass('tab_contents_active');

 });
});

//preload images
if(document.images)
{
      preload_image_object = new Image();
      // set image url
      image_url = new Array();
      image_url[0] = "wp-content/themes/pwblog2/images/menu_hl_01.jpg";
      image_url[1] = "wp-content/themes/pwblog2/images/menu_hl_02.jpg";
      image_url[2] = "wp-content/themes/pwblog2/images/menu_hl_03.jpg";
      image_url[3] = "wp-content/themes/pwblog2/images/menu_hl_04.jpg";
	  image_url[4] = "wp-content/themes/pwblog2/images/menu_hl_05.jpg";
	  image_url[5] = "wp-content/themes/pwblog2/images/menu_hl_06.jpg";
       var i = 0;
       for(i=0; i<=5; i++) 
	   {
         preload_image_object.src = image_url[i];
	   }
}