
	var eminpixels=0;
	var cminpixels=0;
	var pcwinpixels=0;
	var pchinpixels=0;
	var emtocm=0;
	var cmtoem=0;

	function buildPropertySheet()
	{
		// get the fonts used on the page, and their point size
		var enfont = (rule = getCSSRule(".page")) ? rule.style.fontFamily : 'unknown';
		var enpt = (rule = getCSSRule(".page")) ? rule.style.fontSize.substring(0,rule.style.fontSize.length-2) : 'unknown';
		var jpfont =  (rule = getCSSRule(".pagejp")) ? rule.style.fontFamily : 'unknown';
		var jppt = (rule = getCSSRule(".page")) ? rule.style.fontSize.substring(0,rule.style.fontSize.length-2) : 'unknown';

		// we have to make sure that the quoted value uses the correct quotation marks (webkit uses ', but gecko/IE uses ", and we want them to be ')
		enfont = "'" + enfont.substring(1,enfont.length-1) + "'";
		jpfont = "'" + jpfont.substring(1,jpfont.length-1) + "'";
		document.getElementById("propertysheet").innerHTML = document.getElementById('propertysheet').innerHTML + '<div id="empx" style="font-family:'+enfont+'; width:1em; height:1em;"></div><div id="cmpx" style="width:1cm; height:1cm;"></div><div id="pcpx" style="width:1%; height:1%;"></div>';

		// determine the conversion for cm to pixel and em to pixel
		eminpixels = document.getElementById("empx").clientHeight;
		cminpixels = document.getElementById("cmpx").clientHeight;
		pchinpixels = document.getElementById("pcpx").clientHeight;
		pcwinpixels = document.getElementById("pcpx").clientWidth;
		
		document.getElementById("empx").style.display = "none";
		document.getElementById("cmpx").style.display = "none";
		
		emtocm = eminpixels/cminpixels;
		cmtoem = cminpixels/eminpixels;

		var pageheight = (rule = getCSSRule(".offsets")) ? rule.style.height :0;		
		var pagewidth = (rule = getCSSRule(".offsets")) ? rule.style.width : 0;		
		var textareaheight = (rule = getCSSRule(".page")) ? rule.style.height : 0;
		var textareawidth = (rule = getCSSRule(".page")) ? rule.style.width : 0;		
		
		pageheight = pageheight.substring(0,pageheight.length-2)
		pagewidth = pagewidth.substring(0,pagewidth.length-2);
		textareaheight = textareaheight.substring(0,textareaheight.length-2);
		textareawidth = textareawidth.substring(0,textareawidth.length-2);
	   
		var pageheight_in_cm = Math.round(pageheight * emtocm*100)/100;
		var pagewidth_in_cm = Math.round(pagewidth * emtocm*100)/100;
		var textareaheight_in_cm = Math.round(textareaheight * emtocm*100)/100;
		var textareawidth_in_cm = Math.round(textareawidth * emtocm*100)/100;

		pageheight = Math.round(pageheight*100)/100;
		pagewidth = Math.round(pagewidth*100)/100;
		textareaheight = Math.round(textareaheight*100)/100;
		textareawidth = Math.round(textareawidth*100)/100;		
		
		// synchronous processing ... AJAX is still not always the answer.
		var xmlhttp = getNewHTTPObject();
		xmlhttp.open("GET","index.php?getfilelist="+chapter,false);
		xmlhttp.send(null);
		var selector = xmlhttp.responseText;
		
		// after determining all these values, 'print' them to screen
		document.getElementById("propertysheet").innerHTML = document.getElementById("propertysheet").innerHTML +
			"<b>available files: </b>" + selector +"<br>"+
			"<b>page properties</b><blockquote>" +
			"page height: "+pageheight_in_cm+"cm ("+pageheight+"em), "+
			"page width: "+pagewidth_in_cm+"cm ("+pagewidth+"em), "+
			"text area height: "+textareaheight_in_cm+"cm ("+textareaheight+"em), "+
			"text area width: "+textareawidth_in_cm+"cm ("+textareawidth+"em) "+
			"　　　" +
			"(render engine properties: "+eminpixels+"px considered 1em, "+cminpixels+"px considered 1cm)" +
			"</blockquote>"+
			"<b>font properties</b><blockquote>"+
			"English font (if found): "+enfont+" ("+enpt+"pt), "+
			"Japanese font (if found): "+jpfont+" ("+jppt+"pt)"+
			"</blockquote>" +
			"<b>adjust parameters</b><blockquote>" +
			"new page height <input type='text' id='pageheight_in_cm' value='"+pageheight_in_cm+"' class='pagedimension'/>cm, " +
			"new page width <input type='text' id='pagewidth_in_cm' value='"+pagewidth_in_cm+"' class='pagedimension'/>cm, " +
			"new text area height <input type='text' id='textareaheight_in_cm' value='"+textareaheight_in_cm+"' class='pagedimension'/>cm, " +
			"new text area width <input type='text' id='textareawidth_in_cm' value='"+textareawidth_in_cm+"' class='pagedimension'/>cm" +
			"　　　<b><span onclick='reGenerate()' class='regenbutton'>click here to regenerate</span>"+
			", <span onclick='reLoad()' class='regenbutton'>or click here to reload data</span>"+
			"</b>"+
			"</blockquote>";
	}