function submitForm22(formToPost) {
	var kw = {
	        form: dojo.byId(formToPost),
	        url: '/class-search',
	        //handleAs: "json",
	        load: function(response){
	        	//dijit.byId(formId).setValues(response.items);
	        	//alert(response);
				document.getElementById('class-results').innerHTML =  response;
				return response;
	        },
	        error: function(data){
	                alert("An error occurred: " + data);

	                return data;
	        },
	        timeout: 20000
	        };

	dojo.xhrPost(kw);
}
function submitFormCE(formToPost) {
	var kw = {
	        form: dojo.byId(formToPost),
	        url: '/class-search-ce',
	        //handleAs: "json",
	        load: function(response){
	        	//dijit.byId(formId).setValues(response.items);
	        	//alert(response);
				document.getElementById('class-results').innerHTML =  response;
				return response;
	        },
	        error: function(data){
	                alert("An error occurred: " + data);

	                return data;
	        },
	        timeout: 20000
	        };

	dojo.xhrPost(kw);
}
function submitForm21() {
	//userData = dojo.formToQuery("training");
	var kw2 = {
	        form: dojo.byId('sortform'),
	        url: '/class-search',
	        //handleAs: "json",
	        load: function(response){
	        	//dijit.byId(formId).setValues(response.items);
	        	//alert(response);
				document.getElementById('class-results').innerHTML =  response;
				return response;
	        },
	        error: function(data){
	                alert("An error occurred: " + data);

	                return data;
	        },
	        timeout: 2000
	        };

	dojo.xhrPost(kw2);
}

function submitFormAR( whichForm , sendWhere , resultEl )
{
	var data = {	form: dojo.byId( whichForm ),
					url: sendWhere,
					load: 	function(response){
								if( response=='success' )
								{
									dojo.byId(resultEl).innerHTML = '<strong>Thank You for your interest in Kaplan Financial Education\'s Structured Study Program. We will be contacting you soon to discuss your needs.</strong>';
								}
								else
								{
									dojo.byId(resultEl+'-err').innerHTML = response + '<br/>';
								}
								return response;
							},
					error:  function(data){
								// use console to avoid annoying the user and use the actual javascript console!
								console.error( 'An error has occurred: ' + data );
								return data;
							},
					timeout: 2000
				}
	dojo.xhrPost( data );
}
