// Variables.
var decoBlock = null;
var centerBlock = null;

// Function scales the contentBlock so the horizontal 
// scrollbar isn't needed at a 1024x768 resolution.
function fitContent()
{	
	var pageWidth = $('body').width();
	var diff = 1024 - pageWidth;		
	if (pageWidth <= 1024 && pageWidth >= 1000 )
	{					
		centerBlock.css('width', 1024 - diff);
		decoBlock.css('width', decoBlock.width - diff);
		return;
	}			
	centerBlock.css('width', 1024);
	decoBlock.css('width', decoBlock.width);				
}

// Initialize after page is loaded.
$(function()
{ 
	// Get object references.
	centerBlock = $('.centerBlock:first');
	decoBlock = $('.decorationBlock:first');		
	decoBlock.width = decoBlock.width();
	decoBlock.left = decoBlock.position().left;	
	fitContent(); // Resize contentBlock.		
		
	$('.flvDieterBohlen:first').flash(
	{
		src: '/media/player_flv_maxi.swf',
		access: 'domain',
		wmode: 'opaque',
		width: 472,
		height: 270,
		vars: {
			title: 'Dieter Bohlen',
			startimage: '/media/dieter_bohlen.jpg',			
			autoload: 1,			
			showvolume: 1,					
			loadingcolor: '0xffffff',
			playercolor: '0x222222',
			loadingcolor: '0xfffff',
			bgcolor: '0x000000',
			bgcolor1: '0x333333',
			bgcolor2: '0x333333',
			buttoncolor: '0x999999',
			buttonovercolor: '0xffffff',
			sliderovercolor: '0xffffff',
			flv: '/media/Dieter_Bohlen.flv'
		}
	});	
});

// Resize contentBlock when the window scales.
$('window').resize(fitContent);
