var Form1='';

function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
	num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + //'$'
	 + num + '.' + cents);
}

function updateInfo() {
  Form1 = document.getElementById('Form1');
	//Form1.info.value = "Selected Services:  \r\n" + Form1.serviceText.value + " \r\n";
	Form1.info.value = "\r\nRecipient:   \"" + Form1.receipient.value + "\";\r\n";
	Form1.info.value += "\r\nPhone:  \"" + Form1.phone.value + "\"; \r\n";
             Form1.info.value += "\r\nEmail:  \"" + Form1.email.value + "\"; \r\n";
	Form1.info.value += "\r\nMessage:  \"" + Form1.message.value + "\"; \r\n";
}


function updateDollarValue() {
	  Form1 = document.getElementById('Form1');

	var newAmount = new Number(0);
	
	if(Form1.dollarAmount[0].checked)
		newAmount = new Number(50);
	if(Form1.dollarAmount[1].checked)
		newAmount = new Number(75);
	if(Form1.dollarAmount[2].checked)
		newAmount = new Number(100);
	if(Form1.dollarAmount[3].checked)
		newAmount = new Number(125);
	if(Form1.dollarAmount[4].checked)
		newAmount = new Number(150);
	if(Form1.dollarAmount[5].checked)
	{
		newAmount = new Number(Form1.otherAmount.value);
		Form1.otherAmount.value = formatCurrency(newAmount);
	}	
	Form1.amount.value = formatCurrency(newAmount);
		
}

function dollarsOnly() {
  Form1 = document.getElementById('Form1');

	var c = new Number(event.keyCode);
	var good = ((c>47&&c<58)||c==9||c==36||c==190||c==46||c==8||c==37||c==39);	
	//if(!good)alert(c);
	if(good) {Form1.dollarAmount[5].checked = true;}
	return good;
}

function clearPage() {
  Form1 = document.getElementById('Form1');

	Form1.submit();
	Form1.reset();
	return false;
}