// N.B both of the functions below simply set a cookie value 
// which is then tested against in the code that replaces the 
// html content with flash.

/**
 * Called by the FLASH movie to show the HTML content of the page
 * @return
 */
function showHTML( ) {
	var cookie = new CookieJar( );
	var data = { type: 'html' };
	cookie.put(  'content_type', data );
	window.location.reload( true );	
}


Event.observe( window, 'load', function( event ) {
	if( $( 'swapper' ) ) {
		Event.observe( 'swapper', 'click', function( event ) {
			var cookie = new CookieJar( );
			var data = { type: 'flash' };
			cookie.put(  'content_type', data );
			window.location.reload( true );
		});
	}
	
	if( $( 'swapper_2' ) ) {
		Event.observe( 'swapper_2', 'click', function( event ) {
			var cookie = new CookieJar( );
			var data = { type: 'flash' };
			cookie.put(  'content_type', data );
			window.location.reload( true );
		});
	}
});
