// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

$(function(){
  $(".ttip").tooltip({track:true });
  $(".pcode").each(function(){
    height = $(this).height();
    if(height>100){
      $(this).wrap("<div class=\"codewrapper\">");
      o = $(this).parents(".codewrapper");
      o.addClass("code_short");
      handle = $("<div class=\"extender\"><span class=\"handle\"></span></div>");
      handle.click(function(){
        p = $(this).parents(".codewrapper");
        if(p.hasClass("code_short")){
          p.removeClass("code_short");
        } else {
          p.addClass("code_short");
        }
      });
      o.append(handle);
    }
    //ext = $(".admin");
    //ext.find(".extender").each(function(i, a){
    //  if(!$(a).parent().hasClass("open"))$(a).prev().hide();
    //  $(a).click(function(){
    //    $(a).prev().slideToggle(200);
    //  });
    //});
    //}
  });
});


