	/* This script toggles between stick and ball-and-stick models in the Jmol windows on the page.
	 * It takes the following variable:
	 *		numJmol_int is the number of Jmol windows on the page.
	 *		To work properly, it must be incremented every time a Jmol window is placed.
	 *
	 *	Function setRendering(theRender) sets the rendering to the type specified by setRendering. 
	 *	It cycles through the Jmol windows on the page, according to numJmol_int, and changes their 
	 *	rendering to match theRender.
	 *		theRender is a text variable, and can take values "stick", "ball-stick" and "space"
	 *			for wireframe, ball-and-stick, and spacefilling respectively.
	 *		theParameters is an internal string variable; it is set to the appropriate rendering parameters
	 *
	 *	wireframe parameters: 		"wireframe 0.2; spacefill 0;"
	 *	ball-and-stick parameters:	"wireframe 0.15; spacefill 20%;"
	 *	space-filling:				"wireframe 0; spacefill 90%;
	 */
	 var numJmol_int = 0;
	 function setRendering(theRender) {
	 	var theParameters;
	 	// error check
		switch (theRender) {
			case "stick":		theParameters = "wireframe 0.2; spacefill 0;";
								break;
			case "ball-stick":	theParameters = "wireframe 0.15; spacefill 20%;";
								break;
			case "space":		theParameters = "wireframe 0; spacefill 90%;";
								break;
			default:			alert("Out-of-range error in setRendering: the argument can only have values 'stick', 'ball-stick' or 'space'");
	 	}
		for (var x=0; x<numJmol_int; x++)
			jmolScript(theParameters, x.toString());
		return;
	 }
