
function clear_div()
{
	document.getElementById("convert_ans").innerHTML = "";
}

function converter()
{
	if((document.forms[0].from_amt.value == "")||(document.forms[0].from_amt.value == null))
	{
		alert("Amount not Entered");
		document.forms[0].from_amt.focus();
		return;
	}
	if(document.forms[0].from_curr.value == "#")
	{
		alert("From Currency not Selected");
		document.forms[0].from_curr.focus();
		return;
	}
	if(document.forms[0].to_curr.value == "#")
	{
		alert("To Currency not Selected");
		document.forms[0].to_curr.focus();
		return;
	}
	var from		= document.forms[0].from_curr.value;
	var to			= document.forms[0].to_curr.value;
	var from_rate	= from.split("_");
	var to_rate		= to.split("_");
	var from_amt	= dbAmt(document.forms[0].from_amt.value);
	var to_amt		=  parseFloat(parseFloat(from_amt) * parseFloat(from_rate[from_rate.length-1])/parseFloat(to_rate[from_rate.length-1]));
	document.forms[0].hid_to_amt.value = to_amt;
	usrAmt(document.forms[0].hid_to_amt);
	document.getElementById("convert_ans").innerHTML = "<br><font color=red>"+from_amt+"</font> "+from_rate[0]+" Is Equalent to <font color=red>"+document.forms[0].hid_to_amt.value+"</font> "+to_rate[0]+"<br><br> <font size='1px'>One Unit of "+from_rate[0]+" is <font color=red>"+from_rate[1]+"</font></font>";
	
}