window.onload = function() {
	
	//replace titles
	convert_to_flash ( $('news').getElementsByTagName('span'), "flash/small_title.swf", 'news' );
	convert_to_flash ( $('bottom_links').getElementsByTagName('span'), "flash/small_title.swf", 'bottom_links' );

	//title
	var so = new SWFObject( "flash/medium_title.swf", "title_swf", "400", "22", "8", "#ffffff", false);
		so.addParam( "wmode", "transparent" );
	so.addVariable( "text", $('title').innerHTML );
	so.write( $('title') );
	
	//2nd title
	if( $('title2') ) {
		var so = new SWFObject( "flash/medium_title.swf", "title_swf", "400", "22", "8", "#ffffff", false);
		so.addParam( "wmode", "transparent" );
		so.addVariable( "text", $('title2').innerHTML );
		so.write( $('title2') );
	}

}

function convert_to_flash ( elms, swf, id ) {

	for( i=0; i<elms.length; i++ ) {
		var so = new SWFObject(swf, id + "_" + i + "_" + "_swf", "150", "22", "8", "#ffffff", false);
		so.addParam( "wmode", "transparent" );
		so.addVariable( "text", elms[i].innerHTML );
		so.write( elms[i] );
	}

}

function $( id ){
	return document.getElementById( id );
}

var current = '';
function show( id ) {
	
	if( current != '' ) $( current ).style.display = 'none';
	
	$( id ).style.display = 'block';
	
	current = id;
	
}