function popUp(symbol,yahoo) {
	if (yahoo)
		url = "http://www.google.com/finance?q=" + symbol;
	else
		url = symbol;
	
	day = new Date();
	id = day.getTime();
	height = window.outerHeight - 100;
	
	eval ("page" + id + " = window.open(url, '" + id + 
	      "', 'width=" + window.outerWidth + ",height=" + height +
	      ",toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1');");
}

function truebody() {
	return (document.compatMode && document.compatMode != "BackCompat") ? 
		document.documentElement : document.body;
}

function showWindow (id)
{
	var calunits = document.layers ? "" : "px";
	
	dialog = document.getElementById(id).style;
	dialog.visibility = "visible";
	
	if (document.all) {
		documentWidth = truebody().offsetWidth/2 + truebody().scrollLeft - 20;
		documentHeight = truebody().offsetHeight/2 + truebody().scrollTop - 20;
	} else {
		documentWidth = self.innerWidth/2 + window.pageXOffset - 20;
		documentHeight = self.innerHeight/2 + window.pageYOffset - 20;
	}
	
	dialog.left = documentWidth - 100 + calunits;
	dialog.top = 100 + calunits;
}

function closeWindow (id)
{
	dialog = document.getElementById(id).style;
	dialog.visibility = "hidden";
}

function editSettings ()
{
	showWindow('settingsform');
	
	document.getElementById("srlink").value = reservelink;
	document.getElementById("stlink").value = totallink;
	document.getElementById("scb").value = printNumber (costbasis, "$", 2);
	document.getElementById("sres").value = printNumber (reserve, "$", 2);
	document.getElementById("sref").value = refreshrate;
}
