

function perform_AS(form, value) {

	if (ArrayFind(this.actions,value) != null) {
		document.getElementById(this.hiddenId).value = value;
		if(this.target != null  && this.target != "") {
			form.target = this.target;
		}
		
		document.getElementById(this.buttonId).click();
		
	} else {
		if (this.defaultAction != null && this.defaultAction != "") {
			try {
				eval(this.defaultAction);
			} catch(e) {
				if (this.debug) {
					throw e;
				}
			}
		}
	}
}


function ActionSubmit(buttonId, hiddenId,  url,  actions, target, defaultAction, debug ) {
	this.perform = perform_AS;
	this.buttonId = buttonId;
	this.hiddenId = hiddenId;  
	this.url = url;  
	this.actions = actions;
	this.target  = target;
	this.defaultAction = defaultAction;
	this.debug = false;

}