function surveyObj() {
	this.aSurveyIDs = Array();
	
	//if (arguments.length == 1) this.addSurveyID(arguments[0]); //multiple IDs stored so multiple surveys can be placed on a page and have same submit and ajax return handler functions
	
	return this;
}

/*----- AjaxIDs -----------------------------------------------------------------------------------------*/
surveyObj.prototype.getSurveyElement = function(surveyID,elSuffix) {
	return document.getElementById("ckSurvey." + surveyID + "." + elSuffix);
}
surveyObj.prototype.showActionWait = function(surveyID) {
	var bShow = (arguments.length==2 ? arguments[0] : true);
	var oEl;
	if (oEl = this.getSurveyElement(surveyID,"actionWait")) oEl.style.display=(bShow ? "block" : "none");
	if (oEl = this.getSurveyElement(surveyID,"actionButtons")) oEl.style.display=(bShow ? "none" : "block");
}
/*----- Submit -----------------------------------------------------------------------------------------*/
surveyObj.prototype.submitForm = function(oForm) {
	var surveyID = oForm.surveyID.value;
	var oAjax = oError.autoValidateAndAjaxSubmit(oForm,this.ajaxReturnHandler_submitForm,this);

	if (!oError.anyErrors()) {
		this.aSurveyIDs[oAjax.uniqueID] = surveyID;
		this.showActionWait(surveyID);
	}
	
	var aIDs = Array("errors.top","errors.bottom");
	for (var index=0; index < aIDs.length; index++) {
		if (oEl=this.getSurveyElement(surveyID,aIDs[index])) {
			oEl.style.display=(oError.anyErrors() ? "block" : "none");
			oEl.innerHTML = (oError.anyErrors() ? "There are unanswered items. Please review your responses and answer the items indicated." : "");	
		}	
	}
					
}

surveyObj.prototype.ajaxReturnHandler_submitForm = function(oAjax) {
	var oEl;
	var surveyID=this.aSurveyIDs[oAjax.uniqueID];
	
	this.showActionWait(surveyID,false);
	
	if (oEl = this.getSurveyElement(surveyID,"container")) {
		oEl.innerHTML = oAjax.responseText;
	}

}
