// JavaScript Document
$(document).ready(function(event) {
	jQuery(".numericfield").keyup(function(event) {
		this.value = this.value.replace(/[^0-9.]+/i, "");
	});
	
	jQuery(".currencyfield").keyup(function(event) {
		this.value = GabeUtil.currencyOnly(this.value);
	});
	
	jQuery(".alphanumericfield").keyup(function(event) {
		this.value = GabeUtil.alphanumericOnly(this.value);
	});
	
	jQuery(".datepickerfld").datepicker({
		dateFormat : 'yy-mm-dd'
	});
	
	$(".gobackbtn").click(function(ev) {
		var url = $(this).metadata().url;
		window.location.href = url;
	});
	
	jQuery("input[name='firstname'], input[name='lastname']").focus(function(event) {
		if(this.value == 'First name' || this.value == 'Last name') {
			this.value = '';
		}
	});
});
