if(jQuery) {
	jQuery(function($) {
		$('#gcpurchaser').click(function(e) {
		    $('#sendtopurchaserp').slideUp();
		});

		$('#gcrecepient').click(function(e) {
		    $('#sendtopurchaserp').slideDown();
		});

		$('#formSubmit').click(function(e) {

			if(!$('#gcamount').val().match(/\d{1,3}/)) {
		        alert('Gift card amounts need to be whole number denominations');
		        return false;
		    }

			if(!parseInt($('#gcamount').val()) || !(parseInt($('#gcamount').val()) > 0)) {
			    alert('Invalid gift card amount');
				return false;
			}

		    if($('#gcto').val() === '') {
		        alert('No one selected to send to');
		        return false;
		    }

		    if($('#gcfrom').val() === '') {
		        alert('No one selected to send from');
		        return false;
		    }
		});
	});
}
