function getHeight (target) {
	var r = -1;
	if (target.clientHeight) r = target.clientHeight;
	return r;
}

function checkFontSize () {
	if (document.getElementById) {
        	var h = getHeight (document.getElementById ('heightTestLayer'));
//       	alert (h);
        	if (h > 1) {
          		if (currentStylesheet == 'smallest') {
            			var smallestLimit = 12;
            			var mediumLimit = 19;
          		}
          		if (currentStylesheet == 'smaller') {
		        	var smallestLimit = 8;
            			var mediumLimit = 10;
          		}
		        if (currentStylesheet == 'medium') {
            			var smallestLimit = 7;
			        var mediumLimit = 10;
          		}
		        if (h < smallestLimit) {
            			document.styleSheets (0).href = "/css/styles_smallest.css";
			        currentStylesheet = 'smallest';
          		}
          		if (h > smallestLimit - 1 && h < mediumLimit + 1) {
            			document.styleSheets (0).href = "/css/styles_small.css";
			        currentStylesheet = 'smaller';
          		}
		        if (h > mediumLimit) {
            			document.styleSheets (0).href = "/css/styles.css";
			        currentStylesheet = 'medium';
          		}
        	}
      }
      
      autoResized = true;
      setTimeout ('autoResized = false', 100);
}
   
    var currentStylesheet = 'medium';
    var autoResized = false;