function Submitter(submitterName, action, method, target){
		if ( arguments.length > 0 )
			this.init(submitterName, action, method, target);
}


Submitter.prototype.init = function(submitterName, action, method, target){
	this.submitterName = submitterName;
	this.action = action;
	this.method = method;
	this.target = target;
	this.paramNameArr = new Array();
	this.paramValueArr = new Array();
//	this.randomFormName = "submitterform" + Math.floor(Math.random()*1000);
//	document.writeln("<div style='display:block'><form id='"+this.randomFormName+"' name='"+this.randomFormName+"'></form></div>");
};


Submitter.prototype.addParam = function(name, value){
	this.paramNameArr.push(name);
	this.paramValueArr.push(value);
//	this.paramValueArr.push(encodeURIComponent(value));
};

Submitter.prototype.submit = function(){
	
	var formEle = document.getElementById(this.submitterName);
//	var formEle = document.submitterForm;
	
	formEle.innerHTML="";
	formEle.action = this.action;
	formEle.method = this.method;
	formEle.target = this.target;
	for (var i=0; i<this.paramNameArr.length; i++){
		var inputEle = document.createElement("input");
		inputEle.name = this.paramNameArr[i];
		inputEle.value = this.paramValueArr[i];
		formEle.appendChild(inputEle);
	}
	formEle.submit();
};

