/** 
 * @projectDescription	Simple form.
 * @author 	Matt Hobbs matt.hobbs@harvestdigital.com
 * @version 	0.1 
 */
$(function(){
	$("body").addClass("hasJS");
	//Clear the value in the text form when you click other
	$("#other").click(function(){
		$("#inputAmount").attr("value", "").focus().select();
	});
	
	$("#donateBox form").submit(function(){
		//Check to see if the radio button is checked
		if($("#other").is(":checked")){
			//Take value from the text box
			var ourValue = $("#inputAmount").attr("value");
			//Check to see if we have a value
			if(ourValue ==="" || ourValue ==="0"){
				ourValue = "5";
			}
			//Add it to the radio button
			$("#other").attr("value", ourValue);
		} else {
			return;
		}
	});
});