if(!lib)var lib={};log={};lib.trace={};lib.newStack=[];lib.WrappedUp={};lib.trace.Trace=function(){};
lib.trace.Trace.prototype={parseGlob:function(a){a=a.split(" ");for(var b=[],c=[],d=0;d<a.length;d++)if(a[d])a[d][0]==="-"?b.push(a[d].substr(1)):c.push(a[d]);this.pmatch=this.makeRegex(c);this.nmatch=this.makeRegex(b)},load:function(){var a=localStorage.getItem("log.info");this.set(a);this.addHeader(a,"")},makeRegex:function(a){if(a.length==0)return 0;for(var b="https?:\\/\\/[^\\/]*\\/(",c=0;c<a.length;c++)b+="("+a[c].replace("/","\\/").replace("*",".*")+")"+(c===a.length-1?"":"|");b+=")\\.js:";
return RegExp(b)},set:function(a,b){if(a){this.parseGlob(a);b?this.debugTraceOn(true):this.debugTraceOn(false)}else{this.debugTraceOn(false);delete this.nmatch;delete this.pmatch}},setDebug:function(a){if(a){this.debugTraceOn(true);this.set(a,true)}else this.debugTraceOn(false)},debugTraceOn:function(a){log.debug=a?this.logr:function(){}},tracing:function(){return typeof this.pmatch==="object"},log:function(){try{throw Error();}catch(a){if(a.stack){lib.newStack=a.stack.split("\n");if(lib.newStack.length>
4){var b=lib.trace.pattern.exec(lib.newStack[4]);if(b!==null){Position=b[1];if(this.pmatch.test(Position)&&(!this.nmatch||!this.nmatch.test(Position)))return Position}}}}},checkTraceStatus:function(){if(!Trace.tracing())return false;var a=Trace.log();if(a===undefined)return false;return a},logr:function(){var a=Trace.checkTraceStatus();if(a){for(var b=[],c=0;c<arguments.length;c++)b[c]=typeof arguments[c]==="string"?arguments[c]+" ":backendlog.stringify(arguments[c])+" ";b.push(a);backendlog.appendLog(b,
false)}},variable:function(){var a=[],b=Trace.checkTraceStatus();if(b){for(var c=0;c<arguments.length;c+=2){a[c]=arguments[c]+backendlog.stringify(arguments[c+1]);a[c+1]=" "}a.push(b);backendlog.appendLog(a,false)}},func:function(a,b){var c=[],d=Trace.checkTraceStatus();if(d){if(b)for(var e=0;e<b.length;e++){c[e]=backendlog.stringify(b[e]);c[e]+=e==b.length-1?")":", "}c.length===0&&c.push(")");c.unshift(">"+a+"(");c.push(d);backendlog.appendLog(c,true)}},endfunc:function(a,b){var c=Trace.checkTraceStatus();
if(c){var d=["<"+a+(b?" R:"+backendlog.stringify(b):"")];d.push(c);backendlog.appendLog(d,false)}},addHeader:function(a,b){var c="";c=a==""?{log:"*************** Tracing OFF ***************\n"}:{log:"*************** Tracing "+a+" Debugging: "+b+" ***************\n"};$.post("/javascript/log",c)},wrapItUp:function(a){for(var b in eval(a)){Parent=eval(a);if(typeof Parent[b]==="object")this.wrapItUp(a+"."+b);else if(typeof Parent[b]==="function"&&!lib.WrappedUp[Parent[b]]){lib.WrappedUp[a+"."+b]=true;
Parent[b]=Wrapper(a,b)}}}};function Wrapper(a,b,c){c=c||window;var d=eval(a)[b];return function(){for(var e=[],f="(",g=0;g<arguments.length;g++){e.push(arguments[g]);f+=arguments[g]+(g==arguments.length-1?")":",")}return d.apply(c,e)}}var Trace=new lib.trace.Trace;lib.trace.pattern=/(https?.*[0-9])/;log.info=Trace.logr;log.variable=Trace.variable;log.func=Trace.func;log.endfunc=Trace.endfunc;Trace.load();function traceInfo(a){Trace.set(a);Trace.addHeader(a,"");localStorage["log.info"]=a}
function traceDebug(a){Trace.setDebug(a);Trace.addHeader(a,a);localStorage["log.info"]=a;localStorage["log.debug"]=a?true:false}backendlog={};var TempStart="";backendlog.appendLog=function(a,b){var c={log:this.createStack(a,b)};$.post("/javascript/log",c)};backendlog.getModule=function(a){a=a.match(/((((\/[\w]+)+.[js]+:[\d]+)))/)[0];a=/(.*?)\.js(:\d+)/.exec(a);return a[1].substring(1,a[1].length)+a[2]};
backendlog.getStartFunc=function(a){this.startFunction=a.match(/(^([.\s\w]+))/)[0];if(this.startFunction.startsWith("    at Object."))this.startFunction=this.startFunction.slice(14);else if(backendlog.startFunction.startsWith("    at "))this.startFunction=this.startFunction.slice(7);return this.startFunction};
backendlog.createModule=function(a,b,c){var d=[],e="";if(typeof b[0]==="object")d.push(this.stringify(b[0]));else{for(var f=0;f<b.length-1;f++)e+=String(b[f]);d.push(e)}return this.createLine(d,b,a,c)};backendlog.createLine=function(a,b,c,d){for(var e="",f=0;f<a.length;f++){var g=new Date;g=(g.toTimeString().slice(0,8)+":"+g.getMilliseconds()+"   ").slice(0,13)+this.getModule(b[b.length-1]);if(g.length<45)g+=Array(45-g.length).join(" ");g+=Array(c).join(" | ")+(d?" ":" | ")+a[f]+"\n";e+=g}return e};
backendlog.findPresent=function(){for(var a=0;a<lib.newStack.length;a++)if(this.getStartFunc(lib.newStack[a])==TempStart)return a;return-1};
backendlog.createStack=function(a,b){var c=1;if(TempStart=="")TempStart=this.getStartFunc(lib.newStack[4]);if(TempStart==""&&lib.newStack[lib.newStack.length-1].startsWith("    at XMLHttpRequest"))TempStart=this.getStartFunc(lib.newStack[lib.newStack.length-1]);if(this.findPresent()!=-1)c=TempStart=="XMLHttpRequest.jQuery.ajaxTransport.send.callback "?this.findPresent()-8:this.findPresent()-3;else TempStart=this.getStartFunc(lib.newStack[4]);return this.createModule(c,a,b)};
backendlog.replacer=function(a,b,c){if(a!=="__ifWare2015"){a=typeof b;if(b&&(b instanceof Event||b.tagName))return"[DOM]";if(a==="object"&&b!=null)if(b.__ifWare2015)return"self";else{b.__ifWare2015=true;c.push(b)}else if(a==="function")return"[FUNC]";return b}};backendlog.deleter=function(a,b){for(var c in b)delete b[c].__ifWare2015};backendlog.stringify=function(a){var b=[],c=JSON.stringify(a,function(d,e){return backendlog.replacer(d,e,b)});backendlog.deleter(a,b);return c};/*

 Copyright (c) 2015 iNTERFACEWARE Inc.  All rights reserved.
*/
LOG_VAR=function(){var a=/(https?.*[0-9])/;return function(){var b=[],c;a:{try{throw Error();}catch(d){if(d.stack){c=d.stack.split("\n");if(c.length>3){c=a.exec(c[3]);if(c!==null){c=c[1];break a}}}}c=void 0}typeof c!=="undefined"&&b.push(c);for(c=0;c<arguments.length;c++){var e="";if(c>0)e+=", ";e+="? =";b.push(e);b.push(arguments[c])}}}();var Ajax;
$(document).ready(function(){function a(){$("body").append('         <div id="ajax-popup" style="display:none">            <table width="100%">            <tr>               <td colspan="2" id="ajax-message" align="center">            </table>         </div>      ');return $("#ajax-popup").dialog({autoOpen:false,modal:true,title:"Communication Error",buttons:{Retry:function(){$(this).dialog("close");var i=g;g=null;i()}}})}function b(i,j){if(j.status==403)return"Your session has expired.";else if(i==
"parsererror")return"Unable to parse response from server.";else if(i=="permission_issue")return"You don't have the necessary permissions to view this page.";else if(i!="notmodified")return"The server is not responding."}function c(i){$("#permission_dlg").length&&$("#permission_dlg").remove();$("body").append('<div id="permission_dlg" style="display:none">'+i+"</div>");i=$("#permission_dlg");i.append('<p> Go back to the <a href="../dashboard.html"> dashboard. </a> </p>');i.dialog({bgiframe:true,width:400,
height:110,title:"Insufficient Permissions",position:"center",modal:true,autoOpen:false});i.dialog("open")}function d(i){if(i.PermissionIssue)return"permission_issue"}function e(i,j,k){if(h)if(g){var m=g;g=function(){try{m()}catch(n){}j()}}else{var l=$("#ajax-popup");l.length||(l=a());g=function(){j()};$("#ajax-message").text(b(i,k));l.dialog("open")}}function f(i,j,k){if(i=="permission_issue")c(b(i,k));else{typeof IFW!=="undefined"&&IFW.Sde!==null&&ifware.storage.set("CurrentMessageWithEdits",IFW.Sde._CodeMirror.getValue(),
1);MiniLogin.show(b(i,k),function(){location.reload()})}}var g,h;Ajax=window.MiniLogin?AjaxImpl(f,d):AjaxImpl(e,d);$(window).unload(function(){h=false});h=true});
function AFUuploadFile(a,b,c,d,e){function f(){$(this).dialog("close");location.reload()}function g(j){window.MiniLogin?MiniLogin.show("File upload failed. "+j,function(){location.reload()}):$("<div>"+j+"</div>").appendTo("body").dialog({modal:true,title:"Communication Error",buttons:{Reload:f}})}var h="uploader"+(new Date).getTime(),i=$('<iframe name="'+h+'" src="about:blank" />');i.css("display","none");$("body").append(i);i.load(function(){var j=null;j=i.contentDocument?i.contentDocument:i.contentWindow?
i.contentWindow.document:window.frames[h].document;if(j=$(j).find("body").html())if(j=="Not logged in.")g("File upload failed. Your session has expired.");else var k=JSON.parse(j);else g("File upload failed. The server is not responding.");setTimeout(function(){i.remove();d&&k&&d(k,e)},100)});b.attr("action",a).attr("method","post").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data").attr("target",h);b.get(0).submit();c&&c(b)};/*

 Copyright (c) 2010-2011 iNTERFACEWARE Inc.  All rights reserved.
*/
function AjaxImpl(a,b){function c(h){var i=h.error;h.error=function(k,m,l){if(i)try{if(i(k,m,l))return}catch(n){}m!=="abort"&&m!="notmodified"&&a(m,function(){jQuery.ajax(h)},k)};var j=h.success;h.success=function(k,m,l){if(l.status){var n;try{n=b(k,m,l)}catch(p){}if(n)a(n,function(){jQuery.ajax(h)},l);else j&&j(k,m,l)}else a(null,function(){jQuery.ajax(h)},l)};return jQuery.ajax(h)}function d(h,i,j,k){if(typeof j=="function"){k=j;j=undefined}return h.load(i,j,function(m,l,n){if(k)try{if(k(m,l,n))return}catch(p){}var o=
!n.status||l!="success"&&l!="notmodified";if(o){if(n.status)o=l}else try{o=b(m,l,n)||null}catch(q){o=null}if(o||!n.status)a(o,function(){d(h,i,j,k)},n)})}function e(h){return function(i,j,k,m){return typeof j=="function"?h(i,undefined,j,k):typeof k!="function"?h(i,j,undefined,k):h(i,j,k,m)}}function f(h){return e(function(i,j,k,m){return c({url:i,data:j,type:h,success:k,dataType:m})})}function g(h){return e(function(i,j,k){return c({url:i,data:j,success:k,dataType:h})})}a||(a=function(){});b||(b=
function(){});return{ajax:c,load:d,abort:function(h){if(h)try{h.onreadystatechange=function(){};h.abort()}catch(i){}},get:f(),getJSON:g("json"),getScript:g("script"),post:f("POST")}};var SCMreplaceSampleStr="REPLACE_SAMPLE",SCMappendSampleStr="APPEND_SAMPLE",SCM_BUMP_NOTE="Will stop channel",SCM_POPUP_PARAMS={modal:true,minWidth:450,resizable:false,close:function(){$(this).remove()}};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1};function SCMcommitDlgGetConflictingFiles(a,b){SCMcheckConflicts(a,b,SCMcommitDlgUI)}
function handleProjectImportError(a){a=a.responseJSON.error?a.responseJSON.error.description:a.status+" - "+a.statusText;$(document).find("body").append($("<div id='scResponseDlg'><div class='sc_error'></div><br/></div>"));var b=$("#scResponseDlg"),c={};c.Close=function(){$(this).dialog("close")};b.dialog({bgiframe:true,width:400,title:"Error",modal:true,autoOpen:false,buttons:c});b.find(".sc_error").text(a);b.find(".sc_error").show();b.dialog("open");return true}
function SCMclearDependencies(a){$.ajax({url:"/sc/clear_dependencies",method:"POST",data:{translator_guid:a.ifware.ChannelGuid},success:function(b){SCMresponseDlgUI(b,false)},error:handleProjectImportError})}function SCMresponseDlgUI(a,b,c){$("#scResponseDlg").length&&$("#scResponseDlg").remove();typeof c=="function"&&c();return false}function SCMgetMainFileLabel(a){for(var b=0;b<a.length;++b)if(a[b].Type=="Main")return a[b].Label;return""}
function SCMgetProjectList(a,b){for(var c=[],d=0;d<a.length;++d)c.push(a[d][b]);return c}function SCMdialogWaiting(a,b){if(b){$(a).dialog("disable");$(a).siblings(".ui-dialog-buttonpane").prepend('<img class="scSpinner" src="/js/mapper/images/spinner.gif" />')}else{$(a).dialog("enable");$(a).siblings(".ui-dialog-buttonpane").children(".scSpinner").remove()}}
function SCMdialogConfirm(a,b){$("#fossilConfirmDlg").length&&$("#fossilConfirmDlg").remove();$(document).find("body").append($("<div id='fossilConfirmDlg'>"+a+"</div>"));var c={};c.No=function(){$(this).dialog("close")};c.Yes=function(){b();$(this).dialog("close")};var d=$("#fossilConfirmDlg");d.dialog({bgiframe:true,title:"Confirmation Request",width:500,modal:true,autoOpen:false,buttons:c});d.dialog("open")}
function SCMrevertConfirmText(){return"Revert operation might overwrite your changes. Are you sure you want to revert?"}
function SCMactivateUploadedZip(a,b){$.ajax({url:"/sc/import_from_zip",method:"POST",data:{translator_guid:a.ifware.ChannelGuid,uploaded_filename:b,data_import_type:a.ifware.DataImportType},error:handleProjectImportError,success:function(c){if(a.ifware.DataImportType==SCMreplaceSampleStr){a.ifware.setCountOfSample(c.CountOfSampleData);a.ifware.setSampleIndex(1);NISchangeSampleData(a,1)}else a.ifware.DataImportType==SCMappendSampleStr&&a.ifware.setCountOfSample(a.ifware.countOfSample()+c.CountOfSampleData);
NISupdateSampleDataControl(a);NISreloadCurrentFile(a)}})}function SCMuploadFile(a,b,c,d,e){e.handleProjectUpload(b,a,c)}function SCMenableImportBTN(a,b){a.dialog("widget").find('button:contains("Import")').button(b)}
function SCMimportProjectAndData(a,b){function c(){$("#ImportZipFileBrowse",d).val()==""&&$("input[name=import_type]:checked",d).val()=="ImportZippedProject"?SCMenableImportBTN(d,"disable"):SCMenableImportBTN(d,"enable")}$("#importProjectAndData").remove();$(document).find("body").append('<div id="importProjectAndData"><form id="importForm"><table><tr><td valign="top"><input type="radio" name="import_type" value="EmptyProject" id="importProjectAndData_importTypeId" class="ImportBlank"></td><td ><label for="importProjectAndData_importTypeId">Use a blank project</label></td><tr><td valign="top"><input type="radio" id="importProjectAndData_projectList" name="import_type" value="ImportProject" class = "ImportFromProject"></td>    <td><label for="importProjectAndData_projectList">Import from existing projects</label>        <br><select name="projectList"></select>'+(a.ifware.UsesParameter?
'        <br><input id="importProjectAndData_importSampleData" type="checkbox" name="importSampleData" checked="checked">        <label for="importProjectAndData_importSampleData">Import sample data</label>':"")+'<tr><td valign="top"><input type="radio" name="import_type" value="ImportZippedProject" id="importProjectAndData_importZipFile" class = "ImportFromZip"></td>    <td><label for="importProjectAndData_importZipFile">Import project from zip file</label><br><input type="file" id="ImportZipFileBrowse" name="NewFile" value = ""/>      <input type="hidden" name="translator_guid" value="'+
a.ifware.ChannelGuid+'" />  '+(a.ifware.UsesParameter?'<br><input id = "importProjectAndData_includeSampleData" type = "checkbox" name = "includeSampleData" checked="checked">  <label for="importProjectAndData_includeSampleData">Import sample data</label>'+(a.ifware.countOfSample()>0?'   <select name="addSampleTypeList"><option value = "APPEND_SAMPLE">Append</option><option value = "REPLACE_SAMPLE">Replace</option></select>':""):"")+'</td></tr></table></form><div class="importError" style="color: red"></div></div>');
var d=$("#importProjectAndData");NISmainFileSelectedAndEmpty(a)?$('input[class = "ImportBlank"]').prop("checked",true):$('input[class = "ImportFromProject"]').prop("checked",true);$("input[name=import_type]",d).click(function(){c()});$("input[name = NewFile]",d).change(function(){SCMenableImportBTN(d,"enable")});$("select[name = projectList]",d).mousedown(function(){$('input[class = "ImportFromProject"]').prop("checked",true);$(".importError").html("");c()});$("input[name = importSampleData]",d).click(function(){$('input[class = "ImportFromProject"]').prop("checked",
true);c()});$("input[name = NewFile]",d).click(function(){$('input[class = "ImportFromZip"]').prop("checked",true);c()});$("input[name = includeSampleData]",d).click(function(){$('input[class = "ImportFromZip"]').prop("checked",true);c()});$("select[name = addSampleTypeList]",d).mousedown(function(){$('input[class = "ImportFromZip"]').prop("checked",true);c()});var e={};e.Import=function(){if("ImportProject"==$("input[name=import_type]:checked",this).val()){a.ifware.CurrentSourceHash=null;var f=$("select[name=projectList] option:selected",
this).val();f||$(this).dialog("close");SCMdialogWaiting("#importProjectAndData",true);f={translator_guid:a.ifware.ChannelGuid,source_guid:f};if($("input[name=importSampleData]:checked",this).length&&a.ifware.UsesParameter)f.import_sample_data="true";$.ajax({url:"/sc/import_from_project",method:"POST",data:f,error:function(h){SCMdialogWaiting("#importProjectAndData",false);h=h.responseJSON.error?h.responseJSON.error.description:h.status+" - "+h.statusText;$(".importError",d).html(h)},success:function(h){SCMdialogWaiting("#importProjectAndData",
false);a.ifware.setCountOfSample(a.ifware.countOfSample()+h.import_count);NISupdateSampleDataControl(a);NISreloadCurrentFile(a);$(d).dialog("close")}})}else if("ImportZippedProject"==$("input[name=import_type]:checked",this).val()){a.ifware.CurrentSourceHash=null;f=d.find("form");var g=f.find('input[type="file"]');a.ifware.DataImportType=$("input[name=includeSampleData]:checked").length&&a.ifware.UsesParameter?$("select[name=addSampleTypeList] option:selected",this).val()=="APPEND_SAMPLE"||a.ifware.countOfSample()==
0?SCMappendSampleStr:SCMreplaceSampleStr:"";SCMuploadFile(d,f,g,a,b)}else{f="";f=MPRapp?" from "+MPRapp.type:"";f=a.ifware.UsesParameter?"-- The main function is the first function called"+f+".\n-- The Data argument will contain the message to be processed.\nfunction main(Data)\nend":"-- The main function is the first function called"+f+".\nfunction main()\nend";NISsetScriptName(a,a.ifware.MainLuaFile);a.setValue(f);a.clearHistory();SCMclearDependencies(a);$(d).dialog("close")}};e.Cancel=function(){$(this).dialog("close")};
d.dialog({bgiframe:true,title:a.ifware.UsesParameter?"Import Project/Sample Data":"Import Project",resizable:false,modal:true,autoOpen:false,buttons:e,close:function(){a.focus()}});c();d.dialog("open");SCMdialogWaiting("#importProjectAndData",true);$.ajax({url:"/sc/get_all_projects_file_info",method:"POST",data:{translator_guid:a.ifware.ChannelGuid},error:function(f,g,h){d.dialog("close");SCMdialogWaiting("#importProjectAndData",false);handleProjectImportError(f,g,h)},success:function(f){SCMdialogWaiting("#importProjectAndData",
false);f.Projects.sort(function(i,j){var k=(i.Name||i.Guid).toLowerCase(),m=(j.Name||j.Guid).toLowerCase();return k<m?-1:k>m?1:0});for(ProjIndex in f.Projects){var g=f.Projects[ProjIndex],h=$("<option></option>");h.val(g.Guid);h.html(g.Name||g.Guid);$("select[name=projectList]",d).append(h)}f=$("#importProjectAndData table:first").width();d.dialog("option","width",26+f);d.dialog("option","position","center");SCMdialogWaiting("#importProjectAndData",false)}})}
function SCMincludeSampleConfirm(a){$("#IncludeSampleConfirmDlg").remove();$(document).find("body").append('<div id="IncludeSampleConfirmDlg" align="center">Include Sample Messages? </div>');var b={};b.Yes=function(){SCMexportRequest(a,true);$("#IncludeSampleConfirmDlg").dialog("close")};b.No=function(){SCMexportRequest(a,false);$("#IncludeSampleConfirmDlg").dialog("close")};$("#IncludeSampleConfirmDlg").dialog({bgiframe:true,width:300,height:130,title:"Confirm",modal:true,autoOpen:true,buttons:b})}
function SCMexportRequest(a,b){window.open("/sc/export_to_zip?translator_guid="+a+"&sample_data="+b);this.focus()}function SCMpluralLines(a){return a==1?"line":"lines"}function SCMfindLabel(a,b){for(var c=0;c<b.length;c++)if(b[c]==a)return true;return false}
function SCMdisplayError(a,b){$("#scResponseDlg").remove();if(!a)return false;var c="<p> We're sorry, but an unexpected error occurred: </p>                    <p>"+a+"</p> ";$("body").append($("<div id='scResponseDlg'>                       <div class='sc_error'></div><br/>                       <div class='sc_output'></div><div class='sc_info'></div></div>                    "));var d=$("#scResponseDlg"),e={};e.Close=function(){$(this).dialog("close")};d.dialog({bgiframe:true,width:600,title:"Error",
modal:true,autoOpen:false,buttons:e,close:function(){b()}});d.find(".sc_error").html(c);d.find(".sc_error").show();d.dialog("open");return true}function SCMcatchError(a,b){if(!a.ErrorMessage)return false;return SCMdisplayError(a.ErrorMessage,b)}
function SCMupdateLegend(a){var b=$(".toolbar_lines");b.html("");a.summary&&b.html('<span class="label">Lines:</span><span class="lines_info">Added: <span class="lines_added">'+a.summary.added+'</span></span><span class="lines_info">Deleted: <span class="lines_deleted">'+a.summary.deleted+'</span></span><span class="lines_info">Changed: <span class="lines_changed">'+a.summary.changed+"</span></span>")}
function SCMdrawDiffs(a,b){if(b=="condensed"){$("#SCMdiff").html(a.condensed);$("#SCMdiff").addClass("changesOnly")}else{$("#SCMdiff").removeClass("changesOnly");var c=b=="vertical"?" vrt":"";if(a.full){c=$('<div class="diffTank'+c+'" id="diffFromTank"><div class="changeLabel">From</div><div class="diffCling">'+a.full.from+'</div></div><div class="diffDivider'+c+'" /><div class="diffTank'+c+'" id="diffToTank"><div class="changeLabel">To</div><div class="diffCling">'+a.full.to+"</div></div>");$("#SCMdiff").html(c);
var d=$(".diffCling");d.on("scroll",function(){var e=$(this),f=d.not(this);if(e.attr("scrolling")=="false"||e.attr("scrolling")==undefined){f.attr("scrolling","true");f.scrollTop(e.scrollTop());f.scrollLeft(e.scrollLeft())}e.attr("scrolling","false")})}}}function SCMlights(){return["red","yellow","green","gray"]}function SCMinitialDiffs(){return{condensed:"",full:{from:"",to:""},status:"",summary:{added:0,deleted:0,changed:0}}}
function SCMcompare(a,b,c){if(a[c]>b[c])return 1;if(a[c]<b[c])return-1;return 0}function SCMclip(a,b){if(a.length<=b)return a;return a.substr(0,b)+"..."}function SCMchannelConfigNameClip(a,b){var c=/^\Channels\//,d=/-[A-F0-9]{32}\/ChannelConfiguration.xml$/;if(c.test(a))return SCMclip(a.replace(c,"").replace(d,""),b);return SCMtranslatorNameClip(a,b)}
function SCMtranslatorNameClip(a,b){var c=/-(Ack|To|From|Filter|FromHTTP)-[A-Za-z0-9]{14}\//,d=/[A-F0-9]{32}\//;if(c.test(a))a=a.replace(c,"-$1.../");else if(d.test(a))a=a.replace(d,".../");return a.length<=b?a:"..."+a.substring(a.length-b)}function SCMsizeBoxes(a,b){if(!b)return[100,0];if(a<10)return[25,74];var c=a/(a+b)*100;if(c>75)c=75;return[c,99-c]}
function SCMfileClasses(a,b){if(!a.shared_files)return"";var c=" "+Object.keys(a.shared_files).map(function(d){return b[d].Index}).join(" ");if(a.contains_new_file)c+=" NEW";return c}
function SCMdecorate(a,b){$(".c").removeClass("c");$("#"+a).addClass("c");$(".h").removeClass("h");$("div.project."+a).addClass("h");$("div.project").on({mouseenter:function(){$("span.file."+$(this).attr("id")).addClass("h")},mouseleave:function(){$("span.file."+$(this).attr("id")).removeClass("h")}});$(".SCMstageLabel").each(function(){var c=$(this).outerHeight();$(this).next().css("top",c+"px")});$("#SCMstageFilesCollection").scrollTop(b)}
function SCMfixView(a,b,c,d){var e=$("#SCMcommitList"),f=$("#SCMcommitList .scroller");f.height(e.height()-$("#SCMcommitList .fixed").outerHeight()+"px");f.css("top",$("#SCMcommitList .fixed").outerHeight()+"px");$("#SCMcommitList .fixed table").width($("#SCMcommitList .scroller table").width()+"px");f=a.parent();var g=$(".EDT_toolbar_wrapper"),h=f.height();if(f.is("#HistoryBody"))h=f.outerHeight();if(g&&g.length==1)h-=g.outerHeight();a.height(h-e.outerHeight()-$("#SCMreviewControls").outerHeight()+
"px");d.height(b.height()-c.outerHeight()+"px")}function SCMfixDiffView(){var a=$("#SCMreviewPanelAndDiff"),b=$("#SCMdiffTank"),c=$(".diff_toolbar"),d=$("#SCMdiff");SCMfixView(a,b,c,d)}function SCMfixPreviewView(){var a=$("#HistoryBody #SCMreviewPanelAndPreview"),b=$("#HistoryBody #SCMpreviewTank"),c=$("#HistoryBody .preview_toolbar"),d=$("#HistoryBody #SCMpreview");SCMfixView(a,b,c,d)}
function SCMpullStatus(a,b){$.ajax({url:"/dashboard_data",method:"GET",cache:false,data:{include_remote_servers:true},success:function(c){SCMbumpStatus(c,a,b)}})}function SCMbumpStatus(a,b,c){var d=SCMlights();a=a.Channels;for(var e=0;e<a.length;e++){var f=a[e].Channel.Guid,g=d[a[e].Channel.Light];b[f]=g=="green"?true:false;var h=$("input.bumpUpdate[data-cguid="+f+"]");SCMupdateBumpNote(h,f,b,c);$("#BumpStatus_"+f).html('<img src="/images/button-dot'+g+'v4.gif" alt="'+g+'" />')}}
function SCMupdateBumpNote(a,b,c,d){var e=$("td#BumpNote_"+b);a.each(function(){if($(this).prop("checked")&&c[b]){e.html(d);return false}else e.html("")})}
function SCMbumpTickCheck(a,b,c,d,e){a.on("change",function(f){var g=true;f.stopPropagation();f=$(this).attr("data-"+d);a.each(function(){if(!$(this).prop("checked")){g=false;b.prop("checked",false)}});g&&b.prop("checked",true);var h=$("input.bumpUpdate[data-"+d+"='"+f+"']");if(e){SCMpullStatus(e,c);SCMupdateBumpNote(h,f,e,c)}});b.on("change",function(){$(this).prop("checked")?a.prop("checked",true):a.prop("checked",false);a.trigger("change")})}
function SCMcommitKeys(a,b,c){SCMdisableMouse();if(b!=0){var d=$("tr.commitRow.current");$("body").off("keydown.differ");$("body").on("keydown.differ",function(e){if(!(e.ctrlKey||e.metaKey||e.shiftKey)){e.preventDefault();SCMdisableMouse();var f=false;if(e.keyCode==38&&a<b){a++;f=true}else if(e.keyCode==40&&a>0){a--;f=true}f&&c(a,d);return false}});$("body").focus()}}function SCMdisableKeys(){$("body").off("keydown.differ");$("body").focus()}
function SCMscrollCommitList(){var a=$("tr.commitRow.current"),b=a.position();b.top<0&&a[0].scrollIntoView(true);b.top+a.outerHeight()>$(".scroller").height()&&a[0].scrollIntoView(false)}function SCMdisableMouse(){$(".commitTable").removeClass("mouseworthy")}function SCMreEnableMouse(){$(".scroller .commitTable").addClass("mouseworthy")}function SCMlinkText(a){return a.replace(/(https?:\/\/\S*)/,function(b){return'<a href="'+b+'" target="_blank">'+b+"</a>"})}
function SCMclearActiveRequest(a){a&&Object.keys(a).length&&a.hasOwnProperty("abort")&&a.abort()}function SCMcompareFunc(a,b){if(a[0]<b[0])return-1;return 1}
function SCMbuildChannelCollisionTable(a,b,c){var d='<div id="collision_list"><div class="fixed">                   <table class="CollisionTable fixedHead"><thead><tr><th class="CollisionLabel">Channel</th>';if(a)d+='<th class="tick status">Status</th>';d+='<th class="action">Action&nbsp;<br><span class="select-style">                                 <select id="bulk_action" class="dropdown">                                   <option class="dropdown_opt" value="none">No Action</option>                                   <option class="dropdown_opt" value="update_everything">Full Update</option>                                   <option class="dropdown_opt" value="update_translators_only">Update Translators Only</option>                                   <option class="dropdown_opt" value="create_new_channel">'+b+
' As New Channel</option>                                 </select></span>                              </th>                              <th class="newnamecol">New channel name</th>                              <th class="notecol">Notes</th>                    </tr></thead></table></div>                    <div class="scroller"><table class="CollisionTable"><tbody>';d+=SCMbuildChannelCollisionRows(a,b,c);d+="</tbody></table></div></div>";return d}
function SCMbuildChannelCollisionRows(a,b,c){for(var d=Object.keys(c).sort(SCMcompareFunc),e="",f=0;f<d.length;f++){var g=c[d[f]].local_guid;e+='<tr class="CollisionChannel"><td class="CollisionLabel">'+d[f]+"</td>";if(a)e+='<td class="tick status" id="ChannelStatus_'+g+'" /></td>';e+='<td class="action"><span class="select-style"><select class="dropdown" data-cguid="'+g+'" ><option class="dropdown_opt" value="none">No Action</option><option class="dropdown_opt" value="update_everything">Full Update</option><option class="dropdown_opt" value="update_translators_only">Update Translators Only</option><option class="dropdown_opt" value="create_new_channel">'+
b+' As New Channel</option></select></span></td><td class="newnamecol" id="NewName_'+g+'"></td><td class="notecol" id="Note_'+g+'"></td></tr>'}return e}function SCMbuildFileCollisionTable(a,b){return'<table id="bump_file_list" class="bumpTable"><thead><tr><th class="CollisionLabel">Shared file</th><th class="tick control"><input type="checkbox" name="BumpAll" id="BumpAll" />Replace with '+a+'</th><th class="notecol" /></tr></thead><tbody>'+SCMbuildFileCollisionRows(a,b)+"</tbody></table>"}
function SCMbuildFileCollisionRows(a,b){for(var c=Object.keys(b),d="",e=0;e<c.length;e++){d+='<tr class="BumpFile"><td>'+c[e]+'</td><td class="tick"><input type="checkbox" class="bumpUpdate fileBump" data-filepath="'+c[e]+'"></td>';if(e==0)d+='<td id="diffLink" rowspan="'+c.length+'"><span id="showCollidingFileDiffView" class="clickable_link">See what will change</span></td>';d+="</tr>"}return d}
function SCMcheckChannelLights(a,b){$.ajax({url:"/dashboard_data",method:"GET",data:{include_remote_servers:true},success:function(c){SCMupdateLightStatus(c,a,b)}})}function SCMupdateCollisionRestartNote(a,b,c,d){var e=$("table.CollisionTable td#Note_"+b);a.each(function(){if($(this).prop("checked")&&c[b]){e.html(d);return false}else e.html("")})}
function SCMupdateLightStatus(a,b,c){var d=SCMlights();a=a.Channels;for(var e=0;e<a.length;e++){var f=a[e].Channel.Guid,g=d[a[e].Channel.Light];b[f]=g=="green"?true:false;var h=$("input.bumpUpdate[data-cguid="+f+"]");SCMupdateCollisionRestartNote(h,f,b,c);$("#ChannelStatus_"+f).html('<img src="/images/button-dot'+g+'v4.gif" alt="'+g+'" />')}}function SCMupdateCollidingFileApprovals(a,b){a.each(function(){b[$(this).attr("data-filepath")].overwrite=$(this).prop("checked")})}
function SCMremoveInvalidChannelSelectOptions(a){a.NameOnlyCollisionsPresent=false;for(var b in a.ChannelCollisionMap){var c=a.ChannelCollisionMap[b],d=c.local_guid;if(!(c.hasOwnProperty("update_everything")||c.hasOwnProperty("update_translators_only"))){a.NameOnlyCollisionsPresent=true;c="select.dropdown[data-cguid='"+d+"'] option[value='update_translators_only']";$("select.dropdown[data-cguid='"+d+"'] option[value='update_everything']").remove();$(c).remove()}}}
function SCMcheckForNewChannelNameColumnVisibility(a){var b=$("table.CollisionTable th.newnamecol").css("display")=="none",c=a.length;$(a).each(function(){var d=$(this).val(),e="#NewName_"+$(this).attr("data-cguid");if(d!="create_new_channel"){c-=1;$(e).children("input").remove()}else $(e+" input").length||$(e).append("<input type='text'></input>")});if(c&&b){$("table.CollisionTable .newnamecol").css("display","table-cell");$("table.CollisionTable .notecol").css("width","25%")}else if(!c&&!b){$("table.CollisionTable .newnamecol").css("display",
"none");$("table.CollisionTable .notecol").css("width","50%")}}function SCMresetChannelCollisonChoices(a,b){var c=b[a];c.create_new_channel=false;if(c.hasOwnProperty("update_everything"))c.update_everything=false;if(c.hasOwnProperty("update_translators_only"))c.update_translators_only=false;c.new_channel_name=""}
function SCMupdateChannelApprovals(a,b,c){a.each(function(){var d=$(this).attr("data-cguid"),e=$(this).val(),f=c[d];SCMresetChannelCollisonChoices(f,b);if(e!="none"){b[f][e]=true;if(e=="create_new_channel"){d=$("#NewName_"+d+" input").val();b[f].new_channel_name=d}}})}function SCMupdateChannelNotes(a,b,c,d){var e=$("#collision_list td.notecol#Note_"+b);a.each(function(){var f=$(this).val();if((f=="update_everything"||f=="update_translators_only")&&c[b]){e.html(d);return false}else e.html("")})}
function SCMdisplayUpdateWarningMessageIfNeeded(a,b){if(!(!b||$("#collision_list #channel_update_warning_messge").length!=0)){var c;$("#collision_list").append("<p id='channel_update_warning_messge'>Note: <br> Some of the colliding channels match existing channels in name only and don't have the same component types.<br> Because of this you will not be able to "+a+" and update them. You will only be able to "+a+" them as new channels.</p>")}}
function SCMcheckIfContinueButtonNeedsDisabling(a,b){var c=a.length,d=0,e=b.length,f=0;$(a).each(function(){$(this).val()=="none"&&d++});$(b).each(function(){$(this).prop("checked")||f++});var g=$("#confirmation-button-continue");g.length||(g=$("#SCMgo"));if(c>0&&c===d&&e>0&&e==f){g.button("disable");$("#CompleteControls").hide();$("#SCMreviewControls .review-actions").css("padding","20px 20px")}else if(c>0&&c===d&&e===0){g.button("disable");$("#CompleteControls").hide();$("#SCMreviewControls .review-actions").css("padding",
"20px 20px")}else{g.button("enable");$("#SCMreviewControls .review-actions").css("padding","10px 20px");$("#CompleteControls").show()}}
function SCMsetSelectBoxChangeEvents(a,b,c,d,e){b.on("change",function(f){f.stopPropagation();f=$(this);f.val();var g=f.attr("data-"+d);SCMcheckChannelLights(a.StatusMap,SCM_BUMP_NOTE);SCMupdateChannelNotes(f,g,a.StatusMap,SCM_BUMP_NOTE);SCMupdateChannelApprovals(b,a.ChannelCollisionMap,a.LocalGuidsToNameMap);SCMcheckForNewChannelNameColumnVisibility(b)});c.on("change",function(){var f=$(this).val();$(b).each(function(){if($(this).children("option[value="+f+"]").length){$(this).val(f);$(this).trigger("change")}if(f==
"update_everything"||f=="update_translators_only")SCMdisplayUpdateWarningMessageIfNeeded(e,a.NameOnlyCollisionsPresent)})})}function SCMclearNewChannelNameWarnings(a){for(var b=0;b<a.length;b++){var c=$(a[b]).attr("data-cguid");$("#NewName_"+c+" input").css("border","none")}$("#collision_list .NewChannelNameWarning").remove()}
function SCMcheckForExistingName(a,b,c){for(var d in a)if(b===a[d].name){a="#collision_list .ExistingName-"+c;if(!$(a).length){b='<p class="NewChannelNameWarning ExistingName-'+c+'">Channel name "'+b+'" exists already! Choose another name.</p>';$("#collision_list").prepend(b);$(a).css("color","red")}$("#NewName_"+c+" input").css("border","1px solid red");return true}return false}
function SCMemptyNameFound(a){if(!$("#collision_list .EmptyName").length){$("#collision_list").prepend('<p class="NewChannelNameWarning EmptyName">New channel names cannot be empty!</p>');$("#collision_list .EmptyName").css("color","red")}$("#NewName_"+a+" input").css("border","1px solid red")}
function SCMcheckForDuplicateNewName(a,b,c){if(!(!b||b=="")){if(a.hasOwnProperty(b)){$("#NewName_"+c+" input").css("border","1px solid red");$("#NewName_"+a[b]+" input").css("border","1px solid red");a='Channel name "'+b+"\" Can't be added more than once!";if(!$("#collision_list .DuplicateNewName").length||$("#collision_list .DuplicateNewName").length&&$("#collision_list .DuplicateNewName").text()!==a){$("#collision_list").prepend('<p class="NewChannelNameWarning DuplicateNewName">'+a+"</p>");$("#collision_list .DuplicateNewName").css("color",
"red")}return true}else a[b]=c;return false}}function SCMvalidateAndStoreNewChannelNames(a,b,c){for(var d=false,e={},f=0;f<b.length;f++){var g=b[f],h=$(g).attr("data-cguid"),i=$(g).val();g=a.LocalGuidsToNameMap[h];if(i=="create_new_channel"){i=$("#NewName_"+h+" input").val();a.ChannelCollisionMap[g].new_channel_name=i;if(i==""||!i){SCMemptyNameFound(h);d=true}else if(c=="export")d=SCMcheckForExistingName(a.IxportableChannelList,i,h)||d;d=SCMcheckForDuplicateNewName(e,i,h)||d}}return d}
function SCMbuildCollidingFileDiffView(a,b,c,d,e){$("#SCMreview").remove();var f="",g=Object.keys(a.ChannelCollisionMap).length>0;if(g)f='<div id="SCMcommitList"></div>';var h=$('<div id="SCMreview"></div>');h.append(f+'<div id="SCMpanelAndDiff"><div id="SCMpanel"></div><div id="SCMdiffAndControls"><div id="SCMdiffTank"><div class="diff_toolbar"><div class="toolbar_filename"></div><div class="toolbar_lines"></div><div class="toolbar_display"><span class="label">Display:</span><div class="select-style" style="float: right;"><select id="SCMdiffViewSelect"><option value="vertical">Side by Side</option><option value="horizontal">Horizontal</option><option value="condensed">Changes Only</option></select></div><\!--/toolbar_display--\></div><\!--/diff_toolbar--\></div><div id="SCMdiff"></div><\!--/SCMdiffTank--\></div><\!--/SCMdiffAndControls--\></div><\!--/SCMpanelAndDiff--\></div><div id="SCMreviewControls"><div class="review-actions"><span id="CompleteControls"><a id="SCMgo" class="action-button green btn-large">Complete '+
b+'</a> <span style="margin: 0 10px; color: #888888;">or</span> </span><a id="SCMcancel" style="color: #666666; font-size: 14px;">Cancel</a></div><\!--/SCMreviewControls--\></div>');$("body").append(h);c();if(g){$("#collision_list").appendTo($("#SCMreview #SCMcommitList"));$("#SCMreview #SCMcommitList .scroller").css("top","45px")}else{$("#SCMreview #SCMpanelAndDiff").css("top","0");$("#SCMreview #SCMdiff").css("height","100%")}$("#bump_file_list").remove();$("#ApprovalDlg").remove();b=$(window).width()-
30;c=$(window).height()-30;h.css("overflow","hidden");h.dialog({bgiframe:true,width:b,height:c,title:"Confirm overwrites",modal:true,autoOpen:false,resizable:false,close:e});h.dialog("open");addControlsToDiffView(a,d,e)}
function SCMfixCollidingSharedFileView(){var a=$("#SCMreview #SCMcommitList"),b=$("#SCMreview .scroller");b.height(a.height()-$("#SCMreview .fixed").outerHeight()+"px");b.css("top",$("#SCMreview .fixed").outerHeight()-1+"px");$("#SCMreview .fixed table").width($("#SCMreview .scroller table").width()+"px")}
function SCMattachDisableActionsToDiffView(){var a=$("#collision_list .CollisionChannel select.dropdown"),b=$("#SCMpanel .tree input.commitFile");a.on("change",function(){SCMcheckIfContinueButtonNeedsDisabling(a,b)});b.on("change",function(){SCMcheckIfContinueButtonNeedsDisabling(a,b)});SCMcheckIfContinueButtonNeedsDisabling(a,b)}
function addControlsToDiffView(a,b,c){$("#SCMgo").button();$("#SCMreview #SCMdiffViewSelect").change(function(){a.DiffFormat=$(this).val();SCMdoFileDiff(a)});$("#SCMreview #SCMcancel").click(function(){$("#SCMreview").dialog("close");c()});$("#SCMreview #SCMpanelAndDiff").resizable({maxHeight:$("#SCMreview").height()-75,minHeight:10,handles:"n"});$("#SCMreview #SCMpanelAndDiff").on("resize",function(d,e){$("#SCMreview #SCMcommitList").css("height",e.position.top+"px");SCMfixCollidingSharedFileView()});
$("#SCMreview #SCMpanel").resizable({maxWidth:500,minWidth:60,handles:"e"});$("#SCMreview #SCMpanel").on("resize",function(d,e){d.stopPropagation();$("#SCMreview #SCMdiffAndControls").css("left",e.size.width+"px")});b();$("#SCMreview #SCMreviewControls").css("padding","0");$(".review-actions").css("padding","10px 20px")}
function SCMloadCollidingFileDiffViewData(a,b){var c=0,d="",e;for(e in a.FileCollisionMap)if(a.FileCollisionMap.hasOwnProperty(e)){a.IndexMap["File"+c]=e;a.FileCollisionMap[e].index=c;c==0&&SCMsetCurrentFile(a,e);d+=SCMbuildFileRow(a,e,c);c++}var f=a.CollationMap.projects,g=f?Object.keys(f).length:0,h=Object.keys(f);g&&h.sort(function(j,k){return SCMcompare(f[j],f[k],"project_name")});e="";for(var i=0;i<h.length;i++)e+=SCMbuildProjectRow(a,f,h[i]);h=Object.keys(a.FileCollisionMap).length;g=SCMsizeBoxes(h,
g);SCMrefreshFileBox(a,b,c,d,g[0]);SCMrefreshProjectBox(b,e,g[1])}function SCMprojectClasses(a){if(!a.other_projects)return"";return" "+a.other_projects.map(function(b){return"Prj"+b}).join(" ")}
function SCMbuildFileRow(a,b,c){var d="";d='<input class="commitFile" data-filepath="'+b+'" id="commitFile'+c+'" type="checkbox"'+(a.FileCollisionMap[b].overwrite?' checked="checked"':"")+" />";return"<li>"+d+'<label id="File'+c+'" class="file select '+SCMprojectClasses(a.CollationMap.files[b])+(b==a.CurrentFile?" c":"")+'">'+b+"</label></li>"}
function SCMbuildProjectRow(a,b,c){return'<div id="Prj'+c+'" class="project'+SCMfileClasses(b[c],a.FileCollisionMap)+'" data-projectguid="'+c+'"><strong>('+Object.keys(b[c].shared_files).length+")</strong> "+b[c].project_name+'<span class="project-files" id="PrjFil'+c+'" /></div>'}function SCMbuildProjectFileRow(a,b,c){return'<span class="project-file '+a[b].status+' " data-projectguid="'+c+'">'+b+"</span>"}
function SCMsetCurrentFile(a,b){a.CurrentFile=b;a.CurrentIndex="File"+a.FileCollisionMap[b].index;$(".toolbar_filename").html(b)}function SCMdoFileDiff(a){var b=a.Diffs[a.CurrentFile];SCMupdateLegend(b,$("#SCMreviewControls"));b.status&&!b.summary?$("#SCMdiff").html('<div class="noDiff">(<span>'+b.status+"</span>)</div>"):SCMdrawDiffs(b,a.DiffFormat)}
function SCMrefreshFileBox(a,b,c,d){var e=true,f;for(f in a.FileCollisionMap)if(!a.FileCollisionMap[f].overwrite){e=false;break}b=$('<ul class="tree">      <li><label><input type="checkbox" id="commitAll" name="commitAll"'+(e?' checked="checked"':"")+"/>Shared files in this "+b+":</label></li>"+d+"</ul>   ");d=b.find(".commitFile");e=b.find("#commitAll");SCMbumpTickCheck(d,e,"","filepath");d.on("change",function(){SCMupdateCollidingFileApprovals($(this),a.FileCollisionMap)});b.find(".select").click(function(){FileScroll=
$("#SCMstageFilesCollection").scrollTop();SCMsetCurrentFile(a,a.IndexMap[$(this).attr("id")]);SCMdecorate(c,FileScroll);SCMdoFileDiff(a)});$("#SCMreview #SCMpanel ul.tree").remove();$("#SCMreview #SCMpanel").prepend(b)}
function SCMrefreshProjectBox(a,b){if(a==="export")$("div.projects_affected").remove();else if(b){var c=$('<div class="projects_affected"><div class="label">Projects affected:</div><ul>'+b+"</ul></div>");$("#SCMreview div.projects_affected").remove();$("#SCMreview #SCMpanel").append(c)}else $("div.projects_affected").remove()};/*

 Copyright (c) 2010-2011 iNTERFACEWARE Inc.  All rights reserved.
*/
var MiniLogin=function(){function a(){clearTimeout(f);jQuery.ajax({url:"/login_check",method:"POST",data:{Username:$("#login-user").val(),Password:$("#login-pass").val()},dataType:"json",cache:false,success:function(j){if(j)if(j.LoginOkay)if(j.UnlockRequired)window.location="/log_locker_settings.html";else{$("#login-popup").dialog("close");if(g){j=g;g=null;j()}}else $("#login-message").text("Login failed: "+j.ErrorText||"Please try again.");else $("#login-message").text("Login failed: Iguana is not responding.")},
error:function(j,k){if(j.status==403||k=="parsererror"){$("#login-message").text("Iguana is restarting, please wait...");f=setTimeout(a,1E3)}else $("#login-message").text("Login failed: Iguana is not responding.")}})}function b(j,k){if(h)if(g){var m=g;g=function(){try{m()}catch(p){}k()}}else{var l=$("#login-popup");l.length||(l=c());g=function(){k()};var n=$("#login-pass").val(e);$("#login-message").text(j);l.dialog("open");n.focus()}}function c(){$("body").append('         <div id="login-popup" style="display:none">            <table width="100%">            <tr>               <td colspan="2" id="login-message" align="center">            <tr>               <td align="right">Username:               <td><input type="text" id="login-user" readonly class="full_length">            <tr>               <td align="right">Password:               <td><input id="login-pass" type="password" class="full_length">            </table>         </div>      ');
$("#login-user").val(d);$("#login-pass").keydown(function(j){if(j.keyCode==13){j.preventDefault();a()}});return $("#login-popup").dialog({autoOpen:false,closeOnEscape:false,modal:true,open:function(){$(".ui-dialog-titlebar-close").hide()},resizable:false,title:"Iguana Login",buttons:{"Login & Retry":a,Cancel:function(){window.location="/"}}})}var d,e,f,g,h;$(document).ready(function(){$(window).unload(function(){h=false});h=true});var i=AjaxImpl(function(j,k,m){var l;if(m.status==403||j=="parsererror")l=
"Your session has expired.";else if(j!="notmodified")l="Iguana is not responding.";b(l,k)});i.show=b;i.loggedIn=function(){var j=i.ajax({url:"/login_check",method:"POST",dataType:"json",cache:false,async:false});try{if($.parseJSON(j.responseText).LoginOkay)return true}catch(k){}b("Your session has expired.",$.noop);return false};i.init=function(j,k){d=j;e=k};return i}();
