(function(a){a.fn.RestuarantFormatter=function(c){var b=this;if(b){a.RestuarantFormatter.format(this)}return this};a.RestuarantFormatter={format:function(c){var g=c.find("u");if(g&&g.length>1){var i=g.parent("");var b=i.contents();var h=a('<div class="restuarantDiv"/>');var d=a('<ul class="restaurants"></ul>').appendTo(h);var f;var j;var e=true;b.each(function(k){if(this.tagName&&this.tagName.toLowerCase()=="u"){if(a.RestuarantFormatter.appendRestuarant(d,f,j,h)&&!e){d=a('<ul class="restaurants"/>').appendTo(h)}else{e=false}f=a("<li/>");var l=a("<h3/>");l.text(a(this).text());f.append(l);j=a("<p/>")}else{if(!(this.tagName&&this.tagName.toLowerCase()=="br")){if(f){j.append(a(this))}else{c.append(a(this))}}}});a.RestuarantFormatter.appendRestuarant(d,f,j,h);if(f){i.remove();c.append(h)}}},ShowMoreDetails:function(b){if(b.data("created")){b.dialog("open")}else{b.dialog({width:450,height:200});b.show();b.data("created",true)}},appendRestuarant:function(g,f,d,e){if(f){if(d&&d.text()){if(d.text().length>=200){var b=a('<a href="Javascript:;" title="More details">...(more)</a>');var i=a('<div class="restMoreDetails" style="display:none"/>');i.append(f.find("h3").clone(true));i.append(d);b.click(function(){a.RestuarantFormatter.ShowMoreDetails(i)});var c=d.clone(true);c.text(d.text().substring(0,200));c.append(b);f.append(c);f.append(i);i.data("created",false)}else{f.append(d)}g.append(f)}else{var h=f.find("h3");h.insertAfter(g);return true}}return false}}})(jQuery);