// The sm_object function retrieves a handle to the specified Flash
// object, accomodating for different DOM methods supported by 
// different browsers.  This is the method recommended by Adobe.

function sm_object(ID) {
	return (navigator.appName.indexOf("Microsoft") != -1) ? window[ID] : document[ID];
}

// The sm_showContent function loads the HTML code passed as an argument
// into the large content pane.

function sm_showContent(html) {
	var howto_content = document.getElementById('howto_content');
	howto_content.innerHTML = html;
}

// The onWaitForUserInput event is raised when a StoryMaker experience
// has finished loading and is waiting for input from the end user.  In
// this case, the event handler ensures that the event is coming from 
// the navigation control and then invokes a function that displays the
// HTML data associated with the first record (step).

function onWaitForUserInput(flashID) {
	if(flashID == 'navctrl') {
		var record = sm_object('navctrl').getFocusRecord();
		sm_showContent(record.linkURL);
	}
}

// The onEndChangeFocus event is raised when the user navigates from one
// record to another in a StoryMaker experience.  In this case, the event
// handler ensures that the event is coming from the navigation control 
// and then invokes a function that displays the HTML data associated 
// with that record.  This function could also include code to rotate 
// a banner ad embedded in the page, send Omniture tracking events, etc.

function onEndChangeFocus(flashID, record) {
	if(flashID == 'navctrl') {
		sm_showContent(record.linkURL);
	}
}