
function mformat(n,zn)
{
	z = "0000000000";
	n = parseFloat(n);
	p = Math.pow(10, zn);
	s = String(Math.round(n*p)/p);
	s = (s.match(/\./)? s+z : s+"."+z).match('\\d+\\.\\d{'+zn+'}');
	return "$"+s;
}
// fix div
function fixLayout()
{
	var d = document.getElementById("fix");
	var m = document.getElementById("main");
	if (d)
	{
		d.style.minHeight = document.documentElement.clientHeight + "px";
		m.style.minHeight = document.documentElement.clientHeight + "px";
	}
}
function fixLayoutIE()
{
	var d = document.getElementById("fix");
	var m = document.getElementById("main");
	if (d)
	{
		d.style.height = document.body.offsetHeight + "px";
		m.style.height = document.body.offsetHeight + "px";
	}
}
if (window.addEventListener)
{
	window.addEventListener("load", fixLayout, false);
	window.addEventListener("resize", fixLayout, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", fixLayoutIE);
	window.attachEvent("onresize", fixLayoutIE);
	window.attachEvent("onscroll", fixLayoutIE);
}