function Conditional_Logic_Object ( form_name, string, element_name_to_focus_on, alert_message) {
	this.form_name = form_name;
	
	this.string = string;
	this.element_name_to_focus_on = element_name_to_focus_on;
	this.alert_message = alert_message;
	
	this.conjunctive_condition_object_array = new Array();
	
	this.defaultColor = "";
	this.defaultColorSet = false;
	
//	this.firstColor = "";
	
	if (string != ""){
		this.process_string();
	}
}

function process_conjunctive_string () {
	var conjunctive_condition_object_array = this.retrieve_conjunctive_condition_object_array();
	this.conjunctive_condition_object_array = conjunctive_condition_object_array;
}

function retrieve_conjunctive_condition_object_array () {
	var string = this.string;
	var form_name = this.form_name;
	
	var conjunctive_condition_object_array = new Array();
	var conjunctive_string_array = string.split(user_conjunctive_string_delimiter);
	for (var i = 0; i <  conjunctive_string_array.length; i++){
		var conjunctive_string = trim(conjunctive_string_array[i]);
		conjunctive_string = remove_parentheses(conjunctive_string);
		var conjunctive_condition_object = new Conjunctive_Condition_Object (form_name, conjunctive_string);
		conjunctive_condition_object_array[conjunctive_condition_object_array.length] = conjunctive_condition_object;
	}

	return conjunctive_condition_object_array;
}

function get_conjunctive_query_string (debug) {
	var conjunctive_query_array = new Array();
	for (var i = 0; i < this.conjunctive_condition_object_array.length; i++){
		var conjunctive_condition_object = this.conjunctive_condition_object_array[i];
		var conjunctive_query = "";
		if (debug){
			conjunctive_query = conjunctive_condition_object.get_query(debug);
		}
		else {
			conjunctive_query = conjunctive_condition_object.logic_satisfied();
		}
		
		conjunctive_query_array[conjunctive_query_array.length] = conjunctive_query;
	}
	
	return "(" + conjunctive_query_array.join(") " + js_conjunctive_string_delimiter + " (") + ")";
}

function conjunctive_logic_satisfied () {
	return eval(this.get_query());
}

// new conditional_logic_object('','','',''); // To Satisfy NN 3, you need to create and discard one object
Conditional_Logic_Object.prototype.process_string = process_conjunctive_string;
// Conditional_Logic_Object.prototype.process_default_color = process_default_color;
Conditional_Logic_Object.prototype.retrieve_conjunctive_condition_object_array = retrieve_conjunctive_condition_object_array;
Conditional_Logic_Object.prototype.get_query = get_conjunctive_query_string;
Conditional_Logic_Object.prototype.logic_satisfied = conjunctive_logic_satisfied;


