function dialog(d,a,b,c){dialog_id=a.dialog_id==null?"dialog":a.dialog_id;type=a.type==null?"html":a.type;s_width=a.width==null?400:a.width;s_height=a.height==null?350:a.height;s_maxHeight=a.maxHeight==null?600:a.maxHeight;s_maxWidth=a.maxWidth==null?600:a.maxWidth;s_modal=!!a.modal;s_autoOpen=a.autoOpen==null?false:a.autoOpen;_onresize=a.onresize?a.onresize:function(){};if(d=="iframe"&&a.full)_onresize=function(){$("#"+dialog_id).find("iframe").height($("#"+dialog_id).height())};ok_text=a.ok_text||
"\u786e\u5b9a";cancel_text=a.cancel_text||"\u53d6\u6d88";var f=typeof b=="function"?b:eval("("+b+")");$("#"+dialog_id).length==0&&$("<div id='"+dialog_id+"' title=''></div>").appendTo("body");if(d=="choose"){var g=typeof c=="function"?c:eval("("+c+")");buttons={};buttons[ok_text]=function(){dialog_obj=$(this);f()};buttons[cancel_text]=function(){g($(this));$(this).dialog("close")};$("#"+dialog_id).dialog({autoOpen:s_autoOpen,bgiframe:true,closeOnEscape:true,draggable:true,maxHeight:s_maxHeight,maxWidth:s_maxWidth,
width:s_width,height:s_height,modal:s_modal,stack:true,close:g,resize:_onresize,title:a.title,buttons:buttons})}else if(d=="iframe")$("#"+dialog_id).dialog({autoOpen:s_autoOpen,bgiframe:true,closeOnEscape:true,draggable:true,resize:_onresize,resizable:a.resizable?a.resizable:true,maxHeight:s_maxHeight,maxWidth:s_maxWidth,width:s_width,height:s_height,modal:s_modal,stack:true,title:a.title,buttons:{}});else{buttons={};buttons[ok_text]=function(){$(this).dialog("close");f(dialog_id)};$("#"+dialog_id).dialog({autoOpen:s_autoOpen,
bgiframe:true,closeOnEscape:true,draggable:true,maxHeight:s_maxHeight,maxWidth:s_maxWidth,width:s_width,height:s_height,modal:s_modal,resize:_onresize,stack:true,title:a.title,buttons:buttons});$("#"+dialog_id).css("overflow","auto");$("#"+dialog_id).css("overflow-y","auto");$("#"+dialog_id).css("overflow-x","hidden")}if(type=="html"){$("#"+dialog_id).html('<div class="bk_5"></div>'+a.content);d=$("#"+dialog_id+" input[type='text']");d.length&&$(d[0]).focus()}else if(type=="ajax")$.get(a.content,
function(e){$("#"+dialog_id).html(e);e=$("#"+dialog_id+" input[type='text']");if(e.length){$(e[0]).focus(function(){this.focus();return true});setTimeout("",0);$(e[0]).focus();vali_form()}});else type=="iframe"&&$("#"+dialog_id).html('<iframe frameborder="0" scrolling="auto" src="'+a.content+'" width="100%" height="'+(a.height-30)+'" ></iframe>');$("#"+dialog_id).dialog("open");$("#"+dialog_id).css("padding","4px").css("margin-top","-9px");if(type=="iframe"){$("#"+dialog_id).css("padding","0px");
dialog_id=="template_select"&&$("#template_select").css("width","600px");a.full&&$("#"+dialog_id).find("iframe").height($("#"+dialog_id).height())}return false}
function ct_confirm(d,a,b,c){c||(c="ct_dialog_confirm");$("#"+c).length==0&&$("<div id='"+c+"' title=''></div>").appendTo("body");typeof a=="function"||(a=window[a]);typeof b=="function"||(b=window[b]);$("#"+c).dialog({autoOpen:false,bgiframe:true,closeOnEscape:true,draggable:true,width:320,modal:false,stack:true,title:"\u63d0\u793a\u4fe1\u606f",buttons:{"\u786e\u5b9a":function(){$(this).dialog("close");a(1111);return true},"\u53d6\u6d88":function(){$(this).dialog("close");b();return false}}});$("#"+
c).html('<div class="bk_5"></div><p class="ct_confirm"><sup></sup>'+d+"</p>");$("#"+c).dialog("open")}
function ct_confirm_picture(d,a,b,c){c||(c="ct_dialog_confirm_picture");$("#"+c).length==0&&$("<div id='"+c+"' title=''></div>").appendTo("body");a=eval("("+a+")");b=eval("("+b+")");$("#"+c).dialog({autoOpen:false,bgiframe:true,closeOnEscape:true,draggable:true,width:420,modal:true,stack:true,title:"\u63d0\u793a\u4fe1\u606f",buttons:{"\u53d1\u5e03\u65b0\u7ec4\u56fe":function(){$(this).dialog("close");a();return true},"\u9000\u51fa\u53d1\u5e03\u754c\u9762":function(){$("#ct_dialog_confirm_picture").dialog("close");
b();return false}}});$("#"+c).html('<div class="bk_5"></div><p class="ct_ok"><sup></sup>'+d+"</p>");$("#"+c).dialog("open")}
function ct_confirm_interview(d,a,b,c){c||(c="ct_dialog_confirm_picture");$("#"+c).length==0&&$("<div id='"+c+"' title=''></div>").appendTo("body");a=eval("("+a+")");b=eval("("+b+")");$("#"+c).dialog({autoOpen:false,bgiframe:true,closeOnEscape:true,draggable:true,width:420,modal:true,stack:true,title:"\u63d0\u793a\u4fe1\u606f",buttons:{"\u53d1\u5e03\u65b0\u8bbf\u8c08":function(){$(this).dialog("close");a();return true},"\u9000\u51fa\u53d1\u5e03\u754c\u9762":function(){$("#ct_dialog_confirm_picture").dialog("close");
b();return false}}});$("#"+c).html('<div class="bk_5"></div><p class="ct_ok"><sup></sup>'+d+"</p>");$("#"+c).dialog("open")}
function ct_alert(d,a,b){a="ct_"+(a||"ok");dialog_id="ct_dialog_alert";$("#"+dialog_id).length==0&&$("<div id='"+dialog_id+"' title=''></div>").appendTo("body");$("#"+dialog_id).dialog({autoOpen:false,bgiframe:true,closeOnEscape:true,draggable:true,width:320,modal:b==undefined?true:b,stack:true,title:"\u63d0\u793a\u4fe1\u606f",buttons:{"\u786e\u5b9a":function(){$(this).dialog("close");return true}}});$("#"+dialog_id).html('<div class="bk_5"></div><p class="'+a+'"><sup></sup>'+d+"</p>");$("#"+dialog_id).dialog("open")}
function ct_info(d,a,b){a="ct_"+(a||"ok");dialog_id="ct_dialog_info";$("#"+dialog_id).length==0&&$("<div id='"+dialog_id+"' title=''></div>").appendTo("body");$("#"+dialog_id).dialog({autoOpen:false,bgiframe:true,closeOnEscape:true,draggable:true,width:320,modal:true,stack:true,close:b,title:"\u63d0\u793a\u4fe1\u606f",buttons:{"\u786e\u5b9a":function(){$(this).dialog("close");return true}}});$("#"+dialog_id).html('<div class="bk_5"></div><p class="'+a+'"><sup></sup>'+d+"</p>");$("#"+dialog_id).dialog("open")}
function ct_view(d,a){var b=$("#ct_dialog_view");if(b.length){b.empty().load(d);b.dialog("open")}else{b=$("<div id='ct_dialog_view'></div>").appendTo("body");b.dialog({autoOpen:false,bgiframe:true,closeOnEscape:true,draggable:true,width:400,height:480,modal:false,stack:true,title:a||"\u67e5\u770b",buttons:{"\u786e\u5b9a":function(){$(this).dialog("close");return true}}});b.load(d).dialog("open")}};
