$j.accordian=function(I,E,L){var B=E;var G=0;var F=L&&L.titles||".title";var A=L&&L.contents||".content";var J=L&&L.onClick||function(){};var H=L&&L.onShow||function(){};var C=L&&L.onHide||function(){};var K=L&&L.showSpeed||"slow";var D=L&&L.hideSpeed||"fast";$j(I).not(B).children(A).hide();$j(I).not(B).each(C);$j(B).each(H);$j(I).children(F).click(function(N){var M=$j(A,this.parentNode);$j(this.parentNode).each(J);if(G||!M.is(":hidden")){return false}G=2;$j(B).children(A).not(":hidden").slideUp(D,function(){--G});M.slideDown(K,function(){--G});$j(B).each(C);B="#"+$j(this.parentNode)[0].id;$j(B).each(H);return false})};function simpleLog(A){$j("<div>"+A+"</div>").appendTo("#log")}$j(function(){$j.accordian("#list1 > div","#item11");$j.accordian("#list2 > div","#item21",{titles:".mytitle",contents:".mycontent",onClick:function(){simpleLog(this.id+" clicked")},onShow:function(){simpleLog(this.id+" shown");$j(this).removeClass("off").addClass("on")},onHide:function(){simpleLog(this.id+" hidden");$j(this).removeClass("on").addClass("off")},showSpeed:350,hideSpeed:350})});