//****************************************************************************************************
//
//  File 'main.js' written by Timothy Driscoll.
//
//  Most recent revision on January 27,1998.
//
//  Supplement to Protein Architecture, a Chime tutorial on protein structure.
//
//  Tutorial authors Vicky Chang, Frieda Reichsman, and Timothy Driscoll.
//
//****************************************************************************************************



var pageList = new Array ();

	pageList[0] = "helix";
	pageList[1] = "sheet";

		//  'pageList' is an open array that contains all of the pages in the tutorial, in order.
		//
		//  In this case, the pages are the names of each folder, which correspond to the 
		//  'pageName' variable found in the 'menu.html' document of each folder.
		//
		//  Modify the array members to change the order of the tutorial.
		

function nextPage(current)  {
	for (var i=0;i<(pageList.length-1);i++)
		if (pageList[i] == current) document.location.href="../" + pageList[i+1] + "/menu.html";
}
function lastPage(current)  {
	if (current == pageList[0]) document.location.href="../menu.html";
	else
		for (var i=1;i<=pageList.length;i++)
			if (pageList[i] == current) document.location.href="../" + pageList[i-1] + "/menu.html";
}

function backButton()  {
	document.writeln("<INPUT TYPE='button' VALUE='Back' onClick='lastPage(top.pageName);'>");
}
function nextButton()  {
	document.writeln("<INPUT TYPE='button' VALUE='Next' onClick='nextPage(top.pageName);'>");
}
function indexButton()  {
	document.writeln("<INPUT TYPE='button' VALUE='Index' onClick='goToPage(value)'>");
}
function helpButton()  {
	document.writeln("<INPUT TYPE='button' VALUE='Help' onClick='goToPage(value)'>");
}
function closeButton()  {
	document.writeln("<INPUT TYPE='button' VALUE='Close' onClick='top.window.close()'>");
}
function helpButton()  {
	document.writeln("<INPUT TYPE='button' VALUE='Help' onClick='goToPage(value)'>");
}

function goToPage(page)  {
	switch (page)  {
		case "Index" :  openPage("../contents.html",page,"max");window.n.focus();break;
		case "Help" :  openPage("../Chimehelp/menu.html",page,"square");window.n.focus();break;
		case "SmartKey" :  openPage("key/smartkey.html",page,"wide");window.n.focus();break;
		case "Topo" :  openPage("topo.html",page,"square");window.n.focus();break;
		case "Extext" :  openPage("extext.html",page,"tall");window.n.focus();break;
		case "Barrel" :  openPage("brrl_men.html",page,"square");window.n.focus();break;
		case "MglobinDuo" :  openPage("comp_menu.html",page,"max");window.n.focus();break;
		default : alert("goToPage() is not functioning properly. Please notify the site administrator.");
	}
}

function openPage(loc,n,size)  {
	switch (size)  {
		case "tall" : n = window.open(loc,n,'width=350,height=480,screenX=5,screenY=5,resizable,toolbar,status,menubar,scrollbars');break;
		case "square" : n = window.open(loc,n,'width=450,height=450,screenX=5,screenY=5,resizable,toolbar,status,menubar,scrollbars');break;
		default : alert("openPage() is not functioning properly. Please notify the site administrator.");
	}
}



function cssMain()  {								
	document.writeln("<STYLE>");
	document.writeln("BODY.text{background-color:#00000;color:#FFFFFF;font:normal bold 12pt verdana;}"); 
	document.writeln("BODY.struct{background-color:#000000;}");
	document.writeln("BODY.menuPage{color:#CCCCCC;font:normal bold 12pt/14pt verdana;background-color:#FFFFFF;}");
	document.writeln("a{color: #9900ff;}");
	document.writeln("all.sectionTitle{color:#FF0000;font:normal bold 18pt verdana;text-align:center;}");
	document.writeln("all.head1{color:#FFFFFF;font:italic bold 18pt verdana;text-align:left;}");
	document.writeln("all.head2{color:#33FFFF;font:italic bold 14pt verdana;text-align:left;}");
	document.writeln("all.authors1{color:#DDDD00;font:italic normal 14pt/18pt verdana;text-align:left;}");
	document.writeln("all.authors2{color:#B45AB4;font:normal normal 14pt/16pt verdana;text-align:left;}");
	document.writeln("all.struct{text-align:right;}");
	document.writeln("all.title{text-align:center;}");
	document.writeln("all.base{color:#DAA520;font:normal bold 12pt verdana;}");
	document.writeln("all.extext{color:#FFFFFF;font:normal normal 14pt verdana;}");
	document.writeln("</STYLE>");
}

		//
		//  Modify cssMain() to include your own specific styles.
		//


function chimeButton(scriptName,target)  {
	document.writeln("<EMBED SRC='" + scriptName + "' TYPE='application/x-spt' BUTTON='push' TARGET='" + target + "' WIDTH='12' HEIGHT='12'>");
	document.writeln("<SPACER TYPE='horizontal' SIZE='4'>");
}


function chimeToggle(scriptName,altscriptName,target)  {
	document.writeln("<embed type='application/x-spt' button='toggle' target='" + target + "' script='script " + scriptName + "' altscript='script " + altscriptName + "' width='12' height='12'>");
	document.writeln("<spacer type='horizontal' size='4'>");
}

