
update_navigation_stuff(chapX,secX,pageX);


// Call relevent functions within their frames to update images etc.
function update_navigation_stuff(chapX,secX,pageX)
{
	//alert("Chapter " + chapX + "\nSection " + secX + "\nPage " + pageX);

	
	if ( this == top || top.chaps == null)
	{	bateman=window.open("../BOOK.HTM","bateman","resizable,width=760,height=560,top=0,left=0");
		bateman.focus();
		this.page_to_load = "CH"+chapX+"/C"+chapX+"S"+secX+"P"+pageX+".HTM";
	}
	else
	{	top.chaps.update(chapX);				// update chapter headings
		top.secs.update(chapX,secX);			// update section images
		top.chaps.update_head(chapX,secX);		// update running header frame
		top.chaps.update_history(chapX,secX,pageX);

		
		top.chaps.current_chapter = chapX;
		top.secs.current_section = secX
		top.foot.current_page = pageX;	
	}	
}


function trap()
{	alert("In the final product this link will take you to the relevant page in another chapter. In this demonstration version you are able to access material in chapters 3 and 6.");
}


   function open_question_window(question_num,num_questions)
// ==================================================================
// Open a new questions window - called from a 'questions' button if this page has one.
// Questions have a window of their own; indepths, examples and matlabs must share a window.
{
	this.question_num = question_num;
	this.num_questions = num_questions;

	slaveq = window.open("","slaveq","scrollbars,resizable,width=400,height=450");
	slaveq.location = '../INDPTWIN/QUESTION.HTM'
	setTimeout("slaveq.focus();",1000);
	
}


   function open_indepth_window(num)
// ==================================================================
// Open a new IN DEPTH window - called from an 'in depth' button if this page has one.
{
	this.indepth_num = num;

	slave = window.open("","slave","scrollbars,resizable,width=500,height=300");
	slave.location = '../INDPTWIN/INDEPTH.HTM';
	setTimeout("slave.focus();",1000);
}


   function open_examples_window(example_num,num_examples)
// ==================================================================
// Open a new Examples window - called from an 'examples' button if this page has one.
{
	this.example_num = example_num;
	this.num_examples = num_examples;

	slave = window.open("","slave","scrollbars,resizable,width=500,height=300");
	slave.location = '../INDPTWIN/EXAMPLE.HTM';
	setTimeout("slave.focus();",1000);
}


   function open_matlab_window(matlab_num)
// ==================================================================
{	this.matlab_num = matlab_num;

	slave = window.open("","slave","scrollbars,resizable,width=500,height=300");
	slave.location = '../INDPTWIN/MATLAB.HTM';
	setTimeout("slave.focus();",1000);
}
