function uploadInit(){var swfu;var settings={flash_url:"/js/ui/swfupload/Flash/swfupload.swf",upload_url:"/js/ui/swfupload/upload.php",post_params:{PHPSESSID:"11111"},file_size_limit:"100 MB",file_types:"*.mp3;",file_types_description:"选择上传文件",file_upload_limit:-1,file_queue_limit:0,debug:false,button_image_url:"/images/upload_2.jpg",button_width:"55",button_height:"15",button_placeholder_id:"spanButtonPlaceHolder",button_text:'',button_text_style:"",button_text_left_padding:12,button_text_top_padding:3,button_action:SWFUpload.BUTTON_ACTION.SELECT_FILE,button_cursor:SWFUpload.CURSOR.HAND,file_queue_error_handler:function(obj){$("#fsUploadProgressLine,#successLine").hide();$("#errorLine").html(obj.name+" 文件大小超出,限制100MB").show()},file_dialog_complete_handler:function(){this.startUpload()},upload_start_handler:function(){$("#successLine,#errorLine").hide();$("#fsUploadProgressLine").show()},upload_progress_handler:function(obj,currSize,allSize){$("#fsUploadProgress").css("width",currSize/allSize*100+"%")},upload_error_handler:function(){$("#fsUploadProgressLine,#successLine").hide();$("#errorLine").html("上传失败!").show()},upload_success_handler:function(obj,responseText){var p=eval("("+responseText+")");if(p.code==200){$("#fsUploadProgressLine,#errorLine").hide();var str='';$("#successLine").html(str+"插入《"+obj.name+"》").show()}else{$("#fsUploadProgressLine,#successLine").hide();$("#errorLine").html(p.msg).show()}swfu.addPostParam("filename",p.filename);$("#filename").val(p.filename)}};swfu=new SWFUpload(settings)}function insertFile(filename){var str='';$("#swfuploadDiv").data("editor").execCommand("insertHtml",str);$("#swfuploadDiv").closeDialog();$("#successLine").html("")}$(function(){uploadInit()});