function resize() {
	var videoareaRight = ($(window).width()-$("#logo").width()-$("#logo").position().left*4-videowidth)/2;
    $('#video-area').css("right", videoareaRight+"px");
}

init = function () {
	var jwplayerToolbarHeight = 19;
    $('#video').css({
    	height: videoheight+jwplayerToolbarHeight,
    	width: videowidth
    });
    if ($('#video-area-full').offset()) {
        var videoAreaFullOffset = $('#video-area-full').offset().top|0;
    }
    
    $('#video-link').css({
    	top: $('#video').height()
    });
    $('#caption').css({
        top: $('#video').height() + $('#video-link').height() + 8
    });
    
    var streamer = "rtmp://cp70242.edgefcs.net/ondemand/voddolcegabbana/";
    
    //alert (streamer+" "+urlvideo);
    var s1 = new SWFObject(pathToIncludes+'/include/swf/jwplayer5.swf', 'player', videowidth, (videoheight+jwplayerToolbarHeight),'9');
    s1.addParam('allowfullscreen','true');
    s1.addParam('allowscriptaccess','always');
    s1.addParam('wmode','opaque');
    s1.addVariable('autostart','true');
    s1.addVariable('width', ''+videowidth+'');
    s1.addVariable('height', ''+(videoheight+jwplayerToolbarHeight)+'');
    s1.addVariable('streamer', ''+streamer+'');
    s1.addVariable('file',''+urlvideo+'');
	s1.addVariable('skin',pathToIncludes+'/include/swf/'+brand+'_sfilata_skin/sfilata_skin.xml');
    s1.addVariable('type','rtmp');
    //s1.addVariable('controlbar','none');
    s1.write('video-flash');
    

    // close video video-area-full
    $('#grayer').click(function(e) {
    	window.location.href = $('#close-link').attr('href');
    });
    
    $(window).resize(function() {
    	resize();
    });
    
    resize();
}
