/* 
	Quick Search Component v 1.0 
*/ 

function TQuickSearch(Name) {
	this.Name = Name;
	
	this.Root_ID_Base = "";
	this.Root_El_ID = this.Root_ID_Base + Name;
	this.TextInput_ID = this.Root_El_ID + "_W";
	this.SourceInput_ID = this.Root_El_ID + "_Source";	
	
	this.SelectedSource = "All";
	
	this.SelectSource = function(Name) {
		// [PREVIOUS]
		var Button_ID = this.Root_El_ID + "_BTN_" + this.SelectedSource;
		var Button_El = document.getElementById(Button_ID);
		if (Button_El) { Button_El.parentNode.className = ""; }	
		// [NEW]
		var Button_ID = this.Root_El_ID + "_BTN_" + Name;
		var Button_El = document.getElementById(Button_ID);
		var Source_El = document.getElementById(this.SourceInput_ID);
		if (Source_El && Button_El) { 
			Button_El.parentNode.className = "Act"; 
			Source_El.value = Name;
		}
		this.SelectedSource = Name;
		this.Focus_TextInput();
	}
	
	this.Focus_TextInput = function() {
		var W_El = document.getElementById(this.TextInput_ID);
		if (W_El) { W_El.focus(); }		
	}
		
	return this;
}