var CodeMirrorConfig=window.CodeMirrorConfig||{};var CodeMirror=(function(){function e(f,h){for(var g in h){if(!f.hasOwnProperty(g)){f[g]=h[g]}}}function d(h,g){for(var f=0;f<h.length;f++){g(h[f])}}e(CodeMirrorConfig,{stylesheet:"",path:"",parserfile:[],basefiles:["prod_base_c21cb4dde2c20e8f098b71afff0368db.js"],iframeClass:null,passDelay:200,passTime:50,continuousScanning:false,saveFunction:null,onChange:null,undoDepth:50,undoDelay:800,disableSpellcheck:true,textWrapping:true,readOnly:false,width:"100%",height:"300px",autoMatchParens:false,parserConfig:null,tabMode:"indent",reindentOnLoad:false,activeTokens:null,cursorActivity:null,lineNumbers:false,indentUnit:2});function c(f){return function(j){var h=document.createElement("DIV"),l=document.createElement("DIV"),g=document.createElement("DIV");h.style.position="relative";l.style.position="absolute";l.style.height="100%";if(l.style.setExpression){try{l.style.setExpression("height","this.previousSibling.offsetHeight + 'px'")}catch(k){}}l.style.top="0px";l.style.overflow="hidden";f(h);h.appendChild(j);h.appendChild(l);g.className="CodeMirror-line-numbers";l.appendChild(g)}}function b(h,l,m){var o=h.contentWindow,p=o.document,q=h.nextSibling,n=q.firstChild;var k=1,r=null;function g(){if(!h.offsetWidth||!o.Editor){for(var s=h;s.parentNode;s=s.parentNode){if(s!=document){clearInterval(f);return}}}if(q.offsetWidth!=r){r=q.offsetWidth;q.style.left="-"+(h.parentNode.style.marginLeft=r+"px")}}function j(){var t=20+Math.max(p.body.offsetHeight,h.offsetHeight)-n.offsetHeight;for(var u=Math.ceil(t/10);u>0;u--){var s=document.createElement("span");s.id="line-number-"+k;s.className="line-number";if(m){s.onclick=function(w,v){return function(){if(!v.previousSibling||v.previousSibling.nodeName!="IMG"){var x=document.createElement("img");x.src="images/breakpoint.png";x.className="breakpoint";x.title="Breakpoint";x.id="breakPoint-"+w;x.onclick=function(z,y){return function(){delete l.breakpoints[z];y.parentNode.removeChild(y.previousSibling)}}(w,v);l.breakpoints[w]=true;v.parentNode.insertBefore(x,v)}else{delete l.breakpoints[w];v.parentNode.removeChild(v.previousSibling)}}}(k,s)}s.innerHTML=k++;n.appendChild(s);n.appendChild(document.createElement("BR"))}q.scrollTop=p.body.scrollTop||p.documentElement.scrollTop||0;if(window.navigator.userAgent.toLowerCase().indexOf("chrome/4")>-1){throw"Necessary Exception."}}g();j();o.addEventHandler(o,"scroll",j);o.addEventHandler(o,"resize",j);var f=setInterval(g,500)}function a(f,g){if(g.dumbTabs){g.tabMode="spaces"}else{if(g.normalTab){g.tabMode="default"}}this.options=g=g||{};this.breakpoints=[];e(g,CodeMirrorConfig);var l=this.frame=document.createElement("IFRAME");if(g.iframeClass){l.className=g.iframeClass}l.frameBorder=0;l.src="javascript:false;";l.style.border="0";l.style.width=g.width;l.style.height=g.height;l.style.display="block";if(f.appendChild){var j=f;f=function(m){j.appendChild(m)}}if(g.lineNumbers){f=c(f)}f(l);l.CodeMirror=this;this.win=l.contentWindow;if(typeof g.parserfile=="string"){g.parserfile=[g.parserfile]}if(typeof g.stylesheet=="string"){g.stylesheet=[g.stylesheet]}var h=['<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head>'];h.push('<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>');d(g.stylesheet,function(m){h.push('<link rel="stylesheet" type="text/css" href="'+m+'"/>')});d(g.basefiles.concat(g.parserfile),function(m){h.push('<script type="text/javascript" src="'+g.path+m+'"><\/script>')});h.push('</head><body style="border: 0px none;" class="editbox" spellcheck="'+(g.disableSpellcheck?"false":"true")+'"></body></html>');var k=this.win.document;k.open();k.write(h.join(""));k.close()}a.prototype={init:function(){if(this.options.initCallback){this.options.initCallback(this)}if(this.options.lineNumbers){b(this.frame,this,this.options.breakPoints)}if(this.options.reindentOnLoad){this.reindent()}},getBreakPoints:function(){return this.breakpoints},clearBreakPoints:function(){for(i in this.breakpoints){if(this.breakpoints[i]==true){breakPoint=document.getElementById("breakPoint-"+i);breakPoint.parentNode.removeChild(breakPoint)}}this.breakpoints=[]},getCode:function(){return this.editor.getCode()},setCode:function(f){this.editor.importCode(f)},selection:function(){return this.editor.selectedText()},reindent:function(){this.editor.reindent()},reindentSelection:function(){this.editor.reindentSelection(null)},focus:function(){this.win.focus();if(this.editor.selectionSnapshot){this.win.select.selectCoords(this.win,this.editor.selectionSnapshot)}},replaceSelection:function(f){this.focus();this.editor.replaceSelection(f);return true},replaceChars:function(g,h,f){this.editor.replaceChars(g,h,f)},getSearchCursor:function(g,f){return this.editor.getSearchCursor(g,f)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(g,f){this.editor.grabKeys(g,f)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(f){this.editor.setParser(f)},cursorPosition:function(f){if(this.win.select.ie_selection){this.focus()}return this.editor.cursorPosition(f)},firstLine:function(){return this.editor.firstLine()},lastLine:function(){return this.editor.lastLine()},nextLine:function(f){return this.editor.nextLine(f)},prevLine:function(f){return this.editor.prevLine(f)},lineContent:function(f){return this.editor.lineContent(f)},setLineContent:function(f,g){this.editor.setLineContent(f,g)},insertIntoLine:function(g,f,h){this.editor.insertIntoLine(g,f,h)},selectLines:function(j,f,h,g){this.win.focus();this.editor.selectLines(j,f,h,g)},nthLine:function(g){var f=this.firstLine();for(;g>1&&f!==false;g--){f=this.nextLine(f)}return f},lineNumber:function(f){var g=0;while(f!==false){g++;f=this.prevLine(f)}return g},jumpToLine:function(f){this.selectLines(this.nthLine(f),0);this.win.focus()},currentLine:function(){return this.lineNumber(this.cursorPosition().line)}};a.InvalidLineHandle={toString:function(){return"CodeMirror.InvalidLineHandle"}};a.replace=function(f){if(typeof f=="string"){f=document.getElementById(f)}return function(g){f.parentNode.replaceChild(g,f)}};a.fromTextArea=function(h,g){if(typeof h=="string"){h=document.getElementById(h)}g=g||{};if(h.style.width&&g.width==null){g.width=h.style.width}if(h.style.height&&g.height==null){g.height=h.style.height}if(g.content==null){g.content=h.value}if(h.form){function f(){h.value=k.getCode()}if(typeof h.form.addEventListener=="function"){h.form.addEventListener("submit",f,false)}else{h.form.attachEvent("onsubmit",f)}}function j(l){if(h.nextSibling){h.parentNode.insertBefore(l,h.nextSibling)}else{h.parentNode.appendChild(l)}}h.style.display="none";var k=new a(j,g);return k};a.isProbablySupported=function(){var f;if(window.opera){return Number(window.opera.version())>=9.52}else{if(/Apple Computers, Inc/.test(navigator.vendor)&&(f=navigator.userAgent.match(/Version\/(\d+(?:\.\d+)?)\./))){return Number(f[1])>=3}else{if(document.selection&&window.ActiveXObject&&(f=navigator.userAgent.match(/MSIE (\d+(?:\.\d*)?)\b/))){return Number(f[1])>=6}else{if(f=navigator.userAgent.match(/gecko\/(\d{8})/i)){return Number(f[1])>=20050901}else{if(f=navigator.userAgent.match(/AppleWebKit\/(\d+)/)){return Number(f[1])>=525}else{return null}}}}}};return a})();
