// JavaScript Document
<!-- Original: Alex Tu <boudha1@hotmail.com> -->
<!-- Web Site:  http://www.geocities.com/alex_2106 -->
<!-- This script and many more are available free online at -->										  
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function formHandler(form){
	var URL = document.form.site.options[document.form.site.selectedIndex].value;
	window.location.href = URL;
}
//check to see if everything is filled out properly
function sendurl(form){	
	if(document.form1.amount != ""){//amount is empty	
		if ( isNaN( document.form1.amount.value ) || document.form1.amount.value == 0 ){//check to make sure that it's a number
			alert( "Please the amount in numeral format! ex. 100 or 150. Please do not use \".\" or \"$\"" );
		}else{
			if(document.form1.dedication.value == "" && document.form1.amount.value >= 30){//if the amount is over 30 then they get a dedication
				input_box=confirm("You haven't entered a name for Dedication. If you'd like to enter a name click cancel and fill out the dedication field. If you do not wish to dedicate the rivet simply click Continue to check out.");
				if(input_box==true){
					//send the form
					var amount = document.form1.amount.value;//set the value equal to the form field
					var URL = "http://www.redtail.org/cgi-bin/store.cgi?action=add_to_cart&s=00016&p=Donate+Online&quantity="
					URL += Number(Math.round(amount)) + "&option0=" + 1 + "&option1=" + document.form1.dedication.value;//1 dollar times amount entered.					
					location.href = URL;					
				}else{
					//do nothing they want to enter the dedication
					document.form1.dedication.focus();
				}
			}else{
				var amount = document.form1.amount.value;//set the value equal to the form field
				var URL = "http://www.redtail.org/cgi-bin/store.cgi?action=add_to_cart&s=00016&p=Donate+Online&quantity="
				URL += Number(Math.round(amount)) + "&option0=" + 1 + "&option1=" + document.form1.dedication.value;//1 dollar times amount entered.					
				location.href = URL;
			}
		}	
	}else{
		alert("please enter an amount of donation");
		document.form1.amount.focus();//focus the amount field
	}
}
// End -->
	