jQuery().ready(function() {
	// Build tabs if any
	if (jQuery('.tabs').length) {
		jQuery('.tabs').tabs();
	}
	
	// This is for the application to disable the submit button until the declaration has been stated
	var subButton = document.getElementById('submitapp');
	if (subButton) {			
		subButton.disabled = true;
		jQuery('label.declaration input').bind('click', function(E) {
			if (this.checked) {
				subButton.disabled = false;
			} else {
				subButton.disabled = true;
			}
			return true;
		});
	};
	
	jQuery('#agentname').hide();
	jQuery('#f_hearabout').bind('change', function() {
		//alert(this.value);
		if (this.value.toLowerCase() == 'agent') {
			//alert("Open");
			jQuery('#agentname').fadeIn();
		} else {
			jQuery('#agentname').fadeOut();
		}
	});
});