$( document ).ready( function(){

var requiredFlashPlayerVersion = '10';
$( document ).ready( function(){
    if ( swfobject.hasFlashPlayerVersion( requiredFlashPlayerVersion ) ) {
        	var flashvars = new Array();
        	var params = new Array();
        	var attributes = new Array();
        	attributes.id = 'content';
            //params.wmode = 'direct';
            //params.allowScriptAccess = "always";
        	swfobject.embedSWF( '/media/f/preloader.swf', "content", '100%', '100%', '10.0.0', "/media/f/expressInstall.swf", flashvars, params, attributes );    
    } else {  
        $('.flash').append('<p class="error">Potrzebna jest jest wersja 10 Flash Playera.</p>');
    }
});
    
    
    



	 
});

$(window).resize(function(){
	scale();
});	

function scale(){
    
	if( document.getElementById( 'footer' ) ){
		swfHeight =  ( $( 'body' ).height() - $('#footer').height() -5 ) ;
	} else {
		swfHeight =  ( $( 'body' ).height()  ) ;
		$( 'body' ).css( 'line-height', '0' );
	}
    //alert( 'body height '+ $( 'window' ).height());
    //alert( 'footer height:'+ $('#footer').height() );
	if( swfHeight < 475 ){
		swfHeight = '475';
	}
	swfHeight += 'px';
	
	if( $( 'body' ).width() < 960 ){
		swfWidth = '960px';
	}
	//alert( swfHeight+' '+ swfHeight);
    
	$( '#content' ).attr( 'height', swfHeight );
	$( '#content' ).css( 'height', swfHeight );
}
