// Hook for Internet Explorer. 
// This writes the "moviename_DoFScommand" function to VB script in order to receive fscommand calls from flash. 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('sub player_FSCommand(ByVal command, ByVal args)\n');
	document.write(' call player_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

// This javascript function acts as a handler for all fscommands
// called by the flash app. The prefix of the function name must 
// match the id given to the embedded flash object.
// The command passed to this function should be a complete string
// of the javascript call. i.e. command = functionName( 'arg 1', arg2, "arg3" ); 
function player_DoFSCommand( command )
{
	eval( command );
}

// Fix for Safari 3: SWFAddress seems to want to reload the entire page when first
// setting the # location. This forces the URL to contain the # if its left off, fixing the problem. 
var agent = navigator.userAgent;
var isSafari = ( agent.indexOf( 'Safari' ) != -1 );

var version=asual.util.Browser.version

if ( isSafari )
{
	var theRef = window.location.href;
	if ( theRef.indexOf( "?#") == -1 && version >= 500)
	{
		window.location = '?#';
	}
}


