function PlayAPI(config) {

	this.namespace = config.namespace;
	this.formId = this.namespace + "contestForm";
 	this.inputScoreId = this.namespace + "inputScore";
	this.actionUrl = config.actionUrl;
	this.renderUrl = config.renderUrl;

	this.addPlay = function(play) {

		var inputScore = jQuery("#" + this.inputScoreId);
		var form = jQuery("#" + this.formId);
		if (inputScore && form) {
			jQuery("body").append("<form action='" + this.actionUrl + "' method='post' id='" + this.formId + "'><input type='hidden' name='" + this.namespace + "redirect' value='" + this.renderUrl +"'/><input type='hidden' name='" + this.namespace + "struts_action' value='/contest_content/next' /><input type='hidden' name='" + this.namespace + "contest-score' id='" + this.inputScoreId +"' value=''/></form>");
			inputScore = jQuery("#" + this.inputScoreId);
			form = jQuery("#" + this.formId);
		}

		inputScore.attr("value", play.points);
		form.submit();
	};
}



