;(function($){$.fn.dialog=function(opt){opt=opt||{};$this_div=this;var div_dialog=this;var ov=$("div.for_all#overlay ");if(ov.length==0){$("body").append("<div id='overlay' class='for_all apple_overlay'><table align='center' cellpadding='0' cellspacing='0'>"
+"<tr>"
+"<td class='corner_tl'></td>"
+"<td class='corner_tm'></td>"
+"<td class='corner_tr'></td>"
+"</tr>"
+"<tr>"
+"<td class='corner_ml'></td>"
+"<td class='corner_mm'><div class='contentWrap'></div></td>"
+"<td class='corner_mr'></td>"
+"</tr>"
+"<tr>"
+"<td class='corner_bl'></td>"
+"<td class='corner_bm'></td>"
+"<td class='corner_br'></td>"
+"</tr></table>");ov=$("body").find("div.for_all#overlay");ov.bgiframe();}
if(opt.title){$(this).addClass("div_box").prepend("<h1>"+opt.title+"</h1>");}
ov.find(".contentWrap").html("");ov.find(".contentWrap").append(this);div_dialog=ov;$("div#overlay_target").remove();$("body").append("<div id=overlay_target style='display: none;'> </div>");target=$("div#overlay_target");if(opt.buttons){var btns=this.find("div.btns_class");if(btns.length==0){$(this).append("<div class='btns_class'></div>");btns=$("div.btns_class",$(this));}
var f=function(j){return opt.buttons[j]}
for(var i in opt.buttons){if(btns.find("button#id_"+i).length==0)
btns.append("<button type='button' class='btn' id='id_"+i+"'>"+gettext(i)+"</button>")
else
btns.find("button#id_"+i).text(gettext(i));var b=btns.find("button#id_"+i)
b.click(f(i));}}
if(this.parent().find("div#id_close").length==0){this.prepend("<div id='id_close' class='close'></div>");}
this.find("div#id_close").click(function(){target.overlay().close();$this_div.remove();});var opt_overlay={expose:{color:'#000000',loadSpeed:200,opacity:0.6},opacity:'0.6',effect:'apple',close:"#id_close",fixed:false,closeOnClick:false,target:div_dialog,closeOnEsc:false}
if(opt.on_load){opt_overlay["onLoad"]=opt.on_load;}
ret=target.overlay(opt_overlay);target.click();$("body div:last").bgiframe();return ret;};})(jQuery);