openmenu = 0;
function onlynum(f) {
	n=f.value; n2=""; dot=0; 
	while (n.indexOf(",") != -1) n=n.replace(",",".");
	for(i=0;i<n.length;i++) { chr=n.substring(i,i+1); if (chr==".") dot++; if ((chr=="." && dot==1) || chr==parseInt(chr)) n2+=chr; } f.value=n2;
}
function checkconvert() {
	f = document.forms["conv"];
	from = f.from.options[f.from.selectedIndex].text;
	to = f.to.options[f.to.selectedIndex].text;
	from = from.substring(from.lastIndexOf("(")+1,from.lastIndexOf(")"));
	to = to.substring(to.lastIndexOf("(")+1,to.lastIndexOf(")"));
	if (to==from) {
		alert('Please choose two different currencies.');
	} else {
		if (f.amount.value > 0) {
			f.submit();
		} else {
			alert('Please use a valid amount.');
		}
	}
}
function hidemenu() {
	if (openmenu > 0) {
		document.getElementById("menu"+openmenu).style.visibility='hidden';
		document.getElementById("mi"+openmenu).style.color='#FFFFFF';
		openmenu = 0;
		document.getElementById("undermenu").style.visibility='hidden';
	}
}
function showmenu(n) {
	hidemenu();
	document.getElementById("menu"+n).style.visibility='visible';
	document.getElementById("mi"+n).style.color='#F0C000';
	openmenu = n;
	document.getElementById("undermenu").style.visibility='visible';
}
function goto2(l) {
	document.location.href = l;
}
