function resetMainVars(tut,molecule,structNo)  {	parent.cscurrent = tut;	parent.csmol[1] = molecule;	parent.csresetMol[1] = molecule;	parent.csstructNo = structNo;	parent.csresetStructNo = structNo;	parent.cspushed = "movie00";	parent.cskey = "element";	parent.rightAnswer = true;	parent.quizAnswered = false;}function setCookie(value)  {	var today = new Date();	var expire = new Date();	expire.setTime(today.getTime() + 1000*60*60*24*365);	document.cookie ="csvars=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));}function loadCookie() {	var search = "csvars=";	var content;	var temp;	if (document.cookie.length > 0)  {		offset = document.cookie.indexOf(search);		if (offset != -1)  { 			offset += search.length;			// set index of beginning of value			end = document.cookie.indexOf(";",offset);			// set index of end of cookie value			if (end == -1) end = document.cookie.length;			//alert(unescape(document.cookie.substring(offset,end)));			content = unescape(document.cookie.substring(offset,end));		}		else  {			setCookie("normal!student!passive!true!slow!element!none!1atom.pdb!1atom.pdb!1!movie00!1");			content = "normal!student!passive!true!slow!element!none!1atom.pdb!1atom.pdb!1!movie00!1";			sliceCookie(content);			//location.reload();		}	}	else  {		setCookie("normal!student!passive!true!slow!element!none!1atom.pdb!1atom.pdb!1!movie00!1");		content = "normal!student!passive!true!slow!element!none!1atom.pdb!1atom.pdb!1!movie00!1";		sliceCookie(content);		//location.reload();	}	sliceCookie(content);	return temp;}function showCookie() {	var search = "csvars=";	var content;	if (document.cookie.length > 0)  {		offset = document.cookie.indexOf(search);		if (offset != -1)  { 			offset += search.length;			// set index of beginning of value			end = document.cookie.indexOf(";",offset);			// set index of end of cookie value			if (end == -1) end = document.cookie.length;			content = unescape(document.cookie.substring(offset,end));		}		alert(unescape(document.cookie.substring(offset,end)));	}	else alert("Cookies are not enabled!");}function resetCookie()  {	var content = "normal!student!passive!true!slow!element!none!1atom.pdb!1atom.pdb!1!movie00!1";	if (confirm("You are resetting your cookie to "+content+". Accept this reset?"))  {		setCookie(content);		sliceCookie(content);	}}function sliceCookie(content)  {	var quizReset = false;	var cookieList = new Array();	cookieList = content.split("!");	//for (var i=0;i<cookieList.length;i++)  {alert(cookieList[i]);}	parent.csfontsize = cookieList[0];	parent.csformat = cookieList[1];	if (cookieList[2] != "passive")  {		parent.csquiz = "passive";		quizReset = true;	}	else parent.csquiz = cookieList[2];	parent.csnomenus = cookieList[3];	parent.csaccess = cookieList[4];	parent.cskey = cookieList[5];	parent.cscurrent = cookieList[6];	parent.csmol[1] = cookieList[7];	parent.csresetMol[1] = cookieList[8];	parent.csstructNo = cookieList[9];	parent.cspushed = cookieList[10];	parent.csresetStructNo = cookieList[11];	if (quizReset) saveToCookie();	//else alert("csquiz is already set to " + cookieList[2] + ". Your cookie will not be affected.");}function saveToCookie()  {	var content = parent.csfontsize+"!"+parent.csformat+"!"+parent.csquiz+"!"+parent.csnomenus+"!"+parent.csaccess+"!"+parent.cskey+"!"+parent.cscurrent+"!"+parent.csmol[1]+		"!"+parent.csresetMol[1]+"!"+parent.csstructNo+"!"+parent.cspushed+"!"+parent.csresetStructNo;	//if (confirm(content+" will be your new cookie. Save it?")) 	setCookie(content);}function checkRequired()  {	var check_platform = false;	var check_browser = false;	var check_browserVersion = false;	var check_plugin = false;	var check_pluginVersion = false;	var check_java = false;	var check_cookies = false;	if (navigator.platform.slice(0,3) == "Mac" || navigator.platform.slice(0,3) == "Win")		check_platform = true;	if (navigator.appName == "Netscape") 		check_browser = true;	if (navigator.appVersion.slice(0,3) == "4.5" || navigator.appVersion.slice(0,3) == "4.6" || navigator.appVersion.slice(0,3) == "4.7" || navigator.appVersion.slice(0,4) == "4.08")		check_browserVersion = true;	for (var i=0;i<navigator.plugins.length;i++)  {		var pi = navigator.plugins[i].name.split(" ");		if (pi[1] == "Chime")  {			check_plugin = true;			if (pi[2].slice(0,1) == "2") check_pluginVersion = true;		}	}	if (navigator.javaEnabled()) check_java = true;	var today = new Date();	var expire = new Date();	expire.setTime(today.getTime() + 1000*60*60*24*365);	document.cookie ="l3d=" + escape("1") + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));	if (document.cookie.length > 0) check_cookies = true; 	if (check_platform && check_browser && check_browserVersion && check_plugin && check_pluginVersion && check_java && check_cookies) return true;	else  return false;}function checkSystem()  {	if (checkRequired())  {		status_win = window.open('statusok.html','status_winC','width=300,height=300,screenX=10,screenY=10,scrollbars=1,menubar=0,toolbar=0,status=1,resizable=0');	}	else  {		status_win = window.open('statusno.html','status_winC','width=300,height=300,screenX=10,screenY=10,scrollbars=1,menubar=0,toolbar=0,status=1,resizable=0');	}}function loadTut(tut)  {	var docu = tut + "/fs_" + tut + ".html";	var baseWidth = 640;	if (screen.width<720) baseWidth = 640;		else if (screen.width<912) baseWidth = 800;			else baseWidth = 1024;	if (parent.debugging)  {		switch (baseWidth)  {			case 640 : tut_win = window.open(docu,'tut_winC','width=610,height=415,screenX=1,screenY=1,scrollbars=1,menubar=1,toolbar=0,status=1,resizable=1');break;			case 800 : tut_win = window.open(docu,'tut_winC','width=760,height=525,screenX=1,screenY=1,scrollbars=1,menubar=1,toolbar=0,status=1,resizable=1');break;			case 1024 : tut_win = window.open(docu,'tut_winC','width=990,height=690,screenX=1,screenY=1,scrollbars=1,menubar=1,toolbar=0,status=1,resizable=1');break;			default : 	tut_win = window.open(docu,'tut_winC','width=610,height=415,screenX=1,screenY=1,scrollbars=1,menubar=1,toolbar=0,status=1,resizable=1');		}	}	else  {		switch (baseWidth)  {			case 640 : tut_win = window.open(docu,'tut_winC','width=610,height=415,screenX=1,screenY=1,scrollbars=1,menubar=0,toolbar=0,status=0,resizable=0');break;			case 800 : tut_win = window.open(docu,'tut_winC','width=760,height=540,screenX=1,screenY=1,scrollbars=1,menubar=0,toolbar=0,status=0,resizable=0');break;			case 1024 : tut_win = window.open(docu,'tut_winC','width=990,height=705,screenX=1,screenY=1,scrollbars=1,menubar=0,toolbar=0,status=0,resizable=0');break;			default : 	tut_win = window.open(docu,'tut_winC','width=610,height=415,screenX=1,screenY=1,scrollbars=1,menubar=0,toolbar=0,status=0,resizable=0');		}	}}function openTutorial(tut,structNo,mol1,mol2)	{	if (checkRequired())  {		if (parent.tutOpen) tut_win.focus();		else  {			resetMainVars(tut,mol1,structNo);			loadTut(tut);		}	}	else status_win = window.open('statusno.html','status_winC','width=300,height=300,screenX=10,screenY=10,scrollbars=1,menubar=0,toolbar=0,status=1,resizable=0');}function openHelp(helpPage)  {	var source;	source = "help/" + helpPage + ".html";	//source = "help/outoforder.html";	//if (parent.f_title.helpOpen) help_win.focus();	//else  {		var baseWidth = 640;		if (screen.width<720) baseWidth = 640;			else if (screen.width<912) baseWidth = 800;				else baseWidth = 1024;		switch (baseWidth)  {			case 640 : help_win = window.open(source,'help_winC','width=375,height=360,screenX=125,screenY=10,dependent=0,scrollbars=1,menubar=1,location=0,toolbar=0,status=1,resizable=0');break;			case 800 : help_win = window.open(source,'help_winC','width=440,height=400,screenX=140,screenY=20,dependent=0,scrollbars=1,menubar=1,location=0,toolbar=0,status=1,resizable=0');break;			case 1024 : help_win = window.open(source,'help_winC','width=500,height=455,screenX=235,screenY=60,dependent=0,scrollbars=1,menubar=1,location=0,toolbar=0,status=1,resizable=0');break;			default : 	help_win = window.open(source,'help_winC','width=375,height=360,screenX=125,screenY=10,dependent=0,scrollbars=1,menubar=1,location=0,toolbar=0,status=1,resizable=0');		}	//}	help_win.focus();}//**********************************************************////  File 'fcns_index.js' written by Timothy Driscoll.////  Latest revision October 29,1999 to accompany The Biochemistry 3D Tutorials.////**********************************************************