$(document).ready(function() {	
  //Get all the LI from the #tabMenu UL
  $('#tabMenu > li').click(function(){
    //remove the selected class from all LI    
    $('#tabMenu > li').removeClass('selected');
    //Reassign the LI
    $(this).addClass('selected');
	
	
	
	
	var a= document.getElementById('tabMenuslect').value;
	var theValue = $(this).attr("class");
	
	if(theValue=='posts mouseover selected'){$("#tabMenuslect").val( 'posts' ).attr('selected',true);}
	if(theValue=='comments mouseover selected'){$("#tabMenuslect").val( 'comments' ).attr('selected',true);}
	if(theValue=='category mouseover selected'){$("#tabMenuslect").val( 'category' ).attr('selected',true);}
	if(theValue=='famous mouseover selected'){$("#tabMenuslect").val( 'famous' ).attr('selected',true);}
	if(theValue=='random mouseover selected'){$("#tabMenuslect").val( 'random' ).attr('selected',true);}
	

    
	
	
	
	
	
	
	
	
	//Hide all the DIV in .boxBody
    $('.boxBody div.check').slideUp('0');
    //Look for the right DIV in boxBody according to the Navigation UL index, therefore, the arrangement is very important.
    $('.boxBody div.check:eq(' + $('#tabMenu > li').index(this) + ')').slideDown('0');
  }).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 #category div.check').mouseover(function() {
    //Change background color and animate the padding
    $(this).css('backgroundColor','');
    $(this).children().animate({}, {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.
  $('.boxBody div.slide').mouseover(function() {
    $(this).css('backgroundColor','');
  }).mouseout(function() {
    $(this).css('backgroundColor','');
  });  	
});




$(document).ready(function() {	
  //Get all the LI from the #tabMenu UL
  $('#tabMenuslect').change(function(){
	 var a= document.getElementById('tabMenuslect').value;
    //remove the selected class from all LI    
	$('#tabMenu > li').removeClass('selected');
    //Reassign the LI
    $('#tabMenu > li.' + a).addClass('selected');
	

    //Hide all the DIV in .boxBody
    $('.boxBody div.check').slideUp('0');
    //Look for the right DIV in boxBody according to the Navigation UL index, therefore, the arrangement is very important.
	
    document.getElementById(a).style.display = 'block';
	// $('.boxBody div.check:eq(' + $('#tabMenu > li').index(this) + ')').slideDown('0');
  }).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 #category div.check').mouseover(function() {
    //Change background color and animate the padding
    $(this).css('backgroundColor','');
    $(this).children().animate({}, {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.
  $('.boxBody div.slide').mouseover(function() {
    $(this).css('backgroundColor','');
  }).mouseout(function() {
    $(this).css('backgroundColor','');
  });  	
});
