COMMON=window.COMMON||{};var href=window.location.href;if(href.indexOf("debugger")!==-1)COMMON["debugger"]=true;COMMON.contentPath="";COMMON.version="1.0.6";COMMON.setContentPath=function(path){COMMON.contentPath=path;window.CKEDITOR_BASEPATH=path+"/res/framework/htmleditor/ckeditor/";COMMON.AjaxModule.init()};Function.attempt=function(){for(var i=0,l=arguments.length;i");xpath=xpath.replace(/\\/g,">");return new COMMON.XML.Element(this.xml.querySelector(xpath))}catch(e){return null}}}},queryNodes:function(xpath){if(COMMON.Browser.Features.xpath){var xpathResult=this.xml.evaluate(xpath,this.xml,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);if(xpathResult.snapshotLength){return new COMMON.XML.Elements(xpathResult)}else{return null}}else{try{return new COMMON.XML.Elements(this.xml.selectNodes(xpath))}catch(e){var nodes=[];xpath=xpath.replace(/\//g,">");xpath=xpath.replace(/\\/g,">");var firstNode=this.xml.querySelector(xpath);if(firstNode)nodes.push(firstNode);var nextNode=firstNode.nextSibling;while(nextNode){if(nextNode.tagName==xpath){nodes.push(nextNode)}nextNode=nextNode.nextSibling}return new COMMON.XML.Elements(nodes)}}}});COMMON.XML.Element=COMMON.Class.create({initialize:function(node){this.node=node;if(this.node){for(p in this.node){this[p]=this.node[p]}}},queryNode:function(xpath){if(COMMON.Browser.Features.xpath){var xpathResult=this.node.ownerDocument.evaluate(xpath,this.node,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);if(xpathResult.snapshotLength){return new COMMON.XML.Element(xpathResult.snapshotItem(0))}else{return null}}else{try{return new COMMON.XML.Element(this.node.selectSingleNode(xpath))}catch(e){try{xpath=xpath.replace(/\//g,">");xpath=xpath.replace(/\\/g,">");return new COMMON.XML.Element(this.node.querySelector(xpath))}catch(e){return null}}}},queryNodes:function(xpath){if(COMMON.Browser.Features.xpath){var xpathResult=this.node.ownerDocument.evaluate(xpath,this.node,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);if(xpathResult.snapshotLength){return new COMMON.XML.Elements(xpathResult)}else{return null}}else{try{return new COMMON.XML.Elements(this.node.selectNodes(xpath))}catch(e){var nodes=[];xpath=xpath.replace(/\//g,">");xpath=xpath.replace(/\\/g,">");var firstNode=this.node.querySelector(xpath);if(firstNode){nodes.push(firstNode);var nextNode=firstNode.nextSibling;while(nextNode){if(nextNode.tagName==xpath){nodes.push(nextNode)}nextNode=nextNode.nextSibling}}return new COMMON.XML.Elements(nodes)}}},text:function(){try{var text=this.node.textContent;if(text){return text}else{try{return this.node.text}catch(e){return text}}}catch(e){try{return this.node.text}catch(e){return""}}},attr:function(name){return this.node.getAttribute(name)}});COMMON.XML.Elements=COMMON.Class.create({initialize:function(nodes){this.nodes=nodes},length:function(){if(this.nodes.snapshotLength){return this.nodes.snapshotLength}else{return this.nodes.length}},items:function(i){if(this.nodes.snapshotItem){return new COMMON.XML.Element(this.nodes.snapshotItem(i))}else{try{return new COMMON.XML.Element(this.nodes.item(i))}catch(e){try{return new COMMON.XML.Element(this.nodes[i])}catch(e){return null}}}},each:function(fun){if(this.length()){for(var i=0;i=200&&status<300)req.success(req.response.text,req.response.xml);else if(status>=300&&status<400)req.redirect(req);else req.failure(xhr);req.async=true};xhr.onreadystatechange=onreadystatechange;var rdata=data||this.data;xhr.send(rdata)};COMMON.Request.prototype.processScripts=function(text){return text};COMMON.Request.prototype.success=function(text,xml){var t=this.processScripts(text);if(this.onSuccess)this.onSuccess(t,xml)};COMMON.Request.prototype.failure=function(xhr){if(this.onFailure)this.onFailure(xhr)};COMMON.Request.prototype.redirect=function(xhr){if(this.onRedirect)this.onRedirect(xhr)};COMMON.Request.prototype.getHeader=function(name){return this.xhr.getResponseHeader(name)};COMMON.Request.prototype.setHeader=function(name,value){this.headers[name]=value;return this};COMMON.runCallback=function(callback,name,par){if(COMMON.typeOf(callback).toLowerCase()=="object"){if(callback[name]){callback[name].apply(callback,par?par:[])}}};COMMON.Request.prototype.getText=function(url){var v="";var r=new COMMON.Request({url:url,async:false,method:"get",onSuccess:function(text){v=text}}).send();return v};COMMON.AjaxModule={jquery:COMMON.contentPath+"/res/framework/jquery/jquery.min.js","jquery-ui":COMMON.contentPath+"/res/framework/jquery/jquery-ui.custom/js/jquery-ui.custom.min.js",mootools:COMMON.contentPath+"/res/framework/mootools/mootools-1.6.0.js","mootools-more":COMMON.contentPath+"/res/framework/mootools/mootools-1.6.0.js",mwf:COMMON.contentPath+"/res/mwf4/MWF.min.js",ckeditor:COMMON.contentPath+"/res/framework/htmleditor/ckeditor451/ckeditor.js",nicEdit:COMMON.contentPath+"/res/framework/htmleditor/nicEdit/nicEdit.js",kindeditor:COMMON.contentPath+"/res/framework/htmleditor/kindeditor/kindeditor-all-min.js",tinymce:COMMON.contentPath+"/res/framework/htmleditor/tinymce/tinymce.min.js",bmap:"http://api.map.baidu.com/api?v=2.0&ak=fpzGqedB7e8CA8WB8jUgxlOx",amap:"http://webapi.amap.com/maps?v=1.3&key=d7c7ce03a219fa4df4c7a30ba8e68888",raphael:COMMON.contentPath+"/res/framework/raphael/raphael.js",codemirror:COMMON.contentPath+"/res/framework/codemirror/lib/codemirror.js",codemirror_javascript:COMMON.contentPath+"/res/framework/codemirror/mode/javascript/javascript.js",d3:COMMON.contentPath+"/res/framework/d3/d3.min.js",ace:COMMON.contentPath+"/res/framework/ace/src-noconflict/ace.js","ace-tools":COMMON.contentPath+"/res/framework/ace/src-noconflict/ext-language_tools.js",kity:COMMON.contentPath+"/res/framework/kityminder/kity/kity.min.js",kityminder:COMMON.contentPath+"/res/framework/kityminder/core/dist/kityminder.core.js",JSONTemplate:COMMON.contentPath+"/res/framework/mootools/plugin/Template.js",ie_adapter:COMMON.contentPath+"/res/mwf4/ie_adapter.js",init:function(){this["jquery"]=COMMON.contentPath+"/res/framework/jquery/jquery.min.js";this["jquery-ui"]=COMMON.contentPath+"/res/framework/jquery/jquery-ui.custom/js/jquery-ui.custom.min.js";this["mootools"]=COMMON.contentPath+"/res/framework/mootools/mootools-1.6.0.js";this["mootools-more"]=COMMON.contentPath+"/res/framework/mootools/mootools-1.6.0.js";this["mwf"]=COMMON.contentPath+"/res/mwf4/MWF.js";this["ckeditor"]=COMMON.contentPath+"/res/framework/htmleditor/ckeditor451/ckeditor.js";this["nicEdit"]=COMMON.contentPath+"/res/framework/htmleditor/nicEdit/nicEdit.js";this["kindeditor"]=COMMON.contentPath+"/res/framework/htmleditor/kindeditor/kindeditor.js";this["tinymce"]=COMMON.contentPath+"/res/framework/htmleditor/tinymce/tinymce.full.js";this["bmap"]="http://api.map.baidu.com/api?v=2.0&ak=fpzGqedB7e8CA8WB8jUgxlOx";this["amap"]="http://webapi.amap.com/maps?v=1.3&key=d7c7ce03a219fa4df4c7a30ba8e68888";this["raphael"]=COMMON.contentPath+"/res/framework/raphael/raphael.js";this["codemirror"]=COMMON.contentPath+"/res/framework/codemirror/lib/codemirror.js";this["codemirror_javascript"]=COMMON.contentPath+"/res/framework/codemirror/mode/javascript/javascript.js";this["d3"]=COMMON.contentPath+"/res/framework/d3/d3.min.js";this["ace"]=COMMON.contentPath+"/res/framework/ace/src-noconflict/ace.js";this["ace-tools"]=COMMON.contentPath+"/res/framework/ace/src-noconflict/ext-language_tools.js";this["kity"]=COMMON.contentPath+"/res/framework/kityminder/kity/kity.min.js";this["kityminder"]=COMMON.contentPath+"/res/framework/kityminder/core/dist/kityminder.core.js";this["JSONTemplate"]=COMMON.contentPath+"/res/framework/mootools/plugin/Template.js";this["ie_adapter"]=COMMON.contentPath+"/res/mwf4/ie_adapter.js"},loaded:{},loadedCss:{},loadDom:function(urls,callback,async,reload){if(COMMON.typeOf(urls)==="array"){var thisLoaded=[];urls.each(function(url){this.loadDomSingle(url,function(){thisLoaded.push(url);if(thisLoaded.length===urls.length){if(COMMON.typeOf(callback).toLowerCase()==="function"){callback()}else{COMMON.runCallback(callback,"onSuccess")}}},async,reload)}.bind(this))}if(COMMON.typeOf(urls)==="string"){this.loadDomSingle(urls,callback,async,reload)}},loadDomSingle:function(url,callback,async,reload){var jsurl=this[url];if(!jsurl){jsurl=url;if(!COMMON["debugger"]){if(jsurl.indexOf("framework")===-1)jsurl=jsurl.replace(/\.js/,".min.js")}}jsurl=jsurl.indexOf("?")!==-1?jsurl+"&v="+COMMON.version:jsurl+"?v="+COMMON.version;if(!reload){if(this.loaded[key]){if(COMMON.typeOf(callback).toLowerCase()==="function"){callback()}else{COMMON.runCallback(callback,"onSuccess")}return}}var key=encodeURIComponent(url);var head=document.head||document.getElementsByTagName("head")[0]||document.documentElement;var s=document.createElement("script");s.src=jsurl;head.appendChild(s);s.onload=s.onreadystatechange=function(_,isAbort){if(isAbort||!s.readyState||s.readyState==="loaded"||s.readyState==="complete"){COMMON.AjaxModule.loaded[key]=true;s=s.onload=s.onreadystatechange=null;if(!isAbort)callback()}}},load:function(urls,callback,async,reload){if(COMMON.typeOf(urls)==="array"){var thisLoaded=[];urls.each(function(url){this.loadSingle(url,function(){thisLoaded.push(url);if(thisLoaded.length===urls.length){if(COMMON.typeOf(callback).toLowerCase()==="function"){callback()}else{COMMON.runCallback(callback,"onSuccess")}}},async,reload)}.bind(this))}if(COMMON.typeOf(urls)==="string"){this.loadSingle(urls,callback,async,reload)}},loadSingle:function(url,callback,async,reload){var jsurl=this[url];if(!jsurl){jsurl=url;if(!COMMON["debugger"]){jsurl=jsurl.replace(/\.js/,".min.js")}}jsurl=jsurl.indexOf("?")!=-1?jsurl+"&v="+COMMON.version:jsurl+"?v="+COMMON.version;var key=encodeURIComponent(url);if(!reload){if(this.loaded[key]){if(COMMON.typeOf(callback).toLowerCase()=="function"){callback()}else{COMMON.runCallback(callback,"onSuccess")}return}}var loadAsync=true;if(async===false){loadAsync=false}var r=new COMMON.Request({url:jsurl,async:loadAsync,method:"get",cache:true,onSuccess:function(responseText,responseXML){var jsText=responseText;try{COMMON.Browser.exec(jsText);COMMON.AjaxModule.loaded[key]=true}catch(e){COMMON.runCallback(callback,"onFailure",e);return}if(COMMON.typeOf(callback).toLowerCase()=="function"){callback()}else{COMMON.runCallback(callback,"onSuccess")}},onFailure:function(xhr){COMMON.runCallback(callback,"onRequestFailure",xhr)}});r.send()},loadCss:function(urls,callback,async,reload,sourceDoc){if(COMMON.typeOf(urls)=="array"){var thisLoaded=[];urls.each(function(url){this.loadSingleCss(url,function(){thisLoaded.push(url);if(thisLoaded.length==urls.length){if(COMMON.typeOf(callback).toLowerCase()=="function"){callback()}else{COMMON.runCallback(callback,"onSuccess")}}},async,reload)}.bind(this))}if(COMMON.typeOf(urls)=="string"){this.loadSingleCss(urls,callback,async,reload)}},loadSingleCss:function(url,callback,async,reload,sourceDoc){var key=encodeURIComponent(url);if(!reload){if(this.loadedCss[key]){if(COMMON.typeOf(callback).toLowerCase()=="function"){callback()}else{COMMON.runCallback(callback,"onSuccess")}return}}var async=true;if(async===false){async=false}var cssurl=this[url]||url;var r=new COMMON.Request({url:cssurl,async:async,method:"get",cache:true,onSuccess:function(responseText,responseXML){var cssText=responseText;try{if(cssText){var doc=sourceDoc||document;var style=doc.createElement("style");style.setAttribute("type","text/css");var head=doc.getElementsByTagName("head")[0];head.appendChild(style);if(style.styleSheet){var setFunc=function(){style.styleSheet.cssText=cssText};if(style.styleSheet.disabled){setTimeout(setFunc,10)}else{setFunc()}}else{var cssTextNode=doc.createTextNode(cssText);style.appendChild(cssTextNode)}}COMMON.AjaxModule.loadedCss[key]=true;if(COMMON.typeOf(callback).toLowerCase()=="function"){callback()}else{COMMON.runCallback(callback,"onSuccess")}}catch(e){COMMON.runCallback(callback,"onFailure",e);return}},onFailure:function(xhr){COMMON.runCallback(callback,"onRequestFailure",xhr)}});r.send()}};COMMON.onReady=function(){return true};COMMON.DOM={ready:false,loaded:false,checks:[],shouldPoll:false,timer:null,testElement:document.createElement("div"),readys:[],domready:function(){clearTimeout(this.timer);if(COMMON.DOM.ready)return;COMMON.DOM.loaded=COMMON.DOM.ready=true;COMMON.DOM.removeListener(document,"DOMContentLoaded",COMMON.DOM.domready);COMMON.DOM.removeListener(document,"readystatechange",COMMON.DOM.check);COMMON.DOM.onReady()},check:function(){for(var i=COMMON.DOM.checks.length;i--;)if(COMMON.DOM.checks[i]()){COMMON.DOM.domready();return true}return false},poll:function(){clearTimeout(COMMON.DOM.timer);if(!COMMON.DOM.check())COMMON.DOM.timer=setTimeout(COMMON.DOM.poll,10)},doScrollWorks:function(){try{this.testElement.doScroll();return true}catch(e){}return false},addListener:function(dom,type,fn){if(type=="unload"){var old=fn,self=this;fn=function(){self.removeListener(dom,"unload",fn);old()}}if(dom.addEventListener)dom.addEventListener(type,fn,!!arguments[2]);else dom.attachEvent("on"+type,fn)},removeListener:function(dom,type,fn){if(dom.removeEventListener)dom.removeEventListener(type,fn,!!arguments[2]);else dom.detachEvent("on"+type,fn);return this},onReady:function(){for(var i=0;i=0;i--){if(this[i]==o){return i}}return null};Array.prototype.arrayInStr=function(str){var returnArray=[];if(str.toString()!=""){for(var i=0;i