	function matrixSearch() {
			
		this.active = "left";
		this.advanced = false;
	};
	
	matrixSearch.prototype = {
		
		changeState : function() {
			
			if (this.advanced) {
				
				this.advanced = false;	
			}
			else {
			
				this.advanced = true;	
			}
				
		},
		changeSearch : function(obj) {
			
			if (this.active != obj.id) {
				
				this.active = obj.id;
				
				if (this.advanced) {
				
					display = "none";	
				}
				else {
				
					display = "inline";	
				}

				document.getElementById("search_advanced").style.display = display;
				
				this.changeState();
				this.changeColor(obj);
				this.changeStateForm();
			}
		},
		changeColor : function(obj) {
			
			obj.style.color = "";
			
			if (this.active == "left") {

				obj.parentNode.className 				= "searchTdLeftActive";
				obj.parentNode.nextSibling.className 	= "searchTdInactive";
				
				obj.parentNode.nextSibling.firstChild.style.color = "#A5A6A8";
				
			}
			else {
				obj.parentNode.className 					= "searchTdRightActive";
				obj.parentNode.previousSibling.className 	= "searchTdInactive";
				
				obj.parentNode.previousSibling.firstChild.style.color = "#A5A6A8";
			}
		},
		changeStateForm : function() {

			document.getElementById("icms_edit[state]").value = this.advanced;
		},
		addAttribute : function(obj, name, value) {

			obj.setAttribute(name, value);
		},
		deleteAttribute : function (obj, name) {
			
			obj.removeAttribute(name);
		}
	}
	
	matrixSearch = new matrixSearch();
