(function(a){a.extend(a.support,{iecors:!!window.XDomainRequest});a.support.iecors?a.ajaxTransport(function(a){return{send:function(d,c){var e=new window.XDomainRequest;e.onload=function(){c(200,"OK",{text:e.responseText},{"Content-Type":e.contentType})};a.xhrFields&&(e.onerror=a.xhrFields.error,e.ontimeout=a.xhrFields.timeout);e.open(a.type,a.url);e.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 d;return{send:function(c,e){var h=a.xhr();h.open(a.type,a.url,!1);h.hasOwnProperty("responseType")?h.responseType="arraybuffer":h.overrideMimeType&&h.overrideMimeType("text/plain; charset=x-user-defined");!a.crossDomain&&!c["X-Requested-With"]&&(c["X-Requested-With"]="XMLHttpRequest");try{for(var m in c)h.setRequestHeader(m,c[m])}catch(b){}h.send(a.hasContent&&a.data||null);d=function(){var b=h.status,j="",c=h.getAllResponseHeaders(),l={};try{if(d&&4===h.readyState){d=
void 0;try{l.text="string"===typeof h.responseText?h.responseText:null}catch(m){}try{l.binary=h.response}catch(n){}try{j=h.statusText}catch(p){j=""}!b&&a.isLocal&&!a.crossDomain?b=l.text?200:404:1223===b&&(b=204);e(b,j,l,c)}}catch(r){alert(r),e(-1,r)}};d()},abort:function(){}}}))})(jQuery);
(function(a,f,d,c){function e(d,e){function b(b){a(g).each(function(){self.Jmol&&(0<=e.indexOf("mouseup")||0<=e.indexOf("touchend"))&&Jmol._setMouseOwner(null);var g=a(this);this!==b.target&&!g.has(b.target).length&&g.triggerHandler(e,[b.target,b])})}e=e||d+c;var g=a(),j=d+"."+e+"-special-event";a.event.special[e]={setup:function(){g=g.add(this);1===g.length&&a(f).bind(j,b)},teardown:function(){self.Jmol&&Jmol._setMouseOwner(null);g=g.not(this);0===g.length&&a(f).unbind(j)},add:function(b){var a=
b.handler;b.handler=function(b,g){b.target=g;a.apply(this,arguments)}}}}a.map(d.split(" "),function(a){e(a)});e("focusin","focus"+c);e("focusout","blur"+c)})(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=function(a){var f=9E3,d=0==a.location.href.indexOf("https")?"https":"http";return{_version:"JSmol 13.3.9 11/23/2013 10:51:10 PM",_alertNoBinary:!0,_tracker:"http://chemapps.stolaf.edu/jmol/JmolTracker.htm?id=UA-45940799-1",_isLocal:0==a.location.protocol.toLowerCase().indexOf("file:"),_allowedJmolSize:[25,2048,300],_jarFile:null,_j2sPath:null,_use:null,_j2sLoadMonitorOpacity:55,_applets:{},_asynchronous:!0,_ajaxQueue:[],_ajaxTestSite:d+"://google.com",_z:{header:f,main:f++,image:f++,
top:f++,dialog:f++,menu:f+1E3,fileOpener:f+1001,coverImage:f+2E3},_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","pubchem.ncbi.nlm.nih.gov":"%URL",
$:"http://cactus.nci.nih.gov/chemical/structure/%FILE/file?format=sdf&get3d=True",$$:"http://cactus.nci.nih.gov/chemical/structure/%FILE/file?format=sdf","=":"http://www.rcsb.org/pdb/files/%FILE.pdb","==":"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,_execLog:"",_execStack:[],_isMsie:0<=navigator.userAgent.toLowerCase().indexOf("msie"),_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}}(document));
(function(a,f){a.$=function(b,a){return f(a?"#"+b._id+"_"+a:b)};a._$=function(b){return"string"==typeof b?f("#"+b):b};a.$ajax=function(b){a._ajaxCall=b.url;b.cache="NO"!=b.cache;return f.ajax(b)};a.$appEvent=function(b,g,j,d){b=a.$(b,g);b.off(j)&&d&&b.on(j,d)};a.$after=function(b,a){return f(b).after(a)};a.$bind=function(b,a,j){return j?f(b).bind(a,j):f(b).unbind(a)};a.$get=function(b,a){return f(b).get(a)};a.$attr=function(b,g,j){return a._$(b).attr(g,j)};a.$css=function(b,g){return a._$(b).css(g)};
a.$focus=function(b){return a._$(b).focus()};a.$getAncestorDiv=function(b,a){return f("div."+a+":has(#"+b+")")[0]};a.$html=function(b,g){return a._$(b).html(g)};a.$offset=function(b){return a._$(b).offset()};a.$documentOff=function(b,a){return f(document).off(b,"#"+a)};a.$documentOn=function(b,a,j){return f(document).on(b,"#"+a,j)};a.$windowOn=function(b,a){return f(window).on(b,a)};a.$prop=function(b,g,j){var d=a._$(b);return 3==arguments.length?d.prop(g,j):d.prop(g)};a.$remove=function(b){return a._$(b).remove()};
a.$resize=function(b){return f(window).resize(b)};a.$scrollTo=function(b,g){var j=a._$(b);return j.scrollTop(0>g?j[0].scrollHeight:g)};a.$setSize=function(b,g,j){return a._$(b).width(g).height(j)};a.$setVisible=function(b,g){var j=a._$(b);return g?j.show():j.hide()};a.$submit=function(b){return a._$(b).submit()};a.$supportsIECrossDomainScripting=function(){return f.support.iecors};a.$val=function(b,g){var j=a._$(b);return 1==arguments.length?j.val():j.val(g)};a._clearVars=function(){delete jQuery;
delete f;delete a;self.Clazz&&(delete J,delete JU,delete JSV,delete JZ,delete java,delete Clazz,delete ClassLoader,delete ClassLoaderProgressMonitor,delete JavaObject,delete c$,delete $_A,delete $_AB,delete $_AC,delete $_AD,delete $_AF,delete $_AI,delete $_AL,delete $_AS,delete $_Ab,delete $_B,delete $_C,delete $_D,delete $_E,delete $_F,delete $_G,delete $_H,delete $_I,delete $_J,delete $_K,delete $_L,delete $_M,delete $_N,delete $_O,delete $_P,delete $_Q,delete $_R,delete $_S,delete $_T,delete $_U,
delete $_V,delete $_W,delete $_X,delete $_Y,delete $_Z,delete $_k,delete $_s,delete $t$)};var d=document,c=window,e={};e.ua=navigator.userAgent.toLowerCase();var h;a:{h=["linux","unix","mac","win"];for(var m=h.length;m--;)if(-1!=e.ua.indexOf(h[m])){h=h[m];break a}h="unknown"}e.os=h;e.browser=function(){for(var b=e.ua,a="konqueror webkit omniweb opera webtv icab msie mozilla".split(" "),j=0;j<a.length;j++)if(0<=b.indexOf(a[j]))return a[j];return"unknown"};e.browserName=e.browser();e.browserVersion=
parseFloat(e.ua.substring(e.ua.indexOf(e.browserName)+e.browserName.length+1));e.supportsXhr2=function(){return f.support.cors||f.support.iecors};e.allowDestroy="msie"!=e.browserName;e.allowHTML5="msie"!=e.browserName||0>navigator.appVersion.indexOf("MSIE 8");e.getDefaultLanguage=function(){return navigator.language||navigator.userLanguage||"en-US"};e._webGLtest=0;e.supportsWebGL=function(){if(!a.featureDetection._webGLtest){var b;a.featureDetection._webGLtest=c.WebGLRenderingContext&&((b=d.createElement("canvas")).getContext("webgl")||
b.getContext("experimental-webgl"))?1:-1}return 0<a.featureDetection._webGLtest};e.supportsLocalization=function(){for(var b=d.getElementsByTagName("meta"),a=b.length;0<=--a;)if(0<=b[a].outerHTML.toLowerCase().indexOf("utf-8"))return!0;return!1};e.supportsJava=function(){if(!a.featureDetection._javaEnabled){if(a._isMsie)return!0;a.featureDetection._javaEnabled=navigator.javaEnabled()?1:-1}return 0<a.featureDetection._javaEnabled};e.compliantBrowser=function(){var b=!!d.getElementById,a=e.os;if("opera"==
e.browserName&&7.54>=e.browserVersion&&"mac"==a||"webkit"==e.browserName&&125.12>e.browserVersion||"msie"==e.browserName&&"mac"==a||"konqueror"==e.browserName&&3.3>=e.browserVersion)b=!1;return b};e.isFullyCompliant=function(){return e.compliantBrowser()&&e.supportsJava()};e.useIEObject="win"==e.os&&"msie"==e.browserName&&5.5<=e.browserVersion;e.useHtml4Object="mozilla"==e.browserName&&5<=e.browserVersion||"opera"==e.browserName&&8<=e.browserVersion||"webkit"==e.browserName;e.hasFileReader=c.File&&
c.FileReader;a.featureDetection=e;a._ajax=function(b){if(!b.async)return a.$ajax(b).responseText;a._ajaxQueue.push(b);1==a._ajaxQueue.length&&a._ajaxDone()};a._ajaxDone=function(){var b=a._ajaxQueue.shift();b&&a.$ajax(b)};a._grabberOptions=[["$","NCI(small molecules)"],[":","PubChem(small molecules)"],["=","RCSB(macromolecules)"]];a._getGrabberOptions=function(b){if(0==a._grabberOptions.length)return"";var g='<input type="text" id="ID_query" onkeypress="if(13==event.which){Jmol._applets[\'ID\']._search();return false}" size="32" value="" />',
j='<button id="ID_submit" onclick="Jmol._applets[\'ID\']._search()">Search</button></nobr>';1==a._grabberOptions.length?(g="<nobr>"+g+'<span style="display:none">',j="</span>"+j):g+="<br /><nobr>";for(var g=g+'<select id="ID_select">',d=0;d<a._grabberOptions.length;d++)var c=a._grabberOptions[d],g=g+('<option value="'+c[0]+'" '+(0==d?"selected":"")+">"+c[1]+"</option>");g=(g+"</select>"+j).replace(/ID/g,b._id);return"<br />"+g};a._getScriptForDatabase=function(b){return"$"==b?a.db._nciLoadScript:
":"==b?a.db._pubChemLoadScript:a.db._fileLoadScript};a._setInfo=function(b,a,d){var c=[],e="";if(0==d.indexOf("ERROR"))e=d;else switch(a){case "=":a=d.split("<dimStructure.structureId>");c=["<table>"];for(d=1;d<a.length;d++)c.push('<tr><td valign=top><a href="javascript:Jmol.search('+b._id+",'="+a[d].substring(0,4)+"')\">"+a[d].substring(0,4)+"</a></td>"),c.push("<td>"+a[d].split("Title>")[1].split("</")[0]+"</td></tr>");c.push("</table>");e=a.length-1+" matches";break;case "$":case ":":break;default:return}b._infoHeader=
e;b._info=c.join("");b._showInfo(!0)};a._loadSuccess=function(b,g){g&&(a._ajaxDone(),g(b))};a._loadError=function(b){a._ajaxDone();a.say("Error connecting to server: "+a._ajaxCall);null!=b&&b()};a._isDatabaseCall=function(b){return 0<=a.db._databasePrefixes.indexOf(b.substring(0,1))};a._getDirectDatabaseCall=function(b,g){if(g&&!a.featureDetection.supportsXhr2())return b;var d=2,c,e=a.db._DirectDatabaseCalls[b.substring(0,d)];e||(e=a.db._DirectDatabaseCalls[c=b.substring(0,--d)]);e&&":"==c&&(c=b.toLowerCase(),
isNaN(parseInt(b.substring(1)))?0==c.indexOf(":smiles:")?(e+="?POST?smiles="+b.substring(8),b=":smiles"):0==c.indexOf(":cid:")?b=":cid/"+b.substring(5):(0==c.indexOf(":name:")?b=b.substring(5):0==c.indexOf(":cas:")&&(b=b.substring(4)),b=":name/"+encodeURIComponent(b.substring(1))):b=":cid/"+b.substring(1));return b=e?e.replace(/\%FILE/,b.substring(d)):b};a._getRawDataFromServer=function(b,g,d,c,e,h){b="?call=getRawDataFromDatabase&database="+b+(0<=g.indexOf("?POST?")?"?POST?":"")+"&query="+encodeURIComponent(g)+
(e?"&encoding=base64":"")+(h?"":"&script="+encodeURIComponent(a._getScriptForDatabase(b)));return a._contactServer(b,d,c)};a._getInfoFromDatabase=function(b,g,d){if("===="==g){var c=a.db._restQueryXml.replace(/QUERY/,d),c={dataType:"text",type:"POST",contentType:"application/x-www-form-urlencoded",url:a.db._restQueryUrl,data:encodeURIComponent(c)+"&req=browser",success:function(c){a._ajaxDone();a._extractInfoFromRCSB(b,g,d,c)},error:function(){a._loadError(null)},async:a._asynchronous};return a._ajax(c)}d=
"?call=getInfoFromDatabase&database="+g+"&query="+encodeURIComponent(d);return a._contactServer(d,function(d){a._setInfo(b,g,d)})};a._extractInfoFromRCSB=function(b,g,d,c){var e=c.length/5;if(0!=e&&4==d.length&&1!=e){d=d.toUpperCase();var h=c.indexOf(d);0<h&&0<="123456789".indexOf(d.substring(0,1))&&(c=d+","+c.substring(0,h)+c.substring(h+5));50<e&&(c=c.substring(0,250));c=c.replace(/\n/g,",");c=a._restReportUrl.replace(/IDLIST/,c);a._loadFileData(b,c,function(d){a._setInfo(b,g,d)})}};a._loadFileData=
function(b,g,d,c){if(a._isDatabaseCall(g)&&(a._setQueryTerm(b,g),g=a._getDirectDatabaseCall(g,!0),a._isDatabaseCall(g))){g=a._getDirectDatabaseCall(g,!1);a._getRawDataFromServer("_",g,d,c);return}b={type:"GET",dataType:"text",url:g,async:a._asynchronous,success:function(b){a._loadSuccess(b,d)},error:function(){a._loadError(c)}};a._checkAjaxPost(b);a._ajax(b)};a._checkAjaxPost=function(b){var a=b.url.indexOf("?POST?");0<a&&(b.data=b.url.substring(a+6),b.url=b.url.substring(0,a),b.type="POST",b.contentType=
"application/x-www-form-urlencoded")};a._contactServer=function(b,g,d){b={dataType:"text",type:"GET",url:a._serverUrl+b,success:function(b){a._loadSuccess(b,g)},error:function(){a._loadError(d)},async:g?a._asynchronous:!1};a._checkAjaxPost(b);return a._ajax(b)};a._setQueryTerm=function(b,g){if(g&&b._hasOptions&&"http://"!=g.substring(0,7)){if(a._isDatabaseCall(g)){var d=g.substring(0,1);g=g.substring(1);g.substring(0,1)==d&&0<="=$".indexOf(d)&&(g=g.substring(1));var c=a._getElement(b,"select");if(c&&
c.options)for(var e=0;e<c.options.length;e++)c[e].value==d&&(c[e].selected=!0)}a._getElement(b,"query").value=g}};a._search=function(b,g,d){1<arguments.length||(g=null);a._setQueryTerm(b,g);g||(g=a._getElement(b,"query").value);if(0==g.indexOf("!"))b._script(g.substring(1));else{g&&(g=g.replace(/\"/g,""));b._showInfo(!1);var c;a._isDatabaseCall(g)?(c=g.substring(0,1),g=g.substring(1)):c=b._hasOptions?a._getElement(b,"select").value:"$";"="==c&&3==g.length&&(g="="+g);var e=c+g;g&&!(0>e.indexOf("?")&&
e==b._thisJmolModel)&&(b._thisJmolModel=e,"$"==c||":"==c?b._jmolFileType="MOL":"="==c&&(b._jmolFileType="PDB"),b._searchDatabase(g,c,d))}};a._searchDatabase=function(b,g,d,c){b._showInfo(!1);return 0<=g.indexOf("?")?(a._getInfoFromDatabase(b,d,g.split("?")[0]),!0):a.db._DirectDatabaseCalls[d]?(b._loadFile(d+g,c),!0):!1};a._syncBinaryOK="?";a._canSyncBinary=function(){if(self.VBArray)return a._syncBinaryOK=!1;if("?"!=a._syncBinaryOK)return a._syncBinaryOK;a._syncBinaryOK=!0;try{var b=new window.XMLHttpRequest;
b.open("text",a._ajaxTestSite,!1);b.hasOwnProperty("responseType")?b.responseType="arraybuffer":b.overrideMimeType&&b.overrideMimeType("text/plain; charset=x-user-defined")}catch(g){return System.out.println("JmolCore.js: synchronous binary file transfer is requested but not available"),a._alertNoBinary&&alert("JmolCore.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 g=a._binaryTypes.length;0<=--g;)if(0<=b.indexOf(a._binaryTypes[g]))return!0;return!1};a._getFileData=function(b){var g=a._isBinaryUrl(b)?"binary":"text",d="binary"==g&&!a._canSyncBinary();d&&(0<=b.indexOf("pdb.gz")&&0==b.indexOf("http://www.rcsb.org/pdb/files/"))&&(b=b.replace(/pdb\.gz/,"pdb"),d=!1,g="text");var c=0<=b.indexOf("?POST?");0==b.indexOf("file:/")&&0!=b.indexOf("file:///")&&(b="file://"+b.substring(5));var e=0>b.indexOf("://")||0==b.indexOf(document.location.protocol)&&
0<=b.indexOf(document.location.host),h=a._isDirectCall(b);if(!e&&a.$supportsIECrossDomainScripting()||d||!e&&!h)return a._getRawDataFromServer("_",b,null,null,d,!0);b=b.replace(/file:\/\/\/\//,"file://");g={dataType:g,async:!1};c?(g.type="POST",g.url=b.split("?POST?")[0],g.data=b.split("?POST?")[1]):(g.type="GET",g.url=b);b=a.$ajax(g);return!b.responseText||self.Clazz&&Clazz.instanceOf(b.response,self.ArrayBuffer)?b.response:b.responseText};a._isDirectCall=function(b){for(var g in a.db._DirectDatabaseCalls)if(0<=
g.indexOf(".")&&0<=b.indexOf(g))return!0;return!1};a._cleanFileData=function(b){return 0<=b.indexOf("\r")&&0<=b.indexOf("\n")?b.replace(/\r\n/g,"\n"):0<=b.indexOf("\r")?b.replace(/\r/g,"\n"):b};a._getFileType=function(b){var a=b.substring(0,1);if("$"==a||":"==a)return"MOL";if("="==a)return"="==b.substring(1,2)?"LCIF":"PDB";b=b.split(".").pop().toUpperCase();return b.substring(0,Math.min(b.length,3))};a._scriptLoad=function(b,a,d,c){var e=b._isJava||!b._noscript||1<d.length;e&&b._script("zap;set echo middle center;echo Retrieving data...");
if(!c)return!1;e?b._script('load "'+a+'"'+d):b._applet.viewer.openFile(a);b._checkDeferred("");return!0};a._loadFileAsynchronously=function(b,d){if(!a.featureDetection.hasFileReader)return b.setData("Local file reading is not enabled in your browser");d._localReader||(a.$after("#"+d._id+"_appletdiv",('<div id="ID" style="z-index:'+a._z.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>').replace(/ID/g,
d._id+"_localReader")),d._localReader=a.$(d,"localReader"));a.$appEvent(d,"localReader_loadfile","click");a.$appEvent(d,"localReader_loadfile","click",function(){var c=a.$(d,"localReader_files")[0].files[0],e=new FileReader;e.onloadend=function(e){e.target.readyState==FileReader.DONE&&(a.$css(a.$(d,"localReader"),{display:"none"}),b.setData(c.name,a._toBytes(e.target.result)))};e.readAsArrayBuffer(c)});a.$appEvent(d,"localReader_cancel","click");a.$appEvent(d,"localReader_cancel","click",function(){a.$css(a.$(d,
"localReader"),{display:"none"});b.setData(null,"#CANCELED#")});a.$css(a.$(d,"localReader"),{display:"block"})};a._toBytes=function(b){b=new Uint8Array(b);for(var a=Clazz.newByteArray(b.length,0),d=b.length;0<=--d;)a[d]=b[d];return a};a._doAjax=function(b,d,c){b=b.toString();if(null!=c)return a._saveFile(b,c);d&&(b+="?POST?"+d);d=a._getFileData(b);return a._processData(d,a._isBinaryUrl(b))};a._saveFile=function(b,d){var c=a._serverUrl;if(a._localFileSaveFunction&&a._localFileSaveFunction(b,d))return"OK";
if(!c)return"Jmol._serverUrl is not defined";var e="string"==typeof d,h=e?"":"base64";e||(d=(JU?JU:J.util).Base64.getBase64(d).toString());b=b.substring(b.lastIndexOf("/")+1);e=0<=b.indexOf(".png")?"image/png":0<=b.indexOf(".jpg")?"image/jpg":"";a._formdiv||(a.$after("body",'<div id="__jsmolformdiv__" style="display:none">          <form id="__jsmolform__" method="post" target="_blank" action="">          <input name="call" value="saveFile"/>          <input id="__jsmolmimetype__" name="mimetype" value=""/>          <input id="__jsmolencoding__" name="encoding" value=""/>          <input id="__jsmolfilename__" name="filename" value=""/>          <textarea id="__jsmoldata__" name="data"></textarea>          </form>          </div>'),
a._formdiv="__jsmolform__");a.$attr(a._formdiv,"action",c+"?"+(new Date).getMilliseconds());a.$val("__jsmoldata__",d);a.$val("__jsmolfilename__",b);a.$val("__jsmolmimetype__",e);a.$val("__jsmolencoding__",h);a.$submit("__jsmolform__");a.$val("__jsmoldata__","");a.$val("__jsmolfilename__","");return"OK"};a._processData=function(b,d){"undefined"==typeof b&&(b="",d=!1);d&&(d=a._canSyncBinary());if(!d)return self.JU&&JU.SB?JU.SB.newS(b):J.util.SB.newS(b);var c;if(Clazz.instanceOf(b,self.ArrayBuffer))return a._toBytes(b);
c=Clazz.newByteArray(b.length,0);for(var e=b.length;0<=--e;)c[e]=b.charCodeAt(e)&255;return c};a._setConsoleDiv=function(b){self.Clazz&&Clazz.setConsoleDiv(b)};a._setJmolParams=function(b,d,c){for(var e in d)if(0<=";progressbar;progresscolor;boxbgcolor;boxfgcolor;allowjavascript;boxmessage;                  ;messagecallback;pickcallback;animframecallback;appletreadycallback;atommovedcallback;                  ;echocallback;evalcallback;hovercallback;language;loadstructcallback;measurecallback;                  ;minimizationcallback;resizecallback;scriptcallback;statusform;statustext;statustextarea;                  ;synccallback;usecommandthread;syncid;appletid;startupscript;".indexOf(";"+
e.toLowerCase()+";")&&("language"!=e||a.featureDetection.supportsLocalization()))c?b.put(e,!0===d[e]?Boolean.TRUE:!1===d[e]?Boolean.FALSE:d[e]):b[e]=d[e]};a._registerApplet=function(b,d){return window[b]=a._applets[b]=a._applets[d]=d};a._readyCallback=function(b,d,c,e){b=b.split("_object")[0];c=c.booleanValue?c.booleanValue():c;a._track(a._applets[b])._readyCallback(b,d,c,e)};a._getWrapper=function(b,d){var c;if(d){var e="";b._coverImage&&(c=' onclick="Jmol.coverApplet(ID, false)" title="'+b._coverTitle+
'"',e='<div id="ID_coverdiv" style="background-color:red;z-index:'+a._z.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%"'+c+"/>"+('<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._z.coverImage+';opacity:0.5;"'+c+" />")+"</div>");c='...<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._z.header+';width:100%;height:100%;position:absolute;top:0px;left:0px;">';var h=b._height,f=b._width;if("string"!==typeof h||0>h.indexOf("%"))h+="px";if("string"!==typeof f||0>f.indexOf("%"))f+="px";c=c.replace(/IMG/,e).replace(/Hpx/g,h).replace(/Wpx/g,f)}else c='......</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 c.replace(/\.\.\./g,"").replace(/[\n\r]/g,"").replace(/ID/g,b._id)};a._documentWrite=function(b){if(a._document){if(a._isXHTML&&!a._XhtmlElement){var d=document.getElementsByTagName("script");a._XhtmlElement=d.item(d.length-1);a._XhtmlAppendChild=!1}a._XhtmlElement?a._domWrite(b):a._document.write(b)}return b};a._domWrite=function(b){for(var d=[0];d[0]<b.length;){var c=a._getDomElement(b,d);if(!c)break;a._XhtmlAppendChild?a._XhtmlElement.appendChild(c):a._XhtmlElement.parentNode.insertBefore(c,
_jmol.XhtmlElement)}};a._getDomElement=function(b,a){var d=document.createElement("span");d.innerHTML=b;a[0]=b.length;return d};a._setObject=function(b,d,c){b._id=d;b.__Info={};for(var e in c)b.__Info[e]=c[e];b._width=c.width;b._height=c.height;b._noscript=!b._isJava&&c.noscript;b._console=c.console;b._console||(b._console=b._id+"_infodiv");"none"==b._console&&(b._console=null);b._color=c.color?c.color.replace(/0x/,"#"):"#FFFFFF";b._disableInitialConsole=c.disableInitialConsole;b._noMonitor=c.disableJ2SLoadMonitor;
a._j2sPath&&(c.j2sPath=a._j2sPath);b._j2sPath=c.j2sPath;b._deferApplet=c.deferApplet;b._deferUncover=c.deferUncover;b._coverImage=!b._isJava&&c.coverImage;b._isCovered=!!b._coverImage;b._coverScript=c.coverScript;b._coverTitle=c.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=c.addSelectionOptions;b._defaultModel=c.defaultModel;b._readyScript=c.script?c.script:"";b._readyFunction=c.readyFunction;b._coverImage&&!b._deferApplet&&(b._readyScript+=";javascript "+d+"._displayCoverImage(false)");b._src=c.src};a._addDefaultInfo=function(b,d){for(var c in d)"undefined"==typeof b[c]&&(b[c]=d[c]);a._use&&(b.use=a._use);"SIGNED"==b.use&&(0>b.jarFile.indexOf("Signed")&&(b.jarFile=b.jarFile.replace(/Applet/,"AppletSigned")),b.use="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 d=0,c=0;c<a._syncedApplets.length;c++){if(a._syncedApplets[c]==b._id)a._syncedApplets[c]=b,a._syncedReady[c]=1;else if(!a._syncedReady[c])continue;d++}d==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 d=0,c=0;c<a._syncedApplets.length;c++)a._syncedApplets[c]==b&&(a._syncedApplets[c]=null),a._syncedApplets[c]&&d++;0<d||a._clearVars()}catch(e){}};a._setSyncReady=function(){a._syncReady=!0;for(var b="",d=0;d<a._syncedApplets.length;d++)a._syncedCommands[d]&&(b+="Jmol.script(Jmol._syncedApplets["+d+"], Jmol._syncedCommands["+d+"]);");setTimeout(b,50)};a._mySyncCallback=function(b,d){if(!a._syncReady||!a._isJmolJSVSync)return 1;for(var c=
0;c<a._syncedApplets.length;c++)0<=d.indexOf(a._syncedApplets[c]._syncKeyword)&&a._syncedApplets[c]._syncScript(d);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 d=(new Function("return "+b))();return!d?null:a&&void 0!=d[a]?d[a]:d};a._sortMessages=function(b){function a(b,d){return b[0]<d[0]?1:b[0]>d[0]?-1:0}if(!b||"object"!=typeof b)return[];
for(var d=[],c=b.length-1;0<=c;c--)for(var e=0,h=b[c].length;e<h;e++)d[d.length]=b[c][e];if(0!=d.length)return d=d.sort(a)};a._setMouseOwner=function(b,d){null==b||d?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,d){if(!b.applet._ready||a._touching&&0>d.type.indexOf("touch"))return!1;d.preventDefault();
var c=a.$offset(b.id),e,h=d.originalEvent;a._mousePageX=d.pageX;a._mousePageY=d.pageY;h.targetTouches&&h.targetTouches[0]?(e=h.targetTouches[0].pageX-c.left,c=h.targetTouches[0].pageY-c.top):h.changedTouches?(e=h.changedTouches[0].pageX-c.left,c=h.changedTouches[0].pageY-c.top):(e=d.pageX-c.left,c=d.pageY-c.top);return void 0==e?null:[Math.round(e),Math.round(c),a._jsGetMouseModifiers(d)]};a._gestureUpdate=function(b,d){d.stopPropagation();d.preventDefault();var c=d.originalEvent;switch(d.type){case "touchstart":a._touching=
!0;break;case "touchend":a._touching=!1}if(!c.touches||2!=c.touches.length)return!1;switch(d.type){case "touchstart":b._touches=[[],[]];break;case "touchmove":var e=a.$offset(b.id),h=b._touches[0],f=b._touches[1];h.push([c.touches[0].pageX-e.left,c.touches[0].pageY-e.top]);f.push([c.touches[1].pageX-e.left,c.touches[1].pageY-e.top]);c=h.length;3<c&&(h.shift(),f.shift());2<=c&&b.applet._processGesture(b._touches)}return!0};a._jsSetMouse=function(b){a.$bind(b,"mousedown touchstart",function(d){a._setMouseOwner(b,
!0);d.stopPropagation();d.preventDefault();b.isDragging=!0;if("touchstart"==d.type&&a._gestureUpdate(b,d))return!1;a._setConsoleDiv(b.applet._console);var c=a._jsGetXY(b,d);if(!c)return!1;2!=d.button&&b.applet._popups&&a.Menu.hidePopups(b.applet._popups);b.applet._processEvent(501,c);return!1});a.$bind(b,"mouseup touchend",function(d){a._setMouseOwner(null);d.stopPropagation();d.preventDefault();b.isDragging=!1;if("touchend"==d.type&&a._gestureUpdate(b,d))return!1;d=a._jsGetXY(b,d);if(!d)return!1;
b.applet._processEvent(502,d);return!1});a.$bind(b,"mousemove touchmove",function(d){d.stopPropagation();d.preventDefault();if("touchmove"==d.type&&a._gestureUpdate(b,d))return!1;d=a._jsGetXY(b,d);if(!d)return!1;b.isDragging||(d[2]=0);b.applet._processEvent(b.isDragging?506:503,d);return!1});a.$bind(b,"DOMMouseScroll mousewheel",function(d){d.stopPropagation();d.preventDefault();b.isDragging=!1;var c=d.originalEvent,c=c.detail?c.detail:("mac"==a.featureDetection.os?1:-1)*c.wheelDelta;d=a._jsGetMouseModifiers(d);
b.applet._processEvent(-1,[0>c?-1:1,0,d]);return!1});a.$bind(b,"contextmenu",function(){return!1});a.$bind(b,"mouseout",function(){b.applet._applet&&b.applet._applet.viewer.startHoverWatcher(!1);b.isDragging=!1});a.$bind(b,"mouseenter",function(d){b.applet._applet&&b.applet._applet.viewer.startHoverWatcher(!0);if(0===d.buttons||0===d.which){b.isDragging=!1;d=a._jsGetXY(b,d);if(!d)return!1;b.applet._processEvent(502,d)}});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._setDraggable=function(b){b=b.prototype;b.setContainer=function(b){this.container=b;b.obj=this;this.ignoreMouse=this.isDragging=!1;var d=this;b.bind("mousedown touchstart",function(b){if(d.ignoreMouse)return d.ignoreMouse=
!1,!0;a._setMouseOwner(d,!0);d.isDragging=!0;d.pageX=b.pageX;d.pageY=b.pageY;return!1});b.bind("mousemove touchmove",function(b){if(d.isDragging&&a._mouseOwner==d)return d.mouseMove(b),!1});b.bind("mouseup touchend",function(b){d.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.container.css({top:this.pageY0+(b.pageY-this.pageY)+"px",left:this.pageX0+(b.pageX-this.pageX)+"px"})};b.dragBind=function(b){this.container.unbind("mousemoveoutjsmol");this.container.unbind("touchmoveoutjsmol");this.container.unbind("mouseupoutjsmol");
this.container.unbind("touchendoutjsmol");a._setMouseOwner(null);if(b){var d=this;this.container.bind("mousemoveoutjsmol touchmoveoutjsmol",function(b,a,c){d.mouseMove(c)});this.container.bind("mouseupoutjsmol touchendoutjsmol",function(b,a,c){d.mouseUp(c)})}}};a.Dialog={count:0,htDialogs:{}};SwingController=a.Dialog;a.Dialog.JSDialog=function(){};a._setDraggable(a.Dialog.JSDialog);a.Dialog.getScreenDimensions=function(b){b.width=f(window).width();b.height=f(window).height()};a.Dialog.dispose=function(b){a.$remove(b.id+
"_mover");delete a.Dialog.htDialogs[b.id];b.container.obj.dragBind(!1);System.out.println("JmolCore.js: dispose "+b.id)};a.Dialog.register=function(b,d){b.id=d+ ++a.Dialog.count;a.Dialog.htDialogs[b.id]=b;System.out.println("JmolCore.js: register "+b.id)};a.Dialog.setDialog=function(b){a._setMouseOwner(null);a.$remove(b.id);System.out.println("removed "+b.id);var d=b.id+"_mover",c=a.$("#"+d),e;System.out.println("JmolCore.js: setDialog "+b.id);c[0]?(c.html(b.html),e=c[0].jd):(a.$after("body","<div id='"+
d+"' style='position:absolute;left:0px;top:0px;'>"+b.html+"</div>"),e=new a.Dialog.JSDialog,c=a.$("#"+d),b.container=c,e.applet=b.manager.viewer.applet,e.setContainer(c),e.dialog=b,e.setPosition(),e.dragBind(!0),c[0].jd=e);a.$bind("#"+b.id+" .JButton","mousedown touchstart",function(){e.ignoreMouse=!0});a.$bind("#"+b.id+" .JComboBox","mousedown touchstart",function(){e.ignoreMouse=!0});a.$bind("#"+b.id+" .JCheckBox","mousedown touchstart",function(){e.ignoreMouse=!0});a.$bind("#"+b.id+" .JTextField",
"mousedown touchstart",function(){e.ignoreMouse=!0});a.$bind("#"+b.id+" .JTable","mousedown touchstart",function(){e.ignoreMouse=!0});a.$bind("#"+b.id+" .JScrollPane","mousedown touchstart",function(){e.ignoreMouse=!0});a.$bind("#"+b.id+" .JEditorPane","mousedown touchstart",function(){e.ignoreMouse=!0})};a.Dialog.setSelected=function(b){a.$prop(b.id,"checked",!!b.selected)};a.Dialog.setSelectedIndex=function(b){a.$prop(b.id,"selectedIndex",b.selectedIndex)};a.Dialog.setText=function(b){a.$prop(b.id,
"value",b.text)};a.Dialog.setVisible=function(b){a.$setVisible(b.id,b.visible)};a.Dialog.click=function(b,d){var c=a.Dialog.htDialogs[b.id];if(c){System.out.println("click "+b+" "+c);var e=c.toString();if(0<=e.indexOf("JCheck"))c.selected=b.checked;else if(0<=e.indexOf("JCombo"))c.selectedIndex=b.selectedIndex;else if(null!=c.text&&(c.text=b.value,d&&13!=(d.charCode||d.keyCode)))return}e=a.Dialog.htDialogs[a.$getAncestorDiv(b.id,"JDialog").id];c=c?c.name:e.registryKey+"/"+b.id;System.out.println("JmolCore.js: click "+
c);e.manager.actionPerformed(c)};a.Dialog.windowClosing=function(b){b=a.Dialog.htDialogs[a.$getAncestorDiv(b.id,"JDialog").id];System.out.println("JmolCore.js: windowClosing "+b.registryKey);b.manager.processWindowClosing(b.registryKey)};a._track=function(b){if(a._tracker&&!a._isLocal)try{var d='<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",d)}catch(c){}delete a._tracker;return b};a.getProfile=function(){window["j2s.doProfile"]=!0;if(self.Clazz)return Clazz.profile=self.JSON&&{},Clazz.getProfile()}})(Jmol,jQuery);Jmol._debugCode=!1;Jmol._grabberOptions=[["$","NCI(small molecules)"],[":","PubChem(small molecules)"]];Jmol.say=function(a){alert(a)};
Jmol._TMApplet=function(a,f,d){this._uniqueId=(""+Math.random()).substring(3);this._id=a;this._is2D=!0;this._isJava=!1;this._ready=!0;this._mouseDown=!1;this._jmolType="Jmol._Canvas2D (TwirlyMol)";if(d)return this;this._createCanvas(a,f);return this};
Jmol._TMApplet._getApplet=function(a,f,d){if(!Jmol.featureDetection.allowHTML5)return null;d||(d=!1);f||(f={});Jmol._addDefaultInfo(f,{color:"#FFFFFF",width:300,height:300,addSelectionOptions:!1,serverURL:"http://your.server.here/jsmol.php",defaultModel:"",readyFunction:null,use:"HTML5",bondWidth:5,shadeAtoms:!1,zoomScaling:1.5,pinchScaling:2,mouseDragFactor:0.5,touchDragFactor:0.15,multipleBondSpacing:4,spinRateX:0,spinRateY:0.5,spinFPS:20,spin:!1,noscript:!0,debug:!1});f=new Jmol._TMApplet(a,f,
d);return d?f:Jmol._registerApplet(a,f)};Jmol.getTMApplet=Jmol._TMApplet._getApplet;
(function(a){a._CPK="#FF1493 #FFFFFF #D9FFFF #CC80FF #C2FF00 #FFB5B5 #909090 #3050F8 #FF0D0D #90E050 #B3E3F5 #AB5CF2 #8AFF00 #BFA6A6 #F0C8A0 #FF8000 #FFFF30 #1FF01F #80D1E3 #8F40D4 #3DFF00 #E6E6E6 #BFC2C7 #A6A6AB #8A99C7 #9C7AC7 #E06633 #F090A0 #50D050 #C88033 #7D80B0 #C28F8F #668F8F #BD80E3 #FFA100 #A62929 #5CB8D1 #702EB0 #00FF00 #94FFFF #94E0E0 #73C2C9 #54B5B5 #3B9E9E #248F8F #0A7D8C #006985 #C0C0C0 #FFD98F #A67573 #668080 #9E63B5 #D47A00 #940094 #429EB0 #57178F #00C900".split(" ");a._elem="X H He Li Be B C N O F Ne Na Mg Al Si P S Cl Ar K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe Cs Ba La Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn Fr Ra Ac Th Pa U Np Pu Am Cm Bk Cf Es".split(" ");
a._elemNo={};var f=a.prototype;f.spin=function(a){this.__Info.spin=a;this._spin(a)};f._spin=function(a){this._spinThread&&clearTimeout(this._spinThread);if(0==this.spinFPS||0==this.spinRateX&&0==this.spinRateY)a=!1;if(a){var c=this;a=1E3/this.spinFPS;this._mouseDown||(this._rotate(this.spinRateY,this.spinRateX),this._draw());this._spinThread=setTimeout(function(){c._spin(!0)},a)}};f._initParams=function(){this.zoom=this.__Info.defaultZoom||100;this.doSpin=this.__Info.spin||!1;this.center2D=[this._canvas.width/
2,this._canvas.height/2,0];this._getCenterAndRadius();this.rotation=new a.M3;this.shadeAtoms=!1;this._setParams()};f._setParams=function(){this.bondWidth=this.__Info.bondWidth||5;this.zoomScaling=this.__Info.zoomScaling||1.5;this.pinchScaling=this.__Info.pinchScaling||1;this.mouseDragFactor=this.__Info.mouseDragFactor||0.5;this.touchDragFactor=this.__Info.touchDragFactor||0.15;this.multipleBondSpacing=this.__Info.multipleBondSpacing||4;this.spinRateX=this.__Info.spinRateX||0;this.spinRateY=this.__Info.spinRateY||
0;this.spinFPS=this.__Info.spinFPS||0;var a=this.shadeAtoms;(this.shadeAtoms=this.__Info.shadeAtoms||!1)&&!a&&this._setAtomShades()};f._setAtomShades=function(){if(this.atoms)for(var a=this.atoms.length;0<=--a;)this.atoms[a].color50=this._getColor(this.atoms[a].color,0.5)};f._createCanvas=function(a,c){Jmol._setObject(this,a,c);this._color=this._color.replace(/0x/,"#");var e=Jmol._getWrapper(this,!0);Jmol._document?(Jmol._documentWrite(e),this._createCanvas2d(!1),e=""):e+='<script type="text/javascript">'+
a+"._createCanvas2d(false)\x3c/script>";e+=Jmol._getWrapper(this,!1);c.addSelectionOptions&&(e+=Jmol._getGrabberOptions(this,""));Jmol._debugAlert&&!Jmol._document&&alert(e);this._code=Jmol._documentWrite(e)};f._readyCallback=function(a,c,e,h){e&&(Jmol._setDestroy(this),this._ready=!0,a=this._readyScript,this._applet=h,this._defaultModel?this._search(this._defaultModel,a?";"+a:""):this._src&&this._loadFile(this._src),this._showInfo(!0),this._showInfo(!1),this._readyFunction&&this._readyFunction(this),
Jmol._setReady(this))};f._createCanvas2d=function(a){var c=document.createElement("canvas"),e=Jmol.$(this,"appletdiv");a&&(e[0].removeChild(this._canvas),Jmol._jsUnsetMouse(this._canvas));a=Math.round(e.width());var h=Math.round(e.height());c.applet=this;this._canvas=c;c.style.width="100%";c.style.height="100%";c.width=a;c.height=h;c.id=this._id+"_canvas2d";e.append(c);setTimeout(this._id+"._start()",10)};f._start=function(){Jmol._jsSetMouse(this._canvas);this._defaultModel?Jmol._search(this,this._defaultModel):
this._src&&this._loadFile(this._src);this._showInfo(!0);this._showInfo(!1)};f._search=function(a,c){Jmol._search(this,a,c)};f._searchDatabase=function(a,c,e){this._showInfo(!1);if(0<=a.indexOf("?"))Jmol._getInfoFromDatabase(this,c,a.split("?")[0]);else{var h=c+a;if(Jmol.db._DirectDatabaseCalls[c])this._loadFile(h,e);else{var f=this;Jmol._getRawDataFromServer(c,a,function(b){f._loadModel(b,"")})}}};f._loadModel=function(a){this._spin(!1);"''"==a&&(a=this._mol);a?(this._parse(a),this._initParams(),
this._draw(),this._showInfo(!1),this.doSpin&&this._spin(!0)):alert("No model data.")};f._showInfo=function(a){Jmol.$html(Jmol.$(this,"infoheaderspan"),this._infoHeader);this._info&&Jmol.$html(Jmol.$(this,"infodiv"),this._info);!this._isInfoVisible!=!a&&(this._isInfoVisible=a,Jmol.$setVisible(Jmol.$(this,"infotablediv"),a),Jmol.$setVisible(Jmol.$(this,"infoheaderdiv"),a),this._show(!a))};f._show=function(a){Jmol.$setVisible(Jmol.$(this,"appletdiv"),a);a&&this._draw()};f._resize=function(){var a="__resizeTimeout_"+
this._id;Jmol[a]&&clearTimeout(Jmol[a]);var c=this;Jmol[a]=setTimeout(function(){c._draw();Jmol[a]=null},100)};f._canScript=function(){return!1};f._loadFile=function(a){this._showInfo(!1);this._thisJmolModel=a;var c=this;Jmol._loadFileData(this,a,function(a){c._loadModel(a)})};f._processEvent=function(a,c){switch(a){case 502:case 503:this._mouseDown=!1;default:return;case 501:this._mouseX=c[0];this._mouseY=c[1];this._mouseDown=!0;return;case 506:var e=c[0]-this._mouseX,h=c[1]-this._mouseY,e=0>e?-1:
0<e?1:0,h=0>h?-1:0<h?1:0;switch(c[2]){case 17:this._zoomBy(h);break;case 24:this.center2D[0]+=e;this.center2D[1]+=h;break;default:this._rotate(e,h)}this._mouseX=c[0];this._mouseY=c[1];break;case -1:this._zoomBy(c[1])}this._draw()};f._processGesture=function(d){if(!(2>d[0].length)){var c=d[0],e=d[1],h=c[0],f=c[e.length-1];d=h[0];var b=f[0],h=h[1],f=f[1],g=[b-d,f-h,0],j=a._length(g),k=e[0],l=e[e.length-1],e=k[0],q=l[0],k=k[1],l=l[1],n=[q-e,l-k,0],p=a._length(n);3>j||3>p||(a._scale(g,1/j),a._scale(n,
1/p),g=a._dot(g,n),0.8<g?(d=Math.round(b-c[c.length-2][0]),c=Math.round(f-c[c.length-2][1]),this.center2D[0]+=d,this.center2D[1]+=c):-0.8>g&&(g=[e-d,k-h,0],n=[q-b,l-f,0],c=a._length(n)-a._length(g),this.zoom+=(0>c?-1:1)*this.pinchScaling),this._draw())}};f._zoomBy=function(a){this.zoom+=a*this.zoomScaling;5>this.zoom&&(this.zoom=5);500<this.zoom&&(this.zoom=500)};f._getRotationScaling=function(){return[1/Math.max(this._canvas.width,500)*this.mouseDragFactor*a.deg_per_radian,1/Math.max(this._canvas.height,
500)*this.mouseDragFactor*a.deg_per_radian]};f._rotate=function(d,c){var e=this._getRotationScaling();c&&(a._m3.rotX(c*e[1]),this.rotation.mul(a._m3));d&&(a._m3.rotY(d*e[0]),this.rotation.mul(a._m3))};f._getCenterAndRadius=function(){Math.min(this._canvas.width,this._canvas.height);for(var d=[999999,999999,999999],c=[-999999,-999999,-999999],e=this.atoms.length;0<=--e;)for(var h=3;0<=--h;){var f=this.atoms[e].xyz[h];f<d[h]&&(d[h]=f);f>c[h]&&(c[h]=f)}f=[0,0,0];for(h=3;0<=--h;)f[h]=(c[h]+d[h])/2;d=
0;for(e=this.atoms.length;0<=--e;)c=this.atoms[e],c=a._distance(c.xyz,f)+(1==c.elemNo?1:1.5),c>d&&(d=c);this.center=f;this.modelRadius=0==d?10:d};f._setScreenCoords=function(){for(var a=this.center,c=this.rotation,e=this.center2D,h=Math.min(this._canvas.width,this._canvas.height)/2/this.modelRadius*this.zoom/100,f=this.atoms.length;0<=--f;){var b=this.atoms[f];this._transform(b.xyz,b.sxyz,a,c,h,e);b.srad=h*b.radius}for(f=this.bonds.length;0<=--f;)b=this.bonds[f],this._transform(b.xyz,b.sxyz,a,c,h,
e),this._transform(b.pts[0],b.spts[0],a,c,h,e),this._transform(b.pts[1],b.spts[1],a,c,h,e)};f._transform=function(d,c,e,h,f,b){for(var g=a._temp1,j=a._temp2,k=3;0<=--k;)g[k]=(d[k]-e[k])*f;h.transform(g,j);j[1]=-j[1];j[2]=-j[2];for(k=3;0<=--k;)c[k]=j[k]+b[k]};f._parse=function(a){this._parseSDF(a)};f._parseSDF=function(d){this._mol=d;if(!a._elemNo.H)for(var c=a._elem.length;0<=--c;)a._elemNo[a._elem[c]]=c;d=d.split("\n");var e=3,h=d[e++];this.nAtoms=parseFloat(h.substring(0,3));this.nBonds=parseFloat(h.substring(3,
6));this.atoms=Array(this.nAtoms);this.bonds=Array(this.nBonds);this.elements=Array(this.nAtoms+this.nBonds);for(var f=0,b,g,j,c=0;c<this.nAtoms;c++){h=d[e++];b=parseFloat(h.substring(0,10));g=parseFloat(h.substring(10,20));j=parseFloat(h.substring(20,30));var h=h.substring(31,34).replace(/\s+/g,""),h=a._elemNo[h]||0,k=1==h?0.23:0.35,l=a._CPK[h]||a._CPK[0];this.elements[f++]=this.atoms[c]={type:0,elemNo:h,xyz:[b,g,j],sxyz:[0,0,0],radius:k,color:l,color50:l}}for(c=0;c<this.nBonds;c++){h=d[e++];b=this.atoms[parseFloat(h.substring(0,
3))-1];g=this.atoms[parseFloat(h.substring(3,6))-1];j=Math.abs(parseFloat(h.substring(6,9)));switch(j){case 4:case 5:case 6:case 8:j=1;break;case 7:j=2}h=a._getPointAlong(b.xyz,g.xyz,0.5);l=a._distance(b.xyz,h);k=b.radius<l?a._getPointAlong(b.xyz,h,b.radius/l):[0,0,99999];l=g.radius<l?a._getPointAlong(g.xyz,h,g.radius/l):[0,0,99999];this.elements[f++]=this.bonds[c]={type:1,atoms:[b,g],xyz:h,pts:[k,l],sxyz:[0,0,0],spts:[[0,0,0],[0,0,0]],order:j,color:0}}};f._getColor=function(a,c){"#FFFFFF"==a&&(a=
"#D0D0D0");var e=parseInt("0x"+a.substring(1),16),h=e>>16&255,f=e>>8&255,e=e&255;255!=h&&(h+=Math.floor((255-h)*c));255!=f&&(f+=Math.floor((255-f)*c));255!=e&&(e+=Math.floor((255-e)*c));h="000000"+(h<<16|f<<8|e).toString(16);return"#"+h.substring(h.length-6,h.length)};f._draw=function(){if(this.atoms){this._setParams();this._setScreenCoords();var d=this.elements;d.sort(a._zorder);var c=this._canvas.getContext("2d");c.fillStyle=this._color;c.fillRect(0,0,this._canvas.width,this._canvas.height);for(var e=
d.length;0<=--e;){var h=d[e];0==h.type?this._drawAtom(c,h):this._drawBond(c,h)}}};f._drawAtom=function(d,c){d.beginPath();if(this.shadeAtoms){var e=c.srad/4,e=d.createRadialGradient(c.sxyz[0]-e,c.sxyz[1]-e,e,c.sxyz[0],c.sxyz[1],c.srad);e.addColorStop(0,c.color50);e.addColorStop(1,"#FFFFFF"==c.color?"#D0D0D0":c.color);d.fillStyle=e;d.arc(c.sxyz[0],c.sxyz[1],c.srad,0,a._pi2);d.fill()}else d.fillStyle=c.color,d.arc(c.sxyz[0],c.sxyz[1],c.srad,0,a._pi2),d.fill(),d.strokeStyle="#000000",d.lineWidth=1,d.stroke()};
f._drawBond=function(a,c){99999!=c.pts[0][2]&&this._drawBondLines(a,c,c.spts[0],c.atoms[0].color);99999!=c.pts[1][2]&&this._drawBondLines(a,c,c.spts[1],c.atoms[1].color)};f._drawBondLines=function(d,c,e,h){var f=a._temp;f.width=this.bondWidth;f.color=c.color?c.color:h;if(1==c.order)f.pt1=e,f.pt2=c.sxyz,this._drawLine(d,f);else{f.pt1=a._temp1;f.pt2=a._temp2;f.pta=e;f.ptb=c.sxyz;f.dx=f.ptb[0]-f.pta[0];f.dy=f.ptb[1]-f.pta[1];f.mag2d=Math.round(Math.sqrt(f.dx*f.dx+f.dy*f.dy));f.bondOrder=c.order;for(this._resetAxisCoordinates(f);0<
f.bondOrder;)this._drawLine(d,f),f.bondOrder--,this._stepAxisCoordinates(f)}};f._drawLine=function(a,c){a.beginPath();a.strokeStyle=c.color;a.moveTo(c.pt1[0],c.pt1[1]);a.lineTo(c.pt2[0],c.pt2[1]);a.lineWidth=c.width;a.stroke()};f._resetAxisCoordinates=function(a){var c=a.mag2d>>3;1!=this.multipleBondSpacing&&(c*=this.multipleBondSpacing);c=a.width+c;a.dxStep=Math.round(c*a.dy/a.mag2d);a.dyStep=Math.round(c*-a.dx/a.mag2d);a.pt1[0]=a.pta[0];a.pt1[1]=a.pta[1];a.pt2[0]=a.ptb[0];a.pt2[1]=a.ptb[1];c=a.bondOrder-
1;a.pt1[0]-=Math.round(a.dxStep*c/2);a.pt1[1]-=Math.round(a.dyStep*c/2);a.pt2[0]-=Math.round(a.dxStep*c/2);a.pt2[1]-=Math.round(a.dyStep*c/2)};f._stepAxisCoordinates=function(a){a.pt1[0]+=a.dxStep;a.pt1[1]+=a.dyStep;a.pt2[0]+=a.dxStep;a.pt2[1]+=a.dyStep};a._distance=function(a,c){for(var e=0,f=3;0<=--f;)var m=a[f]-c[f],e=e+m*m;return Math.sqrt(e)};a._dot=function(a,c){for(var e=0,f=3;0<=--f;)e+=a[f]*c[f];return e};a._setPt=function(a,c){for(var e=3;0<=--e;)c[e]=a[e];return c};a._scale=function(a,
c){for(var e=3;0<=--e;)a[e]*=c};a._length=function(a){for(var c=0,e=3;0<=--e;)c+=a[e]*a[e];return Math.sqrt(c)};a._getPointAlong=function(a,c,e){return[(c[0]-a[0])*e+a[0],(c[1]-a[1])*e+a[1],(c[2]-a[2])*e+a[2]]};a._zorder=function(a,c){var e=a.sxyz[2],f=c.sxyz[2];return e<f?-1:e>f?1:0};a.M3=function(){this.m00=1;this.m10=this.m02=this.m01=0;this.m11=1;this.m21=this.m20=this.m12=0;this.m22=1};a.M3.prototype.set=function(a,c,e,f,m,b,g,j,k){this.m00=a;this.m01=c;this.m02=e;this.m10=f;this.m11=m;this.m12=
b;this.m20=g;this.m21=j;this.m22=k};a.M3.prototype.transform=function(a,c){c[0]=this.m00*a[0]+this.m01*a[1]+this.m02*a[2];c[1]=this.m10*a[0]+this.m11*a[1]+this.m12*a[2];c[2]=this.m20*a[0]+this.m21*a[1]+this.m22*a[2]};a.M3.prototype.rotX=function(a){var c=Math.cos(a);a=Math.sin(a);this.m00=1;this.m10=this.m02=this.m01=0;this.m11=c;this.m12=-a;this.m20=0;this.m21=a;this.m22=c};a.M3.prototype.rotY=function(a){var c=Math.cos(a);a=Math.sin(a);this.m00=c;this.m01=0;this.m02=a;this.m10=0;this.m11=1;this.m12=
0;this.m20=-a;this.m21=0;this.m22=c};a.M3.prototype.mul=function(a){this.set(a.m00*this.m00+a.m01*this.m10+a.m02*this.m20,a.m00*this.m01+a.m01*this.m11+a.m02*this.m21,a.m00*this.m02+a.m01*this.m12+a.m02*this.m22,a.m10*this.m00+a.m11*this.m10+a.m12*this.m20,a.m10*this.m01+a.m11*this.m11+a.m12*this.m21,a.m10*this.m02+a.m11*this.m12+a.m12*this.m22,a.m20*this.m00+a.m21*this.m10+a.m22*this.m20,a.m20*this.m01+a.m21*this.m11+a.m22*this.m21,a.m20*this.m02+a.m21*this.m12+a.m22*this.m22)};a._pi2=2*Math.PI;
a.deg_per_radian=180/Math.PI;a._z3=[0,0,0];a._temp1=[0,0,0];a._temp2=[0,0,0];a._temp={};a._m3=new a.M3})(Jmol._TMApplet);
