jQuery.noConflict();

/* sidebar show/hide */
jQuery(document).ready(function(){
    
  var sidebarStatus = jQuery.cookie("show_sidebar");

  if(sidebarStatus == null)
      jQuery.cookie("show_sidebar", "yes");
  else if(sidebarStatus == 'no')
  { 
      jQuery("div#sidebar_block").css("display","none");
      jQuery("div#forum_block").css("margin-Right","0px");
      jQuery("div#sidebar_button").removeClass('sidebar_button_active');
  }

  jQuery("div#sidebar_button").click(function() {
    
    sidebarStatus = jQuery.cookie("show_sidebar");
    
    if(sidebarStatus == 'yes')
    {
        jQuery.cookie("show_sidebar", "no");
        jQuery("div#sidebar_block").stop(true).fadeOut('slow', function() {
            jQuery("div#forum_block").stop(true).animate({marginRight: 0}, 500);
        });
        
        jQuery(this).removeClass('sidebar_button_active');
    }
    else if(sidebarStatus == 'no')
    {
        jQuery.cookie("show_sidebar", "yes");
        jQuery("div#forum_block").stop(true).animate({marginRight: "235px"}, 500, function() {
            jQuery("div#sidebar_block").stop(true).fadeIn('slow');
        }); 
        
        jQuery(this).addClass('sidebar_button_active'); 
    }
  });
});


/* Menu animation */
jQuery(document).ready(function(){

	jQuery("div.menu li").prepend("<span></span>");
	jQuery("div.menu li").each(function() { 
		var linkText = jQuery(this).find("a").html(); 
		jQuery(this).find("span").show().html(linkText); 
	}); 
	jQuery("div.menu li").hover(function() {	
		jQuery(this).find("span").stop().animate({
			marginTop: "-38" 
		}, 100);
	} , function() { 
		jQuery(this).find("span").stop().animate({
			marginTop: "0" 
		}, 250);
	});
});
