
function checkBrowserWidth()
{
	//Se viene modificato manualmente la dimensione della finestra del browser
	//fino a 640x480 ridimensioniamo la grandezza del font per evitare la visualizzazione
	//di un font troppo grande.
	var theWidth = getBrowserWidth();
	if ((theWidth <= 640)&&(document.getElementsByTagName("body")[0].style.fontSize!="62.5%"))  {
		setFontSize("medium");
	}
	return true;
}


function setFontSize(value) {
	var theWidth = getBrowserWidth();
	theStyle = null;
	if (theWidth > 640) {
	if (value == "small") theStyle 	= "62.5%";
	if (value == "medium") theStyle = "75%";
	if (value == "large") theStyle 	= "90%";
	} else {
		
	if (value == "small") theStyle 	= "55%";
	if (value == "medium") theStyle = "62.5%";
	if (value == "large") theStyle 	= "65%";
	}
	if (theStyle){
	//alert(theWidth+" "+theStyle);
	  document.getElementsByTagName("body")[0].style.fontSize = theStyle;
	}
}

function getBrowserWidth()
{
	if (window.innerWidth){
		return window.innerWidth;
	}else if (document.documentElement && document.documentElement.clientWidth != 0){
		return document.documentElement.clientWidth;
	      } else if (document.body){
		     return document.body.clientWidth;
	}
	return 0;
}




