/*
Original: Sun Kim
Customized for http://hanpower.com
*/
$(document).ready(function() {	
	jQuery.each(jQuery.browser, function(i, val) {
		if(i=="mozilla") {
			$(".teaser_box").ellipsis();
			$(".teaser_box1").ellipsis();
			$(".teaser_box2").ellipsis();
			$(".teaser_box3").ellipsis();
			$(".teaser_box4").ellipsis();
		}
	}); 

  //Get all the LI from the #tabMenu UL
  $('#tabMenu > li').hover(function(){
        
		//perform the actions when it's not selected
		if (!$(this).hasClass('selected')) {    

			//remove the selected class from all LI    
			$('#tabMenu > li').removeClass('selected');
			$('#tabMenu > li').addClass('mouseout');
			
			//After cleared all the LI, reassign the class to the selected tab
			$(this).addClass('selected');
			
			//Hide all the DIV in .boxBody
			$('.boxBody div').slideUp('fast');
			
			//Look for the right DIV index based on the Navigation UL index
			$('.boxBody div:eq(' + $('#tabMenu li').index(this) + ')').slideDown('fast');	
		}

  });

  
  //Mouseover with animate Effect for Category menu list  :)
  $('.boxBody #category li').mouseover(function() {

    //Change background color and animate the padding
    $(this).css('backgroundColor','#ece9b2');
    $(this).children().animate({paddingLeft:"20px"}, {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 li').click(function(){
    window.location = $(this).find("a").attr("href");
  }).mouseover(function() {
    $(this).css('backgroundColor','#e3e8f7');
  }).mouseout(function() {
    $(this).css('backgroundColor','');
  });  	
	
});