function kaplanuniversityextraquestions()
{
	var url = '/js/php/kaplan-university/kaplanuniversityextraquestions.php';
	//var typeValue = Form.getInputs('myform','radio','kaplanuniversityextraquestions').find(function(radio) { return radio.checked; }).value;
	//var typeValue = $('myform').serialize().toQueryParams()['kaplanuniversityextraquestions'] 
	//alert(typeValue);
	//var registeredObj = thisform.kaplanuniversityextraquestions.value;
	//alert($registeredObj);
	/*for (x in $F)
	{
		document.write($F[x] + "<br>");
	}*/
	var params = 'program=' + $F('program') + '&hidden_program=' + $F('hidden_program') + 
	                                          '&hidden_bachelors=' + $F('hidden_bachelors') + 
	                                          '&hidden_gpa=' + $F('hidden_gpa') + 
	                                          '&hidden_associates=' + $F('hidden_associates') + 
	                                          '&hidden_enforcement=' + $F('hidden_enforcement') + 
	                                          '&hidden_fluids=' + $F('hidden_fluids') + 
	                                          '&hidden_needles=' + $F('hidden_needles') + 
	                                          '&hidden_relations=' + $F('hidden_relations') + 
	                                          '&hidden_rnlicense=' + $F('hidden_rnlicense') + 
	                                          '&hidden_msnnbachelor=' + $F('hidden_msnnbachelor') + 
	                                          '&hidden_msnnlicense=' + $F('hidden_msnnlicense') + 
	                                          '&hidden_edubachelors=' + $F('hidden_edubachelors') + 
	                                          '&hidden_edugpa=' + $F('hidden_edugpa') + 
	                                          '&hidden_contactmethod=' + $F('hidden_contactmethod') +
	                                          '&hidden_bestcalltime=' + $F('hidden_bestcalltime') +
	                                          '&hidden_nursingstate=' + $F('hidden_nursingstate') +
	                                          '&hidden_transfercredits=' + $F('hidden_transfercredits') +
	                                          '&hidden_starttime=' + $F('hidden_starttime') +
	                                          '&hidden_stat=' + $F('hidden_stat');
	//alert("is_registered nurse params: " + params);
	document.getElementById('kaplanuniversityextraquestions').innerHTML = "";
	//document.getElementById("kaplanuniversityextraquestions").style.visibility = "hidden";
	//$('kaplanuniversityextraquestions').replace('<table id=\"kaplanuniversityextraquestions\" width=\"430px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"></table>');
	var ajax = new Ajax.Updater({success: 'kaplanuniversityextraquestions'},url,
			{method: 'get', 
   			 insertion: Insertion.Top,
			 parameters: params, 
			 onFailure: reportError});
}


function findMyText(needle, replacement) 
{
	var haystackText = "";	
	if (haystackText.length == 0) 
	{
		haystackText = document.getElementById("haystack").innerHTML;
     }
     var match = new RegExp(needle, "ig");     
     var replaced = "";
     if (replacement.length > 0) {
          replaced = haystackText.replace(match, replacement);
     }
     else {
          var boldText = "<div style=\"background-color: yellow; display: inline; font-weight: bold;\">" + needle + "</div>";
          replaced = haystackText.replace(match, boldText);
     }
     document.getElementById("haystack").innerHTML = replaced;
}



function kaplanuniversitygetprograms()
{
	//if($F('zip').length = 5 && ($F('campusonline') == "campus" || $F('campusonline') == "online"))
	var url = '/js/php/kaplan-university/kaplanuniversitygetprograms.php';
	var params = 'areaofinterest=' + $F('areaofinterest') + '&hidden_program=' + $F('hidden_program');
	//alert("getPrograms params: " + params);
	//$('programs').replace('<td colspan=\"2\" id=programs></td>');
	//$('program').replace('<select name=\"program\" size=\"1\" id=\"program\" onchange=\"kaplanuniversityextraquestions();\" class=\"form_item\" style=\"width: 390px;\">');
	//document.getElementById("programs").style.visibility = "hidden";
	//document.getElementById('programs').innerHTML = "";
	document.getElementById('kaplanuniversityextraquestions').innerHTML = "";
	var ajax = new Ajax.Updater({success: 'program'},url,
			{method: 'get',
  			//insertion: Insertion.Top,
  			parameters: params,
  			onFailure: reportError});
}
	//document.myform.state[document.myform.state.selectedIndex].value = 'AL';	
	
	
function checkHighestEducation()
{
	if($F('highesteducation') == 'No High School')
	{
		alert("Kaplan University is not currently accepting information requests from potential students who have not yet attained a high school diploma.  Please correct your highest level of education or request information from another school.");
		var highested = document.getElementById('highesteducation');
		highested.focus();
		return false;
	}
}


function checkZip() {

if($F('zip').length >= 5) {
var url = 'addressCheck.php';
var params = 'zip=' + $F('zip') + '&street=' + $F('street');
//var params = 'zip=' + $F('zip');
var ajax = new Ajax.Updater({success: 'cityResult'},url,
  {method: 'get', 
  insertion: Insertion.Top,
  parameters: params, 
  onFailure: reportError});
}
/*var ajax = new Ajax.Updater("cityResult",url,{
   parameters : "params",
   onFailure : function(resp) {
     alert("Oops, there's been an error.");
   }
});}*/


}

function reportError(request) {
$F('cityResult') = "Error";

}