var marginLeftheadSplash=-110;
var marginLeftheadSx=-110;

var marginLeft=0;
var marginTop=0;

var marginTopBottomSplash=0;
var marginTopSponsor=0;
var marginLeftSponsor=0;


var marginLeftBandiere=0;


var ALT_VIDEO=700;
var LARG_VIDEO=1024;

var marginLeftEnter=0;
var posYEnter=0;


var altezzaAttualeVideo=ALT_VIDEO;

$(document).ready(function(){	
		 window.open('popup_new.jpg','Pubblicita','width=800,height=568,toolbar=no, location=no,status=no,menubar=no,scrollbars=no,resizable=no');
		 resizza();
		 $(window).resize(resizza);
		});

function resizza()
	{
		//marginLeftheadSplash=($(window).width()-1000)/2;
		marginLeftheadSplash=-10;
		
		marginLeftheadSx=($(document.body).width()-721)/2;
		
		marginLeftSponsor=($(document.body).width()-1263)/2;
		

		
		marginLeft=($(window).width()-513)/2;
		
		if($(window).height()>400)
			{
			
			$(".headSplash").css({'top' : '0px'});
			$(".headSplashSx").css({'top' : '0px'});
			$(".topSplash").css({'top' : ''+$(".headSplash").height()+'px'});
			$(".headSplash").css({'left' : ''+marginLeftheadSplash+'px'});
		
			$(".sponsor").css({'display' : 'block'});	
			$(".sponsor").css({'top' : ($(window).height()-70)+'px'});
			$(".sponsor").css({'left' : ''+marginLeftSponsor+'px'});
			
			$(".bottomSplash").css({'display' : 'block'});
			$(".bottomSplash").css({'top' : ($(window).height()-70-30)+'px'});
					
			//	marginTop=(($(window).height()-parseInt($(".headSplash").height())-parseInt($(".topSplash").height())-parseInt($(".bottomSplash").height())-parseInt($(".sponsor").height())-parseInt($(".videoSplash").height()))/2)-70;
					
			//altezzaAttualeVideo=($(this).height()-($(".headSplash").height()+$(".topSplash").height())-($(".headSplash").height()+$(".topSplash").height()))+40;
			
			altezzaAttualeVideo=$(this).height()-$(".headSplash").height()-$(".topSplash").height()-$(".sponsor").height()-$(".bottomSplash").height()-$(".enter").height()-20;	
			
					
			$("#object").css({'height':altezzaAttualeVideo+'px'});
			$("#myFlashContent").css({'height':altezzaAttualeVideo+'px'});
			posY=(($(this).height()-altezzaAttualeVideo)/2)-5;
			//$(".videoSplash").css({'height':altezzaAttualeVideo+'px','left' : ''+marginLeft+'px', 'top' : ''+posY+'px'});
			$(".videoSplash").css({'left' : ''+marginLeft+'px', 'top' : ''+posY+'px'});
			
			marginLeftEnter=($(document.body).width()-300)/2;
			
			posYEnter=parseInt($(".bottomSplash").attr("top"))-250;
			
			$(".enter").css({'left' : ''+marginLeftEnter+'px'});
			
			$(".enter").css({'top' : ($(window).height()-200)+'px'});
			}
		else
			{
			$(".bottomSplash").css({'display' : 'none'});
			$(".sponsor").css({'display' : 'none'});
			}
			
			
		
		// Sistema gli sponsor orizzontalmente
		
		if($(window).width()<1539)
			{
			$(".sponsor").css({'width' : $(window).width()+'px'});
			$(".sponsor").css({'left' : '0px'});
			}
		
		// Sistemo la bandiere
		
		$(".topSplash").css({'width' : $(window).width()+'px'});
		$(".bottomSplash").css({'width' : $(window).width()+'px'});
		
		
		// Questo serve per non far spostare troppo a sinistra la head di destra
		if($(window).width()>1224)
			{	
			marginLeftheadSx=($(document.body).width()-721)/2;			
			}
		else
			{
			marginLeftheadSx=(1024-721)/2;
			}
			
		$(".headSplashSx").css({'left' : ''+marginLeftheadSx+'px'});
		
		
		
		}
		
		
// ActionScript file