function CollectScriptData(behavior) {
	this.scriptDataModel = behavior;
	var collector = this;
	
	this.getRunScenarioModel = function(){
		
	}
}
//
//var ParameterModel = function(key, value) {
//	this.key = key;
//	this.value = value;
//}
//var UsePluginModel = function(id, name, parameters) {
//	this.id = id;
//	this.name = name;
//	this.parameters = parameters;
//}
//var BehaviorModel = function(id, use, name, type, parameters) {
//	this.id = id;
//	this.name = name;
//	this.type = type;
//	this.use = use;
//	this.parameters = parameters;
//}
//var ScenarioModel = function(usePlugins, behaviors) {
//	this.usePlugins = usePlugins;
//	this.behaviors = behaviors;
//}

function submitScript(pages,usePlugins) {


	var scriptName = $("#scriptName").val();
	if (scriptName == undefined || scriptName == "") {
		information("need a script name!")
		return;
	}
	var runScenarioModel = new RunScenarioModel(0,usePlugins,new Array(),pages);
	
	$.ajax({
		type : "POST",
		url : "submitScriptCreated" + "/" + scriptName,
		data :{runScenarioModelStr: JSON.stringify(runScenarioModel)},//JSON.stringify(runScenarioModel),
//		dataType : "json",
//		contentType : "application/json",
		success : function(data) {
			if (!data.success) {
				return;
			} else {
				information("success");
			}
		}
	});

}
function updateScript(scriptId, pages, usePlugins){
	var scriptName = $("#scriptName").val();
	if (scriptName == undefined || scriptName == "") {
		information("need a script name!");
		return;
	}
	var runScenarioModel = new RunScenarioModel(0,usePlugins,new Array(),pages);
	
	$.ajax({
		type : "POST",
		url : "updateScript",
		data :{scriptId:scriptId,scriptName:scriptName, runScenarioModelStr: JSON.stringify(runScenarioModel)},//JSON.stringify(runScenarioModel),
//		dataType : "json",
//		contentType : "application/json",
		success : function(data) {
			if (!data.success) {
				return;
			} else {
				information("success");
			}
		}
	});
}
