$(document).ready(function(){var u=document.getElementById("toc"),t,i,r,n;if(u!==null&&(Toc.init({$nav:$("#toc"),$scope:$(".main-text")}),$("body").scrollspy({target:$("#toc")})),t=document.getElementById("jsmol"),t!==null){i=$("#molecule-select option:first").val();Info={width:"100%",height:500,debug:!1,j2sPath:"/content/jsmol/j2s",color:"0xFFFFFF",disableJ2SLoadMonitor:!0,disableInitialConsole:!0,addSelectionOptions:!1,serverURL:"https://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php",use:"HTML5",readyFunction:null,script:"set animationFPS 8;set antialiasdisplay; load "+i};$("#jsmol").html(Jmol.getAppletHtml("jmolApplet",Info));$("#rotate").change(function(){this.checked?Jmol.script(jmolApplet,"spin on"):Jmol.script(jmolApplet,"spin off")});$("#rotate").click();$("#molecule-select").change(function(){Jmol.script(jmolApplet,"load "+this.value);document.getElementById("rotate").checked&&Jmol.script(jmolApplet,"spin on")});$("#display-select").change(function(){switch(this.value){case"ball-and-stick":Jmol.script(jmolApplet,"select all; spacefill 20%; wireframe .15; polyhedra off;");break;case"wire-frame":Jmol.script(jmolApplet,"select all; spacefill off; wireframe .15; polyhedra off;");break;case"space-fill":Jmol.script(jmolApplet,"select all; spacefill 100%; wireframe .15; polyhedra off;");break;case"transparent-tetrahedra":Jmol.script(jmolApplet,"select all; spacefill 20%; wireframe .15; select silicon; polyhedra 2.0; color polyhedra translucent blue; polyhedra EDGES;");break;case"solid-tetrahedra":Jmol.script(jmolApplet,"select silicon or oxygen or aluminum or hydrogen; spacefill off; select all; wireframe off; select silicon; polyhedra 2.0; color polyhedra blue; polyhedra EDGES; select aluminum; polyhedra 2.0; color polyhedra teal; polyhedra EDGES")}})}$(".video-link").click(function(){var t=String($(this).data("target")),i=String($(this).data("source")),n=document.getElementById(t);n.src=i;n.play()});$(".gallery-view").click(function(){document.getElementById("full-image").src="images/"+$(this).data("srcpath");document.getElementById("photo-title").innerHTML=$(this).data("caption")});r=document.getElementsByClassName("correct-problems");r.length>0&&(n=0,$(".problem").each(function(){n++;$(this).find(":radio").each(function(){$(this).attr("name","q"+n)})}),$(".correct-problems").click(function(){$(".problem").each(function(){var n=$(this),t=String($(this).data("answer")),r,i;$(this).find(":radio").each(function(){if($(this).is(":checked")){var i=String(this.value);t===i?(n.removeClass("problem-correct"),n.removeClass("problem-incorrect"),n.addClass("problem-correct")):(n.removeClass("problem-correct"),n.removeClass("problem-incorrect"),n.addClass("problem-incorrect"))}});r=!1;$(this).find(":checkbox").each(function(){$(this).is(":checked")&&(r=!0)});r===!0&&(i=!0,$(this).find(":checkbox").each(function(){t=String($(this).data("selected"));$(this).is(":checked")?t==="true"||(i=!1):t==="true"&&(i=!1)}),i===!0?(n.removeClass("problem-correct"),n.removeClass("problem-incorrect"),n.addClass("problem-correct")):(n.removeClass("problem-correct"),n.removeClass("problem-incorrect"),n.addClass("problem-incorrect")));$(this).find("select").each(function(){var i=String($(this).val());i!==""&&(t===i?(n.removeClass("problem-correct"),n.removeClass("problem-incorrect"),n.addClass("problem-correct")):(n.removeClass("problem-correct"),n.removeClass("problem-incorrect"),n.addClass("problem-incorrect")))})})}))})