﻿Ext.grid.RowExpander=function(config){Ext.apply(this,config);this.addEvents({beforeexpand:true,expand:true,beforecollapse:true,collapse:true});Ext.grid.RowExpander.superclass.constructor.call(this);if(this.tpl){if(typeof this.tpl=='string'){this.tpl=new Ext.Template(this.tpl)}this.tpl.compile()}this.state={};this.bodyContent={}}; 
Ext.extend(Ext.grid.RowExpander,Ext.util.Observable,{header:"",width:20,sortable:false,fixed:true,menuDisabled:true,dataIndex:'',id:'expander',lazyRender:true,enableCaching:true,getRowClass:function(record,rowIndex,p,ds){p.cols=p.cols-1;var content=this.bodyContent[record.id];if(!content&&!this.lazyRender){content=this.getBodyContent(record,rowIndex)}if(content){p.body=content}return this.state[record.id]?'x-grid3-row-expanded':'x-grid3-row-collapsed'},init:function(grid){this.grid=grid;var view=grid.getView();view.getRowClass=this.getRowClass.createDelegate(this);view.enableRowBody=true;grid.on('render',function(){view.mainBody.on('mousedown',this.onMouseDown,this)},this)},getBodyContent:function(record,index){if(!this.enableCaching){return this.tpl.apply(record.data)}var content=this.bodyContent[record.id];if(!content){content=this.tpl.apply(record.data);this.bodyContent[record.id]=content}return content},onMouseDown:function(e,t){if(t.className=='x-grid3-row-expander'){e.stopEvent();var row=e.getTarget('.x-grid3-row');this.toggleRow(row)}},renderer:function(v,p,record){p.cellAttr='rowspan="2"';return'<div class="x-grid3-row-expander">&#160;</div>'},beforeExpand:function(record,body,rowIndex){if(this.fireEvent('beforeexpand',this,record,body,rowIndex)!==false){if(this.tpl&&this.lazyRender){body.innerHTML=this.getBodyContent(record,rowIndex)}return true}else{return false}},toggleRow:function(row){if(typeof row=='number'){row=this.grid.view.getRow(row)}this[Ext.fly(row).hasClass('x-grid3-row-collapsed')?'expandRow':'collapseRow'](row)},expandRow:function(row){if(typeof row=='number'){row=this.grid.view.getRow(row)}var record=this.grid.store.getAt(row.rowIndex);var body=Ext.DomQuery.selectNode('tr:nth(2) div.x-grid3-row-body',row);if(this.beforeExpand(record,body,row.rowIndex)){this.state[record.id]=true;Ext.fly(row).replaceClass('x-grid3-row-collapsed','x-grid3-row-expanded');this.fireEvent('expand',this,record,body,row.rowIndex)}},collapseRow:function(row){if(typeof row=='number'){row=this.grid.view.getRow(row)}var record=this.grid.store.getAt(row.rowIndex);var body=Ext.fly(row).child('tr:nth(1) div.x-grid3-row-body',true);if(this.fireEvent('beforcollapse',this,record,body,row.rowIndex)!==false){this.state[record.id]=false;Ext.fly(row).replaceClass('x-grid3-row-expanded','x-grid3-row-collapsed');this.fireEvent('collapse',this,record,body,row.rowIndex)}}});

Ext.app.SearchField=Ext.extend(Ext.form.TwinTriggerField,{initComponent:function(){Ext.app.SearchField.superclass.initComponent.call(this);this.on('specialkey',function(f,e){if(e.getKey()==e.ENTER){this.onTrigger2Click()}},this)},validationEvent:false,validateOnBlur:false,trigger1Class:'x-form-clear-trigger',trigger2Class:'x-form-search-trigger',hideTrigger1:true,width:180,hasSearch:false,paramName:'query',onTrigger1Click:function(){if(this.hasSearch){this.el.dom.value='';var o={start:0};this.store.baseParams=this.store.baseParams||{};this.store.baseParams[this.paramName]='';this.store.reload({params:o});this.triggers[0].hide();this.hasSearch=false}},onTrigger2Click:function(){var v=this.getRawValue();if(v.length<1){this.onTrigger1Click();return}var o={start:0};this.store.baseParams=this.store.baseParams||{};this.store.baseParams[this.paramName]=v;this.store.reload({params:o});this.hasSearch=true;this.triggers[0].show()}});


Ext.ux.TreeCheckNodeUI=function(){this.checkModel='multiple';this.onlyLeafCheckable=false;Ext.ux.TreeCheckNodeUI.superclass.constructor.apply(this,arguments)};Ext.extend(Ext.ux.TreeCheckNodeUI,Ext.tree.TreeNodeUI,{renderElements:function(n,a,targetNode,bulkRender){var tree=n.getOwnerTree();this.checkModel=tree.checkModel||this.checkModel;this.onlyLeafCheckable=tree.onlyLeafCheckable||false;this.indentMarkup=n.parentNode?n.parentNode.ui.getChildIndent():'';var cb=(!this.onlyLeafCheckable||a.leaf);var href=a.href?a.href:Ext.isGecko?"":"#";var buf=['<li class="x-tree-node"><div ext:tree-node-id="',n.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',a.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img src="',a.icon||this.emptyIcon,'" class="x-tree-node-icon',(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),'" unselectable="on" />',cb?('<input class="x-tree-node-cb" type="checkbox" '+(a.checked?'checked="checked" />':'/>')):'','<a hidefocus="on" class="x-tree-node-anchor" href="',href,'" tabIndex="1" ',a.hrefTarget?' target="'+a.hrefTarget+'"':"",'><span unselectable="on">',n.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join('');var nel;if(bulkRender!==true&&n.nextSibling&&(nel=n.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",nel,buf)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",targetNode,buf)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var cs=this.elNode.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];var index=3;if(cb){this.checkbox=cs[3];Ext.fly(this.checkbox).on('click',this.check.createDelegate(this,[null]));index++}this.anchor=cs[index];this.textNode=cs[index].firstChild},check:function(checked){var n=this.node;var tree=n.getOwnerTree();this.checkModel=tree.checkModel||this.checkModel;if(checked===null){checked=this.checkbox.checked}else{this.checkbox.checked=checked}n.attributes.checked=checked;tree.fireEvent('check',n,checked);if(this.checkModel=='single'){var checkedNodes=tree.getChecked();for(var i=0;i<checkedNodes.length;i++){var node=checkedNodes[i];if(node.id!=n.id){node.getUI().checkbox.checked=false;node.attributes.checked=false;tree.fireEvent('check',node,false)}}}else if(!this.onlyLeafCheckable){if(this.checkModel=='cascade'||this.checkModel=='parentCascade'){var parentNode=n.parentNode;if(parentNode!==null){this.parentCheck(parentNode,checked)}}if(this.checkModel=='cascade'||this.checkModel=='childCascade'){if(!n.expanded&&!n.childrenRendered){n.expand(false,false,this.childCheck)}else{this.childCheck(n)}}}},childCheck:function(node){var a=node.attributes;if(!a.leaf){var cs=node.childNodes;var csui;for(var i=0;i<cs.length;i++){csui=cs[i].getUI();if(csui.checkbox.checked^a.checked)csui.check(a.checked)}}},parentCheck:function(node,checked){var checkbox=node.getUI().checkbox;if(typeof checkbox=='undefined')return;if(!(checked^checkbox.checked))return;if(!checked&&this.childHasChecked(node))return;checkbox.checked=checked;node.attributes.checked=checked;node.getOwnerTree().fireEvent('check',node,checked);var parentNode=node.parentNode;if(parentNode!==null){this.parentCheck(parentNode,checked)}},childHasChecked:function(node){var childNodes=node.childNodes;if(childNodes||childNodes.length>0){for(var i=0;i<childNodes.length;i++){if(childNodes[i].getUI().checkbox.checked)return true}}return false},toggleCheck:function(value){var cb=this.checkbox;if(cb){var checked=(value===undefined?!cb.checked:value);this.check(checked)}}});

var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(settings){this.initSWFUpload(settings)}}SWFUpload.prototype.initSWFUpload=function(settings){try{this.customSettings={};this.settings=settings;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(ex){delete SWFUpload.instances[this.movieName];throw ex;}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 Beta 5 2008-01-29";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(settingName,defaultValue){this.settings[settingName]=(this.settings[settingName]==undefined)?defaultValue:this.settings[settingName]};this.ensureDefault("upload_url","");this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000;font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+new Date().getTime()}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){var targetElement,tempParent;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";}targetElement=document.getElementById(this.settings.button_placeholder_id);if(targetElement==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;}tempParent=document.createElement("div");tempParent.innerHTML=this.getFlashHTML();targetElement.parentNode.replaceChild(tempParent.firstChild,targetElement);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />','</object>'].join("")};SWFUpload.prototype.getFlashVars=function(){var paramString=this.buildParamString();var httpSuccessString=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(httpSuccessString),"&amp;params=",encodeURIComponent(paramString),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element";}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var postParams=this.settings.post_params;var paramStringPairs=[];if(typeof(postParams)==="object"){for(var name in postParams){if(postParams.hasOwnProperty(name)){paramStringPairs.push(encodeURIComponent(name.toString())+"="+encodeURIComponent(postParams[name].toString()))}}}return paramStringPairs.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var movieElement=null;movieElement=this.getMovieElement();if(movieElement&&typeof(movieElement.CallFunction)==="unknown"){for(var i in movieElement){try{if(typeof(movieElement[i])==="function"){movieElement[i]=null}}catch(ex1){}}try{movieElement.parentNode.removeChild(movieElement)}catch(ex){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(ex2){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:",this.settings.upload_url,"\n","\t","flash_url:",this.settings.flash_url,"\n","\t","use_query_string:",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:",this.settings.requeue_on_error.toString(),"\n","\t","http_success:",this.settings.http_success.join(", "),"\n","\t","file_post_name:",this.settings.file_post_name,"\n","\t","post_params:",this.settings.post_params.toString(),"\n","\t","file_types:",this.settings.file_types,"\n","\t","file_types_description:",this.settings.file_types_description,"\n","\t","file_size_limit:",this.settings.file_size_limit,"\n","\t","file_upload_limit:",this.settings.file_upload_limit,"\n","\t","file_queue_limit:",this.settings.file_queue_limit,"\n","\t","debug:",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:",this.settings.button_placeholder_id.toString(),"\n","\t","button_image_url:",this.settings.button_image_url.toString(),"\n","\t","button_width:",this.settings.button_width.toString(),"\n","\t","button_height:",this.settings.button_height.toString(),"\n","\t","button_text:",this.settings.button_text.toString(),"\n","\t","button_text_style:",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding:",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:",this.settings.button_action.toString(),"\n","\t","button_disabled:",this.settings.button_disabled.toString(),"\n","\t","custom_settings:",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(name,value,default_value){if(value==undefined){return(this.settings[name]=default_value)}else{return(this.settings[name]=value)}};SWFUpload.prototype.getSetting=function(name){if(this.settings[name]!=undefined){return this.settings[name]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+'</invoke>');returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed";}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(fileID){this.callFlash("StartUpload",[fileID])};SWFUpload.prototype.cancelUpload=function(fileID,triggerErrorEvent){if(triggerErrorEvent!==false){triggerErrorEvent=true}this.callFlash("CancelUpload",[fileID,triggerErrorEvent])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(statsObject){this.callFlash("SetStats",[statsObject])};SWFUpload.prototype.getFile=function(fileID){if(typeof(fileID)==="number"){return this.callFlash("GetFileByIndex",[fileID])}else{return this.callFlash("GetFile",[fileID])}};SWFUpload.prototype.addFileParam=function(fileID,name,value){return this.callFlash("AddFileParam",[fileID,name,value])};SWFUpload.prototype.removeFileParam=function(fileID,name){this.callFlash("RemoveFileParam",[fileID,name])};SWFUpload.prototype.setUploadURL=function(url){this.settings.upload_url=url.toString();this.callFlash("SetUploadURL",[url])};SWFUpload.prototype.setPostParams=function(paramsObject){this.settings.post_params=paramsObject;this.callFlash("SetPostParams",[paramsObject])};SWFUpload.prototype.addPostParam=function(name,value){this.settings.post_params[name]=value;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(name){delete this.settings.post_params[name];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(types,description){this.settings.file_types=types;this.settings.file_types_description=description;this.callFlash("SetFileTypes",[types,description])};SWFUpload.prototype.setFileSizeLimit=function(fileSizeLimit){this.settings.file_size_limit=fileSizeLimit;this.callFlash("SetFileSizeLimit",[fileSizeLimit])};SWFUpload.prototype.setFileUploadLimit=function(fileUploadLimit){this.settings.file_upload_limit=fileUploadLimit;this.callFlash("SetFileUploadLimit",[fileUploadLimit])};SWFUpload.prototype.setFileQueueLimit=function(fileQueueLimit){this.settings.file_queue_limit=fileQueueLimit;this.callFlash("SetFileQueueLimit",[fileQueueLimit])};SWFUpload.prototype.setFilePostName=function(filePostName){this.settings.file_post_name=filePostName;this.callFlash("SetFilePostName",[filePostName])};SWFUpload.prototype.setUseQueryString=function(useQueryString){this.settings.use_query_string=useQueryString;this.callFlash("SetUseQueryString",[useQueryString])};SWFUpload.prototype.setRequeueOnError=function(requeueOnError){this.settings.requeue_on_error=requeueOnError;this.callFlash("SetRequeueOnError",[requeueOnError])};SWFUpload.prototype.setHTTPSuccess=function(http_status_codes){if(typeof http_status_codes==="string"){http_status_codes=http_status_codes.replace(" ","").split(",")}this.settings.http_success=http_status_codes;this.callFlash("SetHTTPSuccess",[http_status_codes])};SWFUpload.prototype.setDebugEnabled=function(debugEnabled){this.settings.debug_enabled=debugEnabled;this.callFlash("SetDebugEnabled",[debugEnabled])};SWFUpload.prototype.setButtonImageURL=function(buttonImageURL){if(buttonImageURL==undefined){buttonImageURL=""}this.settings.button_image_url=buttonImageURL;this.callFlash("SetButtonImageURL",[buttonImageURL])};SWFUpload.prototype.setButtonDimensions=function(width,height){this.settings.button_width=width;this.settings.button_height=height;var movie=this.getMovieElement();if(movie!=undefined){movie.style.width=width+"px";movie.style.height=height+"px"}this.callFlash("SetButtonDimensions",[width,height])};SWFUpload.prototype.setButtonText=function(html){this.settings.button_text=html;this.callFlash("SetButtonText",[html])};SWFUpload.prototype.setButtonTextPadding=function(left,top){this.settings.button_text_top_padding=top;this.settings.button_text_left_padding=left;this.callFlash("SetButtonTextPadding",[left,top])};SWFUpload.prototype.setButtonTextStyle=function(css){this.settings.button_text_style=css;this.callFlash("SetButtonTextStyle",[css])};SWFUpload.prototype.setButtonDisabled=function(isDisabled){this.settings.button_disabled=isDisabled;this.callFlash("SetButtonDisabled",[isDisabled])};SWFUpload.prototype.setButtonAction=function(buttonAction){this.settings.button_action=buttonAction;this.callFlash("SetButtonAction",[buttonAction])};SWFUpload.prototype.setButtonCursor=function(cursor){this.settings.button_cursor=cursor;this.callFlash("SetButtonCursor",[cursor])};SWFUpload.prototype.queueEvent=function(handlerName,argumentArray){if(argumentArray==undefined){argumentArray=[]}else if(!(argumentArray instanceof Array)){argumentArray=[argumentArray]}var self=this;if(typeof this.settings[handlerName]==="function"){this.eventQueue.push(function(){this.settings[handlerName].apply(this,argumentArray)});setTimeout(function(){self.executeNextEvent()},0)}else if(this.settings[handlerName]!==null){throw"Event handler "+handlerName+" is unknown or is not a function";}};SWFUpload.prototype.executeNextEvent=function(){var f=this.eventQueue?this.eventQueue.shift():null;if(typeof(f)==="function"){f.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(file){var reg=/[$]([0-9a-f]{4})/i;var unescapedPost={};var uk;if(file!=undefined){for(var k in file.post){if(file.post.hasOwnProperty(k)){uk=k;var match;while((match=reg.exec(uk))!==null){uk=uk.replace(match[0],String.fromCharCode(parseInt("0x"+match[1],16)))}unescapedPost[uk]=file.post[k]}}file.post=unescapedPost}return file};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(ex){return false}};SWFUpload.prototype.flashReady=function(){var movieElement=this.getMovieElement();if(!movieElement){this.debug("Flash called back ready but the flash movie can't be found.");return}this.cleanUp(movieElement);this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.cleanUp=function(movieElement){try{if(this.movieElement&&typeof(movieElement.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var key in movieElement){try{if(typeof(movieElement[key])==="function"){movieElement[key]=null}}catch(ex){}}}}catch(ex1){}window["__flash__removeCallback"]=function(instance,name){try{if(instance){instance[name]=null}}catch(flashEx){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("file_queued_handler",file)};SWFUpload.prototype.fileQueueError=function(file,errorCode,message){file=this.unescapeFilePostParams(file);this.queueEvent("file_queue_error_handler",[file,errorCode,message])};SWFUpload.prototype.fileDialogComplete=function(numFilesSelected,numFilesQueued){this.queueEvent("file_dialog_complete_handler",[numFilesSelected,numFilesQueued])};SWFUpload.prototype.uploadStart=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("return_upload_start_handler",file)};SWFUpload.prototype.returnUploadStart=function(file){var returnValue;if(typeof this.settings.upload_start_handler==="function"){file=this.unescapeFilePostParams(file);returnValue=this.settings.upload_start_handler.call(this,file)}else if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function";}if(returnValue===undefined){returnValue=true}returnValue=!!returnValue;this.callFlash("ReturnUploadStart",[returnValue])};SWFUpload.prototype.uploadProgress=function(file,bytesComplete,bytesTotal){file=this.unescapeFilePostParams(file);this.queueEvent("upload_progress_handler",[file,bytesComplete,bytesTotal])};SWFUpload.prototype.uploadError=function(file,errorCode,message){file=this.unescapeFilePostParams(file);this.queueEvent("upload_error_handler",[file,errorCode,message])};SWFUpload.prototype.uploadSuccess=function(file,serverData){file=this.unescapeFilePostParams(file);this.queueEvent("upload_success_handler",[file,serverData])};SWFUpload.prototype.uploadComplete=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("upload_complete_handler",file)};SWFUpload.prototype.debug=function(message){this.queueEvent("debug_handler",message)};SWFUpload.prototype.debugMessage=function(message){if(this.settings.debug){var exceptionMessage,exceptionValues=[];if(typeof message==="object"&&typeof message.name==="string"&&typeof message.message==="string"){for(var key in message){if(message.hasOwnProperty(key)){exceptionValues.push(key+": "+message[key])}}exceptionMessage=exceptionValues.join("\n")||"";exceptionValues=exceptionMessage.split("\n");exceptionMessage="EXCEPTION: "+exceptionValues.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(exceptionMessage)}else{SWFUpload.Console.writeLine(message)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(message){var console,documentForm;try{console=document.getElementById("SWFUpload_Console");if(!console){documentForm=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(documentForm);console=document.createElement("textarea");console.id="SWFUpload_Console";console.style.fontFamily="monospace";console.setAttribute("wrap","off");console.wrap="off";console.style.overflow="auto";console.style.width="700px";console.style.height="350px";console.style.margin="5px";documentForm.appendChild(console)}console.value+=message+"\n";console.scrollTop=console.scrollHeight-console.clientHeight}catch(ex){alert("Exception: "+ex.name+" Message: "+ex.message)}};
Ext.namespace('Ext.ux');Ext.ux.SwfUploadPanel=Ext.extend(Ext.grid.GridPanel,{strings:{text_add:'添加文件',text_upload:'上传文件',text_cancel:'取消上传',text_clear:'清除队列',text_progressbar:'上传进度条',text_remove:'移除文件',text_remove_sure:'你确定要从队列中移除文件吗?',text_error:'错误',text_uploading:'上传文件中: {0} ({1} of {2})',header_filename:'文件名称',header_size:'文件大小',header_status:'状态',status:{0:'队列',1:'上传中...',2:'完成',3:'错误',4:'用户取消'},error_queue_exceeded:'选择的文件超过队列的最大数量.',error_queue_slots_0:'没有上传空位',error_queue_slots_1:'仅有一个上传空位',error_queue_slots_2:'仅有{0}剩余空位',error_size_exceeded:'被选择的文件尺寸超过被允许的限制',error_zero_byte_file:'0字节文件.',error_invalid_filetype:'无效的文件类型.',error_file_not_found:'上传错误.',error_security_error:'安全错误。 不允许公布到不同的url.'},single_select:false,confirm_delete:true,file_types:"*.*",file_types_description:"允许的文件类型",file_size_limit:"1024",file_upload_limit:"10",file_queue_limit:"10",file_post_name:"Filedata",flash_url:"/home/bin/upload/swfupload.swf",autoExpandColumn:'name',enableColumnResize:false,enableColumnMove:false,upload_cancelled:false,initComponent:function(){this.addEvents('swfUploadLoaded','fileQueued','startUpload','fileUploadError','fileUploadSuccess','fileUploadComplete','allUploadsComplete','removeFiles','removeAllFiles');this.rec=Ext.data.Record.create([{name:'name'},{name:'size'},{name:'id'},{name:'type'},{name:'creationdate',type:'date',dateFormat:'m/d/Y'},{name:'status'}]);this.store=new Ext.data.Store({reader:new Ext.data.JsonReader({id:'id'},this.rec)});this.columns=[{id:'name',header:this.strings.header_filename,dataIndex:'name'},{id:'size',header:this.strings.header_size,width:80,dataIndex:'size',renderer:this.formatBytes},{id:'status',header:this.strings.header_status,width:80,dataIndex:'status',renderer:this.formatStatus.createDelegate(this)}];this.sm=new Ext.grid.RowSelectionModel({singleSelect:this.single_select});this.progress_bar=new Ext.ProgressBar({text:this.strings.text_progressbar});this.tbar=[{text:this.strings.text_add,iconCls:'SwfUploadPanel_iconAdd',xhandler:function(){if(this.single_select){this.suo.selectFile()}else{this.suo.selectFiles()}},xscope:this},'->',{text:this.strings.text_cancel,iconCls:'SwfUploadPanel_iconCancel',handler:this.stopUpload,scope:this,hidden:true},{text:this.strings.text_upload,iconCls:'SwfUploadPanel_iconUpload',handler:this.startUpload,scope:this,hidden:true},{text:this.strings.text_clear,iconCls:'SwfUploadPanel_iconClear',handler:this.removeAllFiles,scope:this,hidden:false}];this.bbar=[this.progress_bar];this.addListener({keypress:{fn:function(e){if(this.confirm_delete){if(e.getKey()==e.DELETE){Ext.MessageBox.confirm(this.strings.text_remove,this.strings.text_remove_sure,function(e){if(e=='yes'){this.removeFiles()}},this)}}else{this.removeFiles(this)}},scope:this},contextmenu:function(e){e.stopEvent()},render:{fn:function(){this.resizeProgressBar();this.addBtn=this.getTopToolbar().items.items[0];this.cancelBtn=this.getTopToolbar().items.items[2];this.uploadBtn=this.getTopToolbar().items.items[3];this.clearBtn=this.getTopToolbar().items.items[4];this.on('resize',this.resizeProgressBar,this)},scope:this}});this.on('render',function(){var suoID=Ext.id();var em=this.addBtn.el.child('em');em.setStyle({position:'relative',display:'block'});em.createChild({tag:'div',id:suoID});this.suo=new SWFUpload({button_placeholder_id:suoID,button_width:em.getWidth(),button_height:em.getHeight(),button_cursor:SWFUpload.CURSOR.HAND,button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,upload_url:this.upload_url,post_params:this.post_params,file_post_name:this.file_post_name,file_size_limit:this.file_size_limit,file_queue_limit:this.file_queue_limit,file_types:this.file_types,file_types_description:this.file_types_description,file_upload_limit:this.file_upload_limit,flash_url:this.flash_url,swfupload_loaded_handler:this.swfUploadLoaded.createDelegate(this),file_dialog_start_handler:this.fileDialogStart.createDelegate(this),file_queued_handler:this.fileQueue.createDelegate(this),file_queue_error_handler:this.fileQueueError.createDelegate(this),file_dialog_complete_handler:this.fileDialogComplete.createDelegate(this),upload_start_handler:this.uploadStart.createDelegate(this),upload_progress_handler:this.uploadProgress.createDelegate(this),upload_error_handler:this.uploadError.createDelegate(this),upload_success_handler:this.uploadSuccess.createDelegate(this),upload_complete_handler:this.uploadComplete.createDelegate(this)});Ext.get(this.suo.movieName).setStyle({position:'absolute',top:0,left:0})},this);Ext.ux.SwfUploadPanel.superclass.initComponent.call(this)},resizeProgressBar:function(){this.progress_bar.setWidth(this.getBottomToolbar().el.getWidth()-5);Ext.fly(this.progress_bar.el.dom.firstChild.firstChild).applyStyles("height: 16px")},formatStatus:function(status){return this.strings.status[status]},formatBytes:function(size){if(!size){size=0}var suffix=["B","KB","MB","GB"];var result=size;size=parseInt(size,10);result=size+" "+suffix[0];var loop=0;while(size/1024>1){size=size/1024;loop++}result=Math.round(size)+" "+suffix[loop];return result;if(isNaN(bytes)){return('')}var unit,val;if(bytes<999){unit='B';val=(!bytes&&this.progressRequestCount>=1)?'~':bytes}else if(bytes<999999){unit='kB';val=Math.round(bytes/1000)}else if(bytes<999999999){unit='MB';val=Math.round(bytes/100000)/10}else if(bytes<999999999999){unit='GB';val=Math.round(bytes/100000000)/10}else{unit='TB';val=Math.round(bytes/100000000000)/10}return(val+' '+unit)},swfUploadLoaded:function(){this.fireEvent('swfUploadLoaded',this)},fileDialogStart:function(){this.fireEvent('fileDialogStart',this)},fileQueue:function(file){file.status=0;r=new this.rec(file);r.id=file.id;this.store.add(r);this.fireEvent('fileQueued',this,file)},fileQueueError:function(file,code,message){switch(code){case-100:var slots;switch(message){case'0':slots=this.strings.error_queue_slots_0;break;case'1':slots=this.strings.error_queue_slots_1;break;default:slots=String.format(this.strings.error_queue_slots_2,message)}Ext.MessageBox.alert(this.strings.text_error,String.format(this.strings.error_queue_exceeded+' '+slots,this.file_queue_limit));break;case-110:Ext.MessageBox.alert(this.strings.text_error,String.format(this.strings.error_size_exceeded,this.formatBytes(this.file_size_limit*1024)));break;case-120:Ext.MessageBox.alert(this.strings.text_error,this.strings.error_zero_byte_file);break;case-130:Ext.MessageBox.alert(this.strings.text_error,this.strings.error_invalid_filetype);break}this.fireEvent('fileQueueError',this,file,code,'队列错误')},fileDialogComplete:function(file_count){if(file_count>0){this.uploadBtn.show()}this.addBtn.show();this.clearBtn.show();this.fireEvent('fileDialogComplete',this,file_count)},uploadStart:function(file){this.fireEvent('uploadStart',this,file);return true},uploadProgress:function(file,bytes_completed,bytes_total){this.store.getById(file.id).set('status',1);this.store.getById(file.id).commit();this.progress_bar.updateProgress(bytes_completed/bytes_total,String.format(this.strings.text_uploading,file.name,this.formatBytes(bytes_completed),this.formatBytes(bytes_total)));this.fireEvent('uploadProgress',this,file,bytes_completed,bytes_total)},uploadError:function(file,error,code){switch(error){case-200:Ext.MessageBox.alert(this.strings.text_error,this.strings.error_file_not_found);break;case-230:Ext.MessageBox.alert(this.strings.text_error,this.strings.error_security_error);break;case-290:this.store.getById(file.id).set('status',4);this.store.getById(file.id).commit();break}this.fireEvent('fileUploadError',this,file,error,code)},uploadSuccess:function(file,response){var data=Ext.decode(response);if(data.success){this.store.remove(this.store.getById(file.id))}else{this.store.getById(file.id).set('status',3);this.store.getById(file.id).commit();if(data.msg){Ext.MessageBox.alert(this.strings.text_error,data.msg)}}this.fireEvent('fileUploadSuccess',this,file,data)},uploadComplete:function(file){this.progress_bar.reset();this.progress_bar.updateText(this.strings.text_progressbar);if(this.suo.getStats().files_queued&&!this.upload_cancelled){this.suo.startUpload()}else{this.fireEvent('fileUploadComplete',this,file);this.allUploadsComplete()}},allUploadsComplete:function(){this.cancelBtn.hide();this.addBtn.show();this.clearBtn.show();this.fireEvent('allUploadsComplete',this)},addPostParam:function(name,value){if(this.suo){this.suo.settings.post_params[name]=value;this.suo.setPostParams(this.suo.settings.post_params)}else{this.post_params[name]=value}},startUpload:function(){this.cancelBtn.show();this.uploadBtn.hide();this.clearBtn.hide();this.upload_cancelled=false;this.fireEvent('startUpload',this);this.suo.startUpload()},stopUpload:function(file){this.suo.stopUpload();this.upload_cancelled=true;this.getStore().each(function(){if(this.data.status==1){this.set('status',0);this.commit()}});this.cancelBtn.hide();if(this.suo.getStats().files_queued>0){this.uploadBtn.show()}this.addBtn.show();this.clearBtn.show();this.progress_bar.reset();this.progress_bar.updateText(this.strings.text_progressbar)},removeFiles:function(){var selRecords=this.getSelections();for(var i=0;i<selRecords.length;i++){if(selRecords[i].data.status!=1){this.suo.cancelUpload(selRecords[i].id);this.store.remove(selRecords[i])}}if(this.suo.getStats().files_queued===0){this.uploadBtn.hide()}this.fireEvent('removeFiles',this)},removeAllFiles:function(){var files_left=this.suo.getStats().files_queued;while(files_left>0){this.suo.cancelUpload();files_left=this.suo.getStats().files_queued}this.store.removeAll();this.cancelBtn.hide();this.uploadBtn.hide();this.fireEvent('removeAllFiles',this)}});
function FileBrowser(field_name, url, type, win) {
	
    if (type == 'file') {
        var chooser = new FileChooser({
            width: 700,
            height: 450
        });
        chooser.show(field_name,
        function(el, data) {
            win.document.getElementById(el).value = data
        })
    } else if (type == 'flv') {
        var chooser = new FileChooser({
            width: 700,
            height: 450
        });
        chooser.show(field_name,
        function(el, data) {
            if (win.form.findField('flv').getValue() != data) {
                win.form.findField('flv').setValue(data);
  	   }
        })
    }else if (type == 'files') {
        var chooser = new FileChooser({
            width: 700,
            height: 450
        });
        chooser.show(field_name,
        function(el, data) {
            Ext.getCmp("content").setValue(Ext.getCmp("content").getValue() + "<a href='" + data + "' target=_blank>文件下载</a>")
        })
    } else if (type == 'image') {
        var chooser = new ImageChooser({
            width: 700,
            height: 450
        });
        chooser.show(field_name,
        function(el, data) {
            win.document.getElementById(el).value = data;
            if (win.ImageDialog.getImageData) win.ImageDialog.getImageData();
            if (win.ImageDialog.showPreviewImage) win.ImageDialog.showPreviewImage(data)
        })
    } else if (type == 'images') {
        var chooser = new ImageChooser({
            width: 700,
            height: 450
        });
        chooser.show(field_name,
        function(el, data) {
            if (win.form.findField('small_img').getValue() != data) {
                win.form.findField('small_img').setValue(data);
  	   }
        })
    } else if (type == 'conimages') {
        var chooser = new ImageChooser({
            width: 700,
            height: 450
        });
        chooser.show(field_name,
        function(el, data) {
  Ext.getCmp("content").setValue(Ext.getCmp("content").getValue() + "<img src='" + data + "'/>")
        })
    }
    return false
};
var FileChooser = function(config) {
    
    this.ds =new Ext.data.Store({
		proxy: new Ext.data.HttpProxy({
        url: '/home/data/file/listfile1.asp'
      }),
        reader: new Ext.data.JsonReader({
            root: 'file',
            totalProperty: 'total'
        },
        [{
            name: 'name'
        },
        {
            name: 'size',
            type: 'float'
        },'ico',
        {
            name: 'url'
        },
        {
            name: 'creatdate'
        }]),autoLoad: true
    });
   function renderimg(val) {
      if (val != '') {
        return '<img src=' + val + ' width=16 height=16 border=0 />';
      }
    }
    this.grid = new Ext.grid.GridPanel({
		id:'filegrid',
       
		store: this.ds,
		stripeRows: true,
        loadMask: true,
        border: false,
		autoExpandColumn: 'name',
		columns: [{
	    id:'name',
        header: '名称',
        dataIndex: 'name',
        sortable: true
    },
    {
        header: '类型',
        dataIndex: 'ico',
		width: 50,
        sortable: true,
        renderer: renderimg
    },
    {
        header: '大小',
        dataIndex: 'size',
        sortable: true,
        renderer: Ext.util.Format.fileSize
    },
    {
        header: '路径',
        dataIndex: 'url',
        sortable: true
    },
    {
        header: '时间',
        dataIndex: 'creatdate',
        sortable: true
    }],
        listeners: {
            scope: this,
            'rowdblclick': this.doCallback
        },
        bbar: new Ext.PagingToolbar({
            pageSize: 20,
            store: this.ds,
            displayInfo: true
        })
    });
    this.grid.addListener('rowcontextmenu', prepareCtx);
    var ctxMenu = new Ext.menu.Menu({
        id: 'filelistright',
        items: [{
            id: 'copy_button',
            text: '下载文件',
            disabled: true,
            handler: do_download
        },
        '-', {
            id: 'delete1_button',
            icon: '/bin/images/delete.gif',
            text: '删除文件',
            disabled: true,
            handler: deletesfile
        }]
    });
    function prepareCtx(client, rowindex, e) {
        e.preventDefault();
        ctxMenu.showAt(e.getXY())
    }
    this.popup = new Ext.Window({
        id: 'FileChooser',
        title: '双击要选择的文件进行选定',
        x: 20,
        width: config.width,
        height: config.height,
        minWidth: config.width,
        minHeight: config.height,
        layout: 'fit',
        items:this.grid,
        tbar: [{
            text: "添加文件",
            iconCls: 'SwfUploadPanel_iconAdd',
            handler: insertsfile
        },
        '->', {
            text: "选定文件",
            iconCls: 'SwfUploadPanel_iconcleck',
            scope: this,
            handler: this.doCallback
        },
        "-", {
            text: "关闭视窗",
            iconCls: 'close',
            scope: this,
            handler: function() {
                this.popup.close();
                scope: this
            }
        }]
    })
};
FileChooser.prototype = {
    show: function(el, callback) {
        if (Ext.type(el) == 'object') {
            this.showEl = el.getEl()
        } else {
            this.showEl = el
        }
        this.el = el;
        this.popup.show(this.showEl);
        this.callback = callback
    },
    doCallback: function() {
        var row = this.grid.getSelectionModel().getSelected();
        var callback = this.callback;
        var el = this.el;
        this.popup.close();
        if (row && callback) {
            var data = row.data.url;
            callback(el, data)
        }
    }
};
function deletesfile() {
    Ext.MessageBox.confirm('重要提示', '您当真要删除这个文件吗?请确认这个文件没有任何用途！',
    function(reponse) {
        if (reponse == "yes") {
            var row = this.grid.getSelections();
            var jsonData = "";
            for (var i = 0,
            len = row.length; i < len; i++) {
                var ss = row[i].get("name");
                if (i == 0) {
                    jsonData = jsonData + ss
                } else {
                    jsonData = jsonData + "," + ss
                }
            }
            var connection = new Ext.data.Connection().request({
                url: "/home/data/file/Process.asp?Work=DeleteItem",
                method: "POST",
                params: {
                    action: "delete",
                    CurrIndex: current_directory,
                    file: jsonData
                },
                success: function(o) {
                    var response = Ext.util.JSON.decode(o.responseText);
                    if (response.success == true) {
                        Ext.getCmp('filegrid').ds.load();
                    } else {
                        Ext.MessageBox.alert('友情提示', response.message)
                    }
                },
                failure: function(o) {
                    Ext.MessageBox.alert('友情提示', '服务器出现错误，请通知管理员')
                }
            })
        }
    })
}
function insertsfile() {
    var winuploadfile = new Ext.Window({
        title: '上传文件',
        width: 400,
        height: 300,
        layout: 'fit',
        closeAction: 'hide',
        modal: true,
        items: [new Ext.ux.SwfUploadPanel({
            border: false,
            debug: false,
            upload_url: '/home/bin/upload/upload.asp',
            post_params: {
                action: 'upload',
                CurrIndex: 1
            },
			file_size_limit:"1024",file_upload_limit:"10",file_queue_limit:"10",
            file_types: '*.rar;*.doc;*.zip;*.swf;*.flv;*.ppt;*.xls',
            file_types_description: 'All Files',
            flash_url: '/home/bin/upload/swfupload.swf',
            single_file_select: false,
            confirm_delete: true,
            remove_completed: true,
            listeners: {
                startUpload: function(panel) {},
                allUploadsComplete: function() {Ext.getCmp('filegrid').store.load();}
            }
        })]
    });
    winuploadfile.show()
};
function do_download() {
    var row = this.grid.getSelectionModel().getSelected();
    window.open(row.data.web_path + row.data.name)
};
var ImageChooser = function(config) {
    this.config = config;
    Ext.DataView.LabelEditor = function(cfg, field){
    Ext.DataView.LabelEditor.superclass.constructor.call(this,
        field || new Ext.form.TextField({
            allowBlank: false,
            growMin:90,
            growMax:240,
            grow:true,
            selectOnFocus:true
        }), cfg
    );
}

Ext.extend(Ext.DataView.LabelEditor, Ext.Editor, {
    alignment: "tl-tl",
    hideEl : false,
    cls: "x-small-editor",
    shim: false,
    completeOnEnter: true,
    cancelOnEsc: true,
    labelSelector: 'span.x-editable',

    init : function(view){
        this.view = view;
        view.on('render', this.initEditor, this);
        this.on('complete', this.onSave, this);
    },

    initEditor : function(){
        this.view.getEl().on('mousedown', this.onMouseDown, this, {delegate: this.labelSelector});
    },

    onMouseDown : function(e, target){
        if(!e.ctrlKey && !e.shiftKey){
            var item = this.view.findItemFromChild(target);
            e.stopEvent();
            var record = this.view.store.getAt(this.view.indexOf(item));
            this.startEdit(target, record.data[this.dataIndex]);
            this.activeRecord = record;
        }else{
            e.preventDefault();
        }
    },

    onSave : function(ed, value){
        this.activeRecord.set(this.dataIndex, value);
    }
});


Ext.DataView.DragSelector = function(cfg){
    cfg = cfg || {};
    var view, regions, proxy, tracker;
    var rs, bodyRegion, dragRegion = new Ext.lib.Region(0,0,0,0);
    var dragSafe = cfg.dragSafe === true;

    this.init = function(dataView){
        view = dataView;
        view.on('render', onRender);
    };

    function fillRegions(){
        rs = [];
        view.all.each(function(el){
            rs[rs.length] = el.getRegion();
        });
        bodyRegion = view.el.getRegion();
    }

    function cancelClick(){
        return false;
    }

    function onBeforeStart(e){
        return !dragSafe || e.target == view.el.dom;
    }

    function onStart(e){
        view.on('containerclick', cancelClick, view, {single:true});
        proxy = view.el.createChild({cls:'x-view-selector'});
        proxy.setDisplayed('block');
        fillRegions();
        view.clearSelections();
    }

    function onDrag(e){
        var startXY = tracker.startXY;
        var xy = tracker.getXY();

        var x = Math.min(startXY[0], xy[0]);
        var y = Math.min(startXY[1], xy[1]);
        var w = Math.abs(startXY[0] - xy[0]);
        var h = Math.abs(startXY[1] - xy[1]);

        dragRegion.left = x;
        dragRegion.top = y;
        dragRegion.right = x+w;
        dragRegion.bottom = y+h;

        dragRegion.constrainTo(bodyRegion);
        proxy.setRegion(dragRegion);

        for(var i = 0, len = rs.length; i < len; i++){
            var r = rs[i], sel = dragRegion.intersect(r);
            if(sel && !r.selected){
                r.selected = true;
                view.select(i, true);
            }else if(!sel && r.selected){
                r.selected = false;
                view.deselect(i);
            }
        }
    }

    function onEnd(e){
        if(proxy){
            proxy.setDisplayed(false);
        }
    }

    function onRender(view){
        tracker = new Ext.dd.DragTracker({
            onBeforeStart: onBeforeStart,
            onStart: onStart,
            onDrag: onDrag,
            onEnd: onEnd
        });
        tracker.initEl(view.el);
    }
};  
    this.initTemplates();
    this.store = new Ext.data.JsonStore({
        url: '/home/data/file/viewimg.asp',
        root: 'images',
		totalProperty: 'total',
        fields: ['name', 'url', {name:'size', type: 'float'}, {name:'creatdate'}],
        listeners: {
            scope: this,
            'load': function() {
                this.view.select(0)
            }
        }
    });
    this.store.load();
	
    
    this.lookup = {};
    var formatData = function(data) {
        data.short_name = Ext.util.Format.ellipsis(data.name, 10);
		data.sizeString = Ext.util.Format.fileSize(data.size);
        this.lookup[data.name] = data;
        return data
    };
    this.view = new Ext.DataView({
        id: 'ImgChoos',
        store: this.store,
		loadMask: true,
		loadingText: '载入中,请稍等...',
        tpl: this.thumbTemplate,
        autoHeight:true,
            multiSelect: true,
            overClass:'x-view-over',
            itemSelector:'div.thumb-wrap',
            emptyText: '没有图片显示',

            plugins: [
                new Ext.DataView.DragSelector()
            ],
            prepareData: formatData.createDelegate(this)
          ,listeners: {
			scope: this,
				'dblclick': this.doCallback,
				'beforeselect': function(view) {
                return view.store.getRange().length > 0
            }
            }
      
    });
    this.popup = new Ext.Window({
        id: 'ImageChooser',
        title: '双击你要使用的文件',
        x: 20,
        width: 650,
        height: 450,
		modal: true,
        minWidth: config.width,
        minHeight: config.height,
        layout: 'fit',
        items:this.view,
		tbar: [{
                text: "添加图片",
                iconCls: 'SwfUploadPanel_iconAdd',
                handler: insertsImages
            },
            "-", {
                text: "删除图片",
                iconCls: 'SwfUploadPanel_iconCancel',
                handler: deletesImages
            },
            '->', {
                text: "选定图片",
				iconCls: 'SwfUploadPanel_iconCleck',
                scope: this,
                handler: this.doCallback
            },
            "-", {
                text: "关闭视窗",
                iconCls: 'SwfUploadPanel_iconClose',
                scope: this,
                handler: function() {
                    this.popup.close();
                    scope: this
                }
            }],
            bbar: new Ext.PagingToolbar({
                pageSize: 24,
                store: this.view.store,
                displayInfo: true
            })
    })
};
ImageChooser.prototype = {
    show: function(el, callback) {
        if (Ext.type(el) == 'object') {
            this.showEl = el.getEl()
        } else {
            this.showEl = el
        }
        this.el = el;
        this.popup.show(this.showEl);
        this.callback = callback
    },
	initTemplates: function() {
        this.thumbTemplate = new Ext.XTemplate('<tpl for=".">', '<div class="thumb-wrap" id="{name}">', '<div class="thumb"><img src="{url}" title="{name}"></div>', '<span class="x-editable">{shortName}</span></div>','</tpl>,<div class="x-clear"></div>');
        this.thumbTemplate.compile()
    },
    doCallback: function() {
        var selectedNode = this.view.getSelectedNodes()[0];
        var lookup = this.lookup;
        var callback = this.callback;
        var el = this.el;
        this.popup.close();
        if (selectedNode && callback) {
            var data = lookup[selectedNode.id].url;
            callback(el, data)
        }
    }
};
function deletesImages() {
    var count = Ext.getCmp('ImgChoos').getSelectionCount();
    var nodes = "";
    if (count == 0) {
        Ext.Msg.show({
            title: "提示框",
            msg: "请选择要删除的图片",
            buttons: Ext.MessageBox.OK,
            icon: Ext.MessageBox.INFO
        });
        return false
    }
    for (var i = 0; i < count; i++) {
        nodes += Ext.getCmp('ImgChoos').getSelectedNodes()[i].id;
        if (i < count - 1) {
            nodes += ","
        }
    }
    Ext.Msg.confirm("提示框", "你确认删除所选图片吗",
    function(button) {
        if (button == "yes") {
            Ext.MessageBox.show({
                msg: "删除中,请等待...",
                progress: true,
                progressText: '删除中...',
                width: 300,
                wait: true,
                waitConfig: {
                    interval: 100,
                    duration: 1000,
                    fn: function() {
                        Ext.Ajax.request({
                            url: "/home/data/file/Process.asp",
                            params: {
                                "file": nodes,
                                "Work": 'DeleteItem',
                                "CurrIndex": 0
                            },
                            callback: function(options, success, response) {
                                if (success) {
                                    Ext.getCmp('ImgChoos').store.load()
                                } else {
                                    Ext.Msg.show({
                                        title: "重要提示",
                                        msg: "删除图片失败, 请刷新页面进行重试",
                                        buttons: Ext.MessageBox.OK,
                                        icon: Ext.MessageBox.WARNING
                                    })
                                }
                            }
                        });
                        Ext.MessageBox.hide()
                    }
                }
            })
        }
    })
}
function insertsImages() {
    var winupload = new Ext.Window({
        title: '上传图片',
        width: 400,
        height: 300,
        layout: 'fit',
        closeAction: 'hide',
        modal: true,
        items: [new Ext.ux.SwfUploadPanel({
            border: false,
            debug: false,
            upload_url: '/home/bin/upload/upload.asp',
            post_params: {
                action: 'upload',
                CurrIndex: 0
            },
            file_size_limit: "1024",
            file_upload_limit: "10",
            file_queue_limit: "10",
            file_types: '*.jpg;*.gif;*.png',
            file_types_description: 'All Files',
            flash_url: '/home/bin/upload/swfupload.swf',
            single_file_select: false,
            confirm_delete: true,
            remove_completed: true,
            listeners: {
                
                allUploadsComplete: function() {
                    Ext.getCmp('ImgChoos').store.load();
                }
            }
        })]
    });
    winupload.show()
};
String.prototype.ellipse = function(maxLength) {
    if (this.length > maxLength) {
        return this.substr(0, maxLength - 3) + '...';
    }
    return this;
};
Ext.form.TreeField=Ext.extend(Ext.form.TriggerField,{readOnly:true,displayField:'text',valueField:'',hiddenName:'',listWidth:'',minListWidth:50,listHeight:150,minListHeight:50,dataUrl:'',tree:'',value:'',readchild:'',displayValue:'',baseParams:'',treeRootConfig:{id:'source',text:'请选择',draggable:false},defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},initComponent:function(){Ext.form.TreeField.superclass.initComponent.call(this);this.addEvents('select','expand','collapse','beforeselect')},initList:function(){if(!this.list){var cls='x-treefield-list';this.list=new Ext.Layer({shadow:this.shadow,cls:[cls,this.listClass].join(' '),constrain:false});var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.swallowEvent('mousewheel');this.innerList=this.list.createChild({cls:cls+'-inner'});this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));this.innerList.setHeight(this.listHeight||this.minListHeight);if(!this.tree){this.tree=this.createTree(this.innerList)}this.tree.getRootNode().expand();this.tree.on('click',this.select,this);this.tree.on("check",this.check,this);this.tree.render()}},onRender:function(ct,position){Ext.form.TreeField.superclass.onRender.call(this,ct,position);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:'input',type:'hidden',name:this.hiddenName,id:(this.hiddenId||this.hiddenName)},'before',true);this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name')}if(Ext.isGecko){this.el.dom.setAttribute('autocomplete','off')}this.initList()},select:function(node){if(this.fireEvent('beforeselect',node,this)!=false){if(this.readCheck!==true){if(this.readchild==true){if(node.attributes.leaf==true){this.onSelect(node);this.fireEvent('select',this,node)}}else{this.onSelect(node);this.fireEvent('select',this,node)}}}},onSelect:function(node){this.setValue(node);this.collapse()},check:function(node){var checkedNodes=this.tree.getChecked();var checkedIds=[];for(var i=0;i<checkedNodes.length;i++){checkedIds.push(checkedNodes[i].id)}this.checksed(checkedIds.join(','))},checksed:function(node){this.setValu(node)},createTree:function(el){var Tree=Ext.tree;var tree=new Tree.TreePanel({el:el,autoScroll:true,readchild:true,rootVisible:false,onlyLeafCheckable:this.onlyLeafCheckable,animate:true,containerScroll:true,loader:new Tree.TreeLoader({dataUrl:this.dataUrl,baseParams:this.baseParams,baseAttrs:this.baseAttrs})});var root=new Tree.AsyncTreeNode(this.treeRootConfig);tree.setRootNode(root);return tree},getValue:function(){if(this.valueField){return typeof this.value!='undefined'?this.value:''}else{return Ext.form.TreeField.superclass.getValue.call(this)}},setValu:function(node){var text,value;text=node;value=node;if(this.hiddenField){this.hiddenField.value=value}Ext.form.TreeField.superclass.setValue.call(this,text);this.value=value},setValue:function(node){var text,value;if(node&&typeof node=='object'){text=node[this.displayField];value=node[this.valueField||this.displayField]}else{text=node;value=node}if(this.hiddenField){this.hiddenField.value=value}Ext.form.TreeField.superclass.setValue.call(this,text);this.value=value},onResize:function(w,h){Ext.form.TreeField.superclass.onResize.apply(this,arguments);if(this.list&&this.listWidth==''){var lw=Math.max(w,this.minListWidth);this.list.setWidth(lw);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'))}},validateBlur:function(){return!this.list||!this.list.isVisible()},onDestroy:function(){if(this.list){this.list.destroy()}if(this.wrap){this.wrap.remove()}Ext.form.TreeField.superclass.onDestroy.call(this)},collapseIf:function(e){if(!e.within(this.wrap)&&!e.within(this.list)){this.collapse()}},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un('mousewheel',this.collapseIf,this);Ext.getDoc().un('mousedown',this.collapseIf,this);this.fireEvent('collapse',this)},expand:function(){if(this.isExpanded()||!this.hasFocus){return}this.onExpand();this.list.alignTo(this.wrap,this.listAlign);this.list.show();Ext.getDoc().on('mousewheel',this.collapseIf,this);Ext.getDoc().on('mousedown',this.collapseIf,this);this.fireEvent('expand',this)},onExpand:function(){var doc=Ext.getDoc();this.on('click',function(){alert(111)},this)},isExpanded:function(){return this.list&&this.list.isVisible()},onTriggerClick:function(){if(this.disabled){return}if(this.isExpanded()){this.collapse()}else{this.onFocus({});this.expand()}this.el.focus()}});Ext.reg('treeField',Ext.form.TreeField);
Ext.apply(Ext.form.VTypes,{daterange:function(val,field){var date=field.parseDate(val);var dispUpd=function(picker){var ad=picker.activeDate;picker.activeDate=null;picker.update(ad)};if(field.startDateField){var sd=Ext.getCmp(field.startDateField);sd.maxValue=date;if(sd.menu&&sd.menu.picker){sd.menu.picker.maxDate=date;dispUpd(sd.menu.picker)}}else if(field.endDateField){var ed=Ext.getCmp(field.endDateField);ed.minValue=date;if(ed.menu&&ed.menu.picker){ed.menu.picker.minDate=date;dispUpd(ed.menu.picker)}}return true},password:function(val,field){if(field.initialPassField){var pwd=Ext.getCmp(field.initialPassField);return(val==pwd.getValue())}return true},passwordText:'两次输入的密码不一致！',chinese:function(val,field){var reg=/^[\u4e00-\u9fa5]+$/i;if(!reg.test(val)){return false}return true},chineseText:'请输入中文',age:function(val,field){try{if(parseInt(val)>=18&&parseInt(val)<=100)return true;return false}catch(err){return false}},ageText:'年龄输入有误',alphanum:function(val,field){try{if(!/\W/.test(val))return true;return false}catch(e){return false}},alphanumText:'请输入英文字母或是数字,其它字符是不允许的.',url:function(val,field){try{if(/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(val))return true;return false}catch(e){return false}},urlText:'请输入有效的URL地址.',max:function(val,field){try{if(parseFloat(val)<=parseFloat(field.max))return true;return false}catch(e){return false}},maxText:'超过最大值',min:function(val,field){try{if(parseFloat(val)>=parseFloat(field.min))return true;return false}catch(e){return false}},minText:'小于最小值',datecn:function(val,field){try{var regex=/^(\d{4})-(\d{2})-(\d{2})$/;if(!regex.test(val))return false;var d=new Date(val.replace(regex,'$1/$2/$3'));return(parseInt(RegExp.$2,10)==(1+d.getMonth()))&&(parseInt(RegExp.$3,10)==d.getDate())&&(parseInt(RegExp.$1,10)==d.getFullYear())}catch(e){return false}},datecnText:'请使用这样的日期格式: yyyy-mm-dd. 例如:2008-06-20.',integer:function(val,field){try{if(/^[-+]?[\d]+$/.test(val))return true;return false}catch(e){return false}},integerText:'请输入正确的整数',intenum:function(val,field){try{if(/^[+\-]?\d+(.\d+)?$/.test(val))return true;return false}catch(e){return false}},intenumText:'请输入正确的数字',minlength:function(val,field){try{if(val.length>=parseInt(field.minlen))return true;return false}catch(e){return false}},minlengthText:'长度过小',maxlength:function(val,field){try{if(val.length<=parseInt(field.maxlen))return true;return false}catch(e){return false}},maxlengthText:'长度过大',ip:function(val,field){try{if((/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(val)))return true;return false}catch(e){return false}},ipText:'请输入正确的IP地址',phone:function(val,field){try{if(/^((0[1-9]{3})?(0[12][0-9])?[-])?\d{6,8}$/.test(val))return true;return false}catch(e){return false}},phoneText:'请输入正确的电话号码,如:0920-29392929',mobilephone:function(val,field){try{if(/(^0?[1][35][0-9]{9}$)/.test(val))return true;return false}catch(e){return false}},mobilephoneText:'请输入正确的手机号码',keywords:function(val,field){var reg=/^[\u4e00-\u9fa5|,|A-Z0-9]+$/i;if(!reg.test(val)){return false}return true},keywordsText:'只能输入中文和英文逗号","',alpha:function(val,field){try{if(/^[a-zA-Z]+$/.test(val))return true;return false}catch(e){return false}},alphaText:'请输入英文字母',
    zipcodeText:'请输入正确的邮政编码',card:function(val,field){var num=val.toUpperCase();var reg=/(^\d{15}$)|(^\d{17}([0-9]|X)$)/i;if(!reg.test(num)){return false}var len,re;len=num.length;if(len==15){re=new RegExp(/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/);var arrSplit=num.match(re);var dtmBirth=new Date('19'+arrSplit[2]+'/'+arrSplit[3]+'/'+arrSplit[4]);var bGoodDay;bGoodDay=(dtmBirth.getYear()==Number(arrSplit[2]))&&((dtmBirth.getMonth()+1)==Number(arrSplit[3]))&&(dtmBirth.getDate()==Number(arrSplit[4]));if(!bGoodDay){Ext.MessageBox.alert('友情提示','输入的身份证号里出生日期不对');return false}else{var arrInt=new Array(7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2);var arrCh=new Array('1','0','X','9','8','7','6','5','4','3','2');var nTemp=0,i;num=num.substr(0,6)+'19'+num.substr(6,num.length-6);for(i=0;i<17;i++){nTemp+=num.substr(i,1)*arrInt[i]}num+=arrCh[nTemp%11]}}else if(len==18){re=new RegExp(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/);var arrSplit=num.match(re);var dtmBirth=new Date(arrSplit[2]+"/"+arrSplit[3]+"/"+arrSplit[4]);var bGoodDay;bGoodDay=(dtmBirth.getFullYear()==Number(arrSplit[2]))&&((dtmBirth.getMonth()+1)==Number(arrSplit[3]))&&(dtmBirth.getDate()==Number(arrSplit[4]));if(!bGoodDay){Ext.MessageBox.alert('友情提示','输入的身份证号里出生日期不对');return false}else{var valnum;var arrInt=new Array(7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2);var arrCh=new Array('1','0','X','9','8','7','6','5','4','3','2');var nTemp=0,i;for(i=0;i<17;i++){nTemp+=num.substr(i,1)*arrInt[i]}valnum=arrCh[nTemp%11];if(valnum!=num.substr(17,1)){Ext.MessageBox.alert('友情提示','输入的身份证号码不正确');return false}}}var sBirthday=num.substr(6,4)+"-"+Number(num.substr(10,2))+"-"+Number(num.substr(12,2));if(Number(num.substr(6,2))<19){Ext.MessageBox.alert('友情提示','你不会是19世纪以前的出生吧');return false}return true},cardText:'请输入正确的身份证号'});
Ext.UpdateManager.defaults.indicatorText='<div class="loading-indicator">加载中...</div>';if(Ext.View){Ext.View.prototype.emptyText=""}if(Ext.grid.GridPanel){Ext.grid.GridPanel.prototype.ddText="{0} 选择行"}if(Ext.TabPanelItem){Ext.TabPanelItem.prototype.closeText="关闭"}if(Ext.form.Field){Ext.form.Field.prototype.invalidText="输入值非法"}Date.monthNames=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"];Date.dayNames=["日","一","二","三","四","五","六"];if(Ext.MessageBox){Ext.MessageBox.buttonText={ok:"确定",cancel:"取消",yes:"是",no:"否"}}if(Ext.util.Format){Ext.util.Format.date=function(v,format){if(!v)return"";if(!(v instanceof Date))v=new Date(Date.parse(v));return v.dateFormat(format||"y年m月d日")}}if(Ext.DatePicker){Ext.apply(Ext.DatePicker.prototype,{todayText:"今天",minText:"日期在最小日期之前",maxText:"日期在最大日期之后",disabledDaysText:"",disabledDatesText:"",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:'下月 (Control+Right)',prevText:'上月 (Control+Left)',monthYearText:'选择一个月 (Control+Up/Down 来改变年)',todayTip:"{0} (空格键选择)",format:"y年m月d日",okText:"确定",cancelText:"取消"})}if(Ext.PagingToolbar){Ext.apply(Ext.PagingToolbar.prototype,{beforePageText:"页",afterPageText:"页共 {0} 页",firstText:"第一页",prevText:"前一页",nextText:"下一页",lastText:"最后页",refreshText:"刷新",displayMsg:"显示 {0} - {1}，共 {2} 条",emptyMsg:'没有数据需要显示'})}if(Ext.form.TextField){Ext.apply(Ext.form.TextField.prototype,{minLengthText:"该输入项的最小长度是 {0}",maxLengthText:"该输入项的最大长度是 {0}",blankText:"该输入项为必输项",regexText:"",emptyText:null})}if(Ext.form.NumberField){Ext.apply(Ext.form.NumberField.prototype,{minText:"该输入项的最小值是 {0}",maxText:"该输入项的最大值是 {0}",nanText:"{0} 不是有效数值"})}if(Ext.form.DateField){Ext.apply(Ext.form.DateField.prototype,{disabledDaysText:"禁用",disabledDatesText:"禁用",minText:"该输入项的日期必须在 {0} 之后",maxText:"该输入项的日期必须在 {0} 之前",invalidText:"{0} 是无效的日期 - 必须符合格式： {1}",format:"y年m月d日"})}if(Ext.form.ComboBox){Ext.apply(Ext.form.ComboBox.prototype,{loadingText:"加载...",valueNotFoundText:undefined})}if(Ext.form.VTypes){Ext.apply(Ext.form.VTypes,{emailText:'该输入项必须是电子邮件地址，格式如： "user@domain.com"',urlText:'该输入项必须是URL地址，格式如： "http://www.domain.com"',alphaText:'该输入项只能包含字符和_',alphanumText:'该输入项只能包含字符,数字和_'})}if(Ext.grid.GridView){Ext.apply(Ext.grid.GridView.prototype,{sortAscText:"正序",sortDescText:"逆序",lockText:"锁列",unlockText:"解锁列",columnsText:"列"})}if(Ext.grid.PropertyColumnModel){Ext.apply(Ext.grid.PropertyColumnModel.prototype,{nameText:"名称",valueText:"值",dateFormat:"y年m月d日"})}if(Ext.layout.BorderLayout&&Ext.layout.BorderLayout.SplitRegion){Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype,{splitTip:"拖动来改变尺寸.",collapsibleSplitTip:"拖动来改变尺寸. 双击隐藏."})};
(function(){Ext.ux.Media=function(config){Ext.apply(this,config||{});this.toString=this.mediaMarkup;this.initMedia()};var ux=Ext.ux.Media;ux.mediaTypes={"PDF":Ext.apply({tag:'object',cls:'x-media x-media-pdf',type:"application/pdf",data:"@url",autoSize:true,params:{src:"@url"}},Ext.isIE?{classid:"CLSID:CA8A9780-280D-11CF-A24D-444553540000"}:false),"PDFFRAME":{tag:'iframe',cls:'x-media x-media-pdf-frame',frameBorder:0,style:{overflow:'none',width:'100%',height:'100%'},src:"@url",autoSize:true},"WMV":Ext.apply({tag:'object',cls:'x-media x-media-wmv',type:'application/x-mplayer2',data:"@url",autoSize:false,params:{filename:"@url",displaysize:0,autostart:"@start",showControls:"@controls",showStatusBar:"@status",showaudiocontrols:true,stretchToFit:true,Volume:"@volume",PlayCount:1}},Ext.isIE?{classid:"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95",codebase:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701",type:'application/x-oleobject'}:{src:"@url"}),"SWF":Ext.apply({tag:'object',cls:'x-media x-media-swf',type:'application/x-shockwave-flash',scripting:'sameDomain',standby:'加载中..',loop:true,start:false,unsupportedText:{cn:['The Adobe Flash Player is required.',{tag:'br'},{tag:'a',cn:[{tag:'img',src:'http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif'}],href:'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash',target:'_flash'}]},params:{movie:"@url",menu:"@controls",play:"@start",quality:"high",allowscriptaccess:"@scripting",allownetworking:'all',allowfullScreen:false,bgcolor:"#FFFFFF",wmode:"opaque",loop:"@loop"}},Ext.isIE?{classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"}:{data:"@url"}),"JWP":Ext.apply({tag:'object',cls:'x-media x-media-swf x-media-flv',type:'application/x-shockwave-flash',data:"@url",loop:false,start:false,params:{movie:"@url",flashVars:{autostart:'@start',repeat:'@loop',height:'@height',width:'@width',id:'@id'}}},Ext.isIE?{classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"}:false),"QT":Ext.apply({tag:'object',cls:'x-media x-media-quicktime',type:"video/quicktime",style:{position:'relative',"z-index":1,behavior:'url(#qt_event_source)'},scale:'aspect',unsupportedText:'<a href="http://www.apple.com/quicktime/download/">Get QuickTime</a>',scripting:true,volume:'50%',data:'@url',params:{src:Ext.isIE?'@url':null,href:"http://quicktime.com",target:"_blank",autoplay:"@start",targetcache:true,cache:true,wmode:'transparent',controller:"@controls",enablejavascript:"@scripting",loop:'@loop',scale:'@scale',volume:'@volume',QTSRC:'@url'}},Ext.isIE?{classid:'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',codebase:'http://www.apple.com/qtactivex/qtplugin.cab#version=7,2,1,0'}:{PLUGINSPAGE:"http://www.apple.com/quicktime/download/"}),"QTEVENTS":{tag:'object',id:'qt_event_source',cls:'x-media x-media-qtevents',type:"video/quicktime",params:{},classid:'clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598',codebase:'http://www.apple.com/qtactivex/qtplugin.cab#version=7,2,1,0'},"WPMP3":Ext.apply({tag:'object',cls:'x-media x-media-audio x-media-wordpress',type:'application/x-shockwave-flash',data:'@url',start:true,loop:false,params:{movie:"@url",width:'@width',flashVars:{autostart:"@start",controller:"@controls",enablejavascript:"@scripting",loop:'@loop',scale:'@scale',initialvolume:'@volume',width:'@width',encode:'no',soundFile:''}}},Ext.isIE?{classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"}:false),"REAL":Ext.apply({tag:'object',cls:'x-media x-media-real',type:"audio/x-pn-realaudio",data:"@url",controls:'imagewindow,all',start:false,standby:"载入媒体播放器部件...",params:{src:"@url",autostart:"@start",center:false,maintainaspect:true,controller:"@controls",controls:"@controls",volume:'@volume',loop:"@loop",console:"_master",backgroundcolor:'#000000'}},Ext.isIE?{classid:"clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA"}:false),"SVG":{tag:'object',cls:'x-media x-media-img x-media-svg',type:"image/svg+xml",data:"@url",params:{src:"@url"}},"GIF":{tag:'img',cls:'x-media x-media-img x-media-gif',src:"@url"},"JPEG":{tag:'img',cls:'x-media x-media-img x-media-jpeg',src:"@url"},"JP2":{tag:'object',cls:'x-media x-media-img x-media-jp2',type:"image/jpeg2000-image",data:"@url"},"PNG":{tag:'img',cls:'x-media x-media-img x-media-png',src:"@url"},"HTM":{tag:'iframe',cls:'x-media x-media-html',frameBorder:0,style:{overflow:'auto',width:'100%',height:'100%'},src:"@url"},"TXT":{tag:'object',cls:'x-media x-media-text',type:"text/plain",style:{overflow:'auto',width:'100%',height:'100%'},data:"@url"},"RTF":{tag:'object',cls:'x-media x-media-rtf',type:"application/rtf",style:{overflow:'auto',width:'100%',height:'100%'},data:"@url"},"JS":{tag:'object',cls:'x-media x-media-js',type:"text/javascript",style:{overflow:'auto',width:'100%',height:'100%'},data:"@url"},"CSS":{tag:'object',cls:'x-media x-media-css',type:"text/css",style:{overflow:'auto',width:'100%',height:'100%'},data:"@url"},"SILVERLIGHT":{tag:'object',cls:'x-media x-media-silverlight',type:"application/ag-plugin",data:"@url",params:{MinRuntimeVersion:"1.0",source:"@url"}},"SILVERLIGHT2":{tag:'object',cls:'x-media x-media-silverlight',type:"application/x-silverlight-2-b2",data:"data:application/x-silverlight-2-b2,",params:{MinRuntimeVersion:"2.0"},unsupportedText:'<a href="http://go2.microsoft.com/fwlink/?LinkID=114576&v=2.0"><img style="border-width: 0pt;" alt="Get Microsoft Silverlight" src="http://go2.microsoft.com/fwlink/?LinkID=108181"/></a>'},"DATAVIEW":{tag:'object',cls:'x-media x-media-dataview',classid:'CLSID:0ECD9B64-23AA-11D0-B351-00A0C9055D8E',type:'application/x-oleobject',unsupportedText:'MS Dataview Control is not installed'},"OWC:XLS":Ext.apply({tag:'object',cls:'x-media x-media-xls',type:"application/vnd.ms-excel",controltype:"excel",params:{DataType:"CSVURL",CSVURL:'@url',DisplayTitleBar:true,AutoFit:true}},Ext.isIE?{codebase:"file:msowc.cab",classid:"CLSID:0002E510-0000-0000-C000-000000000046"}:false),"OWC:CHART":Ext.apply({tag:'object',cls:'x-media x-media-xls',type:"application/vnd.ms-excel",data:"@url",params:{DataType:"CSVURL"}},Ext.isIE?{classid:"CLSID:0002E500-0000-0000-C000-000000000046"}:false),"OFFICE":{tag:'object',cls:'x-media x-media-office',type:"application/x-msoffice",data:"@url"},"POWERPOINT":Ext.apply({tag:'object',cls:'x-media x-media-ppt',type:"application/vnd.ms-powerpoint",file:"@url"},Ext.isIE?{classid:"CLSID:EFBD14F0-6BFB-11CF-9177-00805F8813FF"}:false),"XML":{tag:'iframe',cls:'x-media x-media-xml',style:{overflow:'auto'},src:"@url"},"VLC":{tag:'object',cls:'x-media x-media-vlc',type:"application/x-vlc-plugin",version:"VideoLAN.VLCPlugin.2",pluginspage:"http://www.videolan.org",data:"@url"},"RDP":Ext.apply({tag:'object',cls:'x-media x-media-rdp',type:"application/rds",unsupportedText:"Remote Desktop Web Connection ActiveX control is required. <a target=\"_msd\" href=\"http://go.microsoft.com/fwlink/?linkid=44333\">Download it here</a>.",params:{Server:'@url',Fullscreen:false,StartConnected:false,DesktopWidth:'@width',DesktopHeight:'@height'}},Ext.isIE?{classid:"CLSID:9059f30f-4eb1-4bd2-9fdc-36f43a218f4a",CODEBASE:"msrdp.cab#version=5,2,3790,0"}:false)};var stateRE=/4$/i;var pollReadyState=function(media,cb,readyRE){if(media&&typeof media.readyState!='undefined'){(readyRE||stateRE).test(media.readyState)?cb({type:'load'}):pollReadyState.defer(10,null,[media,cb])}};if(parseFloat(Ext.version)<2.1){throw"Ext.ux.Media and sub-classes are not License-Compatible with your Ext release.";}Ext.extend(ux,Object,{mediaObject:null,mediaCfg:null,mediaVersion:null,requiredVersion:null,unsupportedText:null,init:function(component){if(component&&this.getEl===undefined){Ext.applyIf(component,this)}},initMedia:function(){if(!Ext.isIE&&this.initialConfig){new ux.VisibilityFix({mode:this.visibilityCls,hideMode:this.hideMode,elements:this.visModeTargets||null}).init(this)}if(this.events){this.addEvents('mediarender','mediaload')}},getMediaType:function(type){return ux.mediaTypes[type]},assert:function(v,def){v=typeof v==='function'?v.call(v.scope||null):v;return Ext.value(v,def)},mediaMarkup:function(mediaCfg,width,height,ct){mediaCfg=mediaCfg||this.mediaCfg;if(!mediaCfg){return''}var m=Ext.apply({url:false,autoSize:false},mediaCfg);m.url=this.assert(m.url,false);if(m.mediaType){var value,p,El=Ext.Element;var media=Ext.apply({},this.getMediaType(this.assert(m.mediaType,false))||false);var params=Ext.apply(media.params||{},m.params||{});for(var key in params){if(params.hasOwnProperty(key)){m.children||(m.children=[]);p=this.assert(params[key],null);if(p!==null){m.children.push({tag:'param',name:key,value:typeof p==='object'?Ext.urlEncode(p):encodeURI(p)})}}}delete media.params;var unsup=this.assert(m.unsupportedText||this.unsupportedText||media.unsupportedText,null);if(unsup){m.children||(m.children=[]);m.children.push(unsup)}if(m.style&&typeof m.style!="object"){throw'Style must be JSON formatted';}m.style=this.assert(Ext.apply(media.style||{},m.style||{}),{});delete media.style;m.height=this.assert(height||m.height||media.height||m.style.height,null);m.width=this.assert(width||m.width||media.width||m.style.width,null);m=Ext.apply({tag:'object'},m,media);if(m.height||m.autoSize){Ext.apply(m.style,{height:El.addUnits(m.autoSize?'100%':m.height,El.prototype.defaultUnit)})}if(m.width||m.autoSize){Ext.apply(m.style,{width:El.addUnits(m.autoSize?'100%':m.width,El.prototype.defaultUnit)})}m.id||(m.id=Ext.id());m.name=this.assert(m.name,m.id);var _macros={url:m.url||'',height:(/%$/.test(m.height))?m.height:parseInt(m.height,10)||100,width:(/%$/.test(m.width))?m.width:parseInt(m.width,10)||100,scripting:this.assert(m.scripting,false),controls:this.assert(m.controls,false),scale:this.assert(m.scale,1),status:this.assert(m.status,false),start:this.assert(m.start,false),loop:this.assert(m.loop,false),volume:this.assert(m.volume,20),id:m.id};delete m.url;delete m.mediaType;delete m.controls;delete m.status;delete m.start;delete m.loop;delete m.scale;delete m.scripting;delete m.volume;delete m.autoSize;delete m.params;delete m.unsupportedText;delete m.renderOnResize;delete m.listeners;delete m.height;delete m.width;return Ext.DomHelper.markup(m).replace(/(%40url|@url)/g,_macros.url).replace(/(%40start|@start)/g,_macros.start+'').replace(/(%40controls|@controls)/g,_macros.controls+'').replace(/(%40scale|@scale)/g,_macros.scale+'').replace(/(%40status|@status)/g,_macros.status+'').replace(/(%40id|@id)/g,_macros.id+'').replace(/(%40loop|@loop)/g,_macros.loop+'').replace(/(%40volume|@volume)/g,_macros.volume+'').replace(/(%40scripting|@scripting)/g,_macros.scripting+'').replace(/(%40width|@width)/g,_macros.width+'').replace(/(%40height|@height)/g,_macros.height+'')}else{var unsup=this.assert(m.unsupportedText||this.unsupportedText||media.unsupportedText,null);unsup=unsup?Ext.DomHelper.markup(unsup):null;return String.format(unsup||'Media Configuration/Plugin Error',' ',' ')}},setMask:function(el){if(this.mediaMask&&!this.mediaMask.enable){el=Ext.get(el);if(this.mediaMask=new Ext.ux.IntelliMask(el||this[this.mediaEl],Ext.apply({fixElementForMedia:true},this.mediaMask))){this.mediaMask.el.addClass('x-media-mask')}}},renderMedia:function(mediaCfg,ct,domPosition,w,h){if(!Ext.isReady){Ext.onReady(this.renderMedia.createDelegate(this,Array.prototype.slice.call(arguments,0)));return}var mc=(this.mediaCfg=mediaCfg||this.mediaCfg);ct=Ext.get(ct||this.lastCt||(this.mediaObject?this.mediaObject.dom.parentNode:null));this.onBeforeMedia.call(this,mc,ct,domPosition,w,h);if(ct){this.lastCt=ct;var markup;if(mc&&(markup=this.mediaMarkup(mc,w,h,ct))){this.setMask(ct);this.clearMedia();ct.update(markup);if(this.mediaMask&&this.autoMask){this.mediaMask.show()}}}this.onAfterMedia(ct)},clearMedia:function(){if(Ext.isReady&&this.mediaObject){try{this.mediaObject.removeAllListeners();this.mediaObject.remove()}catch(er){}}this.mediaObject=null},onBeforeMedia:function(mediaCfg,ct,domPosition){var m=mediaCfg||this.mediaCfg,mt;if(m&&(mt=this.getMediaType(m.mediaType))){m.autoSize=m.autoSize||mt.autoSize===true;if(m.autoSize&&(ct=Ext.isReady?Ext.get(ct||this.lastCt):null)){m.height=ct.getHeight(true)||this.assert(m.height,'auto');m.width=ct.getWidth(true)||this.assert(m.width,'auto')}}},onMediaLoad:function(e){if(e&&e.type=='load'){this.fireEvent('mediaload',this,this.mediaObject);if(this.mediaMask&&this.autoMask){this.mediaMask.hide()}}},onAfterMedia:function(ct){if(this.mediaCfg&&ct&&(this.mediaObject=ct.child('.x-media'))){this.mediaObject.ownerCt=this;if(this.mediaCfg.tag!=='object'){this.mediaObject.on({load:this.onMediaLoad,scope:this,single:true})}pollReadyState(this.mediaObject.dom,this.onMediaLoad.createDelegate(this));var L;if(L=this.mediaCfg.listeners||null){this.mediaObject.on(L)}this.fireEvent('mediarender',this,this.mediaObject)}},getInterface:function(){return this.mediaObject?this.mediaObject.dom||null:null},detectVersion:Ext.emptyFn,autoMask:Ext.isIE});var mediaComponentAdapter=function(){};Ext.extend(mediaComponentAdapter,Object,{hideMode:!Ext.isIE?'nosize':'display',animCollapse:false,visibilityCls:!Ext.isIE?'x-hide-nosize':null,autoScroll:true,shadow:false,bodyStyle:{position:'relative'},resizeMedia:function(comp,w,h){var mc=this.mediaCfg;if(mc&&this.boxReady){if(arguments.length>3&&(!this.mediaObject||mc.renderOnResize)){this.refreshMedia(this[this.mediaEl])}}},onAfterRender:function(visModeTargets){if(this.mediaCfg.renderOnResize){this.on('resize',this.resizeMedia,this)}else{this.renderMedia(this.mediaCfg,this[this.mediaEl]||this.getEl())}},doAutoLoad:Ext.emptyFn,refreshMedia:function(target){if(this.mediaCfg){this.renderMedia(null,target)}},mediaMask:false});Ext.ux.MediaComponent=Ext.extend(Ext.BoxComponent,{ctype:"Ext.ux.MediaComponent",autoEl:'div',cls:"x-media-comp",mediaEl:'el',getId:function(){return this.id||(this.id="media-comp"+(++Ext.Component.AUTO_ID))},initComponent:function(){this.visModeTargets=[this.actionMode];this.initMedia();Ext.ux.MediaComponent.superclass.initComponent.apply(this,arguments)},onRender:function(){Ext.ux.MediaComponent.superclass.onRender.apply(this,arguments);this.onAfterRender()},afterRender:function(ct){this.setAutoScroll();Ext.ux.MediaComponent.superclass.afterRender.apply(this,arguments)},beforeDestroy:function(){this.clearMedia();Ext.destroy(this.mediaMask,this.loadMask);Ext.ux.MediaComponent.superclass.beforeDestroy.call(this)},setAutoScroll:function(){if(this.rendered&&this.autoScroll){this.getEl().setOverflow('auto')}}});Ext.apply(Ext.ux.MediaComponent.prototype,Ext.ux.Media.prototype);Ext.apply(Ext.ux.MediaComponent.prototype,mediaComponentAdapter.prototype);Ext.reg('media',Ext.ux.MediaComponent);ux.Panel=Ext.extend(Ext.Panel,{ctype:"Ext.ux.Media.Panel",cls:"x-media-panel",mediaEl:'body',initComponent:function(){this.visModeTargets=[this.collapseEl,this.floating?null:this.actionMode];this.initMedia();this.html=this.contentEl=this.items=null;ux.Panel.superclass.initComponent.call(this)},onRender:function(){ux.Panel.superclass.onRender.apply(this,arguments);this.onAfterRender()},beforeDestroy:function(){this.clearMedia();ux.Panel.superclass.beforeDestroy.call(this)}});Ext.apply(ux.Panel.prototype,ux.prototype);Ext.apply(ux.Panel.prototype,mediaComponentAdapter.prototype);Ext.reg('mediapanel',Ext.ux.MediaPanel=ux.Panel);ux.Window=Ext.extend(Ext.Window,{cls:"x-media-window",ctype:"Ext.ux.Media.Window",mediaEl:'body',initComponent:function(){this.visModeTargets=[this.collapseEl,this.floating?null:this.actionMode];this.initMedia();this.html=this.contentEl=this.items=null;ux.Window.superclass.initComponent.call(this)},onRender:function(){ux.Window.superclass.onRender.apply(this,arguments);this.onAfterRender()},beforeDestroy:function(){this.clearMedia();ux.Window.superclass.beforeDestroy.call(this)}});Ext.apply(ux.Window.prototype,ux.prototype);Ext.apply(ux.Window.prototype,mediaComponentAdapter.prototype);Ext.reg('mediawindow',Ext.ux.MediaWindow=ux.Window);Ext.onReady(function(){var CSS=Ext.util.CSS,rules=[];CSS.getRule('.x-media')||(rules.push('.x-media{width:100%;height:100%;display:block;overflow:none;outline:none;}'));CSS.getRule('.x-media-mask')||(rules.push('.x-media-mask{width:100%;height:100%;position:relative;zoom:1;}'));CSS.getRule('.x-media-img')||(rules.push('.x-media-img{background-color:transparent;width:auto;height:auto;zoom:1;}'));CSS.getRule('.x-hide-nosize')||(rules.push('.x-hide-nosize,.x-hide-nosize *{height:0px!important;width:0px!important;border:none!important;}'));if(!!rules.length){CSS.createStyleSheet(rules.join(''))}});Ext.apply(Ext.Element.prototype,{setVisible:function(visible,animate){if(!animate||!Ext.lib.Anim){if(this.visibilityMode===Ext.Element.DISPLAY){this.setDisplayed(visible)}else if(this.visibilityMode===Ext.Element.VISIBILITY){this.fixDisplay();this.dom.style.visibility=visible?"visible":"hidden"}else{this[visible?'removeClass':'addClass'](String(this.visibilityMode))}}else{var dom=this.dom;var visMode=this.visibilityMode;if(visible){this.setOpacity(.01);this.setVisible(true)}this.anim({opacity:{to:(visible?1:0)}},this.preanim(arguments,1),null,.35,'easeIn',function(){if(!visible){if(visMode===Ext.Element.DISPLAY){dom.style.display="none"}else if(visMode===Ext.Element.VISIBILITY){dom.style.visibility="hidden"}else{Ext.get(dom).addClass(String(visMode))}Ext.get(dom).setOpacity(1)}})}return this},isVisible:function(deep){var vis=!(this.getStyle("visibility")==="hidden"||this.getStyle("display")==="none"||this.hasClass(this.visibilityMode));if(deep!==true||!vis){return vis}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!=="body"){if(!Ext.fly(p,'_isVisible').isVisible()){return false}p=p.parentNode}return true}});var ElementMaskFixes={mask:function(msg,msgCls,maskCls){if(this.getStyle("position")=="static"){this.setStyle("position","relative")}if(this._maskMsg){this._maskMsg.remove()}if(this._mask){}this._mask||(this._mask=Ext.DomHelper.append(this.dom,{cls:maskCls||"ext-el-mask"},true));!Ext.isIE||this.addClass("x-masked");this._mask.setVisible(true);if(typeof msg=='string'){var mm=this._maskMsg=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask-msg "+msgCls||'',style:{visibility:'hidden'},cn:{tag:'div',html:msg}},true);var el=this.dom;(function(){try{mm.center(el).setVisible(true)}catch(e){}}).defer(4)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&this.getStyle('height')=='auto'){this._mask.setSize(this.dom.clientWidth,this.getHeight())}return this._mask},unmask:function(remove){if(this._maskMsg){if(remove){this._maskMsg.remove();delete this._maskMsg}else{this._maskMsg.setVisible.defer(4,this._maskMsg,[false])}}if(this._mask){if(remove){this._mask.remove();delete this._mask}else{this._mask.setVisible(false)}}this.removeClass("x-masked")}};ux.VisibilityFix=function(opt){opt||(opt={});this.init=function(c){c.hideMode=opt.hideMode||c.hideMode;c.on('render',function(co){var els=[co.collapseEl,(co.floating?null:co.actionMode)].concat(opt.elements||[]);var El=Ext.Element;var mode=opt.mode||co.visibilityCls||El[co.hideMode.toUpperCase()]||El.VISIBILITY;Ext.each(els,function(el){var e=co[el]||el;if(e&&e.setVisibilityMode){e.setVisibilityMode(mode)}})},c,{single:true})}};Ext.ux.IntelliMask=function(el,config){Ext.apply(this,config);this.el=Ext.get(el);this.removeMask=Ext.value(this.removeMask,true);if(el&&this.fixElementForMedia){Ext.apply(el,ElementMaskFixes)}};Ext.ux.IntelliMask.prototype={msg:'载入媒介...',msgCls:'x-mask-loading',zIndex:null,disabled:false,active:false,autoHide:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},show:function(msg,msgCls,fn,fnDelay){if(this.disabled||!this.el){return null}var opt={},autoHide=this.autoHide;fnDelay=parseInt(fnDelay,10)||20;if(typeof msg=='object'){opt=msg;msg=opt.msg;msgCls=opt.msgCls;fn=opt.fn;autoHide=typeof opt.autoHide!='undefined'?opt.autoHide:autoHide;fnDelay=opt.fnDelay||fnDelay}var mask=this.el.mask(msg||this.msg,msgCls||this.msgCls);this.active=!!this.el._mask;if(this.active){if(this.zIndex){this.el._mask.setStyle("z-index",this.zIndex);if(this.el._maskMsg){this.el._maskMsg.setStyle("z-index",this.zIndex+1)}}}if(typeof fn==='function'){fn.defer(fnDelay,opt.scope||null)}else{fnDelay=0}if(autoHide&&(autoHide=parseInt(autoHide,10)||2000)){this.hide.defer(autoHide+(fnDelay||0),this)}return this.active?{mask:this.el._mask,maskMsg:this.el._maskMsg}:null},hide:function(remove){if(this.el){this.el.unmask(remove||this.removeMask)}this.active=false;return this},destroy:function(){this.hide(true);this.el=null}}})();(function(){var ux=Ext.ux.Media;ux.Flash=Ext.extend(ux,{constructor:function(){ux.Flash.superclass.constructor.apply(this,arguments)},SWFObject:null,varsName:'flashVars',hideMode:'nosize',mediaType:Ext.apply({tag:'object',cls:'x-media x-media-swf',type:'application/x-shockwave-flash',loop:null,scripting:"sameDomain",start:true,unsupportedText:{cn:['The Adobe Flash Player{0}is required.',{tag:'br'},{tag:'a',cn:[{tag:'img',src:'http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif'}],href:'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash',target:'_flash'}]},params:{movie:"@url",play:"@start",loop:"@loop",menu:"@controls",quality:"high",bgcolor:"#FFFFFF",wmode:"opaque",allowscriptaccess:"@scripting",allowfullscreen:false,allownetworking:'all'}},Ext.isIE?{classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"}:{data:"@url"}),getMediaType:function(){return this.mediaType},initMedia:function(){var mc=Ext.apply({},this.mediaCfg||{});var requiredVersion=(this.requiredVersion=mc.requiredVersion||this.requiredVersion||false);var hasFlash=!!(this.playerVersion=this.detectVersion());var hasRequired=hasFlash&&(requiredVersion?this.assertVersion(requiredVersion):true);var unsupportedText=this.assert(mc.unsupportedText||this.unsupportedText||(this.getMediaType()||{}).unsupportedText,null);if(unsupportedText){unsupportedText=Ext.DomHelper.markup(unsupportedText);unsupportedText=mc.unsupportedText=String.format(unsupportedText,(requiredVersion?' '+requiredVersion+' ':' '),(this.playerVersion?' '+this.playerVersion+' ':' Not installed.'))}if(!hasRequired){this.autoMask=false;var canInstall=hasFlash&&this.assertVersion('6.0.65');if(canInstall&&mc.installUrl){mc=mc.installDescriptor||{tag:'object',cls:'x-media x-media-swf x-media-swfinstaller',id:'SWFInstaller',type:'application/x-shockwave-flash',data:"@url",url:mc.installUrl,width:(/%$/.test(mc.width))?mc.width:((parseInt(mc.width,10)||0)<310?310:mc.width),height:(/%$/.test(mc.height))?mc.height:((parseInt(mc.height,10)||0)<138?138:mc.height),loop:false,start:true,unsupportedText:unsupportedText,params:{quality:"high",movie:'@url',allowscriptacess:"always",align:"middle",bgcolor:"#3A6EA5",pluginspage:mc.pluginsPage||this.pluginsPage||"http://www.adobe.com/go/getflashplayer"}};mc.params[this.varsName]="MMredirectURL="+(mc.installRedirect||window.location)+"&MMplayerType="+(Ext.isIE?"ActiveX":"Plugin")+"&MMdoctitle="+(document.title=document.title.slice(0,47)+" - Flash Player Installation")}else{mc.mediaType=null}}if(mc.eventSynch){mc.params||(mc.params={});var vars=mc.params[this.varsName]||(mc.params[this.varsName]={});if(typeof vars==='string'){vars=Ext.urlDecode(vars,true)}var eventVars=(mc.eventSynch===true?{allowedDomain:vars.allowedDomain||document.location.hostname,elementID:mc.id||(mc.id=Ext.id()),eventHandler:'Ext.ux.Media.Flash.eventSynch'}:mc.eventSynch);Ext.apply(mc.params,{allowscriptaccess:'always'})[this.varsName]=Ext.applyIf(vars,eventVars)}delete mc.requiredVersion;delete mc.installUrl;delete mc.installRedirect;delete mc.installDescriptor;delete mc.eventSynch;mc.mediaType="SWF";this.mediaCfg=mc;if(this.events){this.addEvents('flashinit','fscommand')}ux.Flash.superclass.initMedia.call(this)},assertVersion:function(versionMap){var compare;versionMap||(versionMap=[]);if(Ext.isArray(versionMap)){compare=versionMap}else{compare=String(versionMap).split('.')}compare=(compare.concat([0,0,0,0])).slice(0,3);var tpv;if(!(tpv=this.playerVersion||(this.playerVersion=this.detectVersion()))){return false}if(tpv.major>parseFloat(compare[0])){return true}else if(tpv.major==parseFloat(compare[0])){if(tpv.minor>parseFloat(compare[1])){return true}else if(tpv.minor==parseFloat(compare[1])){if(tpv.rev>=parseFloat(compare[2])){return true}}}return false},detectVersion:function(){if(this.mediaVersion){return this.mediaVersion}var version=false;var formatVersion=function(version){return version&&!!version.length?{major:version[0]!==null?parseInt(version[0],10):0,minor:version[1]!==null?parseInt(version[1],10):0,rev:version[2]!==null?parseInt(version[2],10):0,toString:function(){return this.major+'.'+this.minor+'.'+this.rev}}:false};var sfo=null;if(Ext.isIE){try{sfo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{sfo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version=[6,0,21];sfo.allowscriptaccess="always"}catch(ex){if(version&&version[0]===6){return formatVersion(version)}}try{sfo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(ex1){}}if(sfo){version=sfo.GetVariable("$version").split(" ")[1].split(",")}}else if(navigator.plugins&&navigator.mimeTypes.length){sfo=navigator.plugins["Shockwave Flash"];if(sfo&&sfo.description){version=sfo.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".")}}return(this.mediaVersion=formatVersion(version))},_applyFixes:function(){var o;if(Ext.isIE&&Ext.isWindows&&(o=this.SWFObject)){o.style.display='none';if(o.readyState==4){for(var x in o){if(typeof o[x]=='function'){o[x]=null}}}}},onAfterMedia:function(ct){ux.Flash.superclass.onAfterMedia.apply(this,arguments);this.SWFObject=this.getInterface();if(this.mediaObject){var id=this.mediaObject.id;if(Ext.isIE){if(!(Ext.query('script[for='+id+']').length)){writeScript('var c;if(c=Ext.getCmp("'+this.id+'")){c.onfsCommand.apply(c,arguments);}',{event:"FSCommand",htmlFor:id})}}else{window[id+'_DoFSCommand']||(window[id+'_DoFSCommand']=this.onfsCommand.createDelegate(this))}}},clearMedia:function(){if(this.mediaObject){var id=this.mediaObject.id;if(Ext.isIE){Ext.select('script[for='+id+']',true).remove()}else{window[id+'_DoFSCommand']=null;delete window[id+'_DoFSCommand']}this._applyFixes()}ux.Flash.superclass.clearMedia.call(this);this.SWFObject=null},getSWFObject:function(){return this.getInterface()},onfsCommand:function(command,args){if(this.events){this.fireEvent('fscommand',this,command,args)}},setVariable:function(vName,value){var fo=this.getInterface();if(fo&&typeof fo.SetVariable!='undefined'){fo.SetVariable(vName,value);return true}return false},getVariable:function(vName){var fo=this.getInterface();if(fo&&typeof fo.GetVariable!='undefined'){return fo.GetVariable(vName)}return undefined},onFlashInit:function(){if(this.mediaMask&&this.autoMask){this.mediaMask.hide()}this.fireEvent.defer(10,this,['flashinit',this,this.getInterface()])},_handleSWFEvent:function(event){var type=event.type||event||false;if(type){if(this.events&&!this.events[String(type)]){this.addEvents(String(type))}return this.fireEvent.apply(this,[String(type),this].concat(Array.prototype.slice.call(arguments,0)))}}});ux.Flash.eventSynch=function(elementID,event){var SWF=Ext.get(elementID);if(SWF&&SWF.ownerCt){return SWF.ownerCt._handleSWFEvent.apply(SWF.ownerCt,Array.prototype.slice.call(arguments,1))}};Ext.ux.FlashComponent=Ext.extend(Ext.ux.MediaComponent,{ctype:"Ext.ux.FlashComponent",getId:function(){return this.id||(this.id="flash-comp"+(++Ext.Component.AUTO_ID))}});Ext.apply(Ext.ux.FlashComponent.prototype,ux.Flash.prototype);Ext.reg('uxflash',Ext.ux.FlashComponent);ux.Panel.Flash=Ext.extend(ux.Panel,{ctype:"Ext.ux.Media.Panel.Flash"});Ext.apply(ux.Panel.Flash.prototype,ux.Flash.prototype);Ext.reg('flashpanel',Ext.ux.MediaPanel.Flash=Ext.ux.FlashPanel=ux.Panel.Flash);Ext.reg('uxflashpanel',ux.Panel.Flash);Ext.ux.FlashWindow=(ux.Window.Flash=Ext.extend(ux.Window,{ctype:"Ext.ux.FlashWindow",animCollpase:true}));Ext.apply(ux.Window.Flash.prototype,ux.Flash.prototype);var writeScript=function(block,attributes){attributes=Ext.apply({},attributes||{},{type:"text/javascript",text:block});try{var head,script,doc=document;if(doc&&doc.getElementsByTagName){if(!(head=doc.getElementsByTagName("head")[0])){head=doc.createElement("head");doc.getElementsByTagName("html")[0].appendChild(head)}if(head&&(script=doc.createElement("script"))){for(var attrib in attributes){if(attributes.hasOwnProperty(attrib)&&attrib in script){script[attrib]=attributes[attrib]}}return!!head.appendChild(script)}}}catch(ex){}return false}})();
function getCurrentTime(){var myYear,myMonth,myDate,myDayIndex,myDay,myWeekArray;var hours,minutes,seconds,xfile;var intHours,intMinutes,intSeconds;var today;var timeString,dateString,allTimeString;myWeekArray=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");today=new Date();intHours=today.getHours();intMinutes=today.getMinutes();intSeconds=today.getSeconds();myYear=today.getFullYear();myMonth=today.getMonth()+1;myDate=today.getDate();myDayIndex=today.getDay();for(var i=0;i<myWeekArray.length;i++){if(myDayIndex==i){myDay=myWeekArray[i]}}hours=intHours+":";if(intMinutes<10){minutes="0"+intMinutes+":"}else{minutes=intMinutes+":"}if(intSeconds<10){seconds="0"+intSeconds+" "}else{seconds=intSeconds+" "}dateString=myYear+"年"+myMonth+"月"+myDate+"日 "+myDay;timeString="现在时间："+hours+minutes+seconds+" ";allTimeString=timeString+dateString;document.getElementById("currentTimePanel").innerHTML=allTimeString;window.setTimeout("getCurrentTime();",1000)};
(function(){Ext.ux.Media=function(F){Ext.apply(this,F||{});this.toString=this.mediaMarkup;this.initMedia();};var B=Ext.ux.Media;B.mediaTypes={"PDF":Ext.apply({tag:"object",cls:"x-media x-media-pdf",type:"application/pdf",data:"@url",autoSize:true,params:{src:"@url"}},Ext.isIE?{classid:"CLSID:CA8A9780-280D-11CF-A24D-444553540000"}:false),"PDFFRAME":{tag:"iframe",cls:"x-media x-media-pdf-frame",frameBorder:0,style:{overflow:"none",width:"100%",height:"100%"},src:"@url",autoSize:true},"WMV":Ext.apply({tag:"object",cls:"x-media x-media-wmv",type:"application/x-mplayer2",data:"@url",autoSize:false,params:{filename:"@url",displaysize:0,autostart:"@start",showControls:"@controls",showStatusBar:"@status",showaudiocontrols:true,stretchToFit:true,Volume:"@volume",PlayCount:1}},Ext.isIE?{classid:"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95",codebase:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701",type:"application/x-oleobject"}:{src:"@url"}),"SWF":Ext.apply({tag:"object",cls:"x-media x-media-swf",type:"application/x-shockwave-flash",scripting:"sameDomain",standby:"载入中..",loop:true,start:false,unsupportedText:{cn:["The Adobe Flash Player is required.",{tag:"br"},{tag:"a",cn:[{tag:"img",src:"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"}],href:"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash",target:"_flash"}]},params:{movie:"@url",menu:"@controls",play:"@start",quality:"high",allowscriptaccess:"@scripting",allownetworking:"all",allowfullScreen:false,bgcolor:"#FFFFFF",wmode:"opaque",loop:"@loop"}},Ext.isIE?{classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"}:{data:"@url"}),"JWP":Ext.apply({tag:"object",cls:"x-media x-media-swf x-media-flv",type:"application/x-shockwave-flash",data:"@url",loop:false,start:false,params:{movie:"@url",flashVars:{autostart:"@start",repeat:"@loop",height:"@height",width:"@width",id:"@id"}}},Ext.isIE?{classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"}:false),"QT":Ext.apply({tag:"object",cls:"x-media x-media-quicktime",type:"video/quicktime",style:{position:"relative","z-index":1,behavior:"url(#qt_event_source)"},scale:"aspect",unsupportedText:'<a href="http://www.apple.com/quicktime/download/">Get QuickTime</a>',scripting:true,volume:"50%",data:"@url",params:{src:Ext.isIE?"@url":null,href:"http://quicktime.com",target:"_blank",autoplay:"@start",targetcache:true,cache:true,wmode:"transparent",controller:"@controls",enablejavascript:"@scripting",loop:"@loop",scale:"@scale",volume:"@volume",QTSRC:"@url"}},Ext.isIE?{classid:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",codebase:"http://www.apple.com/qtactivex/qtplugin.cab#version=7,2,1,0"}:{PLUGINSPAGE:"http://www.apple.com/quicktime/download/"}),"QTEVENTS":{tag:"object",id:"qt_event_source",cls:"x-media x-media-qtevents",type:"video/quicktime",params:{},classid:"clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598",codebase:"http://www.apple.com/qtactivex/qtplugin.cab#version=7,2,1,0"},"WPMP3":Ext.apply({tag:"object",cls:"x-media x-media-audio x-media-wordpress",type:"application/x-shockwave-flash",data:"@url",start:true,loop:false,params:{movie:"@url",width:"@width",flashVars:{autostart:"@start",controller:"@controls",enablejavascript:"@scripting",loop:"@loop",scale:"@scale",initialvolume:"@volume",width:"@width",encode:"no",soundFile:""}}},Ext.isIE?{classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"}:false),"REAL":Ext.apply({tag:"object",cls:"x-media x-media-real",type:"audio/x-pn-realaudio",data:"@url",controls:"imagewindow,all",start:false,standby:"载入媒体播放器...",params:{src:"@url",autostart:"@start",center:false,maintainaspect:true,controller:"@controls",controls:"@controls",volume:"@volume",loop:"@loop",console:"_master",backgroundcolor:"#000000"}},Ext.isIE?{classid:"clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA"}:false),"SVG":{tag:"object",cls:"x-media x-media-img x-media-svg",type:"image/svg+xml",data:"@url",params:{src:"@url"}},"GIF":{tag:"img",cls:"x-media x-media-img x-media-gif",src:"@url"},"JPEG":{tag:"img",cls:"x-media x-media-img x-media-jpeg",src:"@url"},"JP2":{tag:"object",cls:"x-media x-media-img x-media-jp2",type:"image/jpeg2000-image",data:"@url"},"PNG":{tag:"img",cls:"x-media x-media-img x-media-png",src:"@url"},"HTM":{tag:"iframe",cls:"x-media x-media-html",frameBorder:0,style:{overflow:"auto",width:"100%",height:"100%"},src:"@url"},"TXT":{tag:"object",cls:"x-media x-media-text",type:"text/plain",style:{overflow:"auto",width:"100%",height:"100%"},data:"@url"},"RTF":{tag:"object",cls:"x-media x-media-rtf",type:"application/rtf",style:{overflow:"auto",width:"100%",height:"100%"},data:"@url"},"JS":{tag:"object",cls:"x-media x-media-js",type:"text/javascript",style:{overflow:"auto",width:"100%",height:"100%"},data:"@url"},"CSS":{tag:"object",cls:"x-media x-media-css",type:"text/css",style:{overflow:"auto",width:"100%",height:"100%"},data:"@url"},"SILVERLIGHT":{tag:"object",cls:"x-media x-media-silverlight",type:"application/ag-plugin",data:"@url",params:{MinRuntimeVersion:"1.0",source:"@url"}},"SILVERLIGHT2":{tag:"object",cls:"x-media x-media-silverlight",type:"application/x-silverlight-2-b2",data:"data:application/x-silverlight-2-b2,",params:{MinRuntimeVersion:"2.0"},unsupportedText:'<a href="http://go2.microsoft.com/fwlink/?LinkID=114576&v=2.0"><img style="border-width: 0pt;" alt="Get Microsoft Silverlight" src="http://go2.microsoft.com/fwlink/?LinkID=108181"/></a>'},"DATAVIEW":{tag:"object",cls:"x-media x-media-dataview",classid:"CLSID:0ECD9B64-23AA-11D0-B351-00A0C9055D8E",type:"application/x-oleobject",unsupportedText:"MS Dataview Control is not installed"},"OWC:XLS":Ext.apply({tag:"object",cls:"x-media x-media-xls",type:"application/vnd.ms-excel",controltype:"excel",params:{DataType:"CSVURL",CSVURL:"@url",DisplayTitleBar:true,AutoFit:true}},Ext.isIE?{codebase:"file:msowc.cab",classid:"CLSID:0002E510-0000-0000-C000-000000000046"}:false),"OWC:CHART":Ext.apply({tag:"object",cls:"x-media x-media-xls",type:"application/vnd.ms-excel",data:"@url",params:{DataType:"CSVURL"}},Ext.isIE?{classid:"CLSID:0002E500-0000-0000-C000-000000000046"}:false),"OFFICE":{tag:"object",cls:"x-media x-media-office",type:"application/x-msoffice",data:"@url"},"POWERPOINT":Ext.apply({tag:"object",cls:"x-media x-media-ppt",type:"application/vnd.ms-powerpoint",file:"@url"},Ext.isIE?{classid:"CLSID:EFBD14F0-6BFB-11CF-9177-00805F8813FF"}:false),"XML":{tag:"iframe",cls:"x-media x-media-xml",style:{overflow:"auto"},src:"@url"},"VLC":{tag:"object",cls:"x-media x-media-vlc",type:"application/x-vlc-plugin",version:"VideoLAN.VLCPlugin.2",pluginspage:"http://www.videolan.org",data:"@url"},"RDP":Ext.apply({tag:"object",cls:"x-media x-media-rdp",type:"application/rds",unsupportedText:'Remote Desktop Web Connection ActiveX control is required. <a target="_msd" href="http://go.microsoft.com/fwlink/?linkid=44333">Download it here</a>.',params:{Server:"@url",Fullscreen:false,StartConnected:false,DesktopWidth:"@width",DesktopHeight:"@height"}},Ext.isIE?{classid:"CLSID:9059f30f-4eb1-4bd2-9fdc-36f43a218f4a",CODEBASE:"msrdp.cab#version=5,2,3790,0"}:false)};var C=/4$/i;var D=function(H,F,G){if(H&&typeof H.readyState!="undefined"){(G||C).test(H.readyState)?F({type:"load"}):D.defer(10,null,[H,F]);}};if(parseFloat(Ext.version)<2.1){throw"Ext.ux.Media and sub-classes are not License-Compatible with your Ext release.";}Ext.extend(B,Object,{mediaObject:null,mediaCfg:null,mediaVersion:null,requiredVersion:null,unsupportedText:null,init:function(F){if(F&&this.getEl===undefined){Ext.applyIf(F,this);}},initMedia:function(){if(!Ext.isIE&&this.initialConfig){new B.VisibilityFix({mode:this.visibilityCls,hideMode:this.hideMode,elements:this.visModeTargets||null}).init(this);}if(this.events){this.addEvents("mediarender","mediaload");}},getMediaType:function(F){return B.mediaTypes[F];},assert:function(F,G){F=typeof F==="function"?F.call(F.scope||null):F;return Ext.value(F,G);},mediaMarkup:function(F,H,R,M){F=F||this.mediaCfg;if(!F){return"";}var J=Ext.apply({url:false,autoSize:false},F);J.url=this.assert(J.url,false);if(J.mediaType){var P,G,K=Ext.Element;var I=Ext.apply({},this.getMediaType(this.assert(J.mediaType,false))||false);var L=Ext.apply(I.params||{},J.params||{});for(var Q in L){if(L.hasOwnProperty(Q)){J.children||(J.children=[]);G=this.assert(L[Q],null);if(G!==null){J.children.push({tag:"param",name:Q,value:typeof G==="object"?Ext.urlEncode(G):encodeURI(G)});}}}delete I.params;var N=this.assert(J.unsupportedText||this.unsupportedText||I.unsupportedText,null);if(N){J.children||(J.children=[]);J.children.push(N);}if(J.style&&typeof J.style!="object"){throw"Style must be JSON formatted";}J.style=this.assert(Ext.apply(I.style||{},J.style||{}),{});delete I.style;J.height=this.assert(R||J.height||I.height||J.style.height,null);J.width=this.assert(H||J.width||I.width||J.style.width,null);J=Ext.apply({tag:"object"},J,I);if(J.height||J.autoSize){Ext.apply(J.style,{height:K.addUnits(J.autoSize?"100%":J.height,K.prototype.defaultUnit)});}if(J.width||J.autoSize){Ext.apply(J.style,{width:K.addUnits(J.autoSize?"100%":J.width,K.prototype.defaultUnit)});}J.id||(J.id=Ext.id());J.name=this.assert(J.name,J.id);var O={url:J.url||"",height:(/%$/.test(J.height))?J.height:parseInt(J.height,10)||100,width:(/%$/.test(J.width))?J.width:parseInt(J.width,10)||100,scripting:this.assert(J.scripting,false),controls:this.assert(J.controls,false),scale:this.assert(J.scale,1),status:this.assert(J.status,false),start:this.assert(J.start,false),loop:this.assert(J.loop,false),volume:this.assert(J.volume,20),id:J.id};delete J.url;delete J.mediaType;delete J.controls;delete J.status;delete J.start;delete J.loop;delete J.scale;delete J.scripting;delete J.volume;delete J.autoSize;delete J.params;delete J.unsupportedText;delete J.renderOnResize;delete J.listeners;delete J.height;delete J.width;return Ext.DomHelper.markup(J).replace(/(%40url|@url)/g,O.url).replace(/(%40start|@start)/g,O.start+"").replace(/(%40controls|@controls)/g,O.controls+"").replace(/(%40scale|@scale)/g,O.scale+"").replace(/(%40status|@status)/g,O.status+"").replace(/(%40id|@id)/g,O.id+"").replace(/(%40loop|@loop)/g,O.loop+"").replace(/(%40volume|@volume)/g,O.volume+"").replace(/(%40scripting|@scripting)/g,O.scripting+"").replace(/(%40width|@width)/g,O.width+"").replace(/(%40height|@height)/g,O.height+"");}else{var N=this.assert(J.unsupportedText||this.unsupportedText||I.unsupportedText,null);N=N?Ext.DomHelper.markup(N):null;return String.format(N||"Media Configuration/Plugin Error"," "," ");}},setMask:function(F){if(this.mediaMask&&!this.mediaMask.enable){F=Ext.get(F);if(this.mediaMask=new Ext.ux.IntelliMask(F||this[this.mediaEl],Ext.apply({fixElementForMedia:true},this.mediaMask))){this.mediaMask.el.addClass("x-media-mask");}}},renderMedia:function(L,H,K,F,I){if(!Ext.isReady){Ext.onReady(this.renderMedia.createDelegate(this,Array.prototype.slice.call(arguments,0)));return ;}var J=(this.mediaCfg=L||this.mediaCfg);H=Ext.get(H||this.lastCt||(this.mediaObject?this.mediaObject.dom.parentNode:null));this.onBeforeMedia.call(this,J,H,K,F,I);if(H){this.lastCt=H;var G;if(J&&(G=this.mediaMarkup(J,F,I,H))){this.setMask(H);this.clearMedia();H.update(G);if(this.mediaMask&&this.autoMask){this.mediaMask.show();}}}this.onAfterMedia(H);},clearMedia:function(){if(Ext.isReady&&this.mediaObject){try{this.mediaObject.removeAllListeners();this.mediaObject.remove();}catch(F){}}this.mediaObject=null;},onBeforeMedia:function(J,H,I){var F=J||this.mediaCfg,G;if(F&&(G=this.getMediaType(F.mediaType))){F.autoSize=F.autoSize||G.autoSize===true;if(F.autoSize&&(H=Ext.isReady?Ext.get(H||this.lastCt):null)){F.height=H.getHeight(true)||this.assert(F.height,"auto");F.width=H.getWidth(true)||this.assert(F.width,"auto");}}},onMediaLoad:function(F){if(F&&F.type=="load"){this.fireEvent("mediaload",this,this.mediaObject);if(this.mediaMask&&this.autoMask){this.mediaMask.hide();}}},onAfterMedia:function(G){if(this.mediaCfg&&G&&(this.mediaObject=G.child(".x-media"))){this.mediaObject.ownerCt=this;if(this.mediaCfg.tag!=="object"){this.mediaObject.on({load:this.onMediaLoad,scope:this,single:true});}D(this.mediaObject.dom,this.onMediaLoad.createDelegate(this));var F;if(F=this.mediaCfg.listeners||null){this.mediaObject.on(F);}this.fireEvent("mediarender",this,this.mediaObject);}},getInterface:function(){return this.mediaObject?this.mediaObject.dom||null:null;},detectVersion:Ext.emptyFn,autoMask:Ext.isIE});var E=function(){};Ext.extend(E,Object,{hideMode:!Ext.isIE?"nosize":"display",animCollapse:Ext.enableFx&&Ext.isIE,animFloat:Ext.enableFx&&Ext.isIE,visibilityCls:!Ext.isIE?"x-hide-nosize":null,autoScroll:true,shadow:false,bodyStyle:{position:"relative"},resizeMedia:function(G,F,H){var I=this.mediaCfg;if(I&&this.boxReady){if(arguments.length>3&&(!this.mediaObject||I.renderOnResize)){this.refreshMedia(this[this.mediaEl]);}}},onAfterRender:function(F){if(this.mediaCfg.renderOnResize){this.on("resize",this.resizeMedia,this);}else{this.renderMedia(this.mediaCfg,this[this.mediaEl]||this.getEl());}},doAutoLoad:Ext.emptyFn,refreshMedia:function(F){if(this.mediaCfg){this.renderMedia(null,F);}},mediaMask:false});Ext.ux.MediaComponent=Ext.extend(Ext.BoxComponent,{ctype:"Ext.ux.MediaComponent",autoEl:"div",cls:"x-media-comp",mediaEl:"el",getId:function(){return this.id||(this.id="media-comp"+(++Ext.Component.AUTO_ID));},initComponent:function(){this.visModeTargets=[this.actionMode];this.initMedia();Ext.ux.MediaComponent.superclass.initComponent.apply(this,arguments);},onRender:function(){Ext.ux.MediaComponent.superclass.onRender.apply(this,arguments);this.onAfterRender();},afterRender:function(F){this.setAutoScroll();Ext.ux.MediaComponent.superclass.afterRender.apply(this,arguments);},beforeDestroy:function(){this.clearMedia();Ext.destroy(this.mediaMask,this.loadMask);Ext.ux.MediaComponent.superclass.beforeDestroy.call(this);},setAutoScroll:function(){if(this.rendered&&this.autoScroll){this.getEl().setOverflow("auto");}}});Ext.apply(Ext.ux.MediaComponent.prototype,Ext.ux.Media.prototype);Ext.apply(Ext.ux.MediaComponent.prototype,E.prototype);Ext.reg("media",Ext.ux.MediaComponent);B.Panel=Ext.extend(Ext.Panel,{ctype:"Ext.ux.Media.Panel",cls:"x-media-panel",mediaEl:"body",initComponent:function(){this.visModeTargets=[this.collapseEl,this.floating?null:this.actionMode];this.initMedia();this.html=this.contentEl=this.items=null;B.Panel.superclass.initComponent.call(this);},onRender:function(){B.Panel.superclass.onRender.apply(this,arguments);this.onAfterRender();},beforeDestroy:function(){this.clearMedia();B.Panel.superclass.beforeDestroy.call(this);}});Ext.apply(B.Panel.prototype,B.prototype);Ext.apply(B.Panel.prototype,E.prototype);Ext.reg("mediapanel",Ext.ux.MediaPanel=B.Panel);B.Window=Ext.extend(Ext.Window,{cls:"x-media-window",ctype:"Ext.ux.Media.Window",mediaEl:"body",initComponent:function(){this.visModeTargets=[this.collapseEl,this.floating?null:this.actionMode];this.initMedia();this.html=this.contentEl=this.items=null;B.Window.superclass.initComponent.call(this);},onRender:function(){B.Window.superclass.onRender.apply(this,arguments);this.onAfterRender();},beforeDestroy:function(){this.clearMedia();B.Window.superclass.beforeDestroy.call(this);}});Ext.apply(B.Window.prototype,B.prototype);Ext.apply(B.Window.prototype,E.prototype);Ext.reg("mediawindow",Ext.ux.MediaWindow=B.Window);Ext.onReady(function(){var F=Ext.util.CSS,G=[];F.getRule(".x-media")||(G.push(".x-media{width:100%;height:100%;display:block;overflow:none;outline:none;}"));F.getRule(".x-media-mask")||(G.push(".x-media-mask{width:100%;height:100%;position:relative;zoom:1;}"));F.getRule(".x-media-img")||(G.push(".x-media-img{background-color:transparent;width:auto;height:auto;zoom:1;}"));F.getRule(".x-hide-nosize")||(G.push(".x-hide-nosize,.x-hide-nosize *{height:0px!important;width:0px!important;border:none!important;}"));if(!!G.length){F.createStyleSheet(G.join(""));}});Ext.apply(Ext.Element.prototype,{setVisible:function(I,F){if(!F||!Ext.lib.Anim){if(this.visibilityMode===Ext.Element.DISPLAY){this.setDisplayed(I);}else{if(this.visibilityMode===Ext.Element.VISIBILITY){this.fixDisplay();this.dom.style.visibility=I?"visible":"hidden";}else{this[I?"removeClass":"addClass"](String(this.visibilityMode));}}}else{var H=this.dom;var G=this.visibilityMode;if(I){this.setOpacity(0.01);this.setVisible(true);}this.anim({opacity:{to:(I?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!I){if(G===Ext.Element.DISPLAY){H.style.display="none";}else{if(G===Ext.Element.VISIBILITY){H.style.visibility="hidden";}else{Ext.get(H).addClass(String(G));}}Ext.get(H).setOpacity(1);}});}return this;},isVisible:function(F){var G=!(this.getStyle("visibility")==="hidden"||this.getStyle("display")==="none"||this.hasClass(this.visibilityMode));if(F!==true||!G){return G;}var H=this.dom.parentNode;while(H&&H.tagName.toLowerCase()!=="body"){if(!Ext.fly(H,"_isVisible").isVisible()){return false;}H=H.parentNode;}return true;}});var A={mask:function(J,H,G){if(this.getStyle("position")=="static"){this.setStyle("position","relative");}if(this._maskMsg){this._maskMsg.remove();}this._mask||(this._mask=Ext.DomHelper.append(this.dom,{cls:G||"ext-el-mask"},true));!Ext.isIE||this.addClass("x-masked");this._mask.setVisible(true);if(typeof J=="string"){var I=this._maskMsg=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask-msg "+H||"",style:{visibility:"hidden"},cn:{tag:"div",html:J}},true);var F=this.dom;(function(){try{I.center(F).setVisible(true);}catch(K){}}).defer(4);}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&this.getStyle("height")=="auto"){this._mask.setSize(this.dom.clientWidth,this.getHeight());}return this._mask;},unmask:function(F){if(this._maskMsg){if(F){this._maskMsg.remove();delete this._maskMsg;}else{this._maskMsg.setVisible.defer(4,this._maskMsg,[false]);}}if(this._mask){if(F){this._mask.remove();delete this._mask;}else{this._mask.setVisible(false);}}this.removeClass("x-masked");}};B.VisibilityFix=function(F){F||(F={});this.init=function(G){G.hideMode=F.hideMode||G.hideMode;G.on("render",function(K){var H=[K.collapseEl,(K.floating?null:K.actionMode)].concat(F.elements||[]);var I=Ext.Element;var J=F.mode||K.visibilityCls||I[K.hideMode.toUpperCase()]||I.VISIBILITY;Ext.each(H,function(L){var M=K[L]||L;if(M&&M.setVisibilityMode){M.setVisibilityMode(J);}});},G,{single:true});};};Ext.ux.IntelliMask=function(G,F){Ext.apply(this,F);this.el=Ext.get(G);this.removeMask=Ext.value(this.removeMask,true);if(G&&this.fixElementForMedia){Ext.apply(G,A);}};Ext.ux.IntelliMask.prototype={msg:"载入媒介...",msgCls:"x-mask-loading",zIndex:null,disabled:false,active:false,autoHide:false,disable:function(){this.disabled=true;},enable:function(){this.disabled=false;},show:function(L,K,J,H){if(this.disabled||!this.el){return null;}var I={},F=this.autoHide;H=parseInt(H,10)||20;if(typeof L=="object"){I=L;L=I.msg;K=I.msgCls;J=I.fn;F=typeof I.autoHide!="undefined"?I.autoHide:F;H=I.fnDelay||H;}var G=this.el.mask(L||this.msg,K||this.msgCls);this.active=!!this.el._mask;if(this.active){if(this.zIndex){this.el._mask.setStyle("z-index",this.zIndex);if(this.el._maskMsg){this.el._maskMsg.setStyle("z-index",this.zIndex+1);}}}if(typeof J==="function"){J.defer(H,I.scope||null);}else{H=0;}if(F&&(F=parseInt(F,10)||2000)){this.hide.defer(F+(H||0),this);}return this.active?{mask:this.el._mask,maskMsg:this.el._maskMsg}:null;},hide:function(F){if(this.el){this.el.unmask(F||this.removeMask);}this.active=false;return this;},destroy:function(){this.hide(true);this.el=null;}};})();
(function(){var A=Ext.ux.Media;A.Flash=Ext.extend(A,{constructor:function(){A.Flash.superclass.constructor.apply(this,arguments);},SWFObject:null,varsName:"flashVars",hideMode:"nosize",mediaType:Ext.apply({tag:"object",cls:"x-media x-media-swf",type:"application/x-shockwave-flash",loop:null,scripting:"sameDomain",start:true,unsupportedText:{cn:["The Adobe Flash Player{0}is required.",{tag:"br"},{tag:"a",cn:[{tag:"img",src:"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"}],href:"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash",target:"_flash"}]},params:{movie:"@url",play:"@start",loop:"@loop",menu:"@controls",quality:"high",bgcolor:"#FFFFFF",wmode:"opaque",allowscriptaccess:"@scripting",allowfullscreen:false,allownetworking:"all"}},Ext.isIE?{classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"}:{data:"@url"}),getMediaType:function(){return this.mediaType;},initMedia:function(){var J=Ext.apply({},this.mediaCfg||{});var H=(this.requiredVersion=J.requiredVersion||this.requiredVersion||false);var C=!!(this.playerVersion=this.detectVersion());var F=C&&(H?this.assertVersion(H):true);var E=this.assert(J.unsupportedText||this.unsupportedText||(this.getMediaType()||{}).unsupportedText,null);if(E){E=Ext.DomHelper.markup(E);E=J.unsupportedText=String.format(E,(H?" "+H+" ":" "),(this.playerVersion?" "+this.playerVersion+" ":" Not installed."));}if(!F){this.autoMask=false;var D=C&&this.assertVersion("6.0.65");if(D&&J.installUrl){J=J.installDescriptor||{tag:"object",cls:"x-media x-media-swf x-media-swfinstaller",id:"SWFInstaller",type:"application/x-shockwave-flash",data:"@url",url:J.installUrl,width:(/%$/.test(J.width))?J.width:((parseInt(J.width,10)||0)<310?310:J.width),height:(/%$/.test(J.height))?J.height:((parseInt(J.height,10)||0)<138?138:J.height),loop:false,start:true,unsupportedText:E,params:{quality:"high",movie:"@url",allowscriptacess:"always",align:"middle",bgcolor:"#3A6EA5",pluginspage:J.pluginsPage||this.pluginsPage||"http://www.adobe.com/go/getflashplayer"}};J.params[this.varsName]="MMredirectURL="+(J.installRedirect||window.location)+"&MMplayerType="+(Ext.isIE?"ActiveX":"Plugin")+"&MMdoctitle="+(document.title=document.title.slice(0,47)+" - Flash Player Installation");}else{J.mediaType=null;}}if(J.eventSynch){J.params||(J.params={});var I=J.params[this.varsName]||(J.params[this.varsName]={});if(typeof I==="string"){I=Ext.urlDecode(I,true);}var G=(J.eventSynch===true?{allowedDomain:I.allowedDomain||document.location.hostname,elementID:J.id||(J.id=Ext.id()),eventHandler:"Ext.ux.Media.Flash.eventSynch"}:J.eventSynch);Ext.apply(J.params,{allowscriptaccess:"always"})[this.varsName]=Ext.applyIf(I,G);}delete J.requiredVersion;delete J.installUrl;delete J.installRedirect;delete J.installDescriptor;delete J.eventSynch;J.mediaType="SWF";this.mediaCfg=J;if(this.events){this.addEvents("flashinit","fscommand");}A.Flash.superclass.initMedia.call(this);},assertVersion:function(E){var D;E||(E=[]);if(Ext.isArray(E)){D=E;}else{D=String(E).split(".");}D=(D.concat([0,0,0,0])).slice(0,3);var C;if(!(C=this.playerVersion||(this.playerVersion=this.detectVersion()))){return false;}if(C.major>parseFloat(D[0])){return true;}else{if(C.major==parseFloat(D[0])){if(C.minor>parseFloat(D[1])){return true;}else{if(C.minor==parseFloat(D[1])){if(C.rev>=parseFloat(D[2])){return true;}}}}}return false;},detectVersion:function(){if(this.mediaVersion){return this.mediaVersion;}var C=false;var D=function(I){return I&&!!I.length?{major:I[0]!==null?parseInt(I[0],10):0,minor:I[1]!==null?parseInt(I[1],10):0,rev:I[2]!==null?parseInt(I[2],10):0,toString:function(){return this.major+"."+this.minor+"."+this.rev;}}:false;};var G=null;if(Ext.isIE){try{G=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(H){try{G=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");C=[6,0,21];G.allowscriptaccess="always";}catch(E){if(C&&C[0]===6){return D(C);}}try{G=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(F){}}if(G){C=G.GetVariable("$version").split(" ")[1].split(",");}}else{if(navigator.plugins&&navigator.mimeTypes.length){G=navigator.plugins["Shockwave Flash"];if(G&&G.description){C=G.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".");}}}return(this.mediaVersion=D(C));},_applyFixes:function(){var D;if(Ext.isIE&&Ext.isWindows&&(D=this.SWFObject)){D.style.display="none";if(D.readyState==4){for(var C in D){if(typeof D[C]=="function"){D[C]=null;}}}}},onAfterMedia:function(C){A.Flash.superclass.onAfterMedia.apply(this,arguments);this.SWFObject=this.getInterface();if(this.mediaObject){var D=this.mediaObject.id;if(Ext.isIE){if(!(Ext.query("script[for="+D+"]").length)){B('var c;if(c=Ext.getCmp("'+this.id+'")){c.onfsCommand.apply(c,arguments);}',{event:"FSCommand",htmlFor:D});}}else{window[D+"_DoFSCommand"]||(window[D+"_DoFSCommand"]=this.onfsCommand.createDelegate(this));}}},clearMedia:function(){if(this.mediaObject){var C=this.mediaObject.id;if(Ext.isIE){Ext.select("script[for="+C+"]",true).remove();}else{window[C+"_DoFSCommand"]=null;delete window[C+"_DoFSCommand"];}this._applyFixes();}A.Flash.superclass.clearMedia.call(this);this.SWFObject=null;},getSWFObject:function(){return this.getInterface();},onfsCommand:function(D,C){if(this.events){this.fireEvent("fscommand",this,D,C);}},setVariable:function(D,E){var C=this.getInterface();if(C&&typeof C.SetVariable!="undefined"){C.SetVariable(D,E);return true;}return false;},getVariable:function(D){var C=this.getInterface();if(C&&typeof C.GetVariable!="undefined"){return C.GetVariable(D);}return undefined;},onFlashInit:function(){if(this.mediaMask&&this.autoMask){this.mediaMask.hide();}this.fireEvent.defer(10,this,["flashinit",this,this.getInterface()]);},_handleSWFEvent:function(D){var C=D.type||D||false;if(C){if(this.events&&!this.events[String(C)]){this.addEvents(String(C));}return this.fireEvent.apply(this,[String(C),this].concat(Array.prototype.slice.call(arguments,0)));}}});A.Flash.eventSynch=function(C,E){var D=Ext.get(C);if(D&&D.ownerCt){return D.ownerCt._handleSWFEvent.apply(D.ownerCt,Array.prototype.slice.call(arguments,1));}};Ext.ux.FlashComponent=Ext.extend(Ext.ux.MediaComponent,{ctype:"Ext.ux.FlashComponent",getId:function(){return this.id||(this.id="flash-comp"+(++Ext.Component.AUTO_ID));}});Ext.apply(Ext.ux.FlashComponent.prototype,A.Flash.prototype);Ext.reg("uxflash",Ext.ux.FlashComponent);A.Panel.Flash=Ext.extend(A.Panel,{ctype:"Ext.ux.Media.Panel.Flash"});Ext.apply(A.Panel.Flash.prototype,A.Flash.prototype);Ext.reg("flashpanel",Ext.ux.MediaPanel.Flash=Ext.ux.FlashPanel=A.Panel.Flash);Ext.reg("uxflashpanel",A.Panel.Flash);Ext.ux.FlashWindow=(A.Window.Flash=Ext.extend(A.Window,{ctype:"Ext.ux.FlashWindow",animCollapse:Ext.isIE}));Ext.apply(A.Window.Flash.prototype,A.Flash.prototype);var B=function(I,D){D=Ext.apply({},D||{},{type:"text/javascript",text:I});try{var F,C,H=document;if(H&&H.getElementsByTagName){if(!(F=H.getElementsByTagName("head")[0])){F=H.createElement("head");H.getElementsByTagName("html")[0].appendChild(F);}if(F&&(C=H.createElement("script"))){for(var G in D){if(D.hasOwnProperty(G)&&G in C){C[G]=D[G];}}return !!F.appendChild(C);}}}catch(E){}return false;};})();
(function(){Ext.namespace("Ext.ux.Chart");var chart=Ext.ux.Chart;var Media=Ext.ux.Media;var ofcAdapter=Ext.extend(Media.Flash,{unsupportedText:{cn:['The Adobe Flash Player{0}is required.',{tag:'br'},{tag:'a',cn:[{tag:'img',src:'http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif'}],href:'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash',target:'_flash'}]},chartURL:null,dataURL:null,chartData:null,autoLoad:null,autoScroll:false,mediaCfg:{url:null,id:null,start:true,controls:true,name:'@id',height:null,width:null,autoSize:false,renderOnResize:false,scripting:'always',cls:'x-media x-media-swf x-chart-ofc',params:{wmode:'transparent',scale:'exactfit',salign:'t'}},initMedia:function(){ofcAdapter.superclass.initMedia.call(this);this.addEvents('chartrender');this.chartData=this.assert(this.chartData,null);if(this.autoLoad||this.chartData){this.on('chartload',this.chartAutoLoad,this)}},onBeforeMedia:function(){var mc=this.mediaCfg;var fc=this.ofcCfg||{};var fp=fc.params||{};var fv=fp[this.varsName]||null;if(typeof fv=='function'){fv=fp[this.varsName]=fv()}Ext.apply(mc,fc,{url:this.chartURL});Ext.apply(mc.params,fp,{allowscriptaccess:'@scripting',swliveconnect:true,wmode:'transparent',scale:'exactfit',salign:null});Ext.apply(mc.params[this.varsName]||(mc.params[this.varsName]={}),fv||{},{'data-file':this.dataURL||null});window.ofc_ready=this.onFlashInit.createDelegate(this);ofcAdapter.superclass.onBeforeMedia.call(this)},loadData:function(json){var o;json||(json=this.chartData);if(json&&(o=this.getInterface())&&o.load!=undefined){if(this.loadMask&&this.autoMask&&!this.loadMask.active){this.loadMask.show()}this.chartData=json;o.load(typeof json=='object'?Ext.encode(json):json);this.onChartRendered();return this}},onFlashInit:function(){ofcAdapter.superclass.onFlashInit.apply(this,arguments);this.fireEvent.defer(1,this,['chartload',this,this.getInterface()])},onChartRendered:function(){this.fireEvent('chartrender',this,this.getInterface());if(this.loadMask&&this.autoMask){this.loadMask.hide()}},load:function(url,params,callback){if(this.loadMask&&this.autoMask&&!this.loadMask.active){this.loadMask.show({fn:arguments.callee.createDelegate(this,arguments),fnDelay:50});return this}var method,cfg,callerScope,timeout,disableCaching;url||(url=this.dataURL);if(typeof url=="object"){cfg=url;url=cfg.url;params=params||cfg.params;callback=callback||cfg.callback;callerScope=cfg.scope;method=cfg.method||'GET';disableCaching=cfg.disableCaching||false;timeout=cfg.timeout||30}if(typeof url=="function"){url=url.call(this)}method=method||(params?"POST":"GET");if(method=="GET"){if(disableCaching){var append="_dc="+(new Date().getTime());if(url.indexOf("?")!==-1){url+="&"+append}else{url+="?"+append}}}var o=Ext.apply(cfg||{},{url:url,params:(typeof params=="function"&&callerScope)?params.createDelegate(callerScope):params,success:function(response){this.transaction=false;this.loadData(response.responseText)},failure:function(response){this.transaction=false},scope:this,callback:callback,timeout:(timeout*1000),argument:{"options":cfg,"url":url,"form":null,"callback":callback,"scope":callerScope||window,"params":params}});if(o.url){this.transaction=new(o.connectionClass||Ext.data.Connection)().request(o)}return this},setMask:function(ct){ofcAdapter.superclass.setMask.call(this,ct);if(this.loadMask&&!this.loadMask.enable){this.loadMask=new Ext.ux.IntelliMask(ct||this[this.mediaEl],Ext.apply({fixElementForMedia:true,autoHide:2000},this.loadMask))}},chartAutoLoad:function(){if(this.chartData){this.loadData()}else if(this.autoLoad){this.load(typeof this.autoLoad=='object'?this.autoLoad:{url:this.autoLoad})}},loadMask:false});chart.OFC=Ext.extend(Ext.ux.FlashComponent,{ctype:'Ext.ux.Chart.OFC'});Ext.apply(chart.OFC.prototype,ofcAdapter.prototype);Ext.reg('openchart',chart.OFC);chart.OFC.Panel=Ext.extend(Ext.ux.FlashPanel,{ctype:'Ext.ux.Chart.OFC.Panel'});Ext.apply(chart.OFC.Panel.prototype,ofcAdapter.prototype);Ext.reg('openchartpanel',(Ext.ux.OFCPanel=chart.OFC.Panel));Ext.ux.OFCWindow=chart.OFC.Window=Ext.extend(Ext.ux.FlashWindow,{ctype:"Ext.ux.OFCWindow"});Ext.apply(chart.OFC.Window.prototype,ofcAdapter.prototype);Ext.reg('openchartwindow',Ext.ux.OFCWindow)})();

Ext.namespace('tjnet', 'tjnet.channel');
tjnet.channel.selectionDialog = Ext.extend(Ext.Component, {
	containerName: 'container',
    containersName: 'containers',
    title: null,
    windowHeight: 400,
    win: null,
    tree: null,
    initComponent: function(){
        tjnet.channel.selectionDialog.superclass.initComponent.call(this);
        this.title = this.title ? this.title : String.format('请选择一个{0}', this.containerName);
        this.cancleAction = new Ext.Action({
            text: '取消',
            iconCls: 'action_cancel',
            minWidth: 70,
            handler: this.onCancel,
            scope: this
        });
        
        this.okAction = new Ext.Action({
            disabled: true,
            text:'确认',
            iconCls: 'action_saveAndClose',
            minWidth: 70,
            handler: this.onOk,
            scope: this
        });
        if (Ext.getBody().getHeight(true) * 0.7 < this.windowHeight) {
			this.windowHeight = Ext.getBody().getHeight(true) * 0.7;
		}

        this.win = new Ext.Window({
            title: this.title,
            closeAction: 'close',
            modal: true,
            width: 375,
            height: this.windowHeight,
            minWidth: 375,
            minHeight: this.windowHeight,
            layout: 'fit',
            plain: true,
            bodyStyle: 'padding:5px;',
            buttonAlign: 'right',
            
            buttons: [
                this.cancleAction,
                this.okAction
            ]
        });
        
		this.tree = new Ext.tree.TreePanel({
			id: 'channeltree',
			autoScroll: true,
			animate: false,
			containerScroll: true,
			border: false,
			rootVisible:false,
			loader: new Ext.tree.TreeLoader({
				dataUrl: '/home/data/share/Channelcheck.asp',
				baseAttrs: {uiProvider: Ext.ux.TreeCheckNodeUI},
			    baseParams: {uid:this.TriggerField.getValue()} 
			}),
			root: new Ext.tree.AsyncTreeNode({
				text: '频道目录',
				draggable: false,
				id: 'source',
				expanded: true
			})
            });
		var str=this.TriggerField.getValue();
		
		if(str!=''){
		var strs= new Array();
		    strs=str.split(",");
		for (i=0;i<strs.length ;i++ ){
			Ext.Ajax.request({ 
            url: '/home/data/share/treepath.asp',
            params: {uid:strs[i],cid:'channel'},
            success: function(response, request) {
			var path = response.responseText; 
			Ext.getCmp('channeltree').expandPath(path);
   }});
		}};
		this.tree.on("check",this.onTreeNodeClick, this);
        this.win.add(this.tree);
        this.win.show();
    },
    onTreeNodeClick: function(node) {
        this.okAction.setDisabled(node.id == '');
        if (! node.leaf ) {
            node.expand();
        }
    },
    onCancel: function() {
        this.onClose();
    },
    onClose: function() {
        this.win.close();
    },
    onOk: function() {
    var checkedNodes = this.tree.getChecked();
    var checkedIds = []; 
    for(var i=0;i<checkedNodes.length;i++){ 
        checkedIds.push(checkedNodes[i].id) 
    } 
    if (checkedIds) {
            this.TriggerField.setValue(checkedIds.join(','));
            this.onClose();
        }
    }
});

Ext.namespace('tjnet', 'tjnet.special');
tjnet.special.selectionDialog = Ext.extend(Ext.Component, {
	containerName: 'container',
    containersName: 'containers',
    title: null,
    windowHeight: 400,
    win: null,
    tree: null,
    initComponent: function(){
        tjnet.special.selectionDialog.superclass.initComponent.call(this);
        this.title = this.title ? this.title : String.format('请选择一个{0}', this.containerName);
        this.cancleAction = new Ext.Action({
            text: '取消',
            iconCls: 'action_cancel',
            minWidth: 70,
            handler: this.onCancel,
            scope: this
        });
        
        this.okAction = new Ext.Action({
            disabled: true,
            text:'确认',
            iconCls: 'action_saveAndClose',
            minWidth: 70,
            handler: this.onOk,
            scope: this
        });
        if (Ext.getBody().getHeight(true) * 0.7 < this.windowHeight) {
			this.windowHeight = Ext.getBody().getHeight(true) * 0.7;
		}

        this.win = new Ext.Window({
            title: this.title,
            closeAction: 'close',
            modal: true,
            width: 375,
            height: this.windowHeight,
            minWidth: 375,
            minHeight: this.windowHeight,
            layout: 'fit',
            plain: true,
            bodyStyle: 'padding:5px;',
            buttonAlign: 'right',
            
            buttons: [
                this.cancleAction,
                this.okAction
            ]
        });
        
		this.tree = new Ext.tree.TreePanel({
			id: 'specialtree',
			autoScroll: true,
			animate: false,
			containerScroll: true,
			border: false,
			rootVisible:false,
			loader: new Ext.tree.TreeLoader({
				dataUrl: '/home/data/share/special.asp',
				baseAttrs: {uiProvider: Ext.ux.TreeCheckNodeUI},
			    baseParams: {uid:this.TriggerField.getValue()} 
			}),
			root: new Ext.tree.AsyncTreeNode({
				text: '特性目录',
				draggable: false,
				id: 'source',
				expanded: true
			})
            });
		var str=this.TriggerField.getValue();
		if(str!=''){
		var strs= new Array();
		    strs=str.split(",");
		for (i=0;i<strs.length ;i++ ){
			Ext.Ajax.request({ 
            url: '/home/data/share/treepath.asp',
            params: {uid:strs[i],cid:'special'},
            success: function(response, request) {
			var path = response.responseText; 
			Ext.getCmp('specialtree').expandPath(path);
   
        }});
		}};
		this.tree.on("check",this.onTreeNodeClick, this);
        this.win.add(this.tree);
        this.win.show();
    },
    onTreeNodeClick: function(node) {
        this.okAction.setDisabled(node.id == '');
        if (! node.leaf ) {
            node.expand();
        }
    },
    onCancel: function() {
        this.onClose();
    },
    onClose: function() {
        this.win.close();
    },
    onOk: function() {
    var checkedNodes = this.tree.getChecked();
    var checkedIds = []; 
    for(var i=0;i<checkedNodes.length;i++){ 
        checkedIds.push(checkedNodes[i].id) 
    } 
    if (checkedIds) {
            this.TriggerField.setValue(checkedIds.join(','));
            this.onClose();
        }
    }
});

Ext.namespace('tjnet', 'tjnet.user');
tjnet.user.selectionDialog = Ext.extend(Ext.Component, {
	containerName: 'container',
    containersName: 'containers',
    title: null,
    windowHeight: 400,
    win: null,
    tree: null,
    initComponent: function(){
        tjnet.user.selectionDialog.superclass.initComponent.call(this);
        this.title = this.title ? this.title : String.format('请选择一个{0}', this.containerName);
        this.cancleAction = new Ext.Action({
            text: '取消',
            iconCls: 'action_cancel',
            minWidth: 70,
            handler: this.onCancel,
            scope: this
        });
        
        this.okAction = new Ext.Action({
            disabled: true,
            text:'确认',
            iconCls: 'action_saveAndClose',
            minWidth: 70,
            handler: this.onOk,
            scope: this
        });
        if (Ext.getBody().getHeight(true) * 0.7 < this.windowHeight) {
			this.windowHeight = Ext.getBody().getHeight(true) * 0.7;
		}

        this.win = new Ext.Window({
            title: this.title,
            closeAction: 'close',
            modal: true,
            width: 375,
            height: this.windowHeight,
            minWidth: 375,
            minHeight: this.windowHeight,
            layout: 'fit',
            plain: true,
            bodyStyle: 'padding:5px;',
            buttonAlign: 'right',
            
            buttons: [
                this.cancleAction,
                this.okAction
            ]
        });
        
		this.tree = new Ext.tree.TreePanel({
			
			autoScroll: true,
			animate: false,
			containerScroll: true,
			border: false,
			rootVisible:false,
			loader: new Ext.tree.TreeLoader({
				dataUrl: '/home/data/share/user.asp',
				baseAttrs: {uiProvider: Ext.ux.TreeCheckNodeUI},
			    baseParams: {uid:this.TriggerField.getValue()} 
			}),
			root: new Ext.tree.AsyncTreeNode({
				text: '用户目录',
				draggable: false,
				id: 'source',
				expanded: true
			})
            });
		this.tree.on("check",this.onTreeNodeClick, this);
        this.win.add(this.tree);
        this.win.show();
    },
    onTreeNodeClick: function(node) {
        this.okAction.setDisabled(node.id == '');
        if (! node.leaf ) {
            node.expand();
        }
    },
    onCancel: function() {
        this.onClose();
    },
    onClose: function() {
        this.win.close();
    },
    onOk: function() {
    var checkedNodes = this.tree.getChecked();
    var checkedIds = []; 
    for(var i=0;i<checkedNodes.length;i++){ 
        checkedIds.push(checkedNodes[i].text) 
    } 
    if (checkedIds) {
            this.TriggerField.setValue(checkedIds.join(','));
            this.onClose();
        }
    }
});

Ext.namespace('tjnet', 'tjnet.teacher');
tjnet.teacher.selectionDialog = Ext.extend(Ext.Component, {
	containerName: 'container',
    containersName: 'containers',
    title: null,
    windowHeight: 400,
    win: null,
    tree: null,
    initComponent: function(){
        tjnet.teacher.selectionDialog.superclass.initComponent.call(this);
        this.title = this.title ? this.title : String.format('请选择一个{0}', this.containerName);
        this.cancleAction = new Ext.Action({
            text: '取消',
            iconCls: 'action_cancel',
            minWidth: 70,
            handler: this.onCancel,
            scope: this
        });
        
        this.okAction = new Ext.Action({
            
            text:'确认',
            iconCls: 'action_saveAndClose',
            minWidth: 70,
            handler: this.onOk,
            scope: this
        });
        if (Ext.getBody().getHeight(true) * 0.7 < this.windowHeight) {
			this.windowHeight = Ext.getBody().getHeight(true) * 0.7;
		}

        this.win = new Ext.Window({
            title: this.title,
            closeAction: 'close',
            modal: true,
            width: 375,
            height: this.windowHeight,
            minWidth: 375,
            minHeight: this.windowHeight,
            layout: 'fit',
            plain: true,
            bodyStyle: 'padding:5px;',
            buttonAlign: 'right',
            
            buttons: [
                this.cancleAction,
                this.okAction
            ]
        });
        
		this.tree = new Ext.tree.TreePanel({
			id: 'teachertree',
			autoScroll: true,
			animate: false,
			containerScroll: true,
			border: false,
			rootVisible:false,
			loader: new Ext.tree.TreeLoader({
				dataUrl: '/home/data/share/teacher.asp',
				
			    baseParams: {uid:this.TriggerField.getValue()} 
			}),
			root: new Ext.tree.AsyncTreeNode({
				text: '员工目录',
				draggable: false,
				id: 'source',
				expanded: true
			})
            });
		var str=this.TriggerField.getValue();
		
		this.tree.on("check",this.onTreeNodeClick, this);
        this.win.add(this.tree);
        this.win.show();
    },
    onTreeNodeClick: function(node) {
        this.okAction.setDisabled(node.id == '');
        if (! node.leaf ) {
            node.expand();
        }
    },
    onCancel: function() {
        this.onClose();
    },
    onClose: function() {
        this.win.close();
    },
    onOk: function() {
    var checkedNodes = this.tree.getChecked();
    var checkedIds = []; 
    for(var i=0;i<checkedNodes.length;i++){ 
        checkedIds.push(checkedNodes[i].text) 
    } 
    if (checkedIds) {
            this.TriggerField.setValue(checkedIds.join(','));
            this.onClose();
        }
    }
});

(function(){Ext.namespace("Ext.ux.Chart");var chart=Ext.ux.Chart;var Media=Ext.ux.Media;var fusionAdapter=Ext.extend(Media.Flash,{unsupportedText:{cn:['The Adobe Flash Player{0}is required.',{tag:'br'},{tag:'a',cn:[{tag:'img',src:'http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif'}],href:'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash',target:'_flash'}]},chartURL:null,dataXML:'<chart></chart>',dataURL:null,autoLoad:null,autoScroll:false,mediaCfg:{url:null,id:null,start:true,controls:true,height:null,width:null,autoSize:true,renderOnResize:true,scripting:'always',cls:'x-media x-media-swf x-chart-fusion',params:{wmode:'transparent',scale:'exactfit',scale:null,salign:null}},initMedia:function(){this.addEvents('chartload','chartrender');if(this.autoLoad){this.on('chartload',this.chartAutoLoad,this)}fusionAdapter.superclass.initMedia.call(this)},onBeforeMedia:function(){var mc=this.mediaCfg;var fc=this.fusionCfg||{};var fp=fc.params||{};var fv=fp[this.varsName]||{};Ext.apply(mc,fc,{url:this.chartURL||null});Ext.apply(mc.params,fp,{wmode:'transparent',scale:'exactfit',salign:null});mc.params[this.varsName]||(mc.params[this.varsName]={});Ext.apply(mc.params[this.varsName],fp[this.varsName]||{},{chartWidth:'@width',chartHeight:'@height',debugMode:0,DOMId:'@id',registerWithJS:1,allowScriptAccess:"@scripting",lang:'EN',dataXML:this.dataXML||null,dataURL:this.dataURL||null});var url=(url=mc.params[this.varsName]['dataURL'])?encodeURI(url):null;fusionAdapter.superclass.onBeforeMedia.call(this)},setDataXML:function(xml,immediate){var o;this.dataXML=xml;if(immediate&&(o=this.getInterface())&&typeof o.SetVariable!='undefined'){o.SetVariable("_root.dataURL","");o.SetVariable("_root.isNewData","1");o.SetVariable("_root.newData",xml);o.TGotoLabel("/","JavaScriptHandler");this.onChartRendered()}},setDataURL:function(url,immediate){var o;var vars=this.mediaCfg.params[this.varsName]||{};this.dataXML=null;this.dataURL=url;if((o=this.getInterface())&&immediate){o.setDataURL!==undefined?o.setDataURL(url):this.load(url)}},load:function(url,params,callback){if(!url){return this}if(this.loadMask&&this.autoMask&&!this.loadMask.active){this.loadMask.show({fn:arguments.callee.createDelegate(this,arguments),fnDelay:80});return this}var method,cfg,callerScope,timeout,disableCaching;if(typeof url==="object"){cfg=url;url=cfg.url;params=params||cfg.params;callback=callback||cfg.callback;callerScope=cfg.scope;method=cfg.method||'GET';disableCaching=cfg.disableCaching||false;timeout=cfg.timeout||30}if(typeof url==="function"){url=url.call(this)}method=method||(params?"POST":"GET");if(method==="GET"){if(disableCaching){var append="_dc="+(new Date().getTime());if(url.indexOf("?")!==-1){url+="&"+append}else{url+="?"+append}}}var o=Ext.apply(cfg||{},{url:url,params:(typeof params==="function"&&callerScope)?params.createDelegate(callerScope):params,success:function(response){this.setDataXML(response.responseText,true)},failure:function(response){this.setDataXML('Failure',true)},scope:this,callback:callback,timeout:(timeout*1000),argument:{"options":cfg,"url":url,"form":null,"callback":callback,"scope":callerScope||window,"params":params}});new(o.connectionClass||Ext.data.Connection)().request(o);return this},setMask:function(ct){fusionAdapter.superclass.setMask.call(this,ct);if(this.loadMask&&!this.loadMask.enable){this.loadMask=new Ext.ux.IntelliMask(ct||this[this.mediaEl],Ext.apply({fixElementForMedia:true,autoHide:4000},this.loadMask))}},chartAutoLoad:function(){this.load(typeof this.autoLoad==='object'?this.autoLoad:{url:this.autoLoad})},print:function(){var i;if(i=this.getInterface()){i.print()}},onChartRendered:function(){this.fireEvent('chartrender',this,this.getInterface());if(this.loadMask&&this.autoMask){this.loadMask.hide()}},onChartLoaded:function(){this.fireEvent('chartload',this,this.getInterface());if(this.mediaMask&&this.autoMask){this.mediaMask.hide()}},loadMask:false});fusionAdapter.chartOnLoad=function(DOMId){var c=Ext.get(DOMId);if(c&&(c=c.ownerCt)){c.onChartLoaded.call(c);return false}};fusionAdapter.chartOnRender=function(DOMId){var c=Ext.get(DOMId);if(c&&(c=c.ownerCt)){c.onChartRendered.call(c);return false}};window.FC_Rendered=window.FC_Rendered?window.FC_Rendered.createInterceptor(fusionAdapter.chartOnRender):fusionAdapter.chartOnRender;window.FC_Loaded=window.FC_Loaded?window.FC_Loaded.createInterceptor(fusionAdapter.chartOnLoad):fusionAdapter.chartOnLoad;chart.Fusion=Ext.extend(Ext.ux.FlashComponent,{ctype:'Ext.ux.Chart.Fusion'});Ext.apply(chart.Fusion.prototype,fusionAdapter.prototype);Ext.reg('fusion',chart.Fusion);chart.Fusion.Panel=Ext.extend(Ext.ux.FlashPanel,{ctype:'Ext.ux.Chart.Fusion.Panel'});Ext.apply(chart.Fusion.Panel.prototype,fusionAdapter.prototype);Ext.reg('fusionpanel',(Ext.ux.FusionPanel=chart.Fusion.Panel));Ext.ux.FusionWindow=chart.Fusion.Window=Ext.extend(Ext.ux.FlashWindow,{ctype:"Ext.ux.FusionWindow"});Ext.apply(chart.Fusion.Window.prototype,fusionAdapter.prototype);Ext.reg('fusionwindow',Ext.ux.FusionWindow)})();
Ext.ns('Ext.ux.tree');
Ext.ux.tree.TreeFilterX = Ext.extend(Ext.tree.TreeFilter, {
expandOnFilter:true
,filter:function(value, attr, startNode) {
if(false !== this.expandOnFilter) {
			startNode = startNode || this.tree.root;
			var animate = this.tree.animate;
			this.tree.animate = false;
			startNode.expand(true, false, function() {
Ext.ux.tree.TreeFilterX.superclass.filter.call(this, value, attr, startNode);

			}.createDelegate(this));
			this.tree.animate = animate;
		}
		else {
		Ext.ux.tree.TreeFilterX.superclass.filter.apply(this, arguments);
		}

	},filterBy:function(fn, scope, startNode) {
		startNode = startNode || this.tree.root;
		if(this.autoClear) {
			this.clear();
		}
		var af = this.filtered, rv = this.reverse;

		var f = function(n) {
			if(n === startNode) {
				return true;
			}
			if(af[n.id]) {
				return false;
			}
			var m = fn.call(scope || n, n);
			if(!m || rv) {
				af[n.id] = n;
				n.ui.hide();
				return true;
			}
			else {
				n.ui.show();
				var p = n.parentNode;
				while(p && p !== this.root) {
					p.ui.show();
					p = p.parentNode;
				}
				return true;
			}
			return true;
		};
		startNode.cascade(f);

        if(this.remove){
           for(var id in af) {
               if(typeof id != "function") {
                   var n = af[id];
                   if(n && n.parentNode) {
                       n.parentNode.removeChild(n);
                   }
               }
           } 
        }
	} 
});
Ext.form.FileUploadField = Ext.extend(Ext.form.TextField,  {
buttonText: '浏览...',
buttonOnly: false,
buttonOffset: 3,
readOnly: true,
autoSize: Ext.emptyFn,
initComponent: function(){
Ext.form.FileUploadField.superclass.initComponent.call(this);
this.addEvents(
'fileselected'
        );
    },
onRender : function(ct, position){
        Ext.form.FileUploadField.superclass.onRender.call(this, ct, position);
        
        this.wrap = this.el.wrap({cls:'x-form-field-wrap x-form-file-wrap'});
        this.el.addClass('x-form-file-text');
        this.el.dom.removeAttribute('name');
        
        this.fileInput = this.wrap.createChild({
            id: this.getFileInputId(),
            name: this.name||this.getId(),
            cls: 'x-form-file',
            tag: 'input', 
            type: 'file',
            size: 1
        });
        
        var btnCfg = Ext.applyIf(this.buttonCfg || {}, {
            text: this.buttonText
        });
        this.button = new Ext.Button(Ext.apply(btnCfg, {
            renderTo: this.wrap,
            cls: 'x-form-file-btn' + (btnCfg.iconCls ? ' x-btn-icon' : '')
        }));
        
        if(this.buttonOnly){
            this.el.hide();
            this.wrap.setWidth(this.button.getEl().getWidth());
        }
        
        this.fileInput.on('change', function(){
            var v = this.fileInput.dom.value;
            this.setValue(v);
            this.fireEvent('fileselected', this, v);
        }, this);
    },
    
    // private
    getFileInputId: function(){
        return this.id+'-file';
    },
    onResize : function(w, h){
        Ext.form.FileUploadField.superclass.onResize.call(this, w, h);
        
        this.wrap.setWidth(w);
        
        if(!this.buttonOnly){
            var w = this.wrap.getWidth() - this.button.getEl().getWidth() - this.buttonOffset;
            this.el.setWidth(w);
        }
    },
    preFocus : Ext.emptyFn,
    getResizeEl : function(){
        return this.wrap;
    },
getPositionEl : function(){
        return this.wrap;
    },
alignErrorIcon : function(){
        this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
    }
    
});
Ext.reg('fileuploadfield', Ext.form.FileUploadField);