function JTongAccordion_init(){$(".jtongui-accordion").each(function(){var $controlContainer=$(this).parent();var $controlObj=$(this);$controlObj.height($controlContainer.height());JTongAccordion_setBodyHeight($controlObj);$(this).find(".submenu .head").bind("click",function(event){$controlObj.find(".submenu").removeClass("selected");$(this).parent().addClass("selected");JTongAccordion_setBodyHeight($controlObj)})})};function JTongAccordion_setBodyHeight($controlObj){var controlHeight=0;var height_used=0;var height_remain=0;var headHeight=0;controlHeight=$controlObj.height();$controlObj.find(".submenu .head").each(function(){headHeight=$(this).outerHeight(true);height_used+=headHeight});height_remain=controlHeight-height_used-1;$controlObj.find(".selected .body").height(height_remain)}