'.replace(/ID/g,
f._id+"_localReader")),f._localReader=a.$(f,"localReader"));a.$appEvent(f,"localReader_loadfile","click");a.$appEvent(f,"localReader_loadfile","click",function(){var d=new FileReader;d.onloadend=function(d){d.target.readyState==FileReader.DONE&&(a.$appStyle(f,"localReader",{display:"none"}),c.setData(a._toBytes(d.target.result)))};var e=a.$(f,"localReader_files")[0].files[0];d.readAsArrayBuffer(e)});a.$appEvent(f,"localReader_cancel","click");a.$appEvent(f,"localReader_cancel","click",function(){a.$appStyle(f,
"localReader",{display:"none"});c.setData("#CANCELED#")});a.$appStyle(f,"localReader",{display:"block"})};a._toBytes=function(c){c=new Uint8Array(c);b=Clazz.newByteArray(c.length,0);for(var a=c.length;0<=--a;)b[a]=c[a];return b};a._setConsoleDiv=function(c){self.Clazz&&Clazz.setConsoleDiv(c)};a._setJmolParams=function(c,f,d){for(var e in f)if(0<="'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'".indexOf("'"+
e.toLowerCase()+"'")&&("language"!=e||a.featureDetection.supportsLocalization()))d?c.put(e,!0===f[e]?Boolean.TRUE:!1===f[e]?Boolean.FALSE:f[e]):c[e]=f[e]};a._registerApplet=function(c,f){return window[c]=a._applets[c]=a._applets[f]=f};a._readyCallback=function(c,f,d,e){var g=c.split("_object")[0];a._applets[g]._readyCallback(c,f,d,e)};a._getWrapper=function(c,a){var d=c._height,e=c._width;if("string"!==typeof d||0>d.indexOf("%"))d+="px";if("string"!==typeof e||0>e.indexOf("%"))e+="px";var g="";c._coverImage&&
(g=' onclick="Jmol.coverApplet(ID, false)" title="'+c._coverTitle+'"',g='
"+('")+"
");return(a?
'
').replace(/IMG/,
g).replace(/Hpx/g,d).replace(/Wpx/g,e).replace(/ID/g,c._id)};a._documentWrite=function(c){if(a._document){if(a._isXHTML&&!a._XhtmlElement){var f=document.getElementsByTagName("script");a._XhtmlElement=f.item(f.length-1);a._XhtmlAppendChild=!1}a._XhtmlElement?a._domWrite(c):a._document.write(c);return null}return c};a._domWrite=function(c){for(var f=[0];f[0]
d[0]?-1:0}if(!c||"object"!=typeof c)return[];for(var d=[],e=c.length-1;0<=e;e--)for(var g=0,h=c[e].length;gd.type.indexOf("touch"))return!1;d.preventDefault();var e=a.$offset(c.id),g,h=d.originalEvent;a._mousePageX=d.pageX;a._mousePageY=d.pageY;h.targetTouches&&h.targetTouches[0]?(g=h.targetTouches[0].pageX-e.left,e=h.targetTouches[0].pageY-e.top):h.changedTouches?(g=h.changedTouches[0].pageX-e.left,e=h.changedTouches[0].pageY-e.top):(g=d.pageX-e.left,
e=d.pageY-e.top);return void 0==g?null:[Math.round(g),Math.round(e),a._jsGetMouseModifiers(d)]};a._gestureUpdate=function(c,d){d.stopPropagation();d.preventDefault();var e=d.originalEvent;switch(d.type){case "touchstart":a._touching=!0;break;case "touchend":a._touching=!1}if(!e.touches||2!=e.touches.length)return!1;switch(d.type){case "touchstart":c._touches=[[],[]];break;case "touchmove":var g=a.$offset(c.id),h=c._touches[0],j=c._touches[1];h.push([e.touches[0].pageX-g.left,e.touches[0].pageY-g.top]);
j.push([e.touches[1].pageX-g.left,e.touches[1].pageY-g.top]);e=h.length;3e?-1:1,0,d]);return!1});a.$bind(c,"contextmenu",function(){return!1});a.$bind(c,"mouseout",function(){c.applet._applet&&c.applet._applet.viewer.startHoverWatcher(!1);c.isDragging=!1});a.$bind(c,"mouseenter",function(d){c.applet._applet&&c.applet._applet.viewer.startHoverWatcher(!0);if(0===d.buttons||0===d.which){c.isDragging=
!1;d=a._jsGetXY(c,d);if(!d)return!1;c.applet._processEvent(502,d)}});c.applet._is2D&&a.$resize(function(){c.applet&&c.applet._resize()});a.$bind("body","mouseup touchend",function(){c.applet&&(c.isDragging=!1)})};a._jsUnsetMouse=function(c){c.applet=null;a.$bind(c,"mousedown touchstart mousemove touchmove mouseup touchend DOMMouseScroll mousewheel contextmenu mouseout mouseenter",null)};a._setDraggable=function(c){c=c.prototype;c.setContainer=function(c){this.container=c;this.ignoreMouse=this.isDragging=
!1;var d=this;c.bind("mousedown touchstart",function(c){if(d.ignoreMouse)return d.ignoreMouse=!1,!0;d.isDragging=!0;d.pageX=c.pageX;d.pageY=c.pageY;return!1});c.bind("mousemove touchmove",function(c){if(d.isDragging)return d.mouseMove(c),!1});c.bind("mouseup touchend",function(c){d.mouseUp(c)})};c.mouseUp=function(c){if(this.isDragging)return this.pageX0+=c.pageX-this.pageX,this.pageY0+=c.pageY-this.pageY,this.isDragging=!1};c.setPosition=function(){if(null===a._mousePageX){var c=a.$offset(this.applet._id+
"_"+(this.applet._is2D?"canvas2d":"canvas"));a._mousePageX=c.left;a._mousePageY=c.top}this.pageX0=a._mousePageX;this.pageY0=a._mousePageY;this.container.css({top:a._mousePageY+"px",left:a._mousePageX+"px"})};c.mouseMove=function(c){this.isDragging&&this.container.css({top:this.pageY0+(c.pageY-this.pageY)+"px",left:this.pageX0+(c.pageX-this.pageX)+"px"})};c.dragBind=function(c){this.container.unbind("mousemoveoutjsmol");this.container.unbind("touchmoveoutjsmol");this.container.unbind("mouseupoutjsmol");
this.container.unbind("touchendoutjsmol");if(c){var d=this;this.container.bind("mousemoveoutjsmol touchmoveoutjsmol",function(c,a,e){d.mouseMove(e)});this.container.bind("mouseupoutjsmol touchendoutjsmol",function(c,a,e){d.mouseUp(e)})}}}})(Jmol,jQuery);Jmol._grabberOptions=[["$","NCI(small molecules)"],[":","PubChem(small molecules)"]];Jmol.say=function(a){alert(a)};
Jmol._TMApplet=function(a,h,d){this._syncId=(""+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,h);return this};
Jmol._TMApplet._getApplet=function(a,h,d){if(!Jmol.featureDetection.allowHTML5)return null;d||(d=!1);h||(h={});Jmol._addDefaultInfo(h,{color:"#FFFFFF",width:300,height:300,addSelectionOptions:!1,serverURL:"http://chemapps.stolaf.edu/jmol/jsmol/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});h=new Jmol._TMApplet(a,
h,d);return d?h:Jmol._registerApplet(a,h)};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 h=a.prototype;h.spin=function(d){this.__Info.spin=d;this._spin(d)};h._spin=function(d){this._spinThread&&clearTimeout(this._spinThread);if(0==this.spinFPS||0==this.spinRateX&&0==this.spinRateY)d=!1;if(d){var a=this;d=1E3/this.spinFPS;this._mouseDown||(this._rotate(this.spinRateY,this.spinRateX),this._draw());this._spinThread=setTimeout(function(){a._spin(!0)},d)}};h._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()};h._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 d=this.shadeAtoms;(this.shadeAtoms=this.__Info.shadeAtoms||!1)&&!d&&this._setAtomShades()};h._setAtomShades=function(){if(this.atoms)for(var d=this.atoms.length;0<=--d;)this.atoms[d].color50=this._getColor(this.atoms[d].color,0.5)};h._createCanvas=function(d,a){Jmol._setObject(this,d,a);this._color=this._color.replace(/0x/,"#");var g=Jmol._getWrapper(this,!0);Jmol._document?(Jmol._documentWrite(g),this._createCanvas2d(!1),g=""):g+='