function CreateProductSearch(id, sitedirectoryId, customerType){
	var obj = new Object()
	obj.Id = id;
	obj.SitedirectoryId = sitedirectoryId;
	obj.AjaxTextContainer = 'ajaxProductSearch';
	
	obj.UI = new Object();
	obj.UI.ErrorMessage = function(){return document.getElementById("errSearch" + id);}
	obj.UI.SearchResult = function(){return document.getElementById("searchResult" + id);}
	
	obj.ProductSearch = function(searchtext, typeofsearch, pagenumber) {
		if(pagenumber === undefined) {
			pagenumber = 1;
		}
		var response = ProductSearchFull.AjaxProductSearch(searchtext, typeofsearch, sitedirectoryId, pagenumber);
		if(response.error != null){
			this.UI.ErrorMessage().innerHTML = response.error.Message;
			this.UI.ErrorMessage().style.display = 'block';
		} else {
			this.UI.SearchResult().innerHTML = response.value;
			//renderSifr();
		}
	}
	
	obj.SelectButton = function(div, pushedButton) {
		// narrow the "search" through elements
		var div = document.getElementById(div)
		var elems = div.getElementsByTagName('*')
		
		for(var i = 0; i < elems.length; i++) {
			if(elems[i].id) {
				// price level of the gift
				if(pushedButton.id.indexOf('price_') >= 0) {
					if(elems[i].id.indexOf('price_') >= 0) {	
						if(elems[i].className.indexOf = 'active') {
							elems[i].className = elems[i].className.replace('active', '');
						}
					}
				// occation/type of gift
				} else if (pushedButton.id.indexOf('occation_') >= 0) {
					if(elems[i].id.indexOf('occation_') >= 0) {	
						if(elems[i].className.indexOf = 'active') {
							elems[i].className = elems[i].className.replace('active', '');
						}
					}
				// all products. clear selected
				} else {
					if(elems[i].className.indexOf = 'active') {
						elems[i].className = elems[i].className.replace('active', '');
					}
				}
			}
		}
		pushedButton.className = pushedButton.className + ' active';
	}
			
	
	return obj;
}
