(function(){var d=0,c,f;egg.thumbUploader=function(a){c=a||{};c.size&&"number"==typeof c.size&&(c.size=[c.size,c.size]);var b={absolute:!0,className:"BH-popup",closeTrigger:egg.thumbUploader.close};"creationCover"==c.uploadFor?egg.lightbox(egg.thumbUploader.getUploadContentCreationCover,b):"nocrop"==c.uploadFor?egg.lightbox(egg.thumbUploader.getUploadContentNoCrop,b):egg.lightbox(egg.thumbUploader.getUploadContent,b);egg("#eggThumbBtnOk").click(function(b){switch(d){case 2:b=egg("#cropperImage").attr("src");
var g=f.getCropRect(),e=c.param||"",e=e+("&type="+b.substr(b.lastIndexOf(".")+1,3)),e=e+("&size="+c.size[0]),e=e+("&sizeW="+c.size[0]+"&sizeH="+c.size[1]),e=e+("&x="+g.x+"&y="+g.y+"&w="+g.w+"&h="+g.h);egg("#ignoreCrop").attr("checked")&&(e+="&ignore=yes");"nocrop"==c.uploadFor&&(e+="&ignore=yes");c.saveImage&&(e+="&flag=1");0===e.indexOf("&")&&(e=e.substring(1));egg.ajax({method:"POST",url:c.cropperAction,param:e,loading:function(){egg("#eggThumbBtnOk").val("\u8655\u7406\u4e2d").attr("disabled",!0)},
success:function(a){egg("#eggThumbBtnOk").val("\u78ba\u5b9a").attr("disabled",!1);egg.thumbUploader.error(a,egg("#eggThumbMsg"))||(c.success&&c.success.call(this,a),egg.thumbUploader.close())},fail:function(){egg("#eggThumbMsg").html("\u8cc7\u6599\u67e5\u8a62\u932f\u8aa4!")}});break;default:egg("#eggThumbMsg").html("\u4e0a\u50b3\u4e2d\uff0c\u8acb\u7a0d\u5019......").show(),egg("#eggThumbBtnOk").val("\u8655\u7406\u4e2d").attr("disabled",!0),egg("#eggThumbModeFile").attr("checked")?(b=egg("#eggThumbForm"),
b.attr("action",a.uploadAction),b.get(0).submit()):egg.ajax({method:"POST",param:"img="+encodeURI(egg("#eggThumbUrl").val()),url:a.uploadAction,loading:function(){egg("#eggThumbBtnOk").val("\u8655\u7406\u4e2d").attr("disabled",!0)},success:function(a){egg("#eggThumbBtnOk").val("\u78ba\u5b9a").attr("disabled",!1);egg.thumbUploader.error(a,egg("#eggThumbMsg"))||egg.thumbUploader.cropping(a)}})}});egg("#eggThumbModeUrl").click(function(a){d=0;egg("#eggThumbFile").hide();egg("#eggThumbTruth").hide();
egg("#eggThumbUrlBlock").show();egg("#eggThumbMsg").hide();egg.lightbox.refresh()});egg("#eggThumbModeFile").click(function(a){d=0;egg("#eggThumbUrl").val("");egg("#eggThumbUrlImage").hide();egg("#eggThumbTruth").hide();egg("#eggThumbFile").show();egg("#eggThumbUrlBlock").hide();egg("#eggThumbMsg").hide();egg.lightbox.refresh()});egg("#eggThumbModeTruth").click(function(a){d=0;egg("#eggThumbFile").hide();egg("#eggThumbUrlImage").hide();egg("#eggThumbUrlBlock").hide();egg("#eggThumbMsg").html("\u53d6\u5f97\u8cc7\u6599\u4e2d\uff0c\u8acb\u7a0d\u5f8c...").show();
egg.thumbUploader.getTruthList(1);egg.lightbox.refresh()});egg("#eggThumbUrl").keyup(function(a){egg("#eggThumbUrlImage").attr("src",egg("#eggThumbUrl").val())}).focus(function(a){egg("#eggThumbUrl").get(0).select()});egg("#eggThumbUrlImage").load(function(a){egg("#eggThumbUrlImage").show().attr("eggThumbStatus","loaded").resizeImage(300);egg("#eggThumbMsg").hide();egg.lightbox.refresh()});egg("#eggThumbUrlImage").error(function(a){d=0;egg("#eggThumbUrlImage").hide().attr("eggThumbStatus","error");
egg("#eggThumbMsg").html("\u627e\u4e0d\u5230\u5716\u7247\uff0c\u53ef\u80fd\u662f\u5716\u6a94\u683c\u5f0f\u4e0d\u7b26\u6216\u7db2\u5740\u6709\u8aa4\u3002").show();egg.lightbox.refresh()})};egg.method.resizeImage=function(a,b){this.removeAttr("width").removeAttr("height");var c=this.attr("offsetWidth"),d=this.attr("offsetHeight");this.attr({originalWidth:c,originalHeight:d});c>a&&(d=parseInt(a/c*d,10),c=a);this.attr({width:c,height:d});return this};egg.thumbUploader.error=function(a,b){var c=!0;switch(a){case "ERR_NO_LOGIN":b.html("\u60a8\u5c1a\u672a\u767b\u5165!").show();
break;case "ERR_WRONG_TYPE":b.html("\u9019\u662f\u4e0d\u652f\u63f4\u7684\u6a94\u6848\u985e\u578b\uff0c\u8acb\u91cd\u65b0\u78ba\u8a8d\u3002").show();break;case "ERR_NO_IMAGE":b.html("\u627e\u4e0d\u5230\u5716\u7247!").show();break;case "ERR_CREATE_FAIL":b.html("\u88c1\u5207\u5716\u7247\u5931\u6557!").show();break;case "ERR_OUT_OF_LIMIT":case "ERR_OUT_OF_SIZE":b.html("\u8acb\u78ba\u8a8d\u5716\u7247\u6a94\u6848\u5927\u5c0f\u53ca\u5bec\u9ad8\u662f\u5426\u904e\u5927\u3002").show();break;case "ERR_URL_INCORRECT":b.html("\u8acb\u78ba\u8a8d\u60a8\u8f38\u5165\u7684\u7db2\u5740\u662f\u5426\u6b63\u78ba").show();
break;case "ERR_SYSTEM_FAIL":b.html("\u7cfb\u7d71\u5fd9\u788c\uff0c\u8acb\u7a0d\u5019\u518d\u8a66").show();break;default:b.hide(),c=!1}return c};egg.thumbUploader.uploadComplete=function(a){egg.thumbUploader.error(a,egg("#eggThumbMsg"))||(egg.thumbUploader.cropping(a),d=2,egg("#eggThumbMsg").hide())};egg.thumbUploader.cropping=function(a){egg(".BH-popintxt").html(function(){return"creationCover"==c.uploadFor?egg.thumbUploader.getCropperContentCreationCover(a):"nocrop"==c.uploadFor?egg.thumbUploader.getCropperContentNoCrop(a):
egg.thumbUploader.getCropperContent(a)});egg("#cropperImage").load(function(a){egg("#cropperImage").show().resizeImage(300);egg.lightbox.refresh();f=egg("#cropperImage").imageCropper({preview:egg("#previewImage").get(0),previewSize:c.size,fixed:c.fixed});"nocrop"==c.uploadFor&&(egg("#eggCropperMask").hide(),egg("#eggCropperDragDiv").hide(),egg("#eggCropperResizer").hide());d=2});egg("#btnPreviousStep").click(function(a){egg.thumbUploader.close();egg.thumbUploader(c);d=0});egg("#ignoreCrop").click(function(a){if(egg("#ignoreCrop").attr("checked")){egg("#cropperImage");
a=egg("#cropperImage").attr("originalWidth");var d=egg("#cropperImage").attr("originalHeight");a>c.size[0]&&(d=parseInt(c.size[0]/a*d,10),a=c.size[0]);d>c.size[1]&&(a=parseInt(c.size[1]/d*a,10),d=c.size[1]);var g=parseInt(c.size[0]/2-a/2,10),e=parseInt(c.size[1]/2-d/2,10);egg("#eggCropperPreviewImage").css({left:g+"px",top:e+"px",width:a+"px",height:d+"px"});egg("#eggCropperMask").hide();egg("#eggCropperDragDiv").hide();egg("#eggCropperResizer").hide()}else egg("#eggCropperMask").show(),egg("#eggCropperDragDiv").show(),
egg("#eggCropperResizer").show(),f.refreshPreview()})};egg.thumbUploader.getUploadContent=function(){var a;a='<p class="BH-poptitle">\u4e0a\u50b3\u7e2e\u5716</p>\n<div class="BH-popintxt">\n';a+='<table cellspacing="0" cellpadding="0">\n';a+="<tr>\n";a+='  <td valign="middle"><label><input checked="checked" type="radio" name="eggThumbMode" id="eggThumbModeFile">\u7531\u500b\u4eba\u96fb\u8166\u4e0a\u50b3</label></td>\n';a+='  <td valign="middle"><label><input type="radio" name="eggThumbMode" id="eggThumbModeTruth">\u7531\u5c0f\u5c4b\u5716\u7247\u7a7a\u9593</label></td>\n';
a+='  <td valign="middle"><label><input type="radio" name="eggThumbMode" id="eggThumbModeUrl">\u7531\u7db2\u8def\u5716\u7247\u64f7\u53d6</label></td>\n';a+="</tr>\n";a+="<tr>\n";a+='  <td colspan="3" align="left" height="45">\n';a+='    <form id="eggThumbForm" method="post" enctype="multipart/form-data" target="eggThumbIframe">\n';a+='      <input size="30" name="eggThumbFile" id="eggThumbFile" type="file" />\n';a+="    </form>\n";a+='    <iframe name="eggThumbIframe" id="eggThumbIframe" style="display:none;"></iframe>\n';
a+='    <div style="display:none;" id="eggThumbUrlBlock">\u5716\u7247\u7db2\u5740\uff1a<input size="30" id="eggThumbUrl" type="text" /><br />\n';a+='      <img id="eggThumbUrlImage" style="display:none;" />\n';a+="    </div>\n";a+='    <div style="display:none;height:330px;width:610px;overflow:auto" id="eggThumbTruth"></div>\n';a+='    <span id="eggThumbMsg" style="display:none;color:red;"></span>';a+="  </td>\n";a+="</tr>\n";a+="<tr>\n";a+='  <td colspan="3">\u652f\u63f4JPG\u3001GIF \u6216 PNG \u6a94\u6848\u3002(\u8acb\u6ce8\u610f\uff0c\u5716\u7247\u5167\u5bb9\u53d7\u7ad9\u898f\u9650\u5236\u3002)</td>\n';
a+="</tr>\n";a+="</table>\n";a+="</div>\n";a+='<p class="BH-popbtns">\n';a+='<input id="eggThumbBtnOk" style="width:100px;" type="button" value="\u78ba\u5b9a" />\n';a+='<input style="width:100px;" type="button" value="\u96e2\u958b" onclick="egg.thumbUploader.close();" />\n';return a+="</p>"};egg.thumbUploader.getUploadContentCreationCover=function(){var a;a='<p class="BH-poptitle">\u4e0a\u50b3\u5ba3\u50b3\u5716\u53ca\u7e2e\u5716</p>\n<div class="BH-popintxt">\n';a+='<table cellspacing="0" cellpadding="0">\n';
a+="<tr>\n";a+='  <td valign="middle"><label><input checked="checked" type="radio" name="eggThumbMode" id="eggThumbModeFile">\u7531\u500b\u4eba\u96fb\u8166\u4e0a\u50b3</label></td>\n';a+='  <td valign="middle"><label><input type="radio" name="eggThumbMode" id="eggThumbModeTruth">\u7531\u5c0f\u5c4b\u5716\u7247\u7a7a\u9593</label></td>\n';a+='  <td valign="middle"><label><input type="radio" name="eggThumbMode" id="eggThumbModeUrl">\u7531\u7db2\u8def\u5716\u7247\u64f7\u53d6</label></td>\n';a+="</tr>\n";
a+="<tr>\n";a+='  <td colspan="3" align="left" height="45">\n';a+='    <form id="eggThumbForm" method="post" enctype="multipart/form-data" target="eggThumbIframe">\n';a+='      <input size="30" name="eggThumbFile" id="eggThumbFile" type="file" />\n';a+="    </form>\n";a+='    <iframe name="eggThumbIframe" id="eggThumbIframe" style="display:none;"></iframe>\n';a+='    <div style="display:none;" id="eggThumbUrlBlock">\u5716\u7247\u7db2\u5740\uff1a<input size="30" id="eggThumbUrl" type="text" /><br />\n';
a+='      <img id="eggThumbUrlImage" style="display:none;" />\n';a+="    </div>\n";a+='    <div style="display:none;height:330px;width:610px;overflow:auto" id="eggThumbTruth"></div>\n';a+='    <span id="eggThumbMsg" style="display:none;color:red;"></span>';a+="  </td>\n";a+="</tr>\n";a+="<tr>\n";a+='  <td colspan="3">\u8acb\u9078\u64c7\u89e3\u6790\u5ea6 560x560 \u4ee5\u4e0a\u7684 JPG\u3001GIF \u6216 PNG \u5716\u6a94\u4ee5\u5229\u5ba3\u50b3\u3002\u5716\u7247\u5167\u5bb9\u53d7\u7ad9\u898f\u9650\u5236\u3002</td>\n';
a+="</tr>\n";a+="</table>\n";a+="</div>\n";a+='<p class="BH-popbtns">\n';a+='<input id="eggThumbBtnOk" style="width:100px;" type="button" value="\u78ba\u5b9a" />\n';a+='<input style="width:100px;" type="button" value="\u96e2\u958b" onclick="egg.thumbUploader.close();" />\n';return a+="</p>"};egg.thumbUploader.getUploadContentNoCrop=function(){var a;a='<p class="BH-poptitle">\u4e0a\u50b3\u5716\u7247</p>\n<div class="BH-popintxt">\n';a+='<table cellspacing="0" cellpadding="0">\n';a+="<tr>\n";a+='  <td valign="middle"><label><input checked="checked" type="radio" name="eggThumbMode" id="eggThumbModeFile">\u7531\u500b\u4eba\u96fb\u8166\u4e0a\u50b3</label></td>\n';
a+='  <td valign="middle"><label><input type="radio" name="eggThumbMode" id="eggThumbModeTruth">\u7531\u5c0f\u5c4b\u5716\u7247\u7a7a\u9593</label></td>\n';a+='  <td valign="middle"><label><input type="radio" name="eggThumbMode" id="eggThumbModeUrl">\u7531\u7db2\u8def\u5716\u7247\u64f7\u53d6</label></td>\n';a+="</tr>\n";a+="<tr>\n";a+='  <td colspan="3" align="left" height="45">\n';a+='    <form id="eggThumbForm" method="post" enctype="multipart/form-data" target="eggThumbIframe">\n';a+='      <input size="30" name="eggThumbFile" id="eggThumbFile" type="file" />\n';
a+="    </form>\n";a+='    <iframe name="eggThumbIframe" id="eggThumbIframe" style="display:none;"></iframe>\n';a+='    <div style="display:none;" id="eggThumbUrlBlock">\u5716\u7247\u7db2\u5740\uff1a<input size="30" id="eggThumbUrl" type="text" /><br />\n';a+='      <img id="eggThumbUrlImage" style="display:none;" />\n';a+="    </div>\n";a+='    <div style="display:none;height:330px;width:610px;overflow:auto" id="eggThumbTruth"></div>\n';a+='    <span id="eggThumbMsg" style="display:none;color:red;"></span>';
a+="  </td>\n";a+="</tr>\n";a+="<tr>\n";a+='  <td colspan="3">\u9650 JPG\u3001GIF \u6216 PNG \u6a94\u6848\u3002</td>\n';a+="</tr>\n";a+="</table>\n";a+="</div>\n";a+='<p class="BH-popbtns">\n';a+='<input id="eggThumbBtnOk" style="width:100px;" type="button" value="\u78ba\u5b9a" />\n';a+='<input style="width:100px;" type="button" value="\u96e2\u958b" onclick="egg.thumbUploader.close();" />\n';return a+="</p>"};egg.thumbUploader.getCropperContent=function(a){var b;b='<table cellspacing="0" cellpadding="0" class="BH-poptb1">\n<tr>\n';
b+='  <td colspan="2" valign="middle"><input type="button" value="\u4e0a\u4e00\u6b65" id="btnPreviousStep" /> <span id="eggThumbMsg" style="color:red;"></span></td>\n';b+="</tr>\n";b+="<tr>\n";b+='<td valign="top">\u9078\u53d6\u60a8\u60f3\u8981\u88c1\u5207\u7684\u5340\u584a\uff1a<br /><img style="display:none;" src="'+a+"?t="+(new Date).getTime()+'" id="cropperImage" /></td>\n';b+='<td valign="top" style="padding-left:5px;">\u9810\u89bd\uff1a<br /><div id="previewImage" style="width:120px;height:120px;" ></div></td>\n';
b+="</tr>\n";b+="<tr>\n";b+='  <td colspan="2" valign="middle"><label><input type="checkbox" id="ignoreCrop" value="yes" />\u6211\u4e0d\u9700\u8981\u88c1\u5207\u5716\u7247</label></td>\n';b+="</tr>\n";return b+="</table>\n"};egg.thumbUploader.getCropperContentCreationCover=function(a){var b;b='<table cellspacing="0" cellpadding="0" class="BH-poptb1">\n<tr>\n';b+='  <td colspan="2" valign="middle"><input type="button" value="\u4e0a\u4e00\u6b65" id="btnPreviousStep" /> <span id="eggThumbMsg" style="color:red;"></span></td>\n';
b+="</tr>\n";b+="<tr>\n";b+='<td valign="top" style="color:#FF0000">\u203b\u4e0b\u65b9\u539f\u5716\u6703\u65bc\u7ad9\u4e0a\u520a\u51fa\uff0c\u8acb\u6ce8\u610f\u9808\u7b26\u5408\u7ad9\u898f\uff01<br /><img style="display:none;" src="'+a+"?t="+(new Date).getTime()+'" id="cropperImage" /></td>\n';b+='<td valign="top" style="padding-left:5px;">\u7e2e\u5716\u9810\u89bd\uff1a<br /><div id="previewImage" style="width:120px;height:120px;" ></div></td>\n';b+="</tr>\n";b+="<tr>\n";b+='  <td colspan="2" valign="middle"><label><input type="checkbox" id="ignoreCrop" value="yes" />\u6211\u4e0d\u9700\u8981\u88c1\u5207\u5716\u7247</label></td>\n';
b+="</tr>\n";return b+="</table>\n"};egg.thumbUploader.getCropperContentNoCrop=function(a){var b;b='<table cellspacing="0" cellpadding="0" class="BH-poptb1">\n<tr>\n';b+='  <td colspan="2" valign="middle"><input type="button" value="\u4e0a\u4e00\u6b65" id="btnPreviousStep" /> <span id="eggThumbMsg" style="color:red;"></span></td>\n';b+="</tr>\n";b+="<tr>\n";b+='<td valign="top">\u9810\u89bd\uff1a<br /><img style="display:none;" src="'+a+"?t="+(new Date).getTime()+'" id="cropperImage" /></td>\n';b+=
"</tr>\n";return b+="</table>\n"};egg.thumbUploader.close=function(){egg.lightbox.close();d=0;try{document.body.removeChild(egg("#eggCropperMask").get(0)),document.body.removeChild(egg("#eggCropperDragDiv").get(0)),document.body.removeChild(egg("#eggCropperResizer").get(0))}catch(a){}};egg.thumbUploader.getTruthList=function(a){egg.ajax({url:"/ajax/listtruthimage2.php",param:"p="+a,success:function(b){if("ERR_NOLOGIN"==b)egg("#eggThumbMsg").html("\u8acb\u5148\u767b\u5165").show();else if(egg("#eggThumbMsg").hide(),
1==a)egg("#eggThumbTruth").html(b).show();else{var c=egg("#eggThumbTruth"+a).get(0),d=c.parentNode;egg(document.createElement("div")).html(b).appendTo(d);d.removeChild(c);egg("#eggThumbTruth").get(0).scrollTop=egg("#eggThumbTruth").get(0).scrollHeight}egg.lightbox.refresh()},fail:function(a){egg("#eggThumbMsg").html("\u767c\u751f\u932f\u8aa4, \u8acb\u7a0d\u5f8c\u518d\u8a66\u4e00\u6b21").show();egg.lightbox.refresh()}});egg.lightbox.refresh()}})();
(function(){egg.extend.imageCropper=function(d){d=d||{};d.previewSize=d.previewSize||[120,120];var c=!1,f=!1,a=this.image=egg(this.get(0)),b=a.attr("offsetWidth"),h=a.attr("offsetHeight");this.moveDrag=function(b){b=window.event||b;if(b.button===(egg.browser.ie?1:0)){c=!0;var d=b.clientY;a.attr({cropperLeft:b.clientX-egg("#eggCropperDragDiv").attr("offsetLeft"),cropperTop:d-egg("#eggCropperDragDiv").attr("offsetTop")});egg.event.preventDefault(b)}};this.moveDrop=function(a){a=window.event||a;c=!1;
egg.event.preventDefault(a)};this.moveDragging=function(b){if(c){b=window.event||b;var d=egg("#eggCropperDragDiv"),e=a.pos(),f=b.clientY,m=b.clientX-a.attr("cropperLeft"),f=f-a.attr("cropperTop"),k=a.attr("offsetWidth"),l=a.attr("offsetHeight"),g=d.attr("offsetWidth"),h=d.attr("offsetHeight"),q=d.attr("offsetLeft"),r=d.attr("offsetTop");m<e.x&&(m=e.x);f<e.y&&(f=e.y);k=e.x+k-g;l=e.y+l-h;m>k&&(m=k);f>l&&(f=l);d.css({left:m+"px",top:f+"px"});egg("#eggCropperDragImage").css({left:"-"+(q-e.x)+"px",top:"-"+
(r-e.y)+"px"});egg("#eggCropperResizer").css({left:q+g-3+"px",top:r+h-3+"px"});n();egg.event.stop(b);egg.event.preventDefault(b)}};var g=function(b){if(f){b=window.event||b;var c=egg("#eggCropperDragDiv"),e=a.pos(),g=a.attr("offsetWidth"),h=a.attr("offsetHeight"),k=b.clientX-e.x,l=b.clientY-e.y;b=c.attr("offsetLeft")-e.x;var e=c.attr("offsetTop")-e.y,k=k-b,l=l-e,p=d.fixed||void 0===d.fixed&&d.previewSize[0]==d.previewSize[1];p&&(l=parseInt(k/d.previewSize[0]*d.previewSize[1],10));if(1>k){if(p)return;
k=1}if(1>l){if(p)return;l=1}if(k+b>g){if(p)return;k=g-b}if(l+e>h){if(p)return;l=h-e}c.css({width:k+"px",height:l+"px"});egg("#eggCropperDragContainer").css({width:k+"px",height:l+"px"});egg("#eggCropperResizer").css({left:c.attr("offsetLeft")+k-5+"px",top:c.attr("offsetTop")+l-5+"px"});egg("#eggCropperCover").css({left:egg("#eggCropperResizer").attr("offsetLeft")-75+"px",top:egg("#eggCropperResizer").attr("offsetTop")-75+"px"});n()}},e=function(a){a=window.event||a;f=!1;try{document.body.removeChild(egg("#eggCropperCover").get(0))}catch(b){}egg.event.preventDefault(a)};
this.resizeDrag=function(a){a=window.event||a;f=!0;var b=document.createElement("div");egg(b).attr({id:"eggCropperCover",unselectable:"on"}).css({backgroundColor:"red",width:"150px",height:"150px",position:"absolute",left:egg("#eggCropperResizer").attr("offsetLeft")-75+"px",top:egg("#eggCropperResizer").attr("offsetTop")-75+"px",zIndex:104,cursor:"se-resize"}).mousemove(g).mouseup(e).mouseout(e).opacity(0);document.body.appendChild(b);egg.event.preventDefault(a)};egg.imageCropper.create.call(this,
d);var n=this.refreshPreview=function(){var c=egg("#eggCropperPreviewImage"),e=egg("#eggCropperDragDiv"),f=d.previewSize[0]/e.attr("offsetWidth"),g=d.previewSize[1]/e.attr("offsetHeight"),m=a.pos();c.css({left:"-"+parseInt((e.attr("offsetLeft")-m.x)*f,10)+"px",top:"-"+parseInt((e.attr("offsetTop")-m.y)*g,10)+"px"});c.css({width:parseInt(b*f,10)+"px",height:parseInt(h*g,10)+"px"})};d&&d.preview&&(egg(d.preview).css({backgroundColor:"white",width:d.previewSize[0]+"px",height:d.previewSize[1]+"px",overflow:"hidden",
position:"relative"}),egg(d.preview).html('<img id="eggCropperPreviewImage" src='+a.attr("src")+' style="position:absolute;left:0px;top:0px;" />'),n());this.getCropRect=function(){var b=egg("#eggCropperDragDiv"),c=a.attr("originalWidth")/a.attr("offsetWidth"),d=a.pos(),e=parseInt((b.attr("offsetLeft")-d.x)*c,10),d=parseInt((b.attr("offsetTop")-d.y)*c,10),f=parseInt(b.attr("offsetWidth")*c,10),b=parseInt(b.attr("offsetHeight")*c,10);return{x:e,y:d,w:f,h:b}};return this};egg.imageCropper={create:function(d){var c=
this.image.pos(),f=this.image.attr("offsetWidth"),a=this.image.attr("offsetHeight"),b=document.createElement("div");egg(b).attr("id","eggCropperMask").css({width:f+"px",height:a+"px",position:"absolute",left:c.x+"px",top:c.y+"px",backgroundColor:"#333333",zIndex:101}).opacity(.7);var h=d.previewSize[0];d=d.previewSize[1];f<h&&(d=parseInt(f/h*d,10),h=f);a<d&&(h=parseInt(a/d*h,10),d=a);var g=c.x+parseInt(f/2-h/2,10),e=c.y+parseInt(a/2-d/2,10),n=document.createElement("div");egg(n).attr({id:"eggCropperDragDiv",
unselectable:"on"}).css({"-moz-user-select":"none",width:h+"px",height:d+"px",position:"absolute",left:g+"px",top:e+"px",zIndex:102}).html('<div id="eggCropperDragContainer"><img id="eggCropperDragImage" /></div>');document.body.appendChild(b);document.body.appendChild(n);egg("#eggCropperDragContainer").css({width:h+"px",height:d+"px",position:"relative",overflow:"hidden"});egg("#eggCropperDragImage").attr("src",this.image.attr("src")).css({width:f+"px",height:a+"px",position:"absolute",left:"-"+
(g-c.x)+"px",top:"-"+(e-c.y)+"px",cursor:"move"}).mousedown(this.moveDrag).mouseup(this.moveDrop).mouseout(this.moveDrop).mousemove(this.moveDragging);c=egg("#eggCropperDragDiv");f=document.createElement("div");egg(f).attr({id:"eggCropperResizer",unselectable:"on"}).css({width:"12px",height:"12px",position:"absolute",left:c.attr("offsetLeft")+c.attr("offsetWidth")-3+"px",top:c.attr("offsetTop")+c.attr("offsetHeight")-3+"px",backgroundColor:"#FFFFCF",border:"solid 1px black",fontSize:"1pt",zIndex:103,
cursor:"se-resize"}).mousedown(this.resizeDrag);document.body.appendChild(f)}}})();