function upLoadPhoto(){$("#winPhoto").window("open")}function onOpenWinPhoto(){$("#image").cropper("replace","images/bg.png",true)}function onCloseWinPhoto(){}function repeatNewSelect(){$("#inputImage").click()}function getImageByCode(d,c,g,b,e,a){if(d){$("#"+g).attr("src","images/bg.png");var f=base_path+"lib/images/list.do";var h={};h["limit[0].condition"]="code";h["limit[0].value"]=d;h["limit[1].condition"]="type";h["limit[1].value"]=c;$.post(f,h,function(i){if(i.rows.length>0){if(b){$("."+b).html('')}$("#"+g).attr("src",i.rows[0].image);if(!a){$("#"+g).css({width:"180px",height:"180px"})}if(e){$(".cir-handler-title").hide();$(".rdr-image").show()}}else{if(e){$(".cir-handler-title").show();$(".rdr-image").hide()}}},"json")}}function deleteImageByCode(b,a,d){if(b){var c=base_path+"lib/images/deleteRecords.do";var e={};e["limit[0].condition"]="code";e["limit[0].value"]=b;e["limit[1].condition"]="type";e["limit[1].value"]=a;$.post(c,e,function(f){if(f.status=="0"){openMessageDlg(f.message);$("#"+d).attr("src","images/bg.png")}else{openMessageDlg(f.message)}},"json")}}function saveImageByCode(d,c){if(d){if(vBase64Image==1){var e=$("#photourl").attr("src");if(e.indexOf("data:image/jpeg;base64")>-1||e.indexOf("data:image/png;base64")>-1){var b=base_path+"lib/images/save.do";var a={};a.code=d;a.type=c;a.image=e;$.post(b,a,function(f){vBase64Image=0;openMessageDlg(f.message);if(f.status=="0"){getImageByCode(d,c,"photourl")}},"json")}}}};