
// two scripts with different title font sizes
var scriptNumber;

/* the code immediately below is mostly a kind gift from Tim Driscoll of molvisions.com.
	It sets up variables for the height and width of the Jmol applet   
	by getting the user's window dimensions. It has been modified to work in this
	context.*/

	
var DOC_WIDTH = 900;
var DOC_HEIGHT = 600;
		
	if (typeof window.innerWidth != "undefined") {
	  DOC_WIDTH = window.innerWidth;
	  DOC_HEIGHT = window.innerHeight;
	}
	else if (typeof document.documentElement.offsetWidth != "undefined") {
	  DOC_WIDTH = document.documentElement.offsetWidth;
	  DOC_HEIGHT = document.documentElement.offsetHeight;
	}
	else {
	  DOC_WIDTH = document.body.offsetWidth;
	  DOC_HEIGHT = document.body.offsetHeight;
	}

// end Tim's code


//"safe" doc dimensions based on screen res less chrome
var appletWidth = (screen.width - 56);
var appletHeight = (screen.height - 220);


//but if their open browser window is larger than this, resize the applet

	
function appletSizer() {

	if (DOC_WIDTH*.95 > appletWidth) {
		appletWidth = DOC_WIDTH*.95;
	}

	if (DOC_HEIGHT*.95 > appletHeight) {
		appletHeight = DOC_HEIGHT*.95;
	}

	if (appletWidth < 801) {
		scriptNumber = 2;
	}
	
	else {
		scriptNumber = 1;
	}
}

var script = new Array();
	script[1] = "script scripts/wa_proteins.spt;" ;	
	script[2] = "script scripts/wa_proteins_small.spt;" ;


function put_jmolApplet(i) {
	jmolSetAppletColor("#000066", "#FF9966", "#FF9966");
	jmolApplet([appletWidth, appletHeight],  script[i]);
	}







/* var appletSize = 300 */
/*  */
/*  */
/* function put_jmolApplet(i) */
/* { */
/* 	jmolSetAppletColor("#000066", "#FF9966", "#FF9966"); */
/* 	jmolApplet(appletSize, script[i]) */
/*  */
/* } */
/*  */
/* function sendToAllApplets(script) {       */
/* 	for (var i=0;i<(howManyApplets);i++) {	 */
/* 	 jmolScript(script, i); */
/* 	 } */
/* } */
/*  */
/* 	var appletSize; */
/* 	var scriptNumber; */
/* 	 */
/* 	function appletSizer() { */
/*  */
/* 		if ((screen.width>=1280) && (screen.height>=854)) { */
/* 			appletSize = [1150, 675]; */
/* 			scriptNumber = 1; */
/* 			 */
/* 		} */
/* 		else if ((screen.width>=1024) && (screen.height>=768)) { */
/* 			appletSize = [950, 625]; */
/* 						scriptNumber = 2; */
/*  */
/* 		} */
/* 		else { //else if ((screen.width<1024) && (screen.height<768)){ */
/*   			appletSize = [730, 460]; */
/* 							scriptNumber = 2; */
/*  */
/* 		}   */
/* 	}  */
/* 	  */
/* 	var script = new Array(); */
/* 		script[1] = "script scripts/wa_proteins.spt;" ;	 */
/* 		script[2] = "script scripts/wa_proteins_small.spt;" ; */

