
$(document).ready(function() {	


  //Get all the LI from the #tabMenu UL
  $('#main_navigation > li a').click(function(){
        
    //remove the selected class from all LI    
    $('#main_navigation > li a').removeClass('selected');
    
    //Reassign the LI
    $(this).addClass('selected');
    
    //Hide all the DIV in .boxBody
    $('.boxBody div.slide').slideUp('1500');
    
    //Look for the right DIV in boxBody according to the Navigation UL index, therefore, the arrangement is very important.
    $('.boxBody div.slide:eq(' + $('#main_navigation > li a').index(this) + ')').slideDown('1500');
    
  }).mouseover(function() {

    //Add and remove class, Personally I dont think this is the right way to do it, anyone please suggest    
    $(this).addClass('mouseover');
    $(this).removeClass('mouseout');   
    
  }).mouseout(function() {
    
    //Add and remove class
    $(this).addClass('mouseout');
    $(this).removeClass('mouseover');    
    
  });

  //Mouseover with animate Effect for Category menu list
  $('.boxBody #sub_nav li').mouseover(function() {

    //Change background color and animate the padding
    $(this).css('backgroundColor','#CAF5FB');
    $(this).children().animate({paddingLeft:"10px"}, {queue:false, duration:300});
  }).mouseout(function() {
    
    //Change background color and animate the padding
    $(this).css('backgroundColor','');
    $(this).children().animate({paddingLeft:"0"}, {queue:false, duration:300});
  });  
	
  //Mouseover effect for Posts, Comments, Famous Posts and Random Posts menu list.
  $('#sub_nav > li a').click(function(){
   // window.location = $(this).find("a").attr("href");
       $('#sub_nav > li a').removeClass('selected2');
    
    //Reassign the LI
    $(this).addClass('selected2');
   
  }).mouseover(function() {
    $(this).css('backgroundColor','#CAF5FB');
  }).mouseout(function() {
    $(this).css('backgroundColor','');
  });  	
	
});
