UNPKG

biojs-vis-pdbviewer

Version:

A BioJS 2.0 component to view protein structures

285 lines 144 kB
___JmolDate="$Date: 2014-08-03 08:56:51 -0500 (Sun, 03 Aug 2014) $";___fullJmolProperties="src/org/jmol/viewer/Jmol.properties";___JmolVersion="14.2.4_2014.08.03";
(function(a){function h(a){try{return a?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest}catch(f){}}a.ajaxSettings.xhr=void 0===window.ActiveXObject?h:function(){return(this.url==document.location||0==this.url.indexOf("http")||!this.isLocal)&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&h()||h(1)};a.extend(a.support,{iecors:!!window.XDomainRequest});a.support.iecors?a.ajaxTransport(function(a){return{send:function(f,d){var j=new window.XDomainRequest;j.onload=function(){d(200,
"OK",{text:j.responseText},{"Content-Type":j.contentType})};a.xhrFields&&(j.onerror=a.xhrFields.error,j.ontimeout=a.xhrFields.timeout);j.open(a.type,a.url);j.send(a.hasContent&&a.data||null)},abort:function(){xdr.abort()}}}):(a.ajaxSetup({accepts:{binary:"text/plain; charset=x-user-defined"},responseFields:{binary:"response"}}),a.ajaxTransport("binary",function(a){var f;return{send:function(d,j){var c=a.xhr();c.open(a.type,a.url,a.async);var b=!1;try{c.hasOwnProperty("responseType")&&(c.responseType=
"arraybuffer",b=!0)}catch(g){}try{!b&&c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined")}catch(m){}!a.crossDomain&&!d["X-Requested-With"]&&(d["X-Requested-With"]="XMLHttpRequest");try{for(var p in d)c.setRequestHeader(p,d[p])}catch(q){}c.send(a.hasContent&&a.data||null);f=function(){var g=c.status,b="",m=c.getAllResponseHeaders(),p={};try{if(f&&4===c.readyState){f=void 0;try{p.text="string"===typeof c.responseText?c.responseText:null}catch(d){}try{p.binary=c.response}catch(q){}try{b=
c.statusText}catch(h){b=""}!g&&a.isLocal&&!a.crossDomain?g=p.text?200:404:1223===g&&(g=204);j(g,b,p,m)}}catch(u){alert(u),j(-1,u)}};a.async?4===c.readyState?setTimeout(f):c.onreadystatechange=f:f()},abort:function(){}}}))})(jQuery);
(function(a,h,e,f){function d(d,c){function b(b){a(g).each(function(){self.Jmol&&(0<=c.indexOf("mouseup")||0<=c.indexOf("touchend"))&&Jmol._setMouseOwner(null);var g=a(this);this!==b.target&&!g.has(b.target).length&&g.triggerHandler(c,[b.target,b])})}c=c||d+f;var g=a(),m=d+"."+c+"-special-event";a.event.special[c]={setup:function(){g=g.add(this);1===g.length&&a(h).bind(m,b)},teardown:function(){self.Jmol&&Jmol._setMouseOwner(null);g=g.not(this);0===g.length&&a(h).unbind(m)},add:function(a){var g=
a.handler;a.handler=function(a,b){a.target=b;g.apply(this,arguments)}}}}a.map(e.split(" "),function(a){d(a)});d("focusin","focus"+f);d("focusout","blur"+f)})(jQuery,document,"click mousemove mouseup touchmove touchend","outjsmol");"undefined"==typeof jQuery&&alert("Note -- JSmoljQuery is required for JSmol, but it's not defined.");self.Jmol||(Jmol={});
Jmol._version||(Jmol=function(a){var h=function(a){return{header:a++,rear:a++,main:a++,image:a++,front:a++,fileOpener:a++,coverImage:a++,dialog:a++,menu:a+9E4,console:a+91E3,monitorZIndex:a+99999}},h={_version:"JSmol 14.2.3 July 23, 2014",_alertNoBinary:!0,_allowedJmolSize:[25,2048,300],_fileCache:null,_jarFile:null,_j2sPath:null,_use:null,_j2sLoadMonitorOpacity:90,_applets:{},_asynchronous:!0,_ajaxQueue:[],_getZOrders:h,_z:h(Jmol.z||9E3),_debugCode:!0,db:{_databasePrefixes:"$=:",_fileLoadScript:";if (_loadScript = '' && defaultLoadScript == '' && _filetype == 'Pdb') { select protein or nucleic;cartoons Only;color structure; select * };",
_nciLoadScript:";n = ({molecule=1}.length < {molecule=2}.length ? 2 : 1); select molecule=n;display selected;center selected;",_pubChemLoadScript:"",_DirectDatabaseCalls:{"cactus.nci.nih.gov":"%URL","www.rcsb.org":"%URL","pdbe.org":"%URL","www.ebi.ac.uk":"%URL","wwwdev.ebi.ac.uk":"%URL","pubchem.ncbi.nlm.nih.gov":"%URL","http://www.nmrdb.org/tools/jmol/predict.php":"%URL",$:"http://cactus.nci.nih.gov/chemical/structure/%FILENCI/file?format=sdf&get3d=True",$$:"http://cactus.nci.nih.gov/chemical/structure/%FILENCI/file?format=sdf",
"=":"http://www.rcsb.org/pdb/files/%FILE.pdb","*":"http://www.ebi.ac.uk/pdbe/entry-files/download/%FILE.cif","==":"http://www.rcsb.org/pdb/files/ligand/%FILE.cif",":":"http://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/%FILE/SDF?record_type=3d"},_restQueryUrl:"http://www.rcsb.org/pdb/rest/search",_restQueryXml:"<orgPdbQuery><queryType>org.pdb.query.simple.AdvancedKeywordQuery</queryType><description>Text Search</description><keywords>QUERY</keywords></orgPdbQuery>",_restReportUrl:"http://www.pdb.org/pdb/rest/customReport?pdbids=IDLIST&customReportColumns=structureId,structureTitle"},
_debugAlert:!1,_document:a,_isXHTML:!1,_lastAppletID:null,_mousePageX:null,_mouseOwner:null,_serverUrl:"http://your.server.here/jsmol.php",_syncId:(""+Math.random()).substring(3),_touching:!1,_XhtmlElement:null,_XhtmlAppendChild:!1};a=a.location.href.toLowerCase();h._httpProto=0==a.indexOf("https")?"https://":"http://";h._isFile=0==a.indexOf("file:");h._ajaxTestSite=h._httpProto+"google.com";a=h._isFile||0==a.indexOf("http://localhost")||0==a.indexOf("http://127.");h._tracker="http://"==h._httpProto&&
!a&&"http://chemapps.stolaf.edu/jmol/JmolTracker.htm?id=UA-45940799-1";h._isChrome=0<=navigator.userAgent.toLowerCase().indexOf("chrome");h._isSafari=!h._isChrome&&0<=navigator.userAgent.toLowerCase().indexOf("safari");h._isMsie=void 0!==window.ActiveXObject;h._useDataURI=!h._isSafari&&!h._isMsie;for(var e in Jmol)h[e]=Jmol[e];return h}(document,Jmol));
(function(a,h){a.$=function(a,b){null==a&&alert(b+arguments.callee.caller.toString());return h(b?"#"+a._id+"_"+b:a)};a._$=function(a){return"string"==typeof a?h("#"+a):a};a.$ajax=function(g){a._ajaxCall=g.url;g.cache="NO"!=g.cache;0==g.url.indexOf("http://pubchem.ncbi.nlm.nih")&&(g.url="https://"+g.url.substring(7));return h.ajax(g)};a._getNCIInfo=function(g,b){"name"==b&&(b="names");url="http://cactus.nci.nih.gov/chemical/structure/"+g+"/"+b;return a._getFileData(url)};a.$appEvent=function(g,b,c,
d){g=a.$(g,b);g.off(c)&&d&&g.on(c,d)};a.$resize=function(a){return h(window).resize(a)};a.$after=function(a,b){return h(a).after(b)};a.$bind=function(a,b,c){return c?h(a).bind(b,c):h(a).unbind(b)};a.$closest=function(a,b){return h(a).closest(b)};a.$get=function(a,b){return h(a).get(b)};a.$documentOff=function(a,b){return h(document).off(a,"#"+b)};a.$documentOn=function(a,b,c){return h(document).on(a,"#"+b,c)};a.$getAncestorDiv=function(a,b){return h("div."+b+":has(#"+a+")")[0]};a.$supportsIECrossDomainScripting=
function(){return h.support.iecors};a.$attr=function(g,b,c){return a._$(g).attr(b,c)};a.$css=function(g,b){return a._$(g).css(b)};a.$find=function(g,b){return a._$(g).find(b)};a.$focus=function(g){return a._$(g).focus()};a.$html=function(g,b){return a._$(g).html(b)};a.$offset=function(g){return a._$(g).offset()};a.$windowOn=function(a,b){return h(window).on(a,b)};a.$prop=function(g,b,c){var d=a._$(g);return 3==arguments.length?d.prop(b,c):d.prop(b)};a.$remove=function(g){return a._$(g).remove()};
a.$scrollTo=function(g,b){var c=a._$(g);return c.scrollTop(0>b?c[0].scrollHeight:b)};a.$setEnabled=function(g,b){return a._$(g).attr("disabled",b?null:"disabled")};a.$setSize=function(g,b,c){return a._$(g).width(b).height(c)};a.$setVisible=function(g,b){var c=a._$(g);return b?c.show():c.hide()};a.$submit=function(g){return a._$(g).submit()};a.$val=function(g,b){var c=a._$(g);return 1==arguments.length?c.val():c.val(b)};a._clearVars=function(){delete jQuery;delete h;delete a;delete SwingController;
delete J;delete JM;delete JS;delete JSV;delete JU;delete JV;delete java;delete javajs;delete Clazz;delete c$};var e=document,f=window,d={};d.ua=navigator.userAgent.toLowerCase();var j;a:{j=["linux","unix","mac","win"];for(var c=j.length;c--;)if(-1!=d.ua.indexOf(j[c])){j=j[c];break a}j="unknown"}d.os=j;d.browser=function(){for(var a=d.ua,b="konqueror webkit omniweb opera webtv icab msie mozilla".split(" "),c=0;c<b.length;c++)if(0<=a.indexOf(b[c]))return b[c];return"unknown"};d.browserName=d.browser();
d.browserVersion=parseFloat(d.ua.substring(d.ua.indexOf(d.browserName)+d.browserName.length+1));d.supportsXhr2=function(){return h.support.cors||h.support.iecors};d.allowDestroy="msie"!=d.browserName;d.allowHTML5="msie"!=d.browserName||0>navigator.appVersion.indexOf("MSIE 8");d.getDefaultLanguage=function(){return navigator.language||navigator.userLanguage||"en-US"};d._webGLtest=0;d.supportsWebGL=function(){if(!a.featureDetection._webGLtest){var g;a.featureDetection._webGLtest=f.WebGLRenderingContext&&
((g=e.createElement("canvas")).getContext("webgl")||g.getContext("experimental-webgl"))?1:-1}return 0<a.featureDetection._webGLtest};d.supportsLocalization=function(){for(var a=e.getElementsByTagName("meta"),b=a.length;0<=--b;)if(0<=a[b].outerHTML.toLowerCase().indexOf("utf-8"))return!0;return!1};d.supportsJava=function(){a.featureDetection._javaEnabled||(a.featureDetection._javaEnabled=a._isMsie?navigator.javaEnabled()?1:-1:navigator.javaEnabled()&&(!navigator.mimeTypes||navigator.mimeTypes["application/x-java-applet"])?
1:-1);return 0<a.featureDetection._javaEnabled};d.compliantBrowser=function(){var a=!!e.getElementById,b=d.os;if("opera"==d.browserName&&7.54>=d.browserVersion&&"mac"==b||"webkit"==d.browserName&&125.12>d.browserVersion||"msie"==d.browserName&&"mac"==b||"konqueror"==d.browserName&&3.3>=d.browserVersion)a=!1;return a};d.isFullyCompliant=function(){return d.compliantBrowser()&&d.supportsJava()};d.useIEObject="win"==d.os&&"msie"==d.browserName&&5.5<=d.browserVersion;d.useHtml4Object="mozilla"==d.browserName&&
5<=d.browserVersion||"opera"==d.browserName&&8<=d.browserVersion||"webkit"==d.browserName;d.hasFileReader=f.File&&f.FileReader;a.featureDetection=d;a._ajax=function(g){if(!g.async)return a.$ajax(g).responseText;a._ajaxQueue.push(g);1==a._ajaxQueue.length&&a._ajaxDone()};a._ajaxDone=function(){var g=a._ajaxQueue.shift();g&&a.$ajax(g)};a._grabberOptions=[["$","NCI(small molecules)"],[":","PubChem(small molecules)"],["=","RCSB(macromolecules)"],["*","PDBe(macromolecules)"]];a._getGrabberOptions=function(g){if(0==
a._grabberOptions.length)return"";var b='<input type="text" id="ID_query" onfocus="jQuery(this).select()" onkeypress="if(13==event.which){Jmol._applets[\'ID\']._search();return false}" size="32" value="" />',c='<button id="ID_submit" onclick="Jmol._applets[\'ID\']._search()">Search</button></nobr>';1==a._grabberOptions.length?(b="<nobr>"+b+'<span style="display:none">',c="</span>"+c):b+="<br /><nobr>";for(var b=b+'<select id="ID_select">',d=0;d<a._grabberOptions.length;d++)var k=a._grabberOptions[d],
b=b+('<option value="'+k[0]+'" '+(0==d?"selected":"")+">"+k[1]+"</option>");b=(b+"</select>"+c).replace(/ID/g,g._id);return"<br />"+b};a._getScriptForDatabase=function(g){return"$"==g?a.db._nciLoadScript:":"==g?a.db._pubChemLoadScript:a.db._fileLoadScript};a._setInfo=function(a,b,c){var d=[],k="";if(0==c.indexOf("ERROR"))k=c;else switch(b){case "=":b=c.split("<dimStructure.structureId>");d=["<table>"];for(c=1;c<b.length;c++)d.push('<tr><td valign=top><a href="javascript:Jmol.search('+a._id+",'="+
b[c].substring(0,4)+"')\">"+b[c].substring(0,4)+"</a></td>"),d.push("<td>"+b[c].split("Title>")[1].split("</")[0]+"</td></tr>");d.push("</table>");k=b.length-1+" matches";break;case "$":case ":":break;default:return}a._infoHeader=k;a._info=d.join("");a._showInfo(!0)};a._loadSuccess=function(g,b){b&&(a._ajaxDone(),b(g))};a._loadError=function(g){a._ajaxDone();a.say("Error connecting to server: "+a._ajaxCall);null!=g&&g()};a._isDatabaseCall=function(g){return 0<=a.db._databasePrefixes.indexOf(g.substring(0,
1))};a._getDirectDatabaseCall=function(g,b){if(b&&!a.featureDetection.supportsXhr2())return g;var c=2,d,k=a.db._DirectDatabaseCalls[g.substring(0,c)];k||(k=a.db._DirectDatabaseCalls[d=g.substring(0,--c)]);k&&(":"==d?(d=g.toLowerCase(),isNaN(parseInt(g.substring(1)))?0==d.indexOf(":smiles:")?(k+="?POST?smiles="+g.substring(8),g="smiles"):0==d.indexOf(":cid:")?g="cid/"+g.substring(5):(0==d.indexOf(":name:")?g=g.substring(5):0==d.indexOf(":cas:")&&(g=g.substring(4)),g="name/"+encodeURIComponent(g.substring(c))):
g="cid/"+g.substring(1)):g=encodeURIComponent(g.substring(c)),0<=k.indexOf("FILENCI")?(g=g.replace(/\%2F/g,"/"),g=k.replace(/\%FILENCI/,g)):g=k.replace(/\%FILE/,g));return g};a._getRawDataFromServer=function(g,b,c,d,k,l){g="?call=getRawDataFromDatabase&database="+g+(0<=b.indexOf("?POST?")?"?POST?":"")+"&query="+encodeURIComponent(b)+(k?"&encoding=base64":"")+(l?"":"&script="+encodeURIComponent(a._getScriptForDatabase(g)));return a._contactServer(g,c,d)};a._checkFileName=function(g,b,c){a._isDatabaseCall(b)&&
(c&&a._setQueryTerm(g,b),b=a._getDirectDatabaseCall(b,!0),a._isDatabaseCall(b)&&(b=a._getDirectDatabaseCall(b,!1),c&&(c[0]=!0)));return b};a._checkCache=function(g,b,c){if(g._cacheFiles&&a._fileCache&&!b.endsWith(".js")){if(g=a._fileCache[b])return System.out.println("using "+g.length+" bytes of cached data for "+b),c(g),null;c=function(g,b){c(a._fileCache[g]=b)}}return c};a._loadFileData=function(g,b,c,d){var k=[];b=a._checkFileName(g,b,k);c=a._checkCache(g,b,c);k[0]?a._getRawDataFromServer("_",
b,c,d):(g={type:"GET",dataType:"text",url:b,async:a._asynchronous,success:function(g){a._loadSuccess(g,c)},error:function(){a._loadError(d)}},a._checkAjaxPost(g),a._ajax(g))};a._getInfoFromDatabase=function(g,b,c){if("===="==b){var d=a.db._restQueryXml.replace(/QUERY/,c),d={dataType:"text",type:"POST",contentType:"application/x-www-form-urlencoded",url:a.db._restQueryUrl,data:encodeURIComponent(d)+"&req=browser",success:function(k){a._ajaxDone();a._extractInfoFromRCSB(g,b,c,k)},error:function(){a._loadError(null)},
async:a._asynchronous};return a._ajax(d)}c="?call=getInfoFromDatabase&database="+b+"&query="+encodeURIComponent(c);return a._contactServer(c,function(c){a._setInfo(g,b,c)})};a._extractInfoFromRCSB=function(g,b,c,d){var k=d.length/5;if(0!=k&&4==c.length&&1!=k){c=c.toUpperCase();var l=d.indexOf(c);0<l&&0<="123456789".indexOf(c.substring(0,1))&&(d=c+","+d.substring(0,l)+d.substring(l+5));50<k&&(d=d.substring(0,250));d=d.replace(/\n/g,",");d=a._restReportUrl.replace(/IDLIST/,d);a._loadFileData(g,d,function(c){a._setInfo(g,
b,c)})}};a._checkAjaxPost=function(a){var b=a.url.indexOf("?POST?");0<b&&(a.data=a.url.substring(b+6),a.url=a.url.substring(0,b),a.type="POST",a.contentType="application/x-www-form-urlencoded")};a._contactServer=function(g,b,c){g={dataType:"text",type:"GET",url:a._serverUrl+g,success:function(g){a._loadSuccess(g,b)},error:function(){a._loadError(c)},async:b?a._asynchronous:!1};a._checkAjaxPost(g);return a._ajax(g)};a._setQueryTerm=function(g,b){if(b&&g._hasOptions&&"http://"!=b.substring(0,7)){if(a._isDatabaseCall(b)){var c=
b.substring(0,1);b=b.substring(1);b.substring(0,1)==c&&0<="=$".indexOf(c)&&(b=b.substring(1));var d=a._getElement(g,"select");if(d&&d.options)for(var k=0;k<d.options.length;k++)d[k].value==c&&(d[k].selected=!0)}a.$val(a.$(g,"query"),b)}};a._search=function(g,b,c){1<arguments.length||(b=null);a._setQueryTerm(g,b);b||(b=a.$val(a.$(g,"query")));0==b.indexOf("!")?g._script(b.substring(1)):(b&&(b=b.replace(/\"/g,"")),g._showInfo(!1),a._searchMol(g,b,c,!0))};a._searchMol=function(g,b,c,d){var k;a._isDatabaseCall(b)?
(k=b.substring(0,1),b=b.substring(1)):k=g._hasOptions?a.$val(a.$(g,"select")):"$";"="==k&&3==b.length&&(b="="+b);var l=k+b;if(b&&!(0>l.indexOf("?")&&l==g._thisJmolModel)){g._thisJmolModel=l;var e;d&&null!=g._viewSet&&null!=(e=a.View.__findView(g._viewSet,{chemID:l}))?a.View.__setView(e,g,!1):("$"==k||":"==k?g._jmolFileType="MOL":"="==k&&(g._jmolFileType="PDB"),g._searchDatabase(b,k,c))}};a._searchDatabase=function(g,b,c,d){g._showInfo(!1);return 0<=b.indexOf("?")?(a._getInfoFromDatabase(g,c,b.split("?")[0]),
!0):a.db._DirectDatabaseCalls[c]?(g._loadFile(c+b,d),!0):!1};a._syncBinaryOK="?";a._canSyncBinary=function(b){if(self.VBArray)return a._syncBinaryOK=!1;if("?"!=a._syncBinaryOK)return a._syncBinaryOK;a._syncBinaryOK=!0;try{var c=new window.XMLHttpRequest;c.open("text",a._ajaxTestSite,!1);c.hasOwnProperty("responseType")?c.responseType="arraybuffer":c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined")}catch(d){return System.out.println("JSmolCore.js: synchronous binary file transfer is requested but not available"),
a._alertNoBinary&&!b&&alert("JSmolCore.js: synchronous binary file transfer is requested but not available"),a._syncBinaryOK=!1}return!0};a._binaryTypes=".gz .jpg .png .zip .jmol .bin .smol .spartan .mrc .pse .map .omap".split(" ");a._isBinaryUrl=function(b){for(var c=a._binaryTypes.length;0<=--c;)if(0<=b.indexOf(a._binaryTypes[c]))return!0;return!1};a._getFileData=function(b,c){var d=a._isBinaryUrl(b)?"binary":"text",e=0<=b.indexOf("pdb.gz")&&0==b.indexOf("http://www.rcsb.org/pdb/files/"),k="binary"==
d&&!a._canSyncBinary(e);k&&e&&(b=b.replace(/pdb\.gz/,"pdb"),k=!1,d="text");e=0<=b.indexOf("?POST?");0==b.indexOf("file:/")&&0!=b.indexOf("file:///")&&(b="file://"+b.substring(5));var l=0>b.indexOf("://")||0==b.indexOf(document.location.protocol)&&0<=b.indexOf(document.location.host),f=a._isDirectCall(b),j=!l&&a.$supportsIECrossDomainScripting();if(!c||k)if(j||k||!l&&!f)return a._getRawDataFromServer("_",b,c,c,k,!0);b=b.replace(/file:\/\/\/\//,"file://");var h={dataType:d,async:!!c};e?(h.type="POST",
h.url=b.split("?POST?")[0],h.data=b.split("?POST?")[1]):(h.type="GET",h.url=b);c&&(h.success=function(){c(a._xhrReturn(h.xhr))},h.error=function(){c(xhr.statusText)});h.xhr=a.$ajax(h);if(!c)return a._xhrReturn(h.xhr)};a._xhrReturn=function(a){return!a.responseText||self.Clazz&&Clazz.instanceOf(a.response,self.ArrayBuffer)?a.response||a.statusText:a.responseText};a._isDirectCall=function(b){for(var c in a.db._DirectDatabaseCalls)if(0<=c.indexOf(".")&&0<=b.indexOf(c))return!0;return!1};a._cleanFileData=
function(a){return 0<=a.indexOf("\r")&&0<=a.indexOf("\n")?a.replace(/\r\n/g,"\n"):0<=a.indexOf("\r")?a.replace(/\r/g,"\n"):a};a._getFileType=function(a){var b=a.substring(0,1);if("$"==b||":"==b)return"MOL";if("="==b)return"="==a.substring(1,2)?"LCIF":"PDB";a=a.split(".").pop().toUpperCase();return a.substring(0,Math.min(a.length,3))};a._getZ=function(b,c){return b&&b._z&&b._z[c]||a._z[c]};a._incrZ=function(b,c){return b&&b._z&&++b._z[c]||++a._z[c]};a._loadFileAsynchronously=function(b,c,d,e){if(0!=
d.indexOf("?")){d=a._checkFileName(c,d);var k=function(c){a._setData(b,d,c,e)},k=a._checkCache(c,d,k);return null==k?null:a._getFileData(d,k)}if(!a.featureDetection.hasFileReader)return b.setData("Local file reading is not enabled in your browser",null,e);c._localReader||(k='<div id="ID" style="z-index:'+a._getZ(c,"fileOpener")+';position:absolute;background:#E0E0E0;left:10px;top:10px"><div style="margin:5px 5px 5px 5px;"><input type="file" id="ID_files" /><button id="ID_loadfile">load</button><button id="ID_cancel">cancel</button></div><div>',
a.$after("#"+c._id+"_appletdiv",k.replace(/ID/g,c._id+"_localReader")),c._localReader=a.$(c,"localReader"));a.$appEvent(c,"localReader_loadfile","click");a.$appEvent(c,"localReader_loadfile","click",function(){var k=a.$(c,"localReader_files")[0].files[0],d=new FileReader;d.onloadend=function(d){d.target.readyState==FileReader.DONE&&(a.$css(a.$(c,"localReader"),{display:"none"}),a._setData(b,k.name,d.target.result,e))};d.readAsArrayBuffer(k)});a.$appEvent(c,"localReader_cancel","click");a.$appEvent(c,
"localReader_cancel","click",function(){a.$css(a.$(c,"localReader"),{display:"none"});b.setData(null,e)});a.$css(a.$(c,"localReader"),{display:"block"})};a._setData=function(b,c,d,e){d=a._strToBytes(d);0<=c.indexOf(".jdx")&&a.Cache.put("cache://"+c,d);b.setData(c,d,e)};a._toBytes=function(a){if("string"==typeof a)return a.getBytes();a=new Uint8Array(a);for(var b=Clazz.newByteArray(a.length,0),c=a.length;0<=--c;)b[c]=a[c];return b};a._doAjax=function(b,c,d){b=b.toString();if(null!=d)return a._saveFile(b,
d);c&&(b+="?POST?"+c);c=a._getFileData(b);return a._processData(c,a._isBinaryUrl(b))};a._saveFile=function(b,c,d,e){if(a._localFileSaveFunction&&a._localFileSaveFunction(b,c))return"OK";b=b.substring(b.lastIndexOf("/")+1);d||(d=0<=b.indexOf(".pdf")?"application/pdf":0<=b.indexOf(".png")?"image/png":0<=b.indexOf(".jpg")?"image/jpg":"");var k="string"==typeof c;k||(c=(JU?JU:J.util).Base64.getBase64(c).toString());e||(e=k?"":"base64");(k=a._serverUrl)&&0<=k.indexOf("your.server")&&(k="");a._useDataURI||
!k?(e||(c=btoa(c)),e=document.createElement("a"),e.href="data:"+d+";base64,"+c,e.type=d||"text/plain",e.download=b,e.target="_blank",h("body").append(e),e.click(),e.remove()):(a._formdiv||(a.$after("body",'<div id="__jsmolformdiv__" style="display:none">\t\t\t\t\t\t<form id="__jsmolform__" method="post" target="_blank" action="">\t\t\t\t\t\t<input name="call" value="saveFile"/>\t\t\t\t\t\t<input id="__jsmolmimetype__" name="mimetype" value=""/>\t\t\t\t\t\t<input id="__jsmolencoding__" name="encoding" value=""/>\t\t\t\t\t\t<input id="__jsmolfilename__" name="filename" value=""/>\t\t\t\t\t\t<textarea id="__jsmoldata__" name="data"></textarea>\t\t\t\t\t\t</form>\t\t\t\t\t\t</div>'),
a._formdiv="__jsmolform__"),a.$attr(a._formdiv,"action",k+"?"+(new Date).getMilliseconds()),a.$val("__jsmoldata__",c),a.$val("__jsmolfilename__",b),a.$val("__jsmolmimetype__",d),a.$val("__jsmolencoding__",e),a.$submit("__jsmolform__"),a.$val("__jsmoldata__",""),a.$val("__jsmolfilename__",""));return"OK"};a._processData=function(b,c){"undefined"==typeof b&&(b="",c=!1);c&&(c=a._canSyncBinary());return c?a._strToBytes(b):JU.SB.newS(b)};a._strToBytes=function(b){if(Clazz.instanceOf(b,self.ArrayBuffer))return a._toBytes(b);
for(var c=Clazz.newByteArray(b.length,0),d=b.length;0<=--d;)c[d]=b.charCodeAt(d)&255;return c};a._setConsoleDiv=function(a){self.Clazz&&Clazz.setConsoleDiv(a)};a._registerApplet=function(b,c){return window[b]=a._applets[b]=a._applets[c]=a._applets[b+"__"+a._syncId+"__"]=c};a._readyCallback=function(b,c,d,e){b=b.split("_object")[0];d=d.booleanValue?d.booleanValue():d;a._track(a._applets[b])._readyCallback(b,c,d,e)};a._getWrapper=function(b,c){var d;if(c){var e="";b._coverImage&&(d=' onclick="Jmol.coverApplet(ID, false)" title="'+
b._coverTitle+'"',e='<image id="ID_coverclickgo" src="'+b._j2sPath+'/img/play_make_live.jpg" style="width:25px;height:25px;position:absolute;bottom:10px;left:10px;z-index:'+a._getZ(b,"coverImage")+';opacity:0.5;"'+d+" />",e='<div id="ID_coverdiv" style="background-color:red;z-index:'+a._getZ(b,"coverImage")+';width:100%;height:100%;display:inline;position:absolute;top:0px;left:0px"><image id="ID_coverimage" src="'+b._coverImage+'" style="width:100%;height:100%"'+d+"/>"+e+"</div>");d='...<div id="ID_appletinfotablediv" style="width:Wpx;height:Hpx;position:relative;font-size:14px;text-align:left">IMG......<div id="ID_appletdiv" style="z-index:'+
a._getZ(b,"header")+';width:100%;height:100%;position:absolute;top:0px;left:0px;">';var k=b._height,l=b._width;if("string"!==typeof k||0>k.indexOf("%"))k+="px";if("string"!==typeof l||0>l.indexOf("%"))l+="px";d=d.replace(/IMG/,e).replace(/Hpx/g,k).replace(/Wpx/g,l)}else d='......</div>......<div id="ID_2dappletdiv" style="position:absolute;width:100%;height:100%;overflow:hidden;display:none"></div>......<div id="ID_infotablediv" style="width:100%;height:100%;position:absolute;top:0px;left:0px">.........<div id="ID_infoheaderdiv" style="height:20px;width:100%;background:yellow;display:none"><span id="ID_infoheaderspan"></span><span id="ID_infocheckboxspan" style="position:absolute;text-align:right;right:1px;"><a href="javascript:Jmol.showInfo(ID,false)">[x]</a></span></div>.........<div id="ID_infodiv" style="position:absolute;top:20px;bottom:0px;width:100%;height:100%;overflow:auto"></div>......</div>...</div>';
return d.replace(/\.\.\./g,"").replace(/[\n\r]/g,"").replace(/ID/g,b._id)};a._documentWrite=function(b){if(a._document){if(a._isXHTML&&!a._XhtmlElement){var c=document.getElementsByTagName("script");a._XhtmlElement=c.item(c.length-1);a._XhtmlAppendChild=!1}a._XhtmlElement?a._domWrite(b):a._document.write(b)}return b};a._domWrite=function(b){for(var c=[0];c[0]<b.length;){var d=a._getDomElement(b,c);if(!d)break;a._XhtmlAppendChild?a._XhtmlElement.appendChild(d):a._XhtmlElement.parentNode.insertBefore(d,
_jmol.XhtmlElement)}};a._getDomElement=function(a,b){var c=document.createElement("span");c.innerHTML=a;b[0]=a.length;return c};a._setObject=function(b,c,d){b._id=c;b.__Info={};d.z&&d.zIndexBase&&(a._z=a._getZOrders(d.zIndexBase));for(var e in d)b.__Info[e]=d[e];(b._z=d.z)||d.zIndexBase&&(b._z=b.__Info.z=a._getZOrders(d.zIndexBase));b._width=d.width;b._height=d.height;b._noscript=!b._isJava&&d.noscript;b._console=d.console;b._cacheFiles=!!d.cacheFiles;b._viewSet=null==d.viewSet||b._isJava?null:"Set"+
d.viewSet;null!=b._viewSet&&(a.View.__init(b),b._currentView=null);!a._fileCache&&b._cacheFiles&&(a._fileCache={});b._console||(b._console=b._id+"_infodiv");"none"==b._console&&(b._console=null);b._color=d.color?d.color.replace(/0x/,"#"):"#FFFFFF";b._disableInitialConsole=d.disableInitialConsole;b._noMonitor=d.disableJ2SLoadMonitor;a._j2sPath&&(d.j2sPath=a._j2sPath);b._j2sPath=d.j2sPath;b._deferApplet=d.deferApplet;b._deferUncover=d.deferUncover;b._coverImage=!b._isJava&&d.coverImage;b._isCovered=
!!b._coverImage;b._coverScript=d.coverScript;b._coverTitle=d.coverTitle;b._coverTitle||(b._coverTitle=b._deferApplet?"activate 3D model":"3D model is loading...");b._containerWidth=b._width+(b._width==parseFloat(b._width)?"px":"");b._containerHeight=b._height+(b._height==parseFloat(b._height)?"px":"");b._info="";b._infoHeader=b._jmolType+' "'+b._id+'"';b._hasOptions=d.addSelectionOptions;b._defaultModel=d.defaultModel;b._readyScript=d.script?d.script:"";b._readyFunction=d.readyFunction;b._coverImage&&
!b._deferApplet&&(b._readyScript+=";javascript "+c+"._displayCoverImage(false)");b._src=d.src};a._addDefaultInfo=function(b,c){for(var d in c)"undefined"==typeof b[d]&&(b[d]=c[d]);a._use&&(b.use=a._use);0<=b.use.indexOf("SIGNED")&&(0>b.jarFile.indexOf("Signed")&&(b.jarFile=b.jarFile.replace(/Applet/,"AppletSigned")),b.use=b.use.replace(/SIGNED/,"JAVA"),b.isSigned=!0)};a._syncedApplets=[];a._syncedCommands=[];a._syncedReady=[];a._syncReady=!1;a._isJmolJSVSync=!1;a._setReady=function(b){a._syncedReady[b]=
1;for(var c=0,d=0;d<a._syncedApplets.length;d++){if(a._syncedApplets[d]==b._id)a._syncedApplets[d]=b,a._syncedReady[d]=1;else if(!a._syncedReady[d])continue;c++}c==a._syncedApplets.length&&a._setSyncReady()};a._setDestroy=function(b){a.featureDetection.allowDestroy&&a.$windowOn("beforeunload",function(){a._destroy(b)})};a._destroy=function(b){try{b._applet&&b._applet.destroy();b._applet=null;a._unsetMouse(b._canvas);b._canvas=null;for(var c=0,d=0;d<a._syncedApplets.length;d++)a._syncedApplets[d]==
b&&(a._syncedApplets[d]=null),a._syncedApplets[d]&&c++;0<c||a._clearVars()}catch(e){}};a._setSyncReady=function(){a._syncReady=!0;for(var b="",c=0;c<a._syncedApplets.length;c++)a._syncedCommands[c]&&(b+="Jmol.script(Jmol._syncedApplets["+c+"], Jmol._syncedCommands["+c+"]);");setTimeout(b,50)};a._mySyncCallback=function(b,c){app=a._applets[b];if(app._viewSet)a.View.updateFromSync(app,c);else{if(!a._syncReady||!a._isJmolJSVSync)return 1;for(var d=0;d<a._syncedApplets.length;d++)0<=c.indexOf(a._syncedApplets[d]._syncKeyword)&&
a._syncedApplets[d]._syncScript(c);return 0}};a._getElement=function(b,a){return document.getElementById(b._id+"_"+a)||{}};a._evalJSON=function(b,a){b+="";if(!b)return[];if("{"!=b.charAt(0))return 0<=b.indexOf(" | ")&&(b=b.replace(/\ \|\ /g,"\n")),b;var c=(new Function("return "+b))();return!c?null:a&&void 0!=c[a]?c[a]:c};a._sortMessages=function(b){function a(b,c){return b[0]<c[0]?1:b[0]>c[0]?-1:0}if(!b||"object"!=typeof b)return[];for(var c=[],d=b.length-1;0<=d;d--)for(var k=0,l=b[d].length;k<l;k++)c[c.length]=
b[d][k];if(0!=c.length)return c=c.sort(a)};a._setMouseOwner=function(b,c){null==b||c?a._mouseOwner=b:a._mouseOwner==b&&(a._mouseOwner=null)};a._jsGetMouseModifiers=function(b){var a=0;switch(b.button){case 0:a=16;break;case 1:a=8;break;case 2:a=4}b.shiftKey&&(a+=1);b.altKey&&(a+=8);b.ctrlKey&&(a+=2);return a};a._jsGetXY=function(b,c){if(!b.applet._ready||a._touching&&0>c.type.indexOf("touch"))return!1;c.preventDefault();var d=a.$offset(b.id),e,k=c.originalEvent;c.pageX||(c.pageX=k.pageX);c.pageY||
(c.pageY=k.pageY);a._mousePageX=c.pageX;a._mousePageY=c.pageY;k.targetTouches&&k.targetTouches[0]?(e=k.targetTouches[0].pageX-d.left,d=k.targetTouches[0].pageY-d.top):k.changedTouches?(e=k.changedTouches[0].pageX-d.left,d=k.changedTouches[0].pageY-d.top):(e=c.pageX-d.left,d=c.pageY-d.top);return void 0==e?null:[Math.round(e),Math.round(d),a._jsGetMouseModifiers(c)]};a._gestureUpdate=function(b,c){c.stopPropagation();c.preventDefault();var d=c.originalEvent;switch(c.type){case "touchstart":a._touching=
!0;break;case "touchend":a._touching=!1}if(!d.touches||2!=d.touches.length)return!1;switch(c.type){case "touchstart":b._touches=[[],[]];break;case "touchmove":var e=a.$offset(b.id),k=b._touches[0],l=b._touches[1];k.push([d.touches[0].pageX-e.left,d.touches[0].pageY-e.top]);l.push([d.touches[1].pageX-e.left,d.touches[1].pageY-e.top]);d=k.length;3<d&&(k.shift(),l.shift());2<=d&&b.applet._processGesture(b._touches)}return!0};a._jsSetMouse=function(b){a.$bind(b,"mousedown touchstart",function(c){a._setMouseOwner(b,
!0);c.stopPropagation();c.preventDefault();b.isDragging=!0;if("touchstart"==c.type&&a._gestureUpdate(b,c))return!1;a._setConsoleDiv(b.applet._console);var d=a._jsGetXY(b,c);if(!d)return!1;2!=c.button&&a.Swing.hideMenus(b.applet);b.applet._processEvent(501,d);return!1});a.$bind(b,"mouseup touchend",function(c){a._setMouseOwner(null);c.stopPropagation();c.preventDefault();b.isDragging=!1;if("touchend"==c.type&&a._gestureUpdate(b,c))return!1;c=a._jsGetXY(b,c);if(!c)return!1;b.applet._processEvent(502,
c);return!1});a.$bind(b,"mousemove touchmove",function(c){return a._mouseOwner&&a._mouseOwner!=b&&a._mouseOwner.isDragging?(a._mouseOwner.mouseMove(c),!1):a._drag(b,c)});a._drag=function(b,c){c.stopPropagation();c.preventDefault();if("touchmove"==c.type&&a._gestureUpdate(b,c))return!1;var g=a._jsGetXY(b,c);if(!g)return!1;b.isDragging||(g[2]=0);b.applet._processEvent(b.isDragging?506:503,g);return!1};a.$bind(b,"DOMMouseScroll mousewheel",function(c){c.stopPropagation();c.preventDefault();b.isDragging=
!1;var d=c.originalEvent,d=d.detail?d.detail:("mac"==a.featureDetection.os?1:-1)*d.wheelDelta;c=a._jsGetMouseModifiers(c);b.applet._processEvent(-1,[0>d?-1:1,0,c]);return!1});a.$bind(b,"contextmenu",function(){return!1});a.$bind(b,"mouseout",function(c){b.applet._applet&&b.applet._applet.startHoverWatcher(!1);a._jsGetXY(b,c);return!1});a.$bind(b,"mouseenter",function(c){b.applet._applet&&b.applet._applet.startHoverWatcher(!0);if(0===c.buttons||0===c.which){b.isDragging=!1;c=a._jsGetXY(b,c);if(!c)return!1;
b.applet._processEvent(504,c);b.applet._processEvent(502,c);return!1}});a.$bind(b,"mousemoveoutjsmol",function(c,d,e){if(b==a._mouseOwner&&b.isDragging)return a._drag(b,e)});b.applet._is2D&&a.$resize(function(){b.applet&&b.applet._resize()});a.$bind("body","mouseup touchend",function(){b.applet&&(b.isDragging=!1);a._setMouseOwner(null)})};a._jsUnsetMouse=function(b){b.applet=null;a.$bind(b,"mousedown touchstart mousemove touchmove mouseup touchend DOMMouseScroll mousewheel contextmenu mouseout mouseenter",
null);a._setMouseOwner(null)};a.Swing={count:0,menuInitialized:0,menuCounter:0,htDialogs:{}};var b=a.Swing;SwingController=b;b.setDraggable=function(b){b=b.prototype;b.setContainer||(b.setContainer=function(b){this.container=b;b.obj=this;this.ignoreMouse=this.isDragging=!1;var c=this;b.bind("mousedown touchstart",function(b){if(c.ignoreMouse)return c.ignoreMouse=!1,!0;a._setMouseOwner(c,!0);c.isDragging=!0;c.pageX=b.pageX;c.pageY=b.pageY;return!1});b.bind("mousemove touchmove",function(b){if(c.isDragging&&
a._mouseOwner==c)return c.mouseMove(b),!1});b.bind("mouseup touchend",function(b){c.mouseUp(b);a._setMouseOwner(null)})},b.mouseUp=function(b){if(this.isDragging&&a._mouseOwner==this)return this.pageX0+=b.pageX-this.pageX,this.pageY0+=b.pageY-this.pageY,this.isDragging=!1;a._setMouseOwner(null)},b.setPosition=function(){if(null===a._mousePageX){var b=a.$offset(this.applet._id+"_"+(this.applet._is2D?"canvas2d":"canvas"));a._mousePageX=b.left;a._mousePageY=b.top}this.pageX0=a._mousePageX;this.pageY0=
a._mousePageY;this.container.css({top:a._mousePageY+"px",left:a._mousePageX+"px"})},b.mouseMove=function(b){this.isDragging&&a._mouseOwner==this&&(this.timestamp=System.currentTimeMillis(),this.container.css({top:this.pageY0+(b.pageY-this.pageY)+"px",left:this.pageX0+(b.pageX-this.pageX)+"px"}))},b.dragBind=function(b){this.applet._ignoreMouse=!b;this.container.unbind("mousemoveoutjsmol");this.container.unbind("touchmoveoutjsmol");this.container.unbind("mouseupoutjsmol");this.container.unbind("touchendoutjsmol");
a._setMouseOwner(null);if(b){var c=this;this.container.bind("mousemoveoutjsmol touchmoveoutjsmol",function(b,a,g){c.mouseMove(g)});this.container.bind("mouseupoutjsmol touchendoutjsmol",function(b,a,g){c.mouseUp(g)})}})};b.JSDialog=function(){};b.setDraggable(b.JSDialog);b.getScreenDimensions=function(b){b.width=h(window).width();b.height=h(window).height()};b.dispose=function(c){a.$remove(c.id+"_mover");delete b.htDialogs[c.id];c.container.obj.dragBind(!1)};b.register=function(a,c){a.id=c+ ++b.count;
b.htDialogs[a.id]=a};b.setDialog=function(c){a._setMouseOwner(null);a.$remove(c.id);var d=c.id+"_mover",e=a._$(d),f;e[0]?(e.html(c.html),f=e[0].jd):(a.$after("body","<div id='"+d+"' style='position:absolute;left:0px;top:0px;'>"+c.html+"</div>"),f=new b.JSDialog,e=a._$(d),c.container=e,f.applet=c.manager.vwr.html5Applet,f.setContainer(e),f.dialog=c,f.setPosition(),f.dragBind(!0),e[0].jd=f);a.$bind("#"+c.id+" .JButton","mousedown touchstart",function(){f.ignoreMouse=!0});a.$bind("#"+c.id+" .JComboBox",
"mousedown touchstart",function(){f.ignoreMouse=!0});a.$bind("#"+c.id+" .JCheckBox","mousedown touchstart",function(){f.ignoreMouse=!0});a.$bind("#"+c.id+" .JTextField","mousedown touchstart",function(){f.ignoreMouse=!0});a.$bind("#"+c.id+" .JTable","mousedown touchstart",function(){f.ignoreMouse=!0});a.$bind("#"+c.id+" .JScrollPane","mousedown touchstart",function(){f.ignoreMouse=!0});a.$bind("#"+c.id+" .JEditorPane","mousedown touchstart",function(){f.ignoreMouse=!0})};b.setSelected=function(b){a.$prop(b.id,
"checked",!!b.selected)};b.setSelectedIndex=function(b){a.$prop(b.id,"selectedIndex",b.selectedIndex)};b.setText=function(b){a.$prop(b.id,"value",b.text)};b.setVisible=function(b){a.$setVisible(b.id,b.visible)};b.setEnabled=function(b){a.$setEnabled(b.id,b.enabled)};b.click=function(c,d){var e=b.htDialogs[c.id];if(e){var f=e.toString();if(0<=f.indexOf("JCheck"))e.selected=c.checked;else if(0<=f.indexOf("JCombo"))e.selectedIndex=c.selectedIndex;else if(null!=e.text&&(e.text=c.value,d&&13!=(d.charCode||
d.keyCode)))return}f=b.htDialogs[a.$getAncestorDiv(c.id,"JDialog").id];f.manager.actionPerformed(e?e.name:f.registryKey+"/"+c.id)};b.setFront=function(b){var c=b.manager.vwr.html5Applet;b.zIndex!=a._getZ(c,"dialog")&&(b.zIndex=a._incrZ(c,"dialog"));b.container&&((b.container[0]||b.container).style.zIndex=b.zIndex)};b.hideMenus=function(a){if(a=a._menus)for(var c in a)a[c].visible&&b.hideMenu(a[c])};b.windowClosing=function(c){c=b.htDialogs[a.$getAncestorDiv(c.id,"JDialog").id];c.registryKey?c.manager.processWindowClosing(c.registryKey):
c.dispose()};a._track=function(b){if(a._tracker){try{var c='<iframe style="display:none" width="0" height="0" frameborder="0" tabindex="-1" src="'+(a._tracker+"&applet="+b._jmolType+"&version="+a._version+"&appver="+self.___JmolVersion+"&url="+encodeURIComponent(document.location.href))+'"></iframe>';a.$after("body",c)}catch(d){}delete a._tracker}return b};a.getProfile=function(){window["j2s.doProfile"]=!0;if(self.Clazz&&self.JSON)return Clazz._profile||(Clazz._profile={}),Clazz.getProfile()};a._getInChIKey=
function(b,a){0<=a.indexOf("MOL=")&&a.split("MOL=")[1].split('"')};a._getAttr=function(b,a){var c=b.indexOf(a+"=");return 0<=c&&0<=(c=b.indexOf('"',c))?b.substring(c+1,b.indexOf('"',c+1)):null};a.User={viewUpdatedCallback:null};a.View={count:0,applets:{},sets:{}};(function(b){b.updateView=function(c,d){if(null!=c._viewSet){d.chemID||(c._searchQuery=null);d.data||(d.data="N/A");d.type=c._viewType;if(null==(c._currentView=b.__findView(c._viewSet,d)))c._currentView=b.__createViewSet(c._viewSet,d.chemID,
d.viewID||d.chemID);c._currentView[d.type].data=d.data;c._currentView[d.type].smiles=c._getSmiles();a.User.viewUpdatedCallback&&a.User.viewUpdatedCallback(c,"updateView");b.__setView(c._currentView,c,!1)}};b.updateFromSync=function(c,d){c._updateMsg=d;var e=a._getAttr(d,"sourceID")||a._getAttr(d,"file");if(e){var k=b.__findView(c._viewSet,{viewID:e});if(null==k)return a.updateView(c,d);k!=c._currentView&&b.__setView(k,c,!0);var l=(e=a._getAttr(d,"atoms"))&&0<=d.indexOf("selectionhalos ON")?eval("["+
e+"]"):[];setTimeout(function(){c._currentView==k&&b.updateAtomPick(c,l)},10);a.User.viewUpdatedCallback&&a.User.viewUpdatedCallback(c,"updateFromSync")}};b.updateAtomPick=function(b,c){var g=b._currentView;if(null!=g){for(var k in g)"info"!=k&&g[k].applet!=b&&g[k].applet._updateAtomPick(c);a.User.viewUpdatedCallback&&a.User.viewUpdatedCallback(b,"updateAtomPick")}};b.dumpViews=function(a){var c=b.sets[a];if(c){var d="View set "+a+":\n";a=b.applets[a];for(var k in a)d+="\napplet "+a[k]._id+" currentView="+
(a[k]._currentView?a[k]._currentView.info.viewID:null);for(k=c.length;0<=--k;){a=c[k];var d=d+("\n\n<b>view="+k+" viewID="+a.info.viewID+" chemID="+a.info.chemID+"</b>\n"),l,e;for(e in a)"info"!=e&&(d+="\nview="+k+" type="+e+" applet="+((l=a[e]).applet?l.applet._id:null)+" SMILES="+l.smiles+"\n atomMap="+JSON.stringify(l.atomMap)+"\n data=\n"+l.data+"\n")}return d}};b.__init=function(a){var c=a._viewSet,d=b.applets;d[c]||(d[c]={});d[c][a._viewType]=a};b.__findView=function(a,c){var d=b.sets[a];null==
d&&(d=b.sets[a]=[]);for(var k=d.length;0<=--k;){var l=d[k];if(c.viewID){if(l.info.viewID==c.viewID)return l}else{if(null!=c.chemID&&c.chemID==l.info.chemID)return l;for(var e in l)if("info"!=e&&(null!=c.data&&null!=l[e].data?c.data==l[e].data:c.type==e))return l}}return null};b.__createViewSet=function(c,d,e){b.count++;d={info:{chemID:d,viewID:e||"model_"+b.count}};for(var k in a._applets)e=a._applets[k],e._viewSet==c&&(d[e._viewType]={applet:e,data:null});b.sets[c].push(d);return d};b.__setView=
function(b,a,c){for(var g in b)if("info"!=g){var d=b[g],e=d.applet,f=c||null!=e&&"<modified>"==e._molData;if(!(null==e||e==a&&!f)){var j=null==d.data,h=null!=e._currentView;e._currentView=b;if(!h||!(b[g].data==d.data&&!j&!f))if(e._loadModelFromView(b),j)break}}}})(a.View);a.Cache={fileCache:{}};a.Cache.get=function(b){return a.Cache.fileCache[b]};a.Cache.put=function(b,c){a.Cache.fileCache[b]=c};a.Cache.setDragDrop=function(b){a.$appEvent(b,"appletdiv","dragover",function(b){b=b.originalEvent;b.stopPropagation();
b.preventDefault();b.dataTransfer.dropEffect="copy"});a.$appEvent(b,"appletdiv","drop",function(c){var d=c.originalEvent;d.stopPropagation();d.preventDefault();var e=d.dataTransfer.files[0];if(null==e)try{e=""+d.dataTransfer.getData("text"),(0==e.indexOf("file:/")||0==e.indexOf("http:/"))&&b._scriptLoad(e)}catch(k){}else d=new FileReader,d.onloadend=function(d){if(d.target.readyState==FileReader.DONE){var k="cache://DROP_"+e.name;d=a._toBytes(d.target.result);b._applet.cacheFileByName("cache://DROP_*",
!1);"JSV"==b._viewType||k.endsWith(".jdx")?a.Cache.put(k,d):b._applet.cachePut(k,d);(d=a._jsGetXY(b._canvas,c))&&(!b._applet.setStatusDragDropped||b._applet.setStatusDragDropped(0,d[0],d[1],k))&&b._applet.openFileAsyncSpecial(k,1)}},d.readAsArrayBuffer(e)})}})(Jmol,jQuery);Jmol._debugCode=!1;
(function(a){a._coreFiles=[];a.__execLog=[];a.__execStack=[];a.__execTimer=0;a.__coreSet=[];a.__coreMore=[];a.__execDelayMS=100;a.showExecLog=function(){return a.__execLog.join("\n")};a.__addExec=function(h){var e="JSmol load "+h[0]._id+" "+h[3];self.console&&console.log(e+"...");a.__execLog.push(e);a.__execStack.push(h)};a.__addCoreFile=function(h,e,f){if(!(0<=a.__coreSet.join("").indexOf(h))){a.__coreSet.push(h);a.__coreSet.sort();h=a.__coreSet.join("");a._coreFiles=[e+"/core/core"+("jmol"==h?"":
h)+".z.js"];if(f&&(f=f.split(" ")))for(h=0;h<f.length;h++)0>a.__coreMore.join("").indexOf(f[h])&&a.__coreMore.push(e+"/core/core"+f[h]+".z.js");for(h=0;h<a.__coreMore.length;h++)a._coreFiles.push(a.__coreMore[h])}};a.__nextExecution=function(h){delete a.__execTimer;for(var e=a.__execStack,f;0<e.length&&"done"==(f=e[0])[4];)e.shift();0!=e.length&&(h?(f.push("done"),h="JSmol exec "+f[0]._id+" "+f[3]+" "+f[2],self.console&&console.log(h+" -- OK"),a.__execLog.push(h),f[1](f[0],f[2])):setTimeout("Jmol.__nextExecution(true)",
10))};a.__loadClazz=function(h){a.__clazzLoaded?a.__nextExecution():(a.__clazzLoaded=!0,LoadClazz(),h._noMonitor&&(Clazz._LoaderProgressMonitor.showStatus=function(){}),LoadClazz=null,Clazz._Loader.globalLoaded=function(){Clazz._LoaderProgressMonitor.showStatus("Application loaded.",!0);if(!a._debugCode||!a.haveCore)a.haveCore=!0,a.__nextExecution()},Clazz._Loader.packageClasspath("java",null,!0))};a.__loadClass=function(h,e){Clazz._Loader.loadClass(e,function(){a.__nextExecution()})};a._Canvas2D=
function(h,e,f,d){this._uniqueId=(""+Math.random()).substring(3);this._id=h;this._is2D=!0;this._isJava=!1;this._jmolType="Jmol._Canvas2D ("+f+")";switch(f){case "Jmol":this._platform="J.awtjs2d.Platform";break;case "JSV":this._isLayered=this._isJSV=!0;this._platform="JSV.awtjs2d.Platform";break;case "Astex":this._isAstex=!0,this._platform="astex.awtjs2d.Platform"}if(d)return this;window[h]=this;this._createCanvas(h,e);if(!a._document||this._deferApplet)return this;this._init();return this};a._setAppletParams=
function(h,e,f,d){for(var j in f)if(!h||0<=h.indexOf(";"+j.toLowerCase()+";"))null==f[j]||"language"==j&&!a.featureDetection.supportsLocalization()||(d?e.put(j,!0===f[j]?Boolean.TRUE:!1===f[j]?Boolean.FALSE:f[j]):e[j]=f[j])};a._jsSetPrototype=function(h){h._init=function(){this._setupJS();this._showInfo(!0);this._disableInitialConsole&&this._showInfo(!1)};h._createCanvas=function(e,f,d){a._setObject(this,e,f);d&&(this._GLmol=d,this._GLmol.applet=this,this._GLmol.id=this._id);d=a._getWrapper(this,
!0);this._deferApplet||(a._document?(a._documentWrite(d),this._newCanvas(!1),d=""):(this._deferApplet=!0,d+='<script type="text/javascript">'+e+"._cover(false)\x3c/script>"));d+=a._getWrapper(this,!1);f.addSelectionOptions&&(d+=a._getGrabberOptions(this));a._debugAlert&&!a._document&&alert(d);this._code=a._documentWrite(d)};h._cover=function(e){if(e||!this._deferApplet)this._displayCoverImage(e);else{var f=this._coverScript?this._coverScript:"";this._coverScript="";this._deferUncover&&(f+=";refresh;javascript "+
this._id+"._displayCoverImage(false)");this._script(f,!0);this._deferUncover&&"activate 3D model"==this._coverTitle&&(a._getElement(this,"coverimage").title="3D model is loading...");this._deferApplet&&this._newCanvas(!1);this._defaultModel&&a._search(this,this._defaultModel);this._showInfo(!1);this._deferUncover||this._displayCoverImage(e);this._init&&this._init()}};h._displayCoverImage=function(e){this._coverImage&&this._isCovered!=e&&(this._isCovered=e,a._getElement(this,"coverdiv").style.display=
e?"block":"none")};h._newCanvas=function(a){this._is2D?this._createCanvas2d(a):this._GLmol.create()};h._createCanvas2d=function(){var e=a.$(this,"appletdiv");try{e[0].removeChild(this._canvas),this._canvas.frontLayer&&e[0].removeChild(this._canvas.frontLayer),this._canvas.rearLayer&&e[0].removeChild(this._canvas.rearLayer),this._canvas.imageLayer&&e[0].removeChild(this._canvas.imageLayer),a._jsUnsetMouse(this._mouseInterface)}catch(f){}var d=Math.round(e.width()),j=Math.round(e.height()),c=document.createElement("canvas");
c.applet=this;this._canvas=c;c.style.width="100%";c.style.height="100%";c.width=d;c.height=j;c.id=this._id+"_canvas2d";e.append(c);a._$(c.id).css({"z-index":a._getZ(this,"main")});if(this._isLayered){var b=document.createElement("div");c.imageLayer=b;b.id=this._id+"_imagelayer";e.append(b);a._$(b.id).css({zIndex:a._getZ(this,"image"),position:"absolute",left:"0px",top:"0px",width:"0px",height:"0px",overflow:"hidden"});this._mouseInterface=this._getLayer("front",e,d,j,!1)}else this._mouseInterface=
c;a._jsSetMouse(this._mouseInterface)};h._getLayer=function(e,f,d,j,c){var b=document.createElement("canvas");this._canvas[e+"Layer"]=b;b.style.width="100%";b.style.height="100%";b.id=this._id+"_"+e+"Layer";b.width=d;b.height=j;f.append(b);b.applet=this;a._$(b.id).css({background:c?"rgb(0,0,0,1)":"rgb(0,0,0,0.001)","z-index":a._getZ(this,e),position:"absolute",left:"0px",top:"0px",overflow:"hidden"});return b};h._setupJS=function(){window["j2s.lib"]={base:this._j2sPath+"/",alias:".",console:this._console,
monitorZIndex:a._getZ(this,"monitorZIndex")};0==a.__execStack.length&&a.__addExec([this,a.__loadClazz,null,"loadClazz"]);this._isJSV?(a.__addCoreFile("jsv",this._j2sPath,this.__Info.preloadCore),a._debugCode&&(a.__addExec([this,a.__loadClass,"JSV.appletjs.JSVApplet","load JSV"]),this._isPro&&a.__addExec([this,a.__loadClass,"JSV.appletjs.JSVAppletPro","load JSV(signed)"]))):this._isAstex?(a.__addCoreFile("astex",this._j2sPath,this.__Info.preloadCore),a._debugCode&&a.__addExec([this,a.__loadClass,"astex.MoleculeViewerAppletJS",
"load Astex"])):(a.__addCoreFile("jmol",this._j2sPath,this.__Info.preloadCore),this._is2D||a.__addExec([this,a.__loadClass,"J.export.JSExporter","load JSExporter"]),a._debugCode&&a.__addExec([this,a.__loadClass,"J.appletjs.Jmol","load Jmol"]));a.__addExec([this,this.__startAppletJS,null,"start applet"]);this._isSigned=!0;this._ready=!1;this._applet=null;this._canScript=function(){return!0};this._savedOrientations=[];a.__execTimer&&clearTimeout(a.__execTimer);a.__execTimer=setTimeout(a.__nextExecution,
a.__execDelayMS)};h.__startAppletJS=function(e){var f=new java.util.Hashtable;a._setAppletParams(e._availableParams,f,e.__Info,!0);f.put("appletReadyCallback","Jmol._readyCallback");f.put("applet",!0);f.put("name",e._id);f.put("syncId",a._syncId);e._color&&f.put("bgcolor",e._color);e._is2D?e._startupScript&&f.put("script",e._startupScript):f.put("script","set multipleBondSpacing 0.35;");a._syncedApplets.length&&f.put("synccallback","Jmol._mySyncCallback");f.put("signedApplet","true");f.put("platform",
e._platform);e._is2D&&f.put("display",e._id+"_canvas2d");f.put("documentBase",document.location.href);var d=e._j2sPath+"/";if(0>d.indexOf("://")){var j=document.location.href.split("#")[0].split("?")[0].split("/");0==d.indexOf("/")?j=[j[0],d.substring(1)]:j[j.length-1]=d;d=j.join("/")}f.put("codePath",d);a._registerApplet(e._id,e);e._applet=e._isAstex?new astex.MoleculeViewerAppletJS(f):!e._isJSV?new J.appletjs.Jmol(f):e._isPro?new JSV.appletjs.JSVAppletPro(f):new JSV.appletjs.JSVApplet(f);e._is2D||
(e._GLmol.applet=e);e._jsSetScreenDimensions();a.__nextExecution()};h._jsSetScreenDimensions=function(){if(this._applet){var e=a._getElement(this,this._is2D?"canvas2d":"canvas");this._applet.setScreenDimension(e.width,e.height)}};h._show=function(e){a.$setVisible(a.$(this,"appletdiv"),e);e&&a._repaint(this,!0)};h._canScript=function(){return!0};h._delay=function(a,f,d){this._delayID=setTimeout(function(){a.resumeEval(f,!1)},d)};h._createDomNode=function(a,f){a=this._id+"_"+a;var d=document.getElementById(a);
d&&document.body.removeChild(d);if(f){0==f.indexOf("<?")&&(f=f.substring(f.indexOf("<",1)));if(0<=f.indexOf("/>")){for(var d=f.split("/>"),j=d.length-1;0<=--j;)for(var c=d[j],b=c.lastIndexOf("<")+1,g=b,m=c.length,h="";++g<m;)if(0<=" \t\n\r".indexOf(c.charAt(g))){h=c.substring(b,g);d[j]=c+"></"+h+">";break}f=d.join("")}d=document.createElement("_xml");d.id=a;d.innerHTML=f;d.style.display="none";document.body.appendChild(d);return d}};h.equals=function(a){return this==a};h.clone=function(){return this};
h.hashCode=function(){return parseInt(this._uniqueId)};h._processGesture=function(a){return this._applet.mouse.processTwoPointGesture(a)};h._processEvent=function(a,f){this._applet.processMouseEvent(a,f[0],f[1],f[2],System.currentTimeMillis())};h._resize=function(){var e="__resizeTimeout_"+this._id;a[e]&&clearTimeout(a[e]);var f=this;a[e]=setTimeout(function(){a._repaint(f,!0);a[e]=null},100)};return h};a._repaint=function(h,e){if(h&&h._applet){var f=a.$(h,"appletdiv"),d=Math.round(f.width()),f=Math.round(f.height());
if(h._is2D&&(h._canvas.width!=d||h._canvas.height!=f))h._newCanvas(!0),h._applet.setDisplay(h._canvas);h._applet.setScreenDimension(d,f);e?setTimeout(function(){h._applet&&h._applet.update()}):h._applet.update()}};a._getHiddenCanvas=function(a,e,f,d,j){e=a._id+"_"+e;(a=document.getElementById(e))&&j&&(a=null);a||(a=document.createElement("canvas"));a.width=a.style.width=f;a.height=a.style.height=d;a.id!=e&&(a.id=e);return a};a._loadImage=function(h,e,f,d,j){var c=e[1];if(null==j)return j=new Image,
j.onload=function(){a._loadImage(h,e,null,d,j)},null!=f&&(f=J.io.Base64.getBase64(f).toString(),f=c.substring(url.lastIndexOf("/")+1),0<=f.indexOf(".png")||f.indexOf(".jpg")),j.src=c,!0;f=j.width;var b=j.height,g="echo_"+e[0],m=a._getHiddenCanvas(h.vwr.html5Applet,g,f,b,!0);m.imageWidth=f;m.imageHeight=b;m.id=g;m.image=j;a._setCanvasImage(m,f,b);d(m,c)};a._setCanvasImage=function(a,e,f){a.buf32=null;a.width=e;a.height=f;a.getContext("2d").drawImage(a.image,0,0,e,f)}})(Jmol);
(function(a,h){a._Applet=function(d,e,c){window[d]=this;this._jmolType="Jmol._Applet"+(e.isSigned?" (signed)":"");this._viewType="Jmol";this._isJava=!0;this._syncKeyword="Select:";this._availableParams=";progressbar;progresscolor;boxbgcolor;boxfgcolor;allowjavascript;boxmessage;\t\t\t\t\t\t\t\t\t;messagecallback;pickcallback;animframecallback;appletreadycallback;atommovedcallback;\t\t\t\t\t\t\t\t\t;echocallback;evalcallback;hovercallback;language;loadstructcallback;measurecallback;\t\t\t\t\t\t\t\t\t;minimizationcallback;resizecallback;scriptcallback;statusform;statustext;statustextarea;\t\t\t\t\t\t\t\t\t;synccallback;usecommandthread;syncid;appletid;startupscript;menufile;";
if(c)return this;this._isSigned=e.isSigned;this._readyFunction=e.readyFunction;this._ready=!1;this._isJava=!0;this._isInfoVisible=!1;this._applet=null;this._memoryLimit=e.memoryLimit||512;this._canScript=function(){return!0};this._savedOrientations=[];this._initialize=function(b,c){var d=!1;a._jarFile&&(c=a._jarFile);if(this._jarFile){var f=this._jarFile;0<=f.indexOf("/")?(alert("This web page URL is requesting that the applet used be "+f+". This is a possible security risk, particularly if the applet is signed, because signed applets can read and write files on your local machine or network."),
"yes"==prompt("Do you want to use applet "+f+"? ","yes or no")?(b=f.substring(0,f.lastIndexOf("/")),c=f.substring(f.lastIndexOf("/")+1)):d=!0):c=f;this_isSigned=e.isSigned=0<=c.indexOf("Signed")}this._jarPath=e.jarPath=b||".";this._jarFile=e.jarFile="string"==typeof c?c:(c?"JmolAppletSigned":"JmolApplet")+"0.jar";d&&alert("The web page URL was ignored. Continuing using "+this._jarFile+' in directory "'+this._jarPath+'"');void 0==a.controls||a.controls._onloadResetForms()};this._create(d,e);return this};
var e=a._Applet,f=a._Applet.prototype;e._get=function(d,f,c){c||(c=!1);f||(f={});a._addDefaultInfo(f,{color:"#FFFFFF",width:300,height:300,addSelectionOptions:!1,serverURL:"http://your.server.here/jsmol.php",defaultModel:"",script:null,src:null,readyFunction:null,use:"HTML5",jarPath:"java",jarFile:"JmolApplet0.jar",isSigned:!1,j2sPath:"j2s",coverImage:null,coverTitle:"",coverCommand:"",deferApplet:!1,deferUncover:!1,disableJ2SLoadMonitor:!1,disableInitialConsole:!1,debug:!1});a._debugAlert=f.debug;
a.featureDetection.allowHTML5||(f.use="JAVA");f.serverURL&&(a._serverUrl=f.serverURL);for(var b=!1,g=null,m=f.use.toUpperCase().split("#")[0].split(" "),h=0;h<m.length;h++){switch(m[h]){case "JAVA":b=!0;a.featureDetection.supportsJava()&&(g=new e(d,f,c));break;case "WEBGL":g=e._getCanvas(d,f,c,!0);break;case "HTML5":g=e._getCanvas(d,f,c,!1);break;case "IMAGE":g=new a._Image(d,f,c)}if(null!=g)break}null==g&&(c||!b?g={_jmolType:"none"}:b&&(g=new e(d,f)));return c?g:a._registerApplet(d,g)};e._getCanvas=
function(d,f,c,b){return b&&a.featureDetection.supportsWebGL()?(a._Canvas3D.prototype=a.GLmol.extendApplet(a._jsSetPrototype(new e(d,f,!0))),new a._Canvas3D(d,f,"Jmol",c)):!b?(a._Canvas2D.prototype=a._jsSetPrototype(new e(d,f,!0)),new a._Canvas2D(d,f,"Jmol",c)):null};e._noJavaMsg="Either you do not have Java applets enabled in your web<br />browser or your browser is blocking this applet.<br />\t\t\tCheck the warning message from your browser and/or enable Java applets in<br />\t\t\tyour web browser preferences, or install the Java Runtime Environment from <a href='http://www.java.com'>www.java.com</a>";
e._setCommonMethods=function(a){a._showInfo=f._showInfo;a._search=f._search;a._getName=f._getName;a._readyCallback=f._readyCallback};e._createApplet=function(d,f,c){d._initialize(f.jarPath,f.jarFile);var b=d._jarFile;a._isFile&&(b=b.replace(/0\.jar/,".jar"));var g=0<=d._containerWidth.indexOf("px")?d._containerWidth:"100%",m=0<=d._containerHeight.indexOf("px")?d._containerHeight:"100%",g=' style="width:'+g+";height:"+m+'" ',m="name='"+d._id+"_object' id='"+d._id+"_object' \n"+g+"\n";c.codebase=d._jarPath;
c.codePath=c.codebase+"/";if(0>c.codePath.indexOf("://")){var p=h.location.href.split("#")[0].split("?")[0].split("/");p[p.length-1]=c.codePath;c.codePath=p.join("/")}c.archive=b;c.mayscript="true";c.java_arguments="-Xmx"+Math.round(f.memoryLimit||d._memoryLimit)+"m";c.permissions=d._isSigned?"all-permissions":"sandbox";c.documentLocation=h.location.href;c.documentBase=h.location.href.split("#")[0].split("?")[0];c.jarPath=f.jarPath;a._syncedApplets.length&&(c.synccallback="Jmol._mySyncCallback");
d._startupScript&&(c.script=d._startupScript);var p="\n",q;for(q in c)c[q]&&(p+="  <param name='"+q+"' value='"+c[q]+"' />\n");p=a.featureDetection.useIEObject||a.featureDetection.useHtml4Object?"<object "+m+(a.featureDetection.useIEObject?" classid='clsid:8AD9C840-044E-11D1-B3E9-00805F499D93' codebase='http://java.sun.com/update/1.6.0/jinstall-6u22-windows-i586.cab'>":" type='application/x-java-applet'>")+p+"<p style='background-color:yellow;"+g.split('"')[1]+";text-align:center;vertical-align:middle;'>\n"+
e._noJavaMsg+"</p></object>\n":"<applet "+m+" code='"+c.code+"' codebase='"+d._jarPath+"' archive='"+b+"' mayscript='true'>\n"+p+"<table bgcolor='yellow'><tr><td align='center' valign='middle' "+g+">\n"+e._noJavaMsg+"</td></tr></table></applet>\n";p=a._getWrapper(d,!0)+p+a._getWrapper(d,!1)+(f.addSelectionOptions?a._getGrabberOptions(d):"");a._debugAlert&&alert(p);d._code=a._documentWrite(p)};f._create=function(d,f){a._setObject(this,d,f);var c={syncId:a._syncId,progressbar:"true",progresscolor:"blue",
boxbgcolor:this._color||"black",boxfgcolor:"white",boxmessage:"Downloading JmolApplet ...",script:this._color?'background "'+this._color+'"':"",code:"JmolApplet.class"};a._setAppletParams(this._availableParams,c,f);var b;f.inlineModel?(b=f.inlineModel,b=b.replace(/\r|\n|\r\n/g,0<=b.indexOf("|")?"\\/n":"|").replace(/'/g,"&#39;"),a._debugAlert&&alert("inline model:\n"+b)):b="";c.loadInline=b;c.appletReadyCallback="Jmol._readyCallback";a._syncedApplets.length&&(c.synccallback="Jmol._mySyncCallback");
c.java_arguments="-Xmx"+Math.round(f.memoryLimit||this._memoryLimit)+"m";this._initialize(f.jarPath,f.jarFile);e._createApplet(this,f,c)};f._readyCallback=function(d,e,c,b){c&&(a._setDestroy(this),this._ready=!0,d=this._readyScript,this._applet=b,this._defaultModel?a._search(this,this._defaultModel,d?";"+d:""):d?this._script(d):this._src&&this._script('load "'+this._src+'"'),this._showInfo(!0),this._showInfo(!1),a.Cache.setDragDrop(this),this._readyFunction&&this._readyFunction(this),a._setReady(this),
(b=this._2dapplet)&&(b._isEmbedded&&b._ready&&b.__Info.visible)&&this._show2d(!0))};f._showInfo=function(d){d&&this._2dapplet&&this._2dapplet._show(!1);a.$html(a.$(this,"infoheaderspan"),this._infoHeader);this._info&&a.$html(a.$(this,"infodiv"),this._info);if(!this._isInfoVisible!=!d){this._isInfoVisible=d;if(this._isJava){var e=d?2:"100%";a.$setSize(a.$(this,"appletdiv"),e,e)}a.$setVisible(a.$(this,"infotablediv"),d);a.$setVisible(a.$(this,"infoheaderdiv"),d);this._show(!d)}};f._show2d=function(a){this._2dapplet._show2d(a);
this._2dapplet._isEmbedded&&(this._showInfo(!1),this._show(!a))};f._getAtomCorrelation=function(a){this._loadMolData(a,"atommap = compare({1.1} {2.1} 'MAP' 'H'); zap 2.1",!0);a=jmol._evaluate("atommap");for(var e=jmol._evaluate("{*}.count"),c=[],b=[],g=0;g<a.length;g++){var f=a[g];c[f[0]+1]=f[1]-e+1;b[f[1]-e+1]=f[0]+1}return{fromJmol:c,toJmol:b}};f._show=function(d){var e=!d?2:"100%";a.$setSize(a.$(this,"object"),e,e);this._isJava||a.$setVisible(a.$(this,"appletdiv"),d)};f._clearConsole=function(){this._console==
this._id+"_infodiv"&&(this.info="");self.Clazz&&(a._setConsoleDiv(this._console),Clazz.Console.clear())};f._addScript=function(a){this._readyScript||(this.readyScript="");this._readyScript&&(this._readyScript+=";");this._readyScript+=a;return!0};f._script=function(d){if(!this._ready)return this._addScript(d);a._setConsoleDiv(this._console);this._applet.script(d)};f._syncScript=function(a){this._applet.syncScript(a)};f._scriptCheck=function(a){return this._ready&&this._applet.scriptCheck(a)};f._scriptWait=
function(a,e){var c=this._scriptWaitAsArray(a),b="";if(!e)for(var g=c.length;0<=--g;)for(var f=0,h=c[g].length;f<h;f++)b+=c[g][f]+"\n";return b};f._scriptEcho=function(a){a=this._scriptWaitAsArray(a);for(var e="",c=a.length;0<=--c;)for(var b=a[c].length;0<=--b;)"scriptEcho"==a[c][b][1]&&(e+=a[c][b][3]+"\n");return e.replace(/ \| /g,"\n")};f._scriptMessage=function(a){a=this._scriptWaitAsArray(a);for(var e="",c=a.length;0<=--c;)for(var b=a[c].length;0<=--b;)"scriptStatus"==a[c][b][1]&&(e+=a[c][b][3]+
"\n");return e.replace(/ \| /g,"\n")};f._scriptWaitOutput=function(a){var e="";try{a&&(e+=this._applet.scriptWaitOutput(a))}catch(c){}return e};f._scriptWaitAsArray=function(d){var e="";try{if(this._getStatus("scriptEcho,scriptMessage,scriptStatus,scriptError"),d&&(e+=this._applet.scriptWait(d),e=a._evalJSON(e,"jmolStatus"),"object"==typeof e))return e}catch(c){}return[[e]]};f._getStatus=function(d){return a._sortMessages(this._getPropertyAsArray("jmolStatus",d))};f._getPropertyAsArray=function(d,
e){return a._evalJSON(this._getPropertyAsJSON(d,e),d)};f._getPropertyAsString=function(a,e){void 0==e&&(e="");return this._applet.getPropertyAsString(a,e)+""};f._getPropertyAsJSON=function(a,e){void 0==e&&(e="");try{return this._applet.getPropertyAsJSON(a,e)+""}catch(c){return""}};f._getPropertyAsJavaObject=function(a,e){void 0==e&&(e="");return this._applet.getProperty(a,e)};f._evaluate=function(a){null!=a||(a="");return this._getPropertyAsArray("variableInfo",a)};f._evaluateDEPRECATED=function(a){a=
""+this._getPropertyAsJavaObject("evaluate",a);var e=a.replace(/\-*\d+/,"");if(""==e&&!isNaN(parseInt(a)))return parseInt(a);e=a.replace(/\-*\d*\.\d*/,"");return""==e&&!isNaN(parseFloat(a))?parseFloat(a):a};f._saveOrientation=function(a){return this._savedOrientations[a]=this._getPropertyAsArray("orientationInfo","info").moveTo};f._restoreOrientation=function(a){a=this._savedOrientations[a];return!a||""==a?a.replace(/1\.0/,"0"):this._scriptWait(a)};f._restoreOrientationDelayed=function(a,e){1>arguments.length&&
(e=1);var c=this._savedOrientations[a];return!c||""==c?c.replace(/1\.0/,e):this._scriptWait(c)};f._resizeApplet=function(d){function e(b,c){var d=""+b;return 0==d.length?c?"":a._allowedJmolSize[2]:d.indexOf("%")==d.length-1?d:1>=(b=parseFloat(b))&&0<b?100*b+"%":(isNaN(b=Math.floor(b))?a._allowedJmolSize[2]:b<a._allowedJmolSize[0]?a._allowedJmolSize[0]:b>a._allowedJmolSize[1]?a._allowedJmolSize[1]:b)+(c?c:"")}var c;"object"==typeof d&&null!=d?(c=d[0]||d.width,d=d[1]||d.height):c=d;c=[e(c,"px"),e(d,
"px")];d=a._getElement(this,"appletinfotablediv");d.style.width=c[0];d.style.height=c[1];this._containerWidth=c[0];this._containerHeight=c[1];this._is2D&&a._repaint(this,!0)};f._search=function(d,e){a._search(this,d,e)};f._searchDatabase=function(d,e,c){if(this._2dapplet&&this._2dapplet._isEmbedded&&a.$(this,"2dappletdiv:visible")[0])return this._2dapplet._searchDatabase(d,e,c);this._showInfo(!1);0<=d.indexOf("?")?a._getInfoFromDatabase(this,e,d.split("?")[0]):(c||(c=a._getScriptForDatabase(e)),d=
e+d,this._currentView=null,this._searchQuery=d,this._loadFile(d,c,d))};f._loadFile=function(d,e,c){this._showInfo(!1);e||(e="");this._thisJmolModel=""+Math.random();this._fileName=d;if(!this._scriptLoad(d,e)){var b=this;a._loadFileData(this,d,function(a){b.__loadModel(a,e,c)},function(){b.__loadModel(null)})}};f._scriptLoad=function(a,e){e||(e="");var c=this._isJava||!this._noscript;c&&this._script("zap;set echo middle center;echo Retrieving data...");if(!this._isSigned||null!=this._viewSet)return!1;
c?this._script('load async "'+a+'";'+e):this._applet.openFile(a);this._checkDeferred("");return!0};f.__loadModel=function(d,e,c){null!=d&&(null!=this._viewSet&&(e||(e=""),e+=";if ({*}.molecule.max > 1 || {*}.modelindex.max > 0){ delete molecule > 1 or modelindex > 0;x = getProperty('extractModel',{*});load inline @x};"),!e&&this._noscript?this._applet.loadInlineString(d,"",!1):this._loadMolData(d,e,!1),null!=this._viewSet&&a.View.updateView(this,{chemID:c,data:d}))};f._loadMolData=function(a,e,c){e||
(e="");c=c?"append":"model";this._applet.scriptWait('load DATA "'+c+'"'+a+'\nEND "'+c+'" ;'+e)};f._loadModelFromView=function(d){this._currentView=d;var e=d.Jmol;null!=e.data?this.__loadModel(e.data,null,d.info.chemID):null!=d.info.chemID?a._searchMol(this,d.info.chemID,null,!1):(e=d.JME)&&e.applet._show2d(!1,this)};f._updateView=function(){null!=this._viewSet&&this._applet&&(chemID=""+this._getPropertyAsJavaObject("variableInfo","script('show chemical inchiKey')"),chemID=36>chemID.length()?null:
chemID.substring(36).split("\n")[0],a.View.updateView(this,{chemID:chemID,data:""+this._getPropertyAsJavaObject("evaluate","extractModel","{visible}")}))};f._atomPickedCallback=function(d,e){if(!(0>e)){var c=[e+1];a.View.updateAtomPick(this,c);this._updateAtomPick(c)}};f._updateAtomPick=function(a){this._script(0==a.length?"select none":"select on visible and (@"+a.join(",@")+")")};f._isDeferred=function(){return!this._canvas&&this._cover&&this._isCovered&&this._deferApplet};f._checkDeferred=function(a){return this._isDeferred()?
(this._coverScript=a,this._cover(!1),!0):!1};f._getSmiles=function(){return this._evaluate("{visible}.find('SMILES')")};f._getMol=function(){return this._evaluate("getProperty('ExtractModel',{visible})")};f._getMol2D=function(){return jmol._evaluate("script('select visible;show chemical sdf')")};a.jmolSmiles=function(a){return a._getSmiles()}})(Jmol,document);
(function(a){var h=a.controls={_hasResetForms:!1,_scripts:[""],_checkboxMasters:{},_checkboxItems:{},_actions:{},_buttonCount:0,_checkboxCount:0,_radioGroupCount:0,_radioCount:0,_linkCount:0,_cmdCount:0,_menuCount:0,_previousOnloadHandler:null,_control:null,_element:null,_appletCssClass:null,_appletCssText:"",_buttonCssClass:null,_buttonCssText:"",_checkboxCssClass:null,_checkboxCssText:"",_radioCssClass:null,_radioCssText:"",_linkCssClass:null,_linkCssText:"",_menuCssClass:null,_menuCssText:""};
h._addScript=function(a,f){var d=h._scripts.length;h._scripts[d]=[a,f];return d};h._getIdForControl=function(a,f){return"string"==typeof a?a:!f||!a._canScript||a._canScript(f)?a._id:null};h._radio=function(a,f,d,j,c,b,g,m){var p=h._getIdForControl(a,f);if(null==p)return null;++h._radioCount;void 0!=b&&null!=b||(b="jmolRadioGroup"+(h._radioGroupCount-1));if(!f)return"";void 0!=g&&null!=g||(g="jmolRadio"+(h._radioCount-1));void 0!=d&&null!=d||(d=f.substring(0,32));c||(c="");a="</span>";h._actions[g]=
h._addScript(p,f);f='<span id="span_'+g+'"'+(m?' title="'+m+'"':"")+"><input name='"+b+"' id='"+g+"' type='radio' onclick='Jmol.controls._click(this);return true;' onmouseover='Jmol.controls._mouseOver(this);return true;' onmouseout='Jmol.controls._mouseOut()' "+(j?"checked='true' ":"")+h._radioCssText+" />";0<=d.toLowerCase().indexOf("<td>")&&(f+=a,a="");return f+('<label for="'+g+'">'+d+"</label>"+a+c)};h._scriptExecute=function(e,f){var d=a._applets[f[0]],h=f[1];if("object"==typeof h)h[0](e,h,
d);else"function"==typeof h?h(d):a.script(d,h)};h.__checkScript=function(a,f){var d=0<=f.value.indexOf("JSCONSOLE ")||""===a._scriptCheck(f.value);f.style.color=d?"black":"red";return d};h.__getCmd=function(a,f){if(f._cmds&&f._cmds.length){var d=f._cmds[f._cmdpt=(f._cmdpt+f._cmds.length+a)%f._cmds.length];setTimeout(function(){f.value=d},10);f._cmdadd=1;f._cmddir=a}};h._commandKeyPress=function(e,f,d){e=13==e?13:window.event?window.event.keyCode:e?e.keyCode||e.which:0;var j=document.getElementById(f),
c=a._applets[d];switch(e){case 13:return f=j.value,h._scriptExecute(j,[d,f]),j._cmds||(j._cmds=[],j._cmddir=0,j._cmdpt=-1,j._cmdadd=0),f&&0==j._cmdadd?(++j._cmdpt,j._cmds.splice(j._cmdpt,0,f),j._cmdadd=0,j._cmddir=0):j._cmdadd=0,j.value="",!1;case 27:return setTimeout(function(){j.value=""},20),!1;case 38:h.__getCmd(-1,j);break;case 40:h.__getCmd(1,j);break;default:j._cmdadd=0}setTimeout(function(){h.__checkScript(c,j)},20);return!0};h._click=function(a,f){h._element=a;1==arguments.length&&(f=h._actions[a.id]);
h._scriptExecute(a,h._scripts[f])};h._menuSelected=function(a){var f=a.value;if(void 0!=f)h._scriptExecute(a,h._scripts[f]);else{f=a.length;if("number"==typeof f)for(var d=0;d<f;++d)if(a[d].selected){h._click(a[d],a[d].value);return}alert("?Que? menu selected bug #8734")}};h._cbNotifyMaster=function(a){var f=!0,d=!0,j;for(j in a.chkGroup)a.chkGroup[j].checked?d=!1:f=!1;f&&(a.chkMaster.checked=!0);d&&(a.chkMaster.checked=!1);(f||d)&&h._checkboxItems[a.chkMaster.id]&&h._cbNotifyMaster(h._checkboxItems[a.chkMaster.id])};
h._cbNotifyGroup=function(a,f){for(var d in a.chkGroup){var j=a.chkGroup[d];j.checked!=f&&(j.checked=f,h._cbClick(j));h._checkboxMasters[j.id]&&h._cbNotifyGroup(h._checkboxMasters[j.id],f)}};h._cbSetCheckboxGroup=function(a,f,d){var j=a;"number"==typeof j&&(j="jmolCheckbox"+j);(a=document.getElementById(j))||alert("jmolSetCheckboxGroup: master checkbox not found: "+j);var c=h._checkboxMasters[j]={};c.chkMaster=a;c.chkGroup={};"string"==typeof f?(f=d,j=1):j=0;for(a=j;a<f.length;a++)j=f[a],"number"==
typeof j&&(j="jmolCheckbox"+j),(checkboxItem=document.getElementById(j))||alert("jmolSetCheckboxGroup: group checkbox not found: "+j),c.chkGroup[j]=checkboxItem,h._checkboxItems[j]=c};h._cbClick=function(a){h._control=a;var f=h._actions[a.id][0],d=h._actions[a.id][1];h._click(a,a.checked?f:d);h._checkboxMasters[a.id]&&h._cbNotifyGroup(h._checkboxMasters[a.id],a.checked);h._checkboxItems[a.id]&&h._cbNotifyMaster(h._checkboxItems[a.id])};h._cbOver=function(a){var f=h._actions[a.id][0],d=h._actions[a.id][1];
window.status=h._scripts[a.checked?d:f]};h._mouseOver=function(a,f){1==arguments.length&&(f=h._actions[a.id]);window.status=h._scripts[f]};h._mouseOut=function(){window.status=" ";return!0};h._onloadResetForms=function(){h._hasResetForms||(h._hasResetForms=!0,h._previousOnloadHandler=window.onload,window.onload=function(){if(0<h._buttonCount+h._checkboxCount+h._menuCount+h._radioCount+h._radioGroupCount)for(var a=document.forms,f=a.length;0<=--f;)a[f].reset();h._previousOnloadHandler&&h._previousOnloadHandler()})};
h._getButton=function(e,f,d,j,c){e=h._getIdForControl(e,f);if(null==e)return"";void 0!=j&&null!=j||(j="jmolButton"+h._buttonCount);void 0!=d&&null!=d||(d=f.substring(0,32));++h._buttonCount;h._actions[j]=h._addScript(e,f);f='<span id="span_'+j+'"'+(c?' title="'+c+'"':"")+"><input type='button' name='"+j+"' id='"+j+"' value='"+d+"' onclick='Jmol.controls._click(this)' onmouseover='Jmol.controls._mouseOver(this);return true' onmouseout='Jmol.controls._mouseOut()' "+h._buttonCssText+" /></span>";a._debugAlert&&
alert(f);return a._documentWrite(f)};h._getCheckbox=function(e,f,d,j,c,b,g){var m=h._getIdForControl(e,f);null!=m&&(m=h._getIdForControl(e,d));if(null==m)return"";void 0!=b&&null!=b||(b="jmolCheckbox"+h._checkboxCount);++h._checkboxCount;if(void 0==f||null==f||void 0==d||null==d)alert("jmolCheckbox requires two scripts");else if(void 0==j||null==j)alert("jmolCheckbox requires a label");else return h._actions[b]=[h._addScript(m,f),h._addScript(m,d)],e="</span>",c='<span id="span_'+b+'"'+(g?' title="'+
g+'"':"")+"><input type='checkbox' name='"+b+"' id='"+b+"' onclick='Jmol.controls._cbClick(this)' onmouseover='Jmol.controls._cbOver(this);return true' onmouseout='Jmol.controls._mouseOut()' "+(c?"checked='true' ":"")+h._checkboxCssText+" />",0<=j.toLowerCase().indexOf("<td>")&&(c+=e,e=""),c+='<label for="'+b+'">'+j+"</label>"+e,a._debugAlert&&alert(c),a._documentWrite(c)};h._getCommandInput=function(e,f,d,j,c,b){e=h._getIdForControl(e,"x");if(null==e)return"";void 0!=j&&null!=j||(j="jmolCmd"+h._cmdCount);
void 0!=f&&null!=f||(f="Execute");void 0!=d&&!isNaN(d)||(d=60);void 0!=b||(b="help");++h._cmdCount;f='<span id="span_'+j+'"'+(c?' title="'+c+'"':"")+"><input name='"+j+"' id='"+j+"' size='"+d+"' onkeydown='return Jmol.controls._commandKeyPress(event,\""+j+'","'+e+"\")' value='"+b+"'/><input  type='button' name='"+j+"Btn' id='"+j+"Btn' value = '"+f+"' onclick='Jmol.controls._commandKeyPress(13,\""+j+'","'+e+"\")' /></span>";a._debugAlert&&alert(f);return a._documentWrite(f)};h._getLink=function(e,
f,d,j,c){e=h._getIdForControl(e,f);if(null==e)return"";void 0!=j&&null!=j||(j="jmolLink"+h._linkCount);void 0!=d&&null!=d||(d=f.substring(0,32));++h._linkCount;f=h._addScript(e,f);d='<span id="span_'+j+'"'+(c?' title="'+c+'"':"")+"><a name='"+j+"' id='"+j+"' href='javascript:Jmol.controls._click(null,"+f+");' onmouseover='Jmol.controls._mouseOver(null,"+f+");return true;' onmouseout='Jmol.controls._mouseOut()' "+h._linkCssText+">"+d+"</a></span>";a._debugAlert&&alert(d);return a._documentWrite(d)};
h._getMenu=function(e,f,d,j,c){var b=h._getIdForControl(e,null);void 0!=j&&null!=j||(j="jmolMenu"+h._menuCount);++h._menuCount;b=typeof f;if(null!=b&&"object"==b&&f.length){var g=f.length;"number"!=typeof d||1==d?d=null:0>d&&(d=g);d='<span id="span_'+j+'"'+(c?' title="'+c+'"':"")+"><select name='"+j+"' id='"+j+"' onChange='Jmol.controls._menuSelected(this)'"+(d?" size='"+d+"' ":"")+h._menuCssText+">";for(j=0;j<g;++j){var m=f[j],b=typeof m,p=null,q=c=null;"object"==b&&null!=m?(p=m[0],c=m[1],q=m[2]):
p=c=m;b=h._getIdForControl(e,p);if(null==b)return"";null==c&&(c=p);"#optgroup"==p?d+="<optgroup label='"+c+"'>":"#optgroupEnd"==p?d+="</optgroup>":(b=h._addScript(b,p),d+="<option value='"+b+(q?"' selected='true'>":"'>")+c+"</option>")}d+="</select></span>";a._debugAlert&&alert(d);return a._documentWrite(d)}};h._getRadio=function(e,f,d,j,c,b,g,m){0==h._radioGroupCount&&++h._radioGroupCount;b||(b="jmolRadioGroup"+(h._radioGroupCount-1));e=h._radio(e,f,d,j,c,b,g?g:b+"_"+h._radioCount,m?m:0);if(null==
e)return"";a._debugAlert&&alert(e);return a._documentWrite(e)};h._getRadioGroup=function(e,f,d,j,c,b){var g=typeof f;if("object"!=g||null==g||!f.length)alert("invalid arrayOfRadioButtons");else{void 0!=d&&null!=d||(d="&#xa0; ");var m=f.length;++h._radioGroupCount;j||(j="jmolRadioGroup"+(h._radioGroupCount-1));for(var p="<span id='"+(c?c:j)+"'>",q=0;q<m;++q){q==m-1&&(d="");var k=f[q],g=typeof k,l=null,p="object"==g?p+(l=h._radio(e,k[0],k[1],k[2],d,j,3<k.length?k[3]:(c?c:j)+"_"+q,4<k.length?k[4]:0,
b)):p+(l=h._radio(e,k,null,null,d,j,(c?c:j)+"_"+q,b));if(null==l)return""}p+="</span>";a._debugAlert&&alert(p);return a._documentWrite(p)}}})(Jmol);
(function(a){var h=function(a){a="&"+a+"=";return decodeURI(("&"+document.location.search.substring(1)+a).split(a)[1].split("&")[0])};a._j2sPath=h("_J2S");a._jarFile=h("_JAR");a._use=h("_USE");a.getVersion=function(){return a._jmolInfo.version};a.getApplet=function(e,f,d){return a._Applet._get(e,f,d)};a.getJMEApplet=function(e,f,d,h){return a._JMEApplet._get(e,f,d,h)};a.getJSVApplet=function(e,f,d){return a._JSVApplet._get(e,f,d)};a.loadFile=function(a,f,d){a._loadFile(f,d)};a.script=function(a,f){a._checkDeferred(f)||
a._script(f)};a.scriptCheck=function(a,f){return a&&a._scriptCheck&&a._ready&&a._scriptCheck(f)};a.scriptWait=function(a,f){return a._scriptWait(f)};a.scriptEcho=function(a,f){return a._scriptEcho(f)};a.scriptMessage=function(a,f){return a._scriptMessage(f)};a.scriptWaitOutput=function(a,f){return a._scriptWait(f)};a.scriptWaitAsArray=function(a,f){return a._scriptWaitAsArray(f)};a.search=function(a,f,d){a._search(f,d)};a.evaluateVar=function(a,f){return a._evaluate(f)};a.evaluate=function(a,f){return a._evaluateDEPRECATED(f)};
a.getAppletHtml=function(e,f){if(f){var d=a._document;a._document=null;e=a.getApplet(e,f);a._document=d}return e._code};a.getPropertyAsArray=function(a,f,d){return a._getPropertyAsArray(f,d)};a.getPropertyAsJavaObject=function(a,f,d){return a._getPropertyAsJavaObject(f,d)};a.getPropertyAsJSON=function(a,f,d){return a._getPropertyAsJSON(f,d)};a.getPropertyAsString=function(a,f,d){return a._getPropertyAsString(f,d)};a.getStatus=function(a,f){return a._getStatus(f)};a.resizeApplet=function(a,f){return a._resizeApplet(f)};
a.restoreOrientation=function(a,f){return a._restoreOrientation(f)};a.restoreOrientationDelayed=function(a,f,d){return a._restoreOrientationDelayed(f,d)};a.saveOrientation=function(a,f){return a._saveOrientation(f)};a.say=function(a){alert(a)};a.clearConsole=function(a){a._clearConsole()};a.getInfo=function(a){return a._info};a.setInfo=function(a,f,d){a._info=f;2<arguments.length&&a._showInfo(d)};a.showInfo=function(a,f){a._showInfo(f)};a.show2d=function(a,f){a._show2d(f)};a.jmolBr=function(){return a._documentWrite("<br />")};
a.jmolButton=function(e,f,d,h,c){return a.controls._getButton(e,f,d,h,c)};a.jmolCheckbox=function(e,f,d,h,c,b,g){return a.controls._getCheckbox(e,f,d,h,c,b,g)};a.jmolCommandInput=function(e,f,d,h,c,b){return a.controls._getCommandInput(e,f,d,h,c,b)};a.jmolHtml=function(e){return a._documentWrite(e)};a.jmolLink=function(e,f,d,h,c){return a.controls._getLink(e,f,d,h,c)};a.jmolMenu=function(e,f,d,h,c){return a.controls._getMenu(e,f,d,h,c)};a.jmolRadio=function(e,f,d,h,c,b,g,m){return a.controls._getRadio(e,
f,d,h,c,b,g,m)};a.jmolRadioGroup=function(e,f,d,h,c,b){return a.controls._getRadioGroup(e,f,d,h,c,b)};a.setCheckboxGroup=function(e,f){a.controls._cbSetCheckboxGroup(e,f,arguments)};a.setDocument=function(e){a._document=e};a.setXHTML=function(e){a._isXHTML=!0;a._XhtmlElement=null;a._XhtmlAppendChild=!1;e&&(a._XhtmlElement=document.getElementById(e),a._XhtmlAppendChild=!0)};a.setAppletCss=function(e,f){null!=e&&(a.controls._appletCssClass=e);a.controls._appletCssText=f?f+" ":e?'class="'+e+'" ':""};
a.setButtonCss=function(e,f){null!=e&&(a.controls._buttonCssClass=e);a.controls._buttonCssText=f?f+" ":e?'class="'+e+'" ':""};a.setCheckboxCss=function(e,f){null!=e&&(a.controls._checkboxCssClass=e);a.controls._checkboxCssText=f?f+" ":e?'class="'+e+'" ':""};a.setRadioCss=function(e,f){null!=e&&(a.controls._radioCssClass=e);a.controls._radioCssText=f?f+" ":e?'class="'+e+'" ':""};a.setLinkCss=function(e,f){null!=e&&(a.controls._linkCssClass=e);a.controls._linkCssText=f?f+" ":e?'class="'+e+'" ':""};
a.setMenuCss=function(e,f){null!=e&&(a.controls._menuCssClass=e);a.controls._menuCssText=f?f+" ":e?'class="'+e+'" ':""};a.setAppletSync=function(e,f,d){a._syncedApplets=e;a._syncedCommands=f;a._syncedReady={};a._isJmolJSVSync=d};a.setGrabberOptions=function(e){a._grabberOptions=e};a.setAppletHtml=function(e,f){e._code&&(a.$html(f,e._code),e._init&&!e._deferApplet&&e._init())};a.coverApplet=function(a,f){a._cover&&a._cover(f)};a.setFileCaching=function(e,f){e?e._cacheFiles=f:a.fileCache=f?{}:null};
a.updateView=function(a,f,d){a._updateView(f,d)};a.getChemicalInfo=function(e,f,d){f||(f="name");"string"!=typeof applet_or_Identifier&&(e=e._getSmiles());return a._getNCIInfo(e,f,d)};a.saveImage=function(a){switch(a._viewType){case "Jmol":a._script('write PNGJ "'+a._id+'.png"');break;case "JSV":a._script("write PDF");break;case "JME":a._script("print")}}})(Jmol);
LoadClazz=function(){window["j2s.clazzloaded"]||(window["j2s.clazzloaded"]=!1);window["j2s.clazzloaded"]||(window["j2s.clazzloaded"]=!0,window["j2s.object.native"]=!0,Clazz=function(){},function(a){a.__debuggingBH=!1;a._globals=["j2s.clazzloaded","j2s.object.native"];a.setGlobal=function(c,b){a._globals.push(c);window[c]=b};a.getGlobals=function(){return a._globals.sort().join("\n")};a._profile=window["j2s.doProfile"]&&self.JSON?{}:null;a.getProfile=function(){var c="";if(a._profile){var c=[],b;for(b in a._profile){var g=
""+a._profile[b];c.push("        ".substring(g.length)+g+"\t"+b)}c=c.sort().reverse().join("\r\n");a._profile={}}return c};a.addProfile=function(c,b,g){c=c.__CLASS_NAME__+" "+b+" "+JSON.stringify(g);a._profile[c]||(a._profile[c]=0);a._profile[c]++};NullObject=function(){};a._supportsNativeObject=window["j2s.object.native"];a._supportsNativeObject?(a._O=function(){},a._O.__CLASS_NAME__="Object",a._O.getClass=function(){return a._O}):a._O=Object;a.Console={};a.dateToString=Date.prototype.toString;a.getSignature=
function(a,b,g,d){return d?a[b]=g:a[b]};a.addProto=function(c,b,g){a.getSignature(c,b,g,!0)};var h=a._O.prototype;a.addProto(h,"equals",function(a){return this==a});a.addProto(h,"hashCode",function(){try{return this.toString().hashCode()}catch(a){var b=":",g;for(g in this)b+=g+":";return b.hashCode()}});a.addProto(h,"getClass",function(){return a.getClass(this)});a.addProto(h,"clone",function(){return a.clone(this)});a.clone=function(a){var b=new a.constructor,g;for(g in a)b[g]=a[g];return b};a.addProto(h,
"finalize",function(){});a.addProto(h,"notify",function(){});a.addProto(h,"notifyAll",function(){});a.addProto(h,"wait",function(){});a.addProto(h,"to$tring",Object.prototype.toString);a.addProto(h,"toString",function(){return null!=this.__CLASS_NAME__?"["+this.__CLASS_NAME__+" object]":this.to$tring.apply(this,arguments)});a._extendedObjectMethods="equals hashCode getClass clone finalize notify notifyAll wait to$tring toString".split(" ");a.extendJO=function(c,b){b&&(c.__CLASS_NAME__=c.prototype.__CLASS_NAME__=
b);if(a._supportsNativeObject)for(var g=0;g<a._extendedObjectMethods.length;g++){var d=a._extendedObjectMethods[g];a.getSignature(c.prototype,d,a._O.prototype[d],!0)}};a.extractClassName=function(a){a=a.substring(1,a.length-1);return 0<=a.indexOf("Array")?"Array":0<=a.indexOf("object ")?a.substring(7):a};a.getClassName=function(c,b){if(null==c)return"NullObject";if(c instanceof a.CastedNull)return c.clazzName;switch(typeof c){case "number":return"Number";case "boolean":return"Boolean";case "string":return"String";
case "function":if(null!=c.__CLASS_NAME__)return b?c.__CLASS_NAME__:"Class";var g=c.toString(),d=g.indexOf("function");if(0>d)return"["==g.charAt(0)?a.extractClassName(g):g.replace(/[^a-zA-Z0-9]/g,"");var d=d+8,e=g.indexOf("(",d);if(0>e)return"Object";g=g.substring(d,e);if(0<=g.indexOf("Array"))return"Array";g=g.replace(/^\s+/,"").replace(/\s+$/,"");return"anonymous"==g||""==g?"Function":g;case "object":if(null!=c.__CLASS_NAME__)return c.__CLASS_NAME__;if(null==c.constructor)return"Object";if(null==
c.constructor.__CLASS_NAME__){if(c instanceof Number)return"Number";if(c instanceof Boolean)return"Boolean";if(c instanceof Array)return"Array";g=c.toString();if("["==g.charAt(0))return a.extractClassName(g)}}return a.getClassName(c.constructor,!0)};a.getClass=function(c){if(null==c)return a._O;if("function"==typeof c)return c;var b=null;if(c instanceof a.CastedNull)b=c.clazzName;else{if("string"==typeof c)return String;if("object"==typeof c)if(null!=c.__CLASS_NAME__)b=c.__CLASS_NAME__;else return null==
c.constructor?a._O:c.constructor}return null!=b?a.evalType(b,!0):c.constructor};a.extendsProperties=function(c,b){for(var g in b)"b$"!=g&&("prototype"!=g&&"superClazz"!=g&&"__CLASS_NAME__"!=g&&"implementz"!=g&&!a.checkInnerFunction(b,g))&&(c[g]=b[g])};a.checkInnerFunction=function(c,b){for(var g=0;g<a.innerFunctionNames.length;g++)if(b==a.innerFunctionNames[g]&&a._innerFunctions[b]===c[b])return!0;return!1};a.implementsProperties=function(c,b){for(var g in b)"b$"!=g&&("prototype"!=g&&"superClazz"!=
g&&"__CLASS_NAME__"!=g&&"implementz"!=g)&&!("function"==typeof b[g]&&a.checkInnerFunction(b,g))&&(c[g]=b[g],c.prototype[g]=b[g])};a.args4InheritClass=function(){};a.inheritArgs=new a.args4InheritClass;a.inheritClass=function(c,b,g){a.extendsProperties(c,b);a.isClassUnloaded(c)||(c.prototype=null!=g?g:b!==Number?new b(a.inheritArgs):new Number);c.superClazz=b;c.prototype.__CLASS_NAME__=c.__CLASS_NAME__};a.implementOf=function(c,b){if(2<=arguments.length){null==c.implementz&&(c.implementz=[]);var g=
c.implementz;if(2==arguments.length)if("function"==typeof b)g[g.length]=b,a.implementsProperties(c,b);else{if(b instanceof Array)for(var d=0;d<b.length;d++)g[g.length]=b[d],a.implementsProperties(c,b[d])}else for(d=1;d<arguments.length;d++)g[g.length]=arguments[d],a.implementsProperties(c,arguments[d])}};a.extendInterface=a.implementOf;a.equalsOrExtendsLevel=function(c,b){if(c===b)return 0;if(null!=c.implementz)for(var g=c.implementz,d=0;d<g.length;d++){var e=a.equalsOrExtendsLevel(g[d],b);if(0<=
e)return e+1}return-1};a.getInheritedLevel=function(c,b){if(c===b)return 0;var g="string"==typeof c,d="string"==typeof b;if(g&&("void"==c||"unknown"==c)||d&&("void"==b||"unknown"==b))return-1;if((g&&"NullObject"==c||NullObject===c)&&b!==Number&&b!==Boolean&&b!==NullObject)return 0;g&&(c=a.evalType(c));d&&(b=a.evalType(b));if(null==b||null==c)return-1;g=0;for(d=c;d!==b&&10>g;){if(null!=d.implementz)for(var e=d.implementz,f=0;f<e.length;f++){var k=a.equalsOrExtendsLevel(e[f],b);if(0<=k)return g+k+1}d=
d.superClazz;if(null==d)return b===Object||b===a._O?g+1.5:-1;g++}return g};a.instanceOf=function(c,b){if(null==c)return!1==b;if(null==b)return!1;if(c instanceof b)return!0;var g=a.getClassName(c);return 0<=a.getInheritedLevel(g,b)};a.superCall=function(c,b,g,d){var e=null,f=-1,k=c[g];if(null!=k)if(null!=k.claxxOwner)k.claxxOwner!==b&&(e=k);else if(null==k.stacks&&!(null!=k.lastClaxxRef&&null!=k.lastClaxxRef.prototype[g]&&null!=k.lastClaxxRef.prototype[g].stacks))e=k;else{var l=k.stacks;null==l&&(l=
k.lastClaxxRef.prototype[g].stacks);for(f=l.length-1;0<=f;f--)if(b===l[f]){0<f?(f--,e=l[f].prototype[g]):e=l[0].prototype[g]["\\unknown"];break}else if(0<a.getInheritedLevel(b,l[f])){e=l[f].prototype[g];break}}if(null!=e)return 0==f&&"construct"==g&&(f=k.stacks,null!=f&&(null==f[0].superClazz&&null!=f[0].con$truct)&&f[0].con$truct.apply(c,[])),a.tracingCalling?(f=arguments.callee.caller,f===a.superConstructor&&(f=f.arguments.callee.caller),a.pu$hCalling(new a.callingStack(f,b)),e=e.apply(c,null==
d?[]:d),a.p0pCalling(),e):e.apply(c,null==d?[]:d);if("construct"!=g)throw a.alert(["j2slib","no class found",d.typeString]),new a.MethodNotFoundException(c,b,g,a.getParamsType(d).typeString);};a.superConstructor=function(c,b,g){a.superCall(c,b,"construct",g);null!=b.con$truct&&b.con$truct.apply(c,[])};a.CastedNull=function(c){this.clazzName=null!=c?c instanceof String?c:c instanceof Function?a.getClassName(c,!0):""+c:"Object";this.toString=function(){return null};this.valueOf=function(){return null}};
a.castNullAs=function(c){return new a.CastedNull(c)};a.MethodException=function(){};a.MethodNotFoundException=function(){this.toString=function(){return"MethodNotFoundException"}};a.getParamsType=function(c){var b=c.length;switch(b){case 0:var g=["void"];g.typeString="\\void";return g;case 1:if(g=c[0],null!=g&&"number"==typeof g)return g=["Number"],g.typeString="\\Number",g}g=[];g.hasCastedNull=!1;if(null!=c)for(var d=0;d<b;d++)g[d]=a.getClassName(c[d]),c[d]instanceof a.CastedNull&&(g.hasCastedNull=
!0);g.typeString="\\"+g.join("\\");return g};a.searchAndExecuteMethod=function(c,b,g,d){var e=c[g],f=a.getParamsType(d);a._profile&&a.addProfile(b,g,f);if(e.lastParams==f.typeString&&e.lastClaxxRef===b){b=null;if(f.hasCastedNull){b=[];for(f=0;f<d.length;f++)b[f]=d[f]instanceof a.CastedNull?null:d[f]}else b=d;if(null!=e.lastMethod)return e.lastMethod.apply(c,b)}else{e.lastParams=f.typeString;e.lastClaxxRef=b;var k=e.stacks;null==k&&(k=b.prototype[g].stacks);for(var l=!1,h=k.length-1;-1<h;h--)if(l||
k[h]===b){l=a.tryToSearchAndExecute(g,c,k[h].prototype[g],f,d,e);if(!(l instanceof a.MethodException))return l;l=!0}if("construct"!=g)throw new a.MethodNotFoundException(c,b,g,f.typeString);}};a.tracingCalling=!1;a.tryToSearchAndExecute=function(c,b,g,d,e,f){var k=[],l=!0,h;for(h in g)if(92==h.charCodeAt(0)){var r=h.substring(1).split("\\");r.length==d.length&&(k[k.length]=r);l=!1}else if(l&&"funParams"==h&&null!=g.funParams){h=g.funParams;r=h.substring(1).split("\\");r.length==d.length&&(k[0]=r);
break}if(0==k.length)return new a.MethodException;h=a.searchMethod(k,d);if(null!=h){k=null;k=l?g:g["\\"+h];l=null;if(d.hasCastedNull){l=[];for(h=0;h<e.length;h++)l[h]=e[h]instanceof a.CastedNull?null:e[h]}else l=e;if(a.tracingCalling){r=arguments.callee.caller;r=r=r.arguments.callee.caller;if(h="construct"==k.exName&&0<=a.getInheritedLevel(k.exClazz,Throwable)&&!a._initializingException){a._initializingException=!0;var j=r.arguments.callee.caller.arguments.callee.caller,t=j.arguments.callee,s=t.claxxReference;
null==s&&(s=t.exClazz);null==s&&(s=t.claxxOwner);a.pu$hCalling(new a.callingStack(j,s))}if(j=r!==a.instantialize&&r!==a.superCall)t=r.arguments.callee,s=t.claxxReference,null==s&&(s=t.exClazz),null==s&&(s=t.claxxOwner),a.pu$hCalling(new a.callingStack(r,s));f.lastMethod=k;k=k.apply(b,l);j&&a.p0pCalling();h&&a.p0pCalling();return k}f.lastMethod=k;return k.apply(b,l)}return new a.MethodException};a._initializingException=!1;a.searchMethod=function(c,b){for(var g=[],d=0;d<c.length;d++){for(var e=[],
f=!0,k=0;k<c[d].length;k++)if(e[k]=a.getInheritedLevel(b[k],c[d][k]),0>e[k]){f=!1;break}f&&(e[b.length]=d,g[g.length]=e)}if(0==g.length)return null;e=g[0];for(d=1;d<g.length;d++){f=!0;for(k=0;k<b.length;k++)if(e[k]<g[d][k]){f=!1;break}f&&(e=g[d])}return c[e[b.length]].join("\\")};a.generateDelegatingMethod=function(a,b){var g=function(){var a=arguments;return SAEM(this,a.callee.claxxReference,a.callee.methodName,a)};g.methodName=b;g.claxxReference=a;return g};SAEM=a.searchAndExecuteMethod;a.expExpandParameters=
function(a,b){return"N"==b?"Number":"B"==b?"Boolean":"S"==b?"String":"O"==b?"Object":"A"==b?"Array":"Unknown"};a.formatParameters=function(c){return null==c||0==c.length?"\\void":c.replace(/~([NABSO])/g,a.expExpandParameters).replace(/\s+/g,"").replace(/^|,/g,"\\").replace(/\$/g,"org.eclipse.s")};a.overrideMethod=function(c,b,g,d){a.assureInnerClass&&a.assureInnerClass(c,g);g.exName=b;d=a.formatParameters(d);g.funParams=d;g.claxxOwner=c;return a.getSignature(c.prototype,b,g,!0)};a.defineMethod=function(c,
b,g,d){a.assureInnerClass&&a.assureInnerClass(c,g);g.exName=b;d=a.formatParameters(d);var e=c.prototype,f=a.getSignature(e,b,g,!1);if(null==f||f.claxxOwner===c&&f.funParams==d)return g.funParams=d,g.claxxOwner=c,g.exClazz=c,a.getSignature(e,b,g,!0);var k=null,l=[];null==f.stacks?(k=f,null!=f.claxxOwner&&(l[0]=k.claxxOwner)):l=f.stacks;if(null==f.stacks||f.claxxReference!==c){f=a.getSignature(e,b,a.generateDelegatingMethod(c,b,f),!0);e=[];for(b=0;b<l.length;b++)e[b]=l[b];f.stacks=e}l=f.stacks;if(0==
l.length)l[0]=c;else{e=!1;for(b=l.length-1;0<=b;b--)if(l[b]===c){e=!0;break}e||(l[l.length]=c)}null!=k&&(k.claxxOwner===c?(f[k.funParams]=k,k.claxxOwner=null,k.funParams=null):null==k.claxxOwner&&(f["\\unknown"]=k));g.exClazz=c;f[d]=g;return f};a.makeConstructor=function(c,b,g){a.defineMethod(c,"construct",b,g);null!=c.con$truct&&(c.con$truct.index=c.con$truct.stacks.length)};a.overrideConstructor=function(c,b,g){a.overrideMethod(c,"construct",b,g);null!=c.con$truct&&(c.con$truct.index=c.con$truct.stacks.length)};
a.allPackage={};a.allClasses={};a.lastPackageName=null;a.lastPackage=null;a.unloadedClasses=[];a.isClassUnloaded=function(c){c=a.getClassName(c,!0);return null!=a.unloadedClasses[c]};a.declarePackage=function(c){if(a.lastPackageName==c)return a.lastPackage;if(null!=c&&0!=c.length){for(var b=c.split(/\./),g=a.allPackage,d=0;d<b.length;d++)null==g[b[d]]&&(g[b[d]]={__PKG_NAME__:null!=g.__PKG_NAME__?g.__PKG_NAME__+"."+b[d]:b[d]},0==d&&a.setGlobal(b[d],g[b[d]])),g=g[b[d]];a.lastPackageName=c;return a.lastPackage=
g}};a.evalType=function(c,b){var g=c.lastIndexOf(".");if(-1!=g){var d=c.substring(0,g),d=a.declarePackage(d),g=c.substring(g+1);return d[g]}return b?window[c]:"number"==c?Number:"object"==c?a._O:"string"==c?String:"boolean"==c?Boolean:"function"==c?Function:"void"==c||"undefined"==c||"unknown"==c?c:"NullObject"==c?NullObject:window[c]};a.defineType=function(c,b,g,d){var e=a.unloadedClasses[c];null!=e&&(b=e);e=c.lastIndexOf(".");if(-1!=e){var f=c.substring(0,e),f=a.declarePackage(f),e=c.substring(e+
1);if(null!=f[e])return f[e];f[e]=b}else{if(null!=window[c])return window[c];a.setGlobal(c,b)}a.decorateAsType(b,c,g,d);c=a._innerFunctions;b.defineMethod=c.defineMethod;b.defineStaticMethod=c.defineStaticMethod;b.makeConstructor=c.makeConstructor;return b};a.isSafari=-1!=navigator.userAgent.indexOf("Safari");a.isSafari4Plus=!1;if(a.isSafari){var h=navigator.userAgent,e=h.indexOf("Version/");-1!=e&&(h=h.substring(e+8),h=parseFloat(h),a.isSafari4Plus=4<=h)}a.instantialize=function(c,b){if(!(null!=
b&&1==b.length&&null!=b[0]&&b[0]instanceof a.args4InheritClass)){c instanceof Number&&(c.valueOf=function(){return this});if(a.isSafari4Plus){for(var g=[],d=0;d<b.length;d++)g[d]=b[d];b=g}g=c.construct;null!=g?null==c.con$truct?g.apply(c,b):null==c.getClass().superClazz?(c.con$truct.apply(c,[]),g.apply(c,b)):null!=g.claxxOwner&&g.claxxOwner===c.getClass()||null!=g.stacks&&g.stacks[g.stacks.length-1]==c.getClass()?g.apply(c,b):(null!=g.claxxOwner&&null==g.claxxOwner.superClazz&&null!=g.claxxOwner.con$truct?
g.claxxOwner.con$truct.apply(c,[]):null!=g.stacks&&(1==g.stacks.length&&null==g.stacks[0].superClazz)&&g.stacks[0].con$truct.apply(c,[]),g.apply(c,b),c.con$truct.apply(c,[])):null!=c.con$truct&&c.con$truct.apply(c,[])}};a.innerFunctionNames="equals hashCode getName getClassLoader getResource getResourceAsStream defineMethod defineStaticMethod makeConstructor".split(" ");a._innerFunctions={equals:function(a){return this===a},hashCode:function(){return this.getName().hashCode()},toString:function(){return"class "+
this.getName()},getName:function(){return a.getClassName(this,!0)},getClassLoader:function(){var c=this.__CLASS_NAME__,b=a._Loader.getClasspathFor(c),g=b.lastIndexOf(c.replace(/\./g,"/")),b=-1!=g?b.substring(0,g):a._Loader.getClasspathFor(c,!0),c=a._Loader.requireLoaderByBase(b);c.getResourceAsStream=a._innerFunctions.getResourceAsStream;c.getResource=a._innerFunctions.getResource;return c},getResource:function(a){return this.getResourceAsStream(a).url},getResourceAsStream:function(c){var b=null;
if(null==c)return b;null!=java.io.InputStream?b=new java.io.InputStream:(b=new a._O,b.__CLASS_NAME__="java.io.InputStream",b.close=NullObject);b.read=function(){return 0};c=c.replace(/\\/g,"/");var g=null,d=this.__CLASS_NAME__;2==arguments.length&&0!=c.indexOf("/")&&(c="/"+c);if(0==c.indexOf("/"))if(2==arguments.length?(g=arguments[1],null==g&&(g=a._Loader.binaryFolders[0])):null!=a._Loader&&(g=a._Loader.getClasspathFor(d,!0)),null==g||0==g.length)b.url=c.substring(1);else{var g=g.replace(/\\/g,"/"),
e=g.length,e=g.charAt(e-1);"/"!=e&&(g+="/");b.url=g+c.substring(1)}else{if(null!=this.base)g=this.base;else if(null!=a._Loader)if(g=a._Loader.getClasspathFor(d),e=g.lastIndexOf(d.replace(/\./g,"/")),-1!=e)g=g.substring(0,e);else if(e=-1,g.indexOf(".z.js")==g.length-5&&-1!=(e=g.lastIndexOf("/")))for(var g=g.substring(0,e+1),e=d.split(/\./),f=1;f<e.length;f++){for(var k="/",l=0;l<f;l++)k+=e[l]+"/";if(k.length>g.length)break;if(g.indexOf(k)==g.length-k.length){g=g.substring(0,g.length-k.length+1);break}}else g=
a._Loader.getClasspathFor(d,!0);else e=a.binaryFolders,null!=e&&0!=e.length&&(g=e[0]);if(null==g||0==g.length)g="j2s/";g=g.replace(/\\/g,"/");e=g.length;e=g.charAt(e-1);"/"!=e&&(g+="/");null!=this.base?b.url=g+c:(e=d.lastIndexOf("."),b.url=-1==e||null!=this.base?g+c:g+d.substring(0,e).replace(/\./g,"/")+"/"+c)}return b},defineMethod:function(c,b,g){a.defineMethod(this,c,b,g)},defineStaticMethod:function(c,b,g){a.defineMethod(this,c,b,g);this[c]=this.prototype[c]},makeConstructor:function(c,b){a.makeConstructor(this,
c,b)}};a.decorateFunction=function(c,b,g){null!=a._Loader&&a._Loader.checkInteractive();var d=null;null==b?(d=g,a.setGlobal(g,c)):null!=b.__PKG_NAME__?(d=b.__PKG_NAME__+"."+g,b[g]=c,b===java.lang&&a.setGlobal(g,c)):(d=b.__CLASS_NAME__+"."+g,b[g]=c);a.extendJO(c,d);b=a.innerFunctionNames;for(g=0;g<b.length;g++)c[b[g]]=a._innerFunctions[b[g]];null!=a._Loader&&(c=a._Loader.findClass(d),null!=c&&c.status==a._Node.STATUS_KNOWN&&window.setTimeout(function(b){return function(){a._Loader.updateNode(b)}}(c),
1))};a.currentPath="";a.declareInterface=function(c,b,g){var d=function(){};a.decorateFunction(d,c,b,"Clazz.declareInterface");null!=g&&a.implementOf(d,g);return d};a.decorateAsClass=function(c,b,g,d,e,f,k){var l=null;null!=b&&(l=b.__PKG_NAME__,null==l&&(l=b.__CLASS_NAME__));l=a.unloadedClasses[(null==l?"":l+".")+g];null!=l&&(c=l);a.decorateFunction(c,b,g,k+"...Clazz.decorateAsClass");null!=f?a.inheritClass(c,d,f):null!=d&&a.inheritClass(c,d);null!=e&&a.implementOf(c,e);return c};a.declareType=function(c,
b,g,d,e){return a.decorateAsClass(function(){a.instantialize(this,arguments)},c,b,g,d,e,"Clazz.declareType")};a.declareAnonymous=function(c,b,g,d,e){return a.decorateAsClass(function(){a.prepareCallback(this,arguments);a.instantialize(this,arguments)},c,b,g,d,e,"Clazz.declareAnonymous")};a.decorateAsType=function(c,b,g,d,e,f){a.extendJO(c,b);c.equals=a._innerFunctions.equals;c.getName=a._innerFunctions.getName;if(f)for(b=0;b<a.innerFunctionNames.length;b++)f=a.innerFunctionNames[b],c[f]=a._innerFunctions[f];
null!=e?a.inheritClass(c,g,e):null!=g&&a.inheritClass(c,g);null!=d&&a.implementOf(c,d);return c};a._ex_reg=function(a,b,g){g||(g="[^\\s]+");var d=a.indexOf(b);a=a.substring(0,d)+g+a.substring(d+b.length);return RegExp("^"+a+"$")};try{null.hello()}catch(f){/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)?(h=f.message.indexOf(":"),e=f.message.indexOf(":",h+2),a._NPEMsgFragment=f.message.substr(h+1,e-h-20),a._isNPEExceptionPredicate=function(c){return-1!=c.message.indexOf(a._NPEMsgFragment)}):-1!=navigator.userAgent.toLowerCase().indexOf("webkit")?
(a._exceptionNPERegExp=a._ex_reg(f.message,"hello"),a._isNPEExceptionPredicate=function(c){return a._exceptionNPERegExp.test(c.message)}):(a._exceptionNPERegExp=a._ex_reg(f.message,"$$o$$"),a._isNPEExceptionPredicate=function(c){return a._exceptionNPERegExp.test(c.message)})}a.exceptionOf=function(c,b){return c.__CLASS_NAME__?a.instanceOf(c,b):b==Error?(0<=(""+c).indexOf("Error")&&System.out.println(a.getStackTrace()),0<=(""+c).indexOf("Error")):b==Exception||b==Throwable||b==NullPointerException&&
a._isNPEExceptionPredicate(c)};a.getStackTrace=function(a){var b="\n";a||(a=25);for(var d=arguments.callee.caller,e=0;e<a&&d;e++)b+=e+" "+(d.exName?(d.claxxOwner?d.claxxOwner.__CLASS_NAME__+".":"")+d.exName:d.toString?d.toString().substring(0,d.toString().indexOf("{")):"<native method>")+"\n",d=d.caller;return b};Number.prototype._numberToString=Number.prototype.toString;a.declarePackage("java.io");a.declarePackage("java.lang.annotation");a.declarePackage("java.lang.instrument");a.declarePackage("java.lang.management");
a.declarePackage("java.lang.reflect");a.declarePackage("java.lang.ref");java.lang.ref.reflect=java.lang.reflect;a.declarePackage("java.util");a.declareInterface(java.io,"Closeable");a.declareInterface(java.io,"DataInput");a.declareInterface(java.io,"DataOutput");a.declareInterface(java.io,"Externalizable");a.declareInterface(java.io,"Flushable");a.declareInterface(java.io,"Serializable");a.declareInterface(java.lang,"Iterable");a.declareInterface(java.lang,"CharSequence");a.declareInterface(java.lang,
"Cloneable");a.declareInterface(java.lang,"Appendable");a.declareInterface(java.lang,"Comparable");a.declareInterface(java.lang,"Runnable");a.declareInterface(java.util,"Comparator");java.lang.ClassLoader={__CLASS_NAME__:"ClassLoader"};if(null!=window.Clazz&&null==window.Clazz.unloadClass){a.MethodNotFoundException=function(c,b,d,e){c="";null!=e&&(c=e.substring(1).replace(/\\/g,","));this.message=(null!=d&&"construct"!=d?"Method":"Constructor")+" "+a.getClassName(b,!0)+"."+d+"("+c+") is not found!";
this.toString=function(){return"MethodNotFoundException:"+this.message}};a.prepareCallback=function(c,b){var d=b[0];if(null!=c&&null!=d&&d!==window){var e=[];if(null!=c.b$)for(var f in c.b$)"length"!=f&&(e[f]=c.b$[f]);c.b$=e;var h=a.getClassName(d,!0);e[h.replace(/org\.eclipse\.swt\./,"$wt.")]=d;for(h=a.getClass(d);null!=h.superClazz;)h=h.superClazz,e[a.getClassName(h,!0).replace(/org\.eclipse\.swt\./,"$wt.")]=d;d=d.b$;if(null!=d&&d instanceof Array)for(f in d)"length"!=f&&(e[f]=d[f])}for(e=0;e<b.length-
1;e++)b[e]=b[e+1];b.length--};a.innerTypeInstance=function(c,b,d){null==c&&(c=arguments.callee.caller);var e=null;if(null==d&&null==b.$finals)if(3==arguments.length)e=new c(b);else if(4==arguments.length)e=b.__CLASS_NAME__==c.__CLASS_NAME__&&arguments[3]===a.inheritArgs?b:new c(b,arguments[3]);else if(5==arguments.length)e=new c(b,arguments[3],arguments[4]);else if(6==arguments.length)e=new c(b,arguments[3],arguments[4],arguments[5]);else if(7==arguments.length)e=new c(b,arguments[3],arguments[4],
arguments[5],arguments[6]);else if(8==arguments.length)e=new c(b,arguments[3],arguments[4],arguments[5],arguments[6],arguments[7]);else if(9==arguments.length)e=new c(b,arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8]);else if(10==arguments.length)e=new c(b,arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8],arguments[9]);else{for(var e=new c(b,a.inheritArgs),f=[],h=3;h<arguments.length;h++)f[h-3]=arguments[h];a.instantialize(e,f)}else{e=new c(b,
a.inheritArgs);if(null!=d&&null==b.f$)e.f$=d;else if(null==d&&null!=b.f$)e.f$=b.f$;else if(null!=d&&null!=b.f$){f={};for(h in b.f$)f[h]=b.f$[h];for(h in d)f[h]=d[h];e.f$=f}f=[];for(h=3;h<arguments.length;h++)f[h-3]=arguments[h];a.instantialize(e,f)}return e};a.cloneFinals=function(){for(var a={},b=arguments.length/2,d=0;d<b;d++)a[arguments[d+d]]=arguments[d+d+1];return a};a.isClassDefined=a.isDefinedClass=function(c){if(null!=c&&0!=c.length){if(a.allClasses[c])return!0;for(var b=c.split(/\./),d=null,
e=0;e<b.length;e++)if(null==d){if(null==a.allPackage[b[0]])return!1;d=a.allPackage[b[0]]}else{if(null==d[b[e]])return!1;d=d[b[e]]}if(null!=d)return a.allClasses[c]=!0}return!1};a.defineEnumConstant=function(a,b,d,e,f){var h=null,h=null!=f?new f:new a;h.$name=b;h.$ordinal=d;null!=e&&0!=e.length&&h.construct.apply(h,e);a[b]=h;a.prototype[b]=h;null==a["$ values"]&&(a["$ values"]=[],a.values=function(){return this["$ values"]});a["$ values"].push(h);return h};a.floatToInt=function(a){return 0>a?Math.ceil(a):
Math.floor(a)};a.floatToByte=a.floatToShort=a.floatToLong=a.floatToInt;a.doubleToByte=a.doubleToShort=a.doubleToLong=a.doubleToInt=a.floatToInt;a.floatToChar=function(a){return String.fromCharCode(0>a?Math.ceil(a):Math.floor(a))};a.doubleToChar=a.floatToChar;self.Int32Array&&self.Int32Array!=Array?(a.haveInt32=!0,Int32Array.prototype.sort||(Int32Array.prototype.sort=Array.prototype.sort)):(Int32Array=function(a){a||(a=0);var b=Array(a);b.toString=function(){return"[object Int32Array]"};for(var d=
0;d<a;d++)b[d]=0;return b},a.haveInt32=!1,Int32Array.prototype.sort=Array.prototype.sort,Int32Array.prototype.int32Fake=function(){});self.Float64Array&&self.Float64Array!=Array?(a.haveFloat64=!0,Float64Array.prototype.sort||(Float64Array.prototype.sort=Array.prototype.sort)):(a.haveFloat64=!1,Float64Array=function(a){a||(a=0);for(var b=Array(a),d=0;d<a;d++)b[d]=0;return b},Float64Array.prototype.sort=Array.prototype.sort,Float64Array.prototype.float64Fake=function(){},Float64Array.prototype.toString=
function(){return"[object Float64Array]"});a.newArray=function(){if(arguments[0]instanceof Array)var c=arguments[0],b=arguments[1];else c=arguments,b=Array;if(1>=c.length)return[];var d=c[0];"string"==typeof d&&(d=d.charCodeAt(0));var e=c.length-1,f=c[e];if(2==c.length){if(null==f)return Array(d);if(!0===b&&a.haveInt32)return new Int32Array(d);if(!1===b&&a.haveFloat64)return new Float64Array(d);if(b==Array&&null==f)return Array(d);for(var c=!0===b?new Int32Array:!1===b?new Float64Array:Array(d),h=
d;0<=--h;)c[h]=f;return c}for(var k=Array(e),h=0;h<e;h++)k[h]=c[h+1];c=Array(d);if(null==f||0<=f||2<e)for(h=0;h<d;h++)c[h]=a.newArray(k,b);return c};a.newArray32=function(c,b){var d=c[0];"string"==typeof d&&(d=d.charCodeAt(0));var e=c.length-1,f=c[e];switch(c.length){case 0:case 1:return alert("ERROR IN newArray32 -- args length < 2"),[];case 2:if(0>f)return Array(d);try{return b?new Int32Array(d):new Float64Array(d)}catch(h){alert(d+" "+arguments.callee.caller.arguments.callee.caller+h)}}for(f=Array(e);0<=
--e;)f[e]=c[e+1];for(var k=Array(d),e=0;e<d;e++)k[e]=a.newArray(f,b);return k};a.newInt32Array=function(){return a.newArray32(arguments,!0)};a.newFloat64Array=function(){return a.newArray32(arguments,!1)};a.newFloatArray=a.newDoubleArray=a.newFloat64Array;a.newIntArray=a.newLongArray=a.newShortArray=a.newByteArray=a.newInt32Array;a.newCharArray=a.newBooleanArray=a.newArray;a.arrayIs=function(a,b){return a.constructor&&a.constructor!=Number&&0<=a.constructor.toString().indexOf(b)};a.isAS=function(c){return c&&
"object"==typeof c&&a.arrayIs(c," Array")&&("string"==typeof c[0]||"undefined"==typeof c[0])};a.isASS=function(c){return c&&"object"==typeof c&&a.isAS(c[0])};a.isAP=function(c){return c&&"JU.P3"==a.getClassName(c[0])};a.isAI=function(c){return c&&"object"==typeof c&&(a.haveInt32?a.arrayIs(c,"Int32Array"):c.int32Fake?!0:!1)};a.isAII=function(c){return c&&"object"==typeof c&&a.isAI(c[0])};a.isAF=function(c){return c&&"object"==typeof c&&(a.haveFloat64?a.arrayIs(c,"Float64Array"):c.float64Fake?!0:!1)};
a.isAFF=function(c){return c&&"object"==typeof c&&a.isAF(c[0])};a.isAFFF=function(c){return c&&"object"==typeof c&&a.isAFF(c[0])};a.isAFloat=function(c){return c&&"object"==typeof c&&a.arrayIs(c," Array")&&a.instanceOf(c[0],Float)};a.makeFunction=function(a){return function(b){null==b&&(b=window.event);null!=a.setEvent&&a.setEvent(b);a.run();if(1==a.returnSet)return a.returnNumber;if(2==a.returnSet)return a.returnBoolean;if(3==a.returnSet)return a.returnObject}};a.defineStatics=function(a){for(var b=
arguments.length,d=(b-1)/2;0<=--d;){var e=arguments[--b],f=arguments[--b];a[f]=a.prototype[f]=e}};a.prepareFields=function(c,b){var d=[];if(null!=c.con$truct)for(var e=c.con$truct.stacks,f=0;f<e.length;f++)d[f]=e[f];a.addProto(c.prototype,"con$truct",c.con$truct=function(){var a=arguments.callee.stacks;if(null!=a)for(var b=0;b<a.length;b++)a[b].apply(this,[])});d[d.length]=b;c.con$truct.stacks=d;c.con$truct.index=0};a.registerSerializableFields=function(a){var b=arguments,d=b.length,e=[];if(null!=
a.declared$Fields)for(var f=0;f<a.declared$Fields.length;f++)e[f]=a.declared$Fields[f];a.declared$Fields=e;if(0<d&&1==d%2){e=a.declared$Fields;for(f=1;f<=(d-1)/2;f++){for(var h={name:b[f+f-1],type:b[f+f]},k=!1,l=0;l<e.length;l++)if(e[l].name==h.name){e[l].type=h.type;k=!0;break}k||(e[e.length]=h)}}};a.getMixedCallerMethod=function(c){var b={};c=c.callee.caller;if(null==c||c!==a.tryToSearchAndExecute&&(c=c.arguments.callee.caller,null==c)||c!==a.tryToSearchAndExecute)return null;c=c.arguments.callee.caller;
if(null==c||c!==a.searchAndExecuteMethod)return null;b.claxxRef=c.arguments[1];b.fxName=c.arguments[2];b.paramTypes=a.getParamsType(c.arguments[3]);c=c.arguments.callee.caller;if(null==c)return null;c=c.arguments.callee.caller;if(null==c)return null;b.caller=c;return b};c$=null;a.cStack=[];a.pu$h=function(c){c&&a.cStack.push(c)};a.p0p=function(){return a.cStack.pop()};a.tracingCalling=!1;a._initializingException=!1;a.callingStack=function(a,b){this.caller=a;this.owner=b};a._callingStackTraces=[];
a.pu$hCalling=function(c){a._callingStackTraces[a._callingStackTraces.length]=c};a.p0pCalling=function(){var c=a._callingStackTraces.length;return 0<c?(c=a._callingStackTraces[c-1],a._callingStackTraces.length--,c):null};a.load=function(a,b,d,e){null!=e&&e();delete c$};java.lang.Object=a._O;a._O.getName=a._innerFunctions.getName;System={props:null,$props:{},arraycopy:function(a,b,d,e,f){if(a!==d)for(var h=0;h<f;h++)d[e+h]=a[b+h];else{for(var k=[],h=0;h<f;h++)k[h]=a[b+h];for(h=0;h<f;h++)d[e+h]=k[h]}},
currentTimeMillis:function(){return(new Date).getTime()},gc:function(){},getProperties:function(){return System.props},getProperty:function(a,b){if(System.props)return System.props.getProperty(a,b);var d=System.$props[a];return null!=d?d:1==arguments.length?null:null!=b?b:a},getSecurityManager:function(){return null},setProperties:function(a){System.props=a},setProperty:function(a,b){if(null==System.props)return System.$props[a]=b;System.props.setProperty(a,b)}};System.setProperty("line.separator",
0<=navigator.userAgent.indexOf("Windows")?"\r\n":"\n");System.setProperty("os.name",navigator.userAgent);System.out=new a._O;System.out.__CLASS_NAME__="java.io.PrintStream";System.out.print=function(){};System.out.printf=function(){};System.out.println=function(){};System.out.write=function(){};System.err=new a._O;System.err.__CLASS_NAME__="java.io.PrintStream";System.err.print=function(){};System.err.printf=function(){};System.err.println=function(){};System.err.write=function(){};a.popup=a.assert=
a.log=a.error=window.alert;Thread=function(){};Thread.J2S_THREAD=Thread.prototype.J2S_THREAD=new Thread;Thread.currentThread=Thread.prototype.currentThread=function(){return this.J2S_THREAD};a.intCast=function(a){var b=(a&4278190080)>>24,d=(a&16711680)>>16,e=(a&65280)>>8;a&=255;return 0!=(b&128)?-(((b&127)<<24)+(d<<16)+(e<<8)+a+1):(b<<24)+(d<<16)+(e<<8)+a};a.shortCast=function(){var a=(n&65280)>>8,b=n&255;return 0!=(a&128)?-(((a&127)<<8)+b+1):(a<<8)+b4};a.byteCast=function(a){return 0!=(a&128)?-((a&
127)+1):a&255};a.charCast=function(a){return String.fromCharCode(a&255).charAt(0)};a.floatCast=function(a){return a};a.longMasks=[];a.longReverseMasks=[];a.longBits=[];h=[1];for(e=1;53>e;e++)h[e]=h[e-1]+h[e-1];a.longBits=h;a.longMasks[52]=h[52];for(e=51;0<=e;e--)a.longMasks[e]=a.longMasks[e+1]+h[e];a.longReverseMasks[0]=h[0];for(e=1;52>e;e++)a.longReverseMasks[e]=a.longReverseMasks[e-1]+h[e];a.longLeftShift=function(c,b){if(0==b)return c;if(64<=b)return 0;if(52<b)return error("[Java2Script] Error : JavaScript does not support long shift!"),
c;if(0!=(c&a.longMasks[b-1]))return error("[Java2Script] Error : Such shift operator results in wrong calculation!"),c;var d=c&a.longMasks[20+b];return 0!=d?d*a.longBits[b]+(c&a.longReverseMasks[32-b])<<0:c<<b};a.intLeftShift=function(a,b){return a<<b&4294967295};a.longRightShift=function(c,b){return 0!=(c&a.longMasks[20])?Math.round((c&a.longMasks[20])/a.longBits[32-b])+(c&a.longReverseMasks[b])>>b:c>>b};a.intRightShift=function(a,b){return a>>b};a.long0RightShift=function(a,b){return a>>>b};a.int0RightShift=
function(a,b){return a>>>b};a.declarePackage("java.lang.reflect");a.declarePackage("java.security");a.innerFunctionNames=a.innerFunctionNames.concat("getSuperclass isAssignableFrom getMethods getMethod getDeclaredMethods getDeclaredMethod getConstructor getModifiers isArray newInstance".split(" "));a._innerFunctions.getSuperclass=function(){return this.superClazz};a._innerFunctions.isAssignableFrom=function(c){return 0<=a.getInheritedLevel(c,this)};a._innerFunctions.getConstructor=function(){return new java.lang.reflect.Constructor(this,
[],[],java.lang.reflect.Modifier.PUBLIC)};a._innerFunctions.getDeclaredMethods=a._innerFunctions.getMethods=function(){var a=[],b=this.prototype,d;for(d in b)"function"==typeof b[d]&&null==b[d].__CLASS_NAME__&&(a[a.length]=new java.lang.reflect.Method(this,d,[],java.lang.Void,[],java.lang.reflect.Modifier.PUBLIC));b=this;for(d in b)"function"==typeof b[d]&&null==b[d].__CLASS_NAME__&&(a[a.length]=new java.lang.reflect.Method(this,d,[],java.lang.Void,[],java.lang.reflect.Modifier.PUBLIC|java.lang.reflect.Modifier.STATIC));
return a};a._innerFunctions.getDeclaredMethod=a._innerFunctions.getMethod=function(a){var b=this.prototype,d;for(d in b)if(a==d&&"function"==typeof b[d]&&null==b[d].__CLASS_NAME__)return new java.lang.reflect.Method(this,d,[],java.lang.Void,[],java.lang.reflect.Modifier.PUBLIC);b=this;for(d in b)if(a==d&&"function"==typeof b[d]&&null==b[d].__CLASS_NAME__)return new java.lang.reflect.Method(this,d,[],java.lang.Void,[],java.lang.reflect.Modifier.PUBLIC|java.lang.reflect.Modifier.STATIC);return null};
a._innerFunctions.getModifiers=function(){return java.lang.reflect.Modifier.PUBLIC};a._innerFunctions.isArray=function(){return!1};a._innerFunctions.newInstance=function(){return new this};h=a.innerFunctionNames;for(e=0;e<h.length;e++)a._O[h[e]]=a._innerFunctions[h[e]],Array[h[e]]=a._innerFunctions[h[e]];Array.isArray=function(){return!0};a._4Name=function(c){if(a.isClassDefined(c))return a.evalType(c);if(null!=a._Loader)return a._Loader.setLoadingMode("xhr.sync"),a._Loader.loadClass(c),a.evalType(c);
a.alert("[Java2Script] Error: No ClassLoader!")};a.cleanDelegateMethod=function(a){null!=a&&("function"==typeof a&&null!=a.lastMethod&&null!=a.lastParams&&null!=a.lastClaxxRef)&&(a.lastMethod=null,a.lastParams=null,a.lastClaxxRef=null)};a.unloadClass=function(c){var b=a.evalType(c);if(null!=b){a.unloadedClasses[c]=b;for(var d=c.split(/\./),e=null,f=0;f<d.length-1;f++)e=null==e?a.allPackage[d[0]]:e[d[f]];if(null==e){a.allPackage[d[0]]=null;window[d[0]]=null;for(var h in window)0==h.indexOf(c+"$")&&
(a.unloadClass(h),window[h]=null)}else for(h in e[d[d.length-1]]=null,e)0==h.indexOf(d[d.length-1]+"$")&&(a.unloadClass(e.__PKG_NAME__+"."+h),e[h]=null);if(!0==a.allClasses[c])for(h in a.allClasses[c]=!1,a.allClasses)0==h.indexOf(c+"$")&&(a.allClasses[h]=!1);for(var k in b)a.cleanDelegateMethod(b[k]);for(k in b.prototype)a.cleanDelegateMethod(b.prototype[k]);null!=a._Loader&&a._Loader.unloadClassExt(c);return!0}return!1}}a._Loader=function(){};a._Node=function(){a._Loader.initNode(this)};(function(a,
b,d){b.initNode=function(a){a.parents=[];a.musts=[];a.optionals=[];a.declaration=null;a.name=null;a.path=null;a.status=0;a.random=0.13412;a.optionalsLoaded=null};d.prototype.toString=function(){return this.name||this.path||"ClazzNode"};d.STATUS_UNKNOWN=0;d.STATUS_KNOWN=1;d.STATUS_CONTENT_LOADED=2;d.STATUS_MUSTS_LOADED=3;d.STATUS_DECLARED=4;d.STATUS_OPTIONALS_LOADED=5;b.loaders=[];b.requireLoaderByBase=function(a){for(var c=0;c<b.loaders.length;c++)if(b.loaders[c].base==a)return b.loaders[c];c=new b;
c.base=a;return b.loaders[b.loaders.length]=c};b.clazzTreeRoot=new d;b.loadedScripts={};b.inLoadingThreads=0;b.maxLoadingThreads=6;b.userAgent=navigator.userAgent.toLowerCase();b.isOpera=-1!=b.userAgent.indexOf("opera");b.isIE=-1!=b.userAgent.indexOf("msie")&&!b.isOpera;b.isGecko=-1!=b.userAgent.indexOf("gecko");if(b.isOpera){b.maxLoadingThreads=1;var e=b.userAgent.indexOf("opera/");if(-1!=e){var f=9;try{f=parseFloat(b.userAgent.subString(e+6))}catch(h){}9.6<=f&&(b.maxLoadingThreads=6)}}null!=window.Clazz&&
a.isClassDefined?b.isClassDefined=a.isClassDefined:(b.definedClasses={},b.isClassDefined=function(a){return!0==b.definedClasses[a]});b.isAsynchronousLoading=!0;b.isUsingXMLHttpRequest=!1;b.loadingTimeLag=-1;b.setLoadingMode=function(a,c){null!=a&&("string"==typeof a?(a=a.toLowerCase(),0==a.length||-1!=a.indexOf("script")?(b.isUsingXMLHttpRequest=!1,b.isAsynchronousLoading=!0):(b.isUsingXMLHttpRequest=!0,b.isAsynchronousLoading=-1!=a.indexOf("async")?!0:!1),b.isAsynchronousLoading=!1):a==b.MODE_SCRIPT?
(b.isUsingXMLHttpRequest=!1,b.isAsynchronousLoading=!0):(b.isUsingXMLHttpRequest=!0,b.isAsynchronousLoading=a==b.MODE_XHR_ASYNC?!0:!1));b.loadingTimeLag=b.isAsynchronousLoading&&0<=c?c:-1};b.MODE_SCRIPT=0;b.MODE_SCRIPT_ASYNC=0;b.MODE_XHR=3;b.MODE_XHR_SYNC=3;b.MODE_XHR_ASYNC=1;b.unwrapArray=function(a){if(null==a||0==a.length)return a;for(var b=null,c=0;c<a.length;c++)if(null!=a[c]){if("$"==a[c].charAt(0))if("."==a[c].charAt(1)){if(null==b)continue;var d=b.lastIndexOf(".");-1!=d&&(b=b.substring(0,
d),a[c]=b+a[c].substring(1))}else a[c]="org.eclipse.s"+a[c].substring(1);b=a[c]}return a};b.classQueue=[];b.classpathMap={};b.packageClasspath=function(a,c,d){var e=b.classpathMap,f=!0==d&&null!=e["@"+a];d&&(null==e["@java"]&&0!=a.indexOf("java"))&&b.assurePackageClasspath("java");if(a instanceof Array){b.unwrapArray(a);for(e=0;e<a.length;e++)b.packageClasspath(a[e],c,d)}else{if("java"==a||"java.*"==a){var g="@net.sf.j2s.ajax";null==e[g]&&null!=c&&(e[g]=c);g="@net.sf.j2s";null==e[g]&&null!=c&&(e[g]=
c)}else"swt"==a?a="org.eclipse.swt":"ajax"==a?a="net.sf.j2s.ajax":"j2s"==a&&(a="net.sf.j2s");a.lastIndexOf(".*")==a.length-2&&(a=a.substring(0,a.length-2));null!=c&&(e["@"+a]=c);!0==d&&(!0!=window[a+".registered"]&&!f)&&(b.pkgRefCount++,"java"==a&&(a="core"),b.loadClass(a+".package",function(){b.pkgRefCount--;0==b.pkgRefCount&&b.runtimeLoaded()},!0))}};b.pkgRefCount=0;b.jarClasspath=function(a,c){c instanceof Array||(c=[classes]);b.unwrapArray(c);for(var d=0;d<c.length;d++)b.classpathMap["#"+c[d]]=
a;b.classpathMap["$"+a]=c};b.registerPackages=function(d,e){b.checkInteractive();for(var f=b.getClasspathFor(d+".*",!0),g=0;g<e.length;g++)null!=window.Clazz&&a.declarePackage(d+"."+e[g]),b.packageClasspath(d+"."+e[g],f)};b.multipleSites=function(a){var c=window["j2s.update.delta"];if(null!=c&&c instanceof Array&&3<=c.length)for(var d=null,e=null,f=0;f<c.length/3;f++){var g=c[f+f+f];"$"!=g&&(d=g);g=c[f+f+f+1];"$"!=g&&(e=g);var g=c[f+f+f+2],h=d+"/"+g,j=a.indexOf(h);if(-1!=j&&j==a.length-h.length){a=
a.substring(0,j)+e+"/"+g;break}}c=a.length;if(1<b.maxLoadingThreads&&(15<c&&"http://archive."==a.substring(0,15)||9<c&&"http://a."==a.substring(0,9)))if(d=a.lastIndexOf("/"),d<c-3)return e=a.charCodeAt(d+1),f=a.charCodeAt(d+2),j=3*(c-d)+5*e+7*f,a.substring(0,7)+"aeiouy".split("")[j%6]+a.substring(8);return a};b.getClasspathFor=function(a,c,d){var e=b.classpathMap["#"+a],f=null;if(null!=e){if(!c&&null==d)return b.multipleSites(e);var g=e.lastIndexOf(a.replace(/\./g,"/"));-1!=g?f=e.substring(0,g):(g=
a.lastIndexOf("."),-1!=g&&(g=e.lastIndexOf(a.substring(0,g).replace(/\./g,"/")),-1!=g&&(f=e.substring(0,g))))}else for(g=a.lastIndexOf(".");-1!=g;){e=a.substring(0,g);f=b.classpathMap["@"+e];if(null!=f)break;g=a.lastIndexOf(".",g-2)}f=b.assureBase(f);if(c)return b.multipleSites(f);if(a.lastIndexOf(".*")==a.length-2)return a=f+a.substring(0,g+1).replace(/\./g,"/"),b.multipleSites(a);null==d?d=".js":"."!=d.charAt(0)&&(d="."+d);a=f+a.replace(/\./g,"/")+d;return b.multipleSites(a)};b.assureBase=function(d){null==
d&&(d=null!=window.Clazz&&null!=a.binaryFolders&&0!=a.binaryFolders.length?a.binaryFolders[0]:null!=b.binaryFolders&&0!=b.binaryFolders.length?b.binaryFolders[0]:"j2s");d.lastIndexOf("/")!=d.length-1&&(d+="/");return d};b.excludeClassMap={};b.ignore=function(){var a=null;1==arguments.length&&arguments[0]instanceof Array&&(a=arguments[0]);if(null==a)for(var a=[],c=0;c<arguments.length;c++)a[a.length]=arguments[c];b.unwrapArray(a);for(c=0;c<a.length;c++)b.excludeClassMap["@"+a[c]]=!0};b.isClassExcluded=
function(a){return!0==b.excludeClassMap["@"+a]};b.scriptLoading=function(){};b.scriptLoaded=function(){};b.scriptInited=function(){};b.scriptCompleted=function(){};b.classUnloaded=function(){};b.classReloaded=function(){};b.globalLoaded=function(){};b.keepOnLoading=!0;b.mapPath2ClassNode={};b.xhrOnload=function(d,e){if(400<=d.status||null==d.responseText||0==d.responseText.length){a.alert("xhronload error"+d.responseText);var f=b.failedScripts;null==f[e]?(f[e]=1,b.loadedScripts[e]=!1,b.loadScript(e,
"xhrOnload 2nd try")):(a.alert("[Java2Script] ClazzLoader.xhrOnload Error in loading "+e+"!"),b.tryToLoadNext(e))}else b.evaluate(e,d.responseText)};b.evaluate=function(d,e){try{eval(e)}catch(f){var g="[Java2Script] Script error: "+f.message+" \n"+d+"\n\n"+e;alert(g);a.alert(g);throw f;}b.scriptLoaded(d);b.tryToLoadNext(d)};b.emptyOnRSC=function(){};b.failedScripts={};b.failedHandles={};b.takeAnotherTry=!0;b.generateRemovingFunction=function(a){return function(){if("interactive"!=a.readyState){try{null!=
a.parentNode&&a.parentNode.removeChild(a)}catch(b){}a=null}}};b.removeScriptNode=function(a){window["j2s.script.debugging"]||window.setTimeout(b.generateRemovingFunction(a),1)};b.generatingXHROnload=function(a,c){return function(){b.xhrOnload(a,c);c=a=null}};b.generatingXHRCallback=function(a,c){return function(){if(4==a.readyState){0<b.inLoadingThreads&&b.inLoadingThreads--;var d=b.generatingXHROnload(a,c);isActiveX?(a.onreadystatechange=b.emptyOnRSC,window.setTimeout(d,0>b.loadingTimeLag?0:b.loadingTimeLag)):
(a.onreadystatechange=null,0<=b.loadingTimeLag?window.setTimeout(d,b.loadingTimeLag):b.xhrOnload(a,c));c=a=null}}};b.loadingNextByPath=function(a){0<=b.loadingTimeLag?window.setTimeout(function(){b.tryToLoadNext(a)},b.loadingTimeLag):b.tryToLoadNext(a)};b.ieToLoadScriptAgain=function(a,c){return window.setTimeout(function(){b.takeAnotherTry&&(b.failedScripts[a]=0,b.loadedScripts[a]=!1,0<b.inLoadingThreads&&b.inLoadingThreads--,b.loadScript(a,"ietoloadscriptAgain"))},c?500:15E3)};b.w3cFailedLoadingTest=
function(a){return window.setTimeout(function(){a.onerror();a=a.timeoutHandle=null},500)};b.generatingW3CScriptOnCallback=function(d,e){return function(){e&&a.__debuggingBH&&a.alert("############ forError="+e+" path="+d+" ####"+(e?"NOT":"")+"LOADED###");b.isGecko&&null!=this.timeoutHandle&&(window.clearTimeout(this.timeoutHandle),this.timeoutHandle=null);0<b.inLoadingThreads&&b.inLoadingThreads--;this.onerror=this.onload=null;if(e){var f=b.failedScripts;if(null==f[d]&&b.takeAnotherTry){f[d]=1;e||
(b.innerLoadedScripts[this.src]=!1);b.loadedScripts[d]=!1;b.loadScript(d,"w3c script failed");b.removeScriptNode(this);return}e&&b.scriptLoaded(d)}else b.scriptLoaded(d);b.loadingNextByPath(d);b.removeScriptNode(this)}};b.generatingIEScriptOnCallback=function(d){return function(){var e=b.failedHandles,f=b.failedScripts,g=""+this.readyState,h="loading"==g&&(0==this.src.indexOf("file:")||"file:"==window.location.protocol&&0!=this.src.indexOf("http"));if("loaded"!=g&&"complete"!=g){if(null==f[d]){e[d]=
b.ieToLoadScriptAgain(d,h);return}if(1==f[d])return}null!=e[d]&&(window.clearTimeout(e[d]),e[d]=null);if((h||"loaded"==g)&&!b.innerLoadedScripts[this.src]){if(!h&&(null==f[d]||0==f[d])&&b.takeAnotherTry){0<b.inLoadingThreads&&b.inLoadingThreads--;f[d]=1;b.loadedScripts[d]=!1;b.loadScript(d,"local or loaded failed");b.removeScriptNode(this);return}a.alert("[Java2Script] generatingIEScriptOnCallback Error in loading "+d+"!")}0<b.inLoadingThreads&&b.inLoadingThreads--;b.scriptLoaded(d);this.onreadystatechange=
null;b.loadingNextByPath(d);b.removeScriptNode(this)}};a.transport=null;b.loadScript=function(d,e,f){a.currentPath=d;f=!0==f;if(b.loadedScripts[d]&&!f)b.tryToLoadNext(d);else{b.loadedScripts[d]=!0;for(var g=b.classQueue,h=0;h<g.length;h++)if(g[h]==d){for(var j=h;j<g.length-1;j++)g[h]=g[h+1];g.length--;break}System.out.println("\t"+d.substring(4)+(e?"\n -- required by "+e:""));if(b.isUsingXMLHttpRequest)if(b.scriptLoading(d),b.isAsynchronousLoading){if(!a.transport){if(window.XMLHttpRequest)a.transport=
new XMLHttpRequest;else try{a.transport=new ActiveXObject("Msxml2.XMLHTTP")}catch(m){a.transport=new ActiveXObject("Microsoft.XMLHTTP")}if(null==a.transport){a.alert("[Java2Script] XMLHttpRequest not supported!");return}}f=a.transport;try{f.open("GET",d,b.isAsynchronousLoading)}catch(p){alert(p+" "+d)}f.onreadystatechange=b.generatingXHRCallback(f,d);b.inLoadingThreads++;try{f.send(null)}catch(q){a.alert("[Java2Script] Loading file error: "+q.message),b.xhrOnload(f,d)}}else self.Jmol?f=Jmol._getFileData(d):
(e=jQuery.ajax({type:"GET",dataType:"text",async:!1,url:d,cached:!0}),f=e.responseText,null==f&&e.state&&(f="alert('error loading file "+d+" state="+e.state()+"')")),b.evaluate(d,f);else if(e=document.createElement("SCRIPT"),e.type="text/javascript",e.src=b.isChrome&&b.reloadingClasses[d]?d+"?"+Math.floor(1E5*Math.random()):d,g=document.getElementsByTagName("HEAD")[0],f)g.appendChild(e);else{e.defer=!0;if("undefined"==typeof e.onreadystatechange||!b.isIE){if(b.isGecko&&(0==d.indexOf("file:")||"file:"==
window.location.protocol&&0!=d.indexOf("http")))e.timeoutHandle=b.w3cFailedLoadingTest(e);e.onload=b.generatingW3CScriptOnCallback(d,!1);e.onerror=b.generatingW3CScriptOnCallback(d,!0);b.isOpera&&(b.needOnloadCheck=!0)}else b.needOnloadCheck=!0,e.onreadystatechange=b.generatingIEScriptOnCallback(d);b.inLoadingThreads++;g.appendChild(e);b.scriptLoading(d)}}};b.isResourceExisted=function(a,b,c){if(null!=a&&null!=document.getElementById(a))return!0;if(null!=b){var d=b;null!=c&&0==b.indexOf(c)&&(d=b.substring(c.length));
if(b.lastIndexOf(".css")==b.length-4){var e=document.getElementsByTagName("LINK");for(b=0;b<e.length;b++){var f=e[b].href;c=f.lastIndexOf(d);if(-1!=c&&c==f.length-d.length)return!0}if(!0==window["css."+a])return!0}else if(b.lastIndexOf(".js")==b.length-4){a=document.getElementsByTagName("SCRIPT");for(b=0;b<a.length;b++)if(e=a[b].src,c=e.lastIndexOf(d),-1!=c&&c==e.length-d.length)return!0}}return!1};b.queueBe4SWT=[];b.lockQueueBe4SWT=!0;b.isLoadingEntryClass=!0;b.besidesJavaPackage=!1;b.tryToLoadNext=
function(a){if(b.lockQueueBe4SWT&&0!=b.pkgRefCount&&a.lastIndexOf("package.js")!=a.length-10&&!b.isOpera){var c=b.queueBe4SWT;c[c.length]=a}else{var e=b.mapPath2ClassNode["@"+a];if(null!=e){var f=b.classpathMap["$"+a];if(null!=f)for(a=0;a<f.length;a++){var h=f[a];if(h!=e.name)if(c=b.findClass(h),null!=c)c.status<d.STATUS_CONTENT_LOADED&&(c.status=d.STATUS_CONTENT_LOADED,b.updateNode(c));else{c=new d;c.name=h;var j=b.classpathMap["#"+h];null==j&&(alert(h),error("Java2Script implementation error! Please report this bug!"));
c.path=j;b.mappingPathNameNode(c.path,h,c);c.status=d.STATUS_CONTENT_LOADED;b.addChildClassNode(b.clazzTreeRoot,c,-1);b.updateNode(c)}}if(e instanceof Array)for(a=0;a<e.length;a++)e[a].status<d.STATUS_CONTENT_LOADED&&(e[a].status=d.STATUS_CONTENT_LOADED,b.updateNode(e[a]));else if(e.status<d.STATUS_CONTENT_LOADED){c=!1;f=document.getElementsByTagName("SCRIPT");for(a=0;a<f.length;a++)if(b.isIE){if(null!=f[a].onreadystatechange&&f[a].onreadystatechange.path==e.path&&"interactive"==f[a].readyState){c=
!0;break}}else if(null!=f[a].onload&&f[a].onload.path==e.path){c=!0;break}c||(e.status=d.STATUS_CONTENT_LOADED,b.updateNode(e))}if(b.keepOnLoading){e=!1;c=b.findNextMustClass(b.clazzTreeRoot,d.STATUS_KNOWN);if(null!=c)for(b.loadClassNode(c);b.inLoadingThreads<b.maxLoadingThreads;){a=b.findNextMustClass(b.clazzTreeRoot,d.STATUS_KNOWN);if(null==a)break;b.loadClassNode(a)}else if(f=b.classQueue,0!=f.length){c=f[0];for(a=0;a<f.length-1;a++)f[a]=f[a+1];f.length--;!b.loadedScripts[c.path]||0!=f.length||
!b.isLoadingEntryClass||null!=c.musts&&0!=c.musts.length||null!=c.optionals&&0!=c.optionals.length?(b.addChildClassNode(b.clazzTreeRoot,c,1),b.loadScript(c.path,c.requiredBy)):b.isLoadingEntryClass&&(b.isLoadingEntryClass=!1)}else if(c=b.findNextOptionalClass(d.STATUS_KNOWN),null!=c)for(b.loadClassNode(c);b.inLoadingThreads<b.maxLoadingThreads;){a=b.findNextOptionalClass(d.STATUS_KNOWN);if(null==a)break;b.loadClassNode(a)}else e=!0;if(e&&0==b.inLoadingThreads){for(;null!=(c=b.findNextMustClass(b.clazzTreeRoot,
d.STATUS_CONTENT_LOADED));)b.updateNode(c);for(a=null;null!=(c=b.findNextOptionalClass(d.STATUS_CONTENT_LOADED));)a===c&&(c.status=d.STATUS_OPTIONALS_LOADED),b.updateNode(c),a=c;for(;!(b.tracks=[],!b.checkOptionalCycle(b.clazzTreeRoot)););for(a=null;null!=(c=b.findNextMustClass(b.clazzTreeRoot,d.STATUS_DECLARED))&&a!==c;)b.updateNode(c),a=c;for(a=null;null!=(c=b.findNextOptionalClass(d.STATUS_DECLARED))&&a!==c;)b.updateNode(c),a=c;for(e=[];null!=(c=b.findNextMustClass(b.clazzTreeRoot,d.STATUS_DECLARED));)e[e.length]=
c,c.status=d.STATUS_OPTIONALS_LOADED;for(;null!=(c=b.findNextOptionalClass(d.STATUS_DECLARED));)e[e.length]=c,c.status=d.STATUS_OPTIONALS_LOADED;for(a=0;a<e.length;a++)b.destroyClassNode(e[a]);for(a=0;a<e.length;a++)c=e[a].optionalsLoaded,null!=c&&(e[a].optionalsLoaded=null,c());b.globalLoaded()}}}}};b.tracks=[];b.checkOptionalCycle=function(a){for(var c=b.tracks,e=c.length,f=-1,h=0;h<c.length;h++)if(c[h]===a&&c[h].status>=d.STATUS_DECLARED){f=h;break}c[c.length]=a;if(-1!=f){for(h=f;h<c.length;h++){c[h].status=
d.STATUS_OPTIONALS_LOADED;b.destroyClassNode(c[h]);for(a=0;a<c[h].parents.length;a++)b.updateNode(c[h].parents[a]);c[h].parents=[];a=c[h].optionalsLoaded;null!=a&&(c[h].optionalsLoaded=null,a())}c.length=0;return!0}for(h=0;h<a.musts.length;h++)if(a.musts[h].status==d.STATUS_DECLARED&&b.checkOptionalCycle(a.musts[h]))return!0;for(h=0;h<a.optionals.length;h++)if(a.optionals[h].status==d.STATUS_DECLARED&&b.checkOptionalCycle(a.optionals[h]))return!0;c.length=e;return!1};b.updateNode=function(a){if(null==
a.name||a.status>=d.STATUS_OPTIONALS_LOADED)b.destroyClassNode(a);else{var c=!1;if(null==a.musts||0==a.musts.length||null==a.declaration)c=!0;else for(var c=!0,e=a.musts.length,f=e-1;0<=f;f--){var h=a.musts[f];h.requiredBy=a;if(h.status<d.STATUS_DECLARED){if(b.isClassDefined(h.name)){var j=[];h.status=d.STATUS_OPTIONALS_LOADED;b.destroyClassNode(h);if(null!=h.declaration&&null!=h.declaration.clazzList){for(var m=h.declaration.clazzList,p=0;p<m.length;p++){var q=b.findClass(m[p]);q.status!=d.STATUS_OPTIONALS_LOADED&&
q!==h&&(q.status=h.status,q.declaration=null,b.destroyClassNode(q),null!=q.optionalsLoaded&&(j[j.length]=q))}h.declaration=null}null!=h.optionalsLoaded&&(j[j.length]=h);for(p=0;p<j.length;p++)h=j[p].optionalsLoaded,null!=h&&(j[p].optionalsLoaded=null,h())}else h.status==d.STATUS_CONTENT_LOADED&&b.updateNode(h),h.status<d.STATUS_DECLARED&&(c=!1);a.musts.length!=e&&(f=e=a.musts.length,c=!0)}}if(c){if(a.status<d.STATUS_DECLARED&&(f=a.declaration,null!=f&&(!1==f.executed?(f(),f.executed=!0):f()),a.status=
d.STATUS_DECLARED,null!=b.definedClasses&&(b.definedClasses[a.name]=!0),b.scriptInited(a.path),null!=a.declaration&&null!=a.declaration.clazzList)){m=a.declaration.clazzList;for(p=0;p<m.length;p++)q=b.findClass(m[p]),q.status!=d.STATUS_DECLARED&&q!==a&&(q.status=d.STATUS_DECLARED,null!=b.definedClasses&&(b.definedClasses[q.name]=!0),b.scriptInited(q.path))}c=d.STATUS_DECLARED;m=!1;if((null==a.optionals||0==a.optionals.length)&&(null==a.musts||0==a.musts.length)||a.status>d.STATUS_KNOWN&&null==a.declaration)m=
!0;else{m=!0;for(f=0;f<a.musts.length;f++)if(h=a.musts[f],h.status<d.STATUS_OPTIONALS_LOADED){m=!1;break}if(m)for(f=0;f<a.optionals.length;f++)if(h=a.optionals[f],h.status<d.STATUS_OPTIONALS_LOADED){m=!1;break}}if(m){c=d.STATUS_OPTIONALS_LOADED;a.status=c;b.scriptCompleted(a.path);h=a.optionalsLoaded;if(null!=h&&(a.optionalsLoaded=null,h(),!b.keepOnLoading))return!1;b.destroyClassNode(a);if(null!=a.declaration&&null!=a.declaration.clazzList){m=a.declaration.clazzList;for(p=0;p<m.length;p++)if(q=b.findClass(m[p]),
q.status!=c&&q!==a){q.status=c;q.declaration=null;b.scriptCompleted(q.path);h=q.optionalsLoaded;if(null!=h&&(q.optionalsLoaded=null,h(),!b.keepOnLoading))return!1;b.destroyClassNode(a)}}}b.updateParents(a,c)}}};b.updateParents=function(a,c){if(!(null==a.parents||0==a.parents.length)){for(var e=0;e<a.parents.length;e++){var f=a.parents[e];f.status>=c||b.updateNode(f)}c==d.STATUS_OPTIONALS_LOADED&&(a.parents=[])}};b.findNextMustClass=function(a,c){if(null!=a){if(null!=a.musts&&0!=a.musts.length)for(var e=
0;e<a.musts.length;e++){var f=a.musts[e];if(f.status==c&&(c!=d.STATUS_KNOWN||!0!=b.loadedScripts[f.path])&&(c==d.STATUS_DECLARED||!b.isClassDefined(f.name)))return f;f=b.findNextMustClass(f,c);if(null!=f)return f}if(a.status==c&&(c!=d.STATUS_KNOWN||!0!=b.loadedScripts[a.path])&&(c==d.STATUS_DECLARED||!b.isClassDefined(a.name)))return a}return null};b.usedRandoms={};b.usedRandoms["r0.13412"]=0.13412;b.findNextOptionalClass=function(a){for(var c=0;;){var c=Math.random(),d="r"+c;if(b.usedRandoms[d]!=
c){b.usedRandoms[d]=c;break}}b.clazzTreeRoot.random=c;return b.findNodeNextOptionalClass(b.clazzTreeRoot,a)};b.findNodeNextOptionalClass=function(a,c){var e=b.clazzTreeRoot.random;if(null!=a.musts&&0!=a.musts.length){var f=b.searchClassArray(a.musts,e,c);if(null!=f&&(c!=d.STATUS_KNOWN||!0!=b.loadedScripts[f.path])&&(c==d.STATUS_DECLARED||!b.isClassDefined(f.name)))return f}return null!=a.optionals&&0!=a.optionals.length&&(f=b.searchClassArray(a.optionals,e,c),null!=f&&(c!=d.STATUS_KNOWN||!0!=b.loadedScripts[f.path])&&
(c==d.STATUS_DECLARED||!b.isClassDefined(f.name)))?f:a.status==c&&(c!=d.STATUS_KNOWN||!0!=b.loadedScripts[a.path])&&(c==d.STATUS_DECLARED||!b.isClassDefined(a.name))?a:null};b.searchClassArray=function(a,c,e){for(var f=0;f<a.length;f++){var h=a[f];if(h.status==e&&(e!=d.STATUS_KNOWN||!0!=b.loadedScripts[h.path])&&(e==d.STATUS_DECLARED||!b.isClassDefined(h.name))||h.random!=c&&(h.random=c,h=b.findNodeNextOptionalClass(h,e),null!=h))return h}return null};b.innerLoadedScripts={};b.interactiveScript=null;
b.needOnloadCheck=!1;b.checkInteractive=function(){if(b.needOnloadCheck){var a=b.interactiveScript;if(!(null!=a&&"interactive"==a.readyState)){b.interactiveScript=null;for(var a=document.getElementsByTagName("SCRIPT"),c=0;c<a.length;c++)"interactive"==a[c].readyState&&null!=a[c].onreadystatechange?(b.interactiveScript=a[c],b.innerLoadedScripts[a[c].src]=!0):b.isOpera&&"loaded"==a[c].readyState&&(null!=a[c].src&&0!=a[c].src.length)&&(b.innerLoadedScripts[a[c].src]=!0)}}};b.load=function(a,c,e,f){b.checkInteractive();
if(c instanceof Array){b.unwrapArray(c);for(var h=0;h<c.length;h++)b.load(a,c[h],e,f,c)}else{"$"==c.charAt(0)&&(c="org.eclipse.s"+c.substring(1));var j=b.mapPath2ClassNode["#"+c];if(null==j){var m=b.findClass(c),j=null!=m?m:new d;j.name=c;h=b.classpathMap["#"+c];null==h&&(h="unknown");j.path=h;b.mappingPathNameNode(j.path,c,j);j.status=d.STATUS_KNOWN;b.addChildClassNode(b.clazzTreeRoot,j,-1)}if(null!=a&&0!=a.length){b.unwrapArray(a);for(h=0;h<a.length;h++)if(m=a[h],!(null==m||0==m.length)&&!b.isClassDefined(m)&&
!b.isClassExcluded(m))m=b.findClass(m),null==m&&(m=new d,m.name=a[h],m.status=d.STATUS_KNOWN),m.requiredBy=j,b.addChildClassNode(j,m,1)}5==arguments.length&&null!=f&&(f.status=j.status,f.clazzList=arguments[4]);j.declaration=f;null!=f&&(j.status=d.STATUS_CONTENT_LOADED);if(null!=e&&0!=e.length){b.unwrapArray(e);for(h=0;h<e.length;h++)if(m=e[h],!(null==m||0==m.length)&&!b.isClassDefined(m)&&!b.isClassExcluded(m))m=b.findClass(m),null==m&&(m=new d,m.name=e[h],m.status=d.STATUS_KNOWN),b.addChildClassNode(j,
m,-1)}}};null!=window.Clazz&&(a.load=b.load);b.findClass=function(a){for(var c=0;;){var c=Math.random(),d="r"+c;if(b.usedRandoms[d]!=c){b.usedRandoms[d]=c;break}}b.clazzTreeRoot.random=c;return b.findClassUnderNode(a,b.clazzTreeRoot)};b.findClassUnderNode=function(a,c){var d=b.clazzTreeRoot.random;if(c.name==a)return c;for(var e=0;e<c.musts.length;e++){var f=c.musts[e];if(f.name==a||f.random!=d&&(f.random=d,f=b.findClassUnderNode(a,f),null!=f))return f}for(e=0;e<c.optionals.length;e++)if(f=c.optionals[e],
f.name==a||f.random!=d&&(f.random=d,f=b.findClassUnderNode(a,f),null!=f))return f;return null};b.mappingPathNameNode=function(a,c,d){var e=b.mapPath2ClassNode,f="@"+a;a=e[f];if(null!=a)if(a instanceof Array){for(var f=!1,g=0;g<a.length;g++)if(a[g].name==c){f=!0;break}f||(a[a.length]=d)}else g=[],g[0]=a,g[1]=d,e[f]=g;else e[f]=d;e["#"+c]=d};b.loadClassNode=function(a){var c=a.name;if(!b.isClassDefined(c)&&!b.isClassExcluded(c)){var d=b.getClasspathFor(c);a.path=d;b.mappingPathNameNode(d,c,a);if(!b.loadedScripts[d])return b.loadScript(d,
a.requiredBy),!0}return!1};b.runtimeKeyClass="java.lang.String";b.queueBe4KeyClazz=[];b.getJ2SLibBase=function(){var a=window["j2s.lib"];if(null!=a)return null==a.base&&(a.base="http://archive.java2script.org/"),a.base+("."==a.alias?"":(a.alias?a.alias:a.version?a.version:"1.0.0")+"/");for(var a=document.getElementsByTagName("SCRIPT"),c=0;c<a.length;c++){var d=a[c].src,e=d.indexOf("j2slib.z.js");if(-1!=e)return d.substring(0,e);e=d.indexOf("j2slibcore.z.js");if(-1!=e)return d.substring(0,e);e=b.classpathMap["@java"];
if(null!=e)return e;e=d.indexOf("java/lang/ClassLoader.js");if(-1!=e)return d.substring(0,e)}return null};b.J2SLibBase=null;b.fastGetJ2SLibBase=function(){null==b.J2SLibBase&&(b.J2SLibBase=b.getJ2SLibBase());return b.J2SLibBase};b.assurePackageClasspath=function(a){var c=window[a+".registered"];!1!=c&&(!0!=c&&null==b.classpathMap["@"+a])&&(window[a+".registered"]=!1,c=b.fastGetJ2SLibBase(),null==c&&(c="j2s"),b.packageClasspath(a,c,!0))};b.loadClass=function(e,f,h,j){if("boolean"==typeof f)return a.evalType(e);
b.assurePackageClasspath("java");b.assurePackageClasspath("core");(0==e.indexOf("org.eclipse.swt")||0==e.indexOf("$wt"))&&b.assurePackageClasspath("org.eclipse.swt");0==e.indexOf("junit")&&b.assurePackageClasspath("junit");b.keepOnLoading=!0;if(!h&&(0!=b.pkgRefCount&&e.lastIndexOf(".package")!=e.length-8||!b.isClassDefined(b.runtimeKeyClass)&&0!=e.indexOf("java.")))j=b.queueBe4KeyClazz,j[j.length]=[e,f];else if(!b.isClassDefined(e)&&!b.isClassExcluded(e)){var m=b.getClasspathFor(e),p=b.loadedScripts[m];
j=b.classQueue;if(!p)for(h=j.length-1;0<=h;h--)if(j[h].path==m||j[h].name==e)p=!0;if(p){if(null!=f&&(p=b.findClass(e),null!=p))if(null==p.optionalsLoaded)p.optionalsLoaded=f;else if(f!=p.optionalsLoaded){var q=p.optionalsLoaded;p.optionalsLoaded=function(){q();f()}}}else{p=null;null!=a.unloadedClasses[e]&&(p=b.findClass(e));null==p&&(p=new d);p.name=e;p.path=m;b.mappingPathNameNode(m,e,p);p.optionalsLoaded=f;p.status=d.STATUS_KNOWN;var u=!1;for(h=j.length-1;0<=h;h--)if(j[h].status!=d.STATUS_OPTIONALS_LOADED){u=
!0;break}if(m.lastIndexOf("package.js")==m.length-10){m=!1;for(h=j.length-1;0<=h;h--){e=j[h].name;if(e.lastIndexOf("package.js")==e.length-10){j[h+1]=p;m=!0;break}j[h+1]=j[h]}m||(j[0]=p)}else u&&(j[j.length]=p);u||(e=!1,null!=f&&(e=b.isLoadingEntryClass,b.isLoadingEntryClass=!0),b.addChildClassNode(b.clazzTreeRoot,p,1),b.loadScript(p.path),null!=f&&(b.isLoadingEntryClass=e))}}else if(null!=f&&b.isClassDefined(e)&&(e=b.findClass(e),null==e||e.status>=d.STATUS_OPTIONALS_LOADED))j?window.setTimeout(f,
25):f()};b.loadJ2SApp=function(d,e,f){if(null!=d){var g=d;"$"==d.charAt(0)&&(g="org.eclipse.s"+d.substring(1));var h=-1;if(-1!=(h=g.indexOf("@")))d=g.substring(h+1),b.setPrimaryFolder(d),g=g.substring(0,h),h=g.lastIndexOf("."),-1!=h&&(h=g.substring(0,h),b.packageClasspath(h,d));if(null==e||!(e instanceof Array))e=[];if(null==f){var j=g,m=e;f=function(){a.evalType(j).main(m)}}else f=f(g,e);b.loadClass(g,f)}};b.loadJUnit=function(d,e){b.loadJ2SApp(d,e,function(d){return function(){b.loadClass("junit.textui.TestRunner",
function(){junit.textui.TestRunner.run(a.evalType(d))})}})};b.runtimeLoaded=function(){if(0==b.pkgRefCount&&b.isClassDefined(b.runtimeKeyClass)){for(var a=b.queueBe4KeyClazz,c=0;c<a.length;c++)b.loadClass(a[c][0],a[c][1]);b.queueBe4KeyClazz=[]}};b.loadZJar=function(a,c){var d=c,e=c instanceof Array;e&&(d=c[c.length-1]);b.jarClasspath(a,e?c:[c]);c==b.runtimeKeyClass?b.loadClass(d,b.runtimeLoaded,!0):b.loadClass(d,null,!0)};b._nodeMap={};b._allNodes=[];b.addChildClassNode=function(a,c,d){var e=!1,f=
null;1==d?(f=a.musts,c.requiredBy||(c.requiredBy=a),a.requires||(a.requires=[],a.requiresMap={}),a.requiresMap[c.name]||(a.requiresMap[c.name]=c,a.requires.push[c])):f=a.optionals;b._nodeMap[c.name]||(b._allNodes.push(c),b._nodeMap[c.name]=c);for(d=0;d<f.length;d++)if(f[d].name==c.name){e=!0;break}if(!e){f[f.length]=c;if(0==c.name.indexOf("org.eclipse.swt")||0==c.name.indexOf("$wt"))window["swt.lazy.loading.callback"]=b.swtLazyLoading,b.assurePackageClasspath("org.eclipse.swt");b.isLoadingEntryClass&&
(0!=c.name.indexOf("java")&&0!=c.name.indexOf("net.sf.j2s.ajax"))&&(b.besidesJavaPackage&&(b.isLoadingEntryClass=!1),b.besidesJavaPackage=!0)}e=!1;for(d=0;d<c.parents.length;d++)if(c.parents[d].name==a.name){e=!0;break}!e&&(null!=a.name&&a!=b.clazzTreeRoot&&a!=c)&&(c.parents[c.parents.length]=a)};b.swtLazyLoading=function(){b.lockQueueBe4SWT=!1;for(var a=b.queueBe4SWT,c=0;c<a.length;c++)b.tryToLoadNext(a[c]);b.queueBe4SWT=[]};b.removeFromArray=function(a,b){if(null==b||null==a)return!1;for(var c=
0,d=0;d<b.length;d++)b[d]!==a&&(c<d&&(b[c]=b[d]),c++);b.length=c;return!1};b.destroyClassNode=function(a){var c=a.parents;if(null!=c)for(var d=0;d<c.length;d++)b.removeFromArray(a,c[d].musts)||b.removeFromArray(a,c[d].optionals)};b.unloadClassExt=function(a){null!=b.definedClasses&&(b.definedClasses[a]=!1);if(null!=b.classpathMap["#"+a]){var c=b.classpathMap["#"+a];b.classpathMap["#"+a]=null;for(var e=b.classpathMap["$"+c],f=!1,h=0;h<e.length;h++)if(e[h]==a){for(f=h;f<e.length-1;f++)e[f]=e[f+1];e.length--;
f=!0;break}f&&(b.classpathMap["$"+c]=e)}c=b.findClass(a);null!=c&&(c.status=d.STATUS_KNOWN,b.loadedScripts[c.path]=!1);c=b.getClasspathFor(a);b.loadedScripts[c]=!1;b.innerLoadedScripts[c]&&(b.innerLoadedScripts[c]=!1);b.classUnloaded(a)};b.assureInnerClass=function(b,d){var e=b.__CLASS_NAME__;if(a.unloadedClasses[e]&&-1==e.indexOf("$")){var f=[],e=e+"$",g;for(g in a.unloadedClasses)null!=a.unloadedClasses[g]&&0==g.indexOf(e)&&(f[f.length]=g);if(0!=f.length&&(f=""+d,g=f.indexOf(e),-1!=g)){var h=f.indexOf('"',
g+e.length);-1!=h&&(e=f.substring(g,h),null!=a.unloadedClasses[e]&&(g=f.indexOf("{",h),-1!=g&&(g++,h=f.indexOf("("+e+",",g+3),-1!=h&&(h=f.lastIndexOf("}",h-1),-1!=h&&(f=f.substring(g,h),eval(f),a.unloadedClasses[e]=null)))))}}}})(a,a._Loader,a._Node);a._LoaderProgressMonitor=function(){};var d=a._LoaderProgressMonitor;d.fadeOutTimer=null;d.fadeAlpha=0;d.monitorEl=null;d.lastScrollTop=0;d.bindingParent=null;d.DEFAULT_OPACITY=self.Jmol&&Jmol._j2sLoadMonitorOpacity?Jmol._j2sLoadMonitorOpacity:55;d.clearChildren=
function(a){if(null!=a)for(var b=a.childNodes.length-1;0<=b;b--){var d=a.childNodes[b];if(null!=d){null!=d.childNodes&&0!=d.childNodes.length&&this.clearChildren(d);try{a.removeChild(d)}catch(e){}}}};d.setAlpha=function(a){null!=this.fadeOutTimer&&a==this.DEFAULT_OPACITY&&(window.clearTimeout(this.fadeOutTimer),this.fadeOutTimer=null);this.fadeAlpha=a;navigator.userAgent.toLowerCase();this.monitorEl.style.filter="Alpha(Opacity="+a+")";this.monitorEl.style.opacity=a/100};d.hiddingOnMouseOver=function(){this.style.display=
"none"};d.attached=!1;d.cleanup=function(){d.monitorEl=null;d.bindingParent=null;d.attached=!1};d.createHandle=function(){var a=document.createElement("DIV");a.id="clazzloader-status";a.style.cssText="position:absolute;bottom:4px;left:4px;padding:2px 8px;z-index:"+(window["j2s.lib"].monitorZIndex||1E4)+";background-color:#8e0000;color:yellow;font-family:Arial, sans-serif;font-size:10pt;white-space:nowrap;";a.onmouseover=this.hiddingOnMouseOver;this.monitorEl=a;null==this.bindingParent?document.body.appendChild(a):
this.bindingParent.appendChild(a);return a};d.fadeOut=function(){"none"!=this.monitorEl.style.display&&(this.fadeAlpha==this.DEFAULT_OPACITY?(this.fadeOutTimer=window.setTimeout(function(){d.fadeOut()},750),this.fadeAlpha-=5):0<=this.fadeAlpha-10?(this.setAlpha(this.fadeAlpha-10),this.fadeOutTimer=window.setTimeout(function(){d.fadeOut()},40)):this.monitorEl.style.display="none")};d.getFixedOffsetTop=function(){if(null!=this.bindingParent){var a=this.bindingParent;return a.scrollTop}var b=navigator.userAgent,
a=document.body,d=a.parentNode,e=d.clientHeight,a=a.scrollTop+a.offsetTop,f=d.scrollTop+d.offsetTop;return-1==b.indexOf("Opera")&&document.all?0==e?a:f:-1!=b.indexOf("Gecko")?e==d.offsetHeight&&e==d.scrollHeight?a:f:a};d.showStatus=function(a,b){null==this.monitorEl&&(this.createHandle(),this.attached||(this.attached=!0));this.clearChildren(this.monitorEl);this.monitorEl.appendChild(document.createTextNode(""+a));"none"==this.monitorEl.style.display&&(this.monitorEl.style.display="");this.setAlpha(this.DEFAULT_OPACITY);
var d=this.getFixedOffsetTop();this.lastScrollTop!=d&&(this.lastScrollTop=d,this.monitorEl.style.bottom=this.lastScrollTop+4+"px");b&&this.fadeOut()};null!=window.ClazzLoader&&(ClazzLoader.scriptLoading=function(a){d.showStatus("Loading "+a+"...")},ClazzLoader.scriptLoaded=function(a){d.showStatus(a+" loaded.",!0)},ClazzLoader.globalLoaded=function(){d.showStatus("Application loaded.",!0)},ClazzLoader.classUnloaded=function(a){d.showStatus("Class "+a+" is unloaded.",!0)},ClazzLoader.classReloaded=
function(a){d.showStatus("Class "+a+" is reloaded.",!0)},h=navigator.userAgent.toLowerCase(),-1!=h.indexOf("msie")&&-1==h.indexOf("opera")&&ClazzLoader.setLoadingMode("script",5));var j=a.Console;j.maxTotalLines=1E4;j.setMaxTotalLines=function(a){j.maxTotalLines=0>=a?999999:a};j.maxLatency=40;j.setMaxLatency=function(a){j.maxLatency=0>=a?40:a};j.pinning=!1;j.enablePinning=function(a){j.pinning=a};j.linesCount=0;j.metLineBreak=!1;j.splitNeedFixed=2!="\n".split(/\n/).length;j.splitIntoLineByR=function(a){for(var b=
[],d=0,e=-1;;)if(d=a.indexOf("\r",e+1),-1!=d){if(b[b.length]=a.substring(e+1,d),e=d,e+1==a.length){b[b.length]="";break}}else{b[b.length]=a.substring(e+1);break}return b};j.splitIntoLines=function(a){var b=[];if(null==a)return b;for(var d=0,e=-1;;){var d=a.indexOf("\n",e+1),f=null;-1!=d?(f=0<d&&"\r"==a.charAt(d-1)?a.substring(e+1,d-1):a.substring(e+1,d),e=d):f=a.substring(e+1);for(var f=j.splitIntoLineByR(f),h=0;h<f.length;h++)b[b.length]=f[h];if(-1==d)break;else if(e+1==a.length){b[b.length]="";
break}}return b};j.createConsoleWindow=function(){var a=document.createElement("DIV");a.style.cssText="font-family:monospace, Arial, sans-serif;";document.body.appendChild(a);return a};j.consoleOutput=function(a,b){var d=window["j2s.lib"];(d=d&&d.console)&&"string"==typeof d&&(d=document.getElementById(d));if(!d)return!1;if(j.linesCount>j.maxTotalLines){for(var e=0;e<j.linesCount-j.maxTotalLines;e++)null!=d&&0<d.childNodes.length&&d.removeChild(d.childNodes[0]);j.linesCount=j.maxTotalLines}var f=
!1;a="undefined"==typeof a?"":null==a?"null":""+a;0<a.length&&(e=a.charAt(a.length-1),"\n"==e?(a=1<a.length?"\r"==a.charAt(a.length-2)?a.substring(0,a.length-2):a.substring(0,a.length-1):"",f=!0):"\r"==e&&(a=a.substring(0,a.length-1),f=!0));var h=null;a=a.replace(/\t/g,j.c160);if(j.splitNeedFixed)try{h=j.splitIntoLines(a)}catch(k){window.popup(k.message)}else h=a.split(/\r\n|\r|\n/g);for(e=0;e<h.length;e++){var l=null;if(j.metLineBreak||0==j.linesCount||1>d.childNodes.length)l=document.createElement("DIV"),
d.appendChild(l),l.style.whiteSpace="nowrap",j.linesCount++;else try{l=d.childNodes[d.childNodes.length-1]}catch(v){l=document.createElement("DIV"),d.appendChild(l),l.style.whiteSpace="nowrap",j.linesCount++}var r=document.createElement("SPAN");l.appendChild(r);r.style.whiteSpace="nowrap";null!=b&&(r.style.color=b);0==h[e].length&&(h[e]=String.fromCharCode(160));r.appendChild(document.createTextNode(h[e]));j.pinning||(d.scrollTop+=100);j.metLineBreak=e!=h.length-1?!0:f}f=d.parentNode.className;!j.pinning&&
(null!=f&&-1!=f.indexOf("composite"))&&(d.parentNode.scrollTop=d.parentNode.scrollHeight);j.lastOutputTime=(new Date).getTime()};j.clear=function(){try{j.metLineBreak=!0;var a=window["j2s.lib"],b=a&&a.console;if(b&&(b=document.getElementById(b))){for(var d=b.childNodes,e=d.length-1;0<=e;e--)b.removeChild(d[e]);j.linesCount=0}}catch(f){}};a.alert=function(a){j.consoleOutput(a+"\r\n")};j.c160=String.fromCharCode(160);j.c160+=j.c160+j.c160+j.c160;System.out.print=function(a){j.consoleOutput(a)};System.out.println=
function(a){j.consoleOutput("undefined"==typeof a?"\r\n":null==a?"null\r\n":a+"\r\n")};System.out.write=function(a,b,d){System.out.print(String.instantialize(a).substring(b,b+d))};System.err.__CLASS_NAME__="java.io.PrintStream";System.err.print=function(a){j.consoleOutput(a,"red")};System.err.println=function(a){j.consoleOutput("undefined"==typeof a?"\r\n":null==a?"null\r\n":a+"\r\n","red")};System.err.write=function(a,b,d){System.err.print(String.instantialize(a).substring(b,b+d))};a.setConsoleDiv=
function(a){window["j2s.lib"]&&(window["j2s.lib"].console=a)};a.binaryFolders=a._Loader.binaryFolders=[a._Loader.getJ2SLibBase()]}(Clazz))};