// JavaScript Document
/* ----------------------------------------------------------------------------
 * Copyright (c) 2010 Moblico Solutions, LLC. All Rights Reserved
 *
 * This software is the property of Moblico Solutions, LLC and contains HIGHLY 
 * CONFIDENTIAL and PROPRIETARY INFORMATION. Use, disclosure, reproduction, 
 * modification, distribution or other use of this software and information is 
 * permitted only in strict compliance with an express written agreement with 
 * Moblico Solutions, LLC.
 * ----------------------------------------------------------------------------
 */
$(document).ready(function(event) {

	MoblicoUtil.regNumericField(".numericfield");
	
	jQuery(".floatfield").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("input[name='firstname'], input[name='lastname']").focus(function(event) {
		if(this.value == 'First name' || this.value == 'Last name') {
			this.value = '';
		}
	});
	
	$("a.submitformbtn").click(function(event) {
		event.preventDefault();
		var form = $(this).metadata().formid;
		if(!form) {
			form = "mainform";
		}
		$("#" + form).submit();
	});
});