/** RSH must be initialized after the
    page is finished loading. */
window.onload = initialize;

function initialize() {
	// initialize RSH
	dhtmlHistory.initialize();
  
	// add ourselves as a listener for history
	// change events
	dhtmlHistory.addListener(handleHistoryChange);
  
	// determine our current location so we can
	// initialize ourselves at startup
	// var initialLocation = dhtmlHistory.getCurrentLocation();
  
	// if no location specified, use the default
	// if (initialLocation == null)
	//	initialLocation = 0;

	// now initialize our starting UI
	// updateUI(initialLocation, null);
}

/** A function that is called whenever the user
    presses the back or forward buttons. This
    function will be passed the newLocation,
    as well as any history data we associated
    with the location. */
function handleHistoryChange(newLocation, historyData) {
	callExternalInterface(newLocation);                          
}
    
/** Call the flash external interface. */
function callExternalInterface(newLocation) {
	if(getFlashObject("NovoSonic").selectMenu){
		getFlashObject("NovoSonic").selectMenu(newLocation);
	} else {
		return true;
	}
}

/** Check whether the browser is IE. If so, flashVideoPlayer is
    window.videoPlayer. Otherwise, it's document.videoPlayer. The
    videoPlayer is the ID assigned to the <object> and <embed> tags. */
function getFlashObject(flashName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[flashName] : document[flashName];
}

/** Set the browser title. */
function setBrowserTitle(title) {
	document.title = "NovoSonic - "+title;
}