var appRequest = 
{	
	toggleAccountLabel: function(choice)
	{				
		if(choice == 'employment compensation')
		{
			$('label[for=acctNumber_required]').html('Employer Name');			
		}
		else
		{
			$('label[for=acctNumber_required]').html('Account Number (from utility bill)');	
		}
	},
	
	showOther: function(jqObject)
	{
		if(jqObject.val() == '100')
		{
			// if cat_id = 100 then show "other" question before submit button 
			var html = 
			'<li class="formRow" id="hsOtherConditional">'+
				'<div class="formColumnLeft">'+
					'<label class="formElementLabel" for="hsOther_required">High School Name:</label>'+
				'</div>'+
				'<div class="formColumnRight">'+
					'<input type="text" class="formElementInput" id="hsOther_required" name="hsOther" />'+
				'</div>'+
				'<div class="clear"></div>'+
			'</li>';
			
			$('#buttonRow').before(html);			
		}
		else
		{
			$('#hsOtherConditional').remove();
		}		
	},
	
	init: function()
	{		
		// get radio values from scholarship app request
		var test = $('input:radio[name=relationship]').bind('click', function() { appRequest.toggleAccountLabel($(this).val()) });
		
		// add event to high school list for "other" option
		$('#cat_required').bind('change', function() { appRequest.showOther($(this)); });
		
	}
}

// add to document after dom is loaded
$(document).ready(function() { appRequest.init(); });