function get_balloon()
{
	var amount = document.getElementById('id_amount').value;
	var balloon = document.getElementById('id_balloon').value;
	if(balloon.search('%') != -1)
	{
		var pc = balloon.substr(0,balloon.search('%'));
		var new_balloon = (amount*pc)/100;
		document.getElementById('id_balloon').value = new_balloon.toFixed(2);
	}
}
function toggleImg(id)
{
	document.getElementById(id).innerHTML=((document.getElementById(id).innerHTML=="-") ? "+" : "-");
}
function toggle(id){
	var target1 = document.getElementById(id)
	if (target1.style.display == 'none') {
	target1.style.display = 'block'
	} else {
	target1.style.display = 'none'
	}
} 

function AllowOnlyNumeric()
{
    // Get the ASCII value of the key that the user entered
    var key = window.event.keyCode;

    // Verify if the key entered was a numeric character (0-9) or a decimal (.) or space
    if ( (key > 47 && key < 58) || key == 46 || key == 47 || key == 37 || key == 32)
        // If it was, then allow the entry to continue
        return;
    else
        // If it was not, then dispose the key and continue with entry
        window.event.returnValue = null;
}

function chk_email(str)
{

	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1)
	   return false;
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
	   return false;
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
		return false;
	if (str.indexOf(at,(lat+1))!=-1)
		return false;
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		return false;
	if (str.indexOf(dot,(lat+2))==-1)
		return false;
	if (str.indexOf(" ")!=-1)
		return false;
	return true;			
}