function fontResize() {
        //Set default resolution and font size
        var resolution = 1024;
        var font = 10;

        //Get window width
        var width = $(window).width();
        //Set new font size
        //console.log('Risoluzione Maggiore');
        var newFont = font * (width/resolution);
        $('body').css('font-size', newFont);
        images = $('#center img');
        for (i = 0; i < images.length ; i++) {
        	var newHeight = $(images[i]).height() * (width/resolution);
                var newWidth = $(images[i]).width() * (width/resolution);
        	$(images[i]).css({'width': newWidth, 'height' : newHeight });
        }
        objects = $('#center object');
        for (i = 0; i < objects.length ; i++) {
        	var newHeight = $(objects[i]).height() * (width/resolution);
                var newWidth = $(objects[i]).width() * (width/resolution);
        	$(objects[i]).css({'width': newWidth, 'height' : newHeight });

	}
        film = $('#center a.flow');
        for (i = 0; i < film.length ; i++) {
                var newHeight = $(film[i]).height() * (width/resolution);
                var newWidth = $(film[i]).width() * (width/resolution);
                $(film[i]).css({'width': newWidth, 'height' : newHeight });
        }
	frame = $('#center iframe');
        for (i = 0; i < frame.length ; i++) {
                var newHeight = $(frame[i]).height() * (width/resolution);
                var newWidth = $(frame[i]).width() * (width/resolution);
                $(frame[i]).css({'width': newWidth, 'height' : newHeight });
        }

};


function allineaMenuDestra() {
cella = $('#cellasito-selected').offset().left;
menu = $('#menu').offset().left;
cella_right = cella + $('#cellasito-selected').outerWidth();
menu_right = menu + $('#menu').outerWidth();
if (cella_right > menu_right) { 
	diff = (cella_right - menu_right);
	$('#menu').css({'margin-left' : diff});
	}
};

function allineaMenuSinistra() {
cella = $('#cellasito-selected').offset().left;
menu = $('#menu').offset().left;
diff = (cella - menu);
if (cella > menu) { 
	$('#menu').css({'margin-left' : diff});
	}
};


function totalHeight() {
tot = ($('#total').offset().top + $('#total').height());

val = 800

if ($('#cms').offset()) {
	val = ($('#cms').offset().top + $('#cms').height()); }

if ($('#center-blog').offset()) {
	val = ($('#center-blog').offset().top + $('#center-blog').height()); }

if ($('#center').offset()) {
	val = ($('#center').offset().top + $('#center').height()); }

//alert(tot);
//alert(cms);
if (tot < val) { $('#total').css('height', val); }
};

function ClickToPrint()
     {
        film = $('#center a.flow');
        if (film.length == 0) {
        docPrint=window.open("","Print", "width=500,height=350");
        docPrint.document.open();
        docPrint.document.write('<html><head><title></title>');
        docPrint.document.write('</head><body onload="self.print();">');
        docPrint.document.write('<table width="100%"><tr><td width=50% align="left">');
        docPrint.document.write(document.getElementById("pallino_sinistra").innerHTML); 
        docPrint.document.write('</td><td width="50%" align="right">');
        docPrint.document.write(document.getElementById("logo_right").innerHTML); 
        docPrint.document.write('</td></tr></table><hr/>');
        docPrint.document.write('<table width="100%"><tr><td width=100% align="center" margin=1 padding=1>');
       	docPrint.document.write(document.getElementById("cms").innerHTML); 
        docPrint.document.write('</td></tr></table></body></html>');
        docPrint.document.close(); 
        docPrint.focus();
        } else { alert("Can't print video page!"); }
    }



