function espcms_dialog(title,type,url,width,height,cssName,callback,bgclose){var w,h,box01,client_width,left,divdialog,checkdialog,temp_float='<div id="floatBoxBg"></div>';switch(temp_float+='<div id="floatBox" class="floatBox"><div id="headtitle"><div class="title" id="titlediv"></div></div><div id="dialogcontentlist" class="content"></div></div>',$("body").append(temp_float),w=parseInt(width),h=parseInt(height),$("#floatBox .content").css({width:w}),bgclose||$("#floatBoxBg").unbind("click").bind("click",function(){$("#floatBoxBg").remove(),$("#floatBox").remove()}),$("#floatBox .title").html(title),type){case"url":$("#floatBox .content").css({height:h}),$("#dialogcontentlist").load(url,function(){callback&&eval(callback)});break;case"text":$("#floatBox .content").html(url);break;case"id":$("#floatBox .content").html($("#"+url).html());break;case"iframe":url=url+"&digheight="+(parseInt(height)-30),$("#dialogcontentlist").html('<iframe name="diglogfirameclass" id="diglogfirameclass" src="'+url+'" width="100%" height="'+(parseInt(height)-30)+"px"+'" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe>')}$("#floatBoxBg").show(),$("#floatBoxBg").animate({opacity:"0.4"},"fast"),$("#floatBox").show(),box01=($(window).height()-(parseInt(height)+13))/2,client_width=$(window).width(),left=(client_width-(parseInt(width)+2))/2,$("#floatBox").css({left:parseInt(left)+"px",top:parseInt(box01)+"px",width:width}),$("#floatBox").attr("class","floatBox "+cssName),divdialog=document.getElementById("floatBox"),checkdialog=document.getElementById("headtitle"),DragAndDrop.Register(divdialog,checkdialog)}function dialog_heigth(a,b){var c,d,e;b=b?parseInt(b):60,c=parseInt(a)+b,d=$("#floatBoxBg").outerHeight()-300,d>c?$("#diglogfirameclass").height(c):(c=d,$("#diglogfirameclass").height(c)),e=($(window).height()-(parseInt(c)+13))/2,$("#floatBox").css({top:parseInt(e)+"px"})}function closeifram(){$("#floatBoxBg").remove(),$("#floatBox").remove()}var DragAndDrop=function(){var a,b,c,d,f,g,e=!1,i=function(c){d&&(c=c||window.event,a=document.body.clientWidth,b=document.documentElement.scrollHeight,e=!0,f={x:$(d).offset().left,y:$(d).offset().top},g={x:c.screenX,y:c.screenY},$(document).bind("mousemove",j),$(document).bind("mouseup",k),c.preventDefault?c.preventDefault():c.returnValue=!1)},j=function(a){if(e){a=a||window.event;var b={x:a.screenX,y:a.screenY};f.x=f.x+(b.x-g.x),f.y=f.y+(b.y-g.y),g=b,$(d).css("left",f.x+"px"),$(d).css("top",f.y+"px"),a.preventDefault?a.preventDefault():a.returnValue=!1}},k=function(a){e&&(a=a||window.event,l(),e=!1)},l=function(){c&&($(c.document).unbind("mousemove"),$(c.document).unbind("mouseup"))};return{Register:function(a,b){d=a,c=b,$(c).bind("mousedown",i)}}}();!function(a){a.fn.espcms_dig=function(){a(this).unbind("click").bind("click",function(){var b=a(this).attr("data-url"),c=a(this).attr("data-title"),d=a(this).attr("data-w"),e=a(this).attr("data-h");parent.espcms_dialog(c,"iframe",b,d,e,"dialogname")})}}(jQuery);