
$(document).ready(function(){

	$("code").wrap("<div class='codeWrapper'></div>").each(function(){
	  var title = $(this).attr("title");
	  //if(title==undefined) title="Code"
	  if(title!=undefined) $(this).before("<h3>"+title+"</h3>");
	});
	$("hr").wrap("<div class='hr'></div>");	
     
     $(".listCont li").hover(
          function(){
               $(this).addClass("selected");
          }, function(){
               $(this).removeClass("selected");
          }
     ).click(function() {
          $(this).children("a").click();
     });     

});

function toggleThread(obj,cont) {
	var current = $(obj).attr("class");
	if(current == "open") {
		$(obj).removeClass("open").addClass("closed");
		$("#"+cont).hide();
	} 
	else {
		$(obj).removeClass("closed").addClass("open");
		$("#"+cont).show();
	}
}