function searchkey(obj){
	var k = obj.value;
	if (k.match(/\S/)) {
		var word=k.split(/[\s,\?]+/);
		$(obj).parent().next(".brands").find("li a").each( function() {
			this.innerHTML = this.innerHTML.replace(/<\/?[^>]+(>|$)/g, "");
			var key=this.innerHTML;				
			var matched=0;
			var newText ="";
			for (w=0; w<word.length; w++) {
				if (word[w]) {
					var str = new RegExp(word[w], "gi");
					if (key.search(str) > -1) {
						matched = 1;
						while (key.search(str) > -1) {
							var io = key.search(str);
							if (key.lastIndexOf(">",io) >= key.lastIndexOf("<",io)) {
								newText += key.substring(0,io)+"<font class=matchedkey>"+ key.substr(io, word[w].length) +"</font>";
								key = key.substr(io+word[w].length);
								this.innerHTML = newText+key;
							}
						}
					} else {
						matched = 0;							
						break;
					}
				}
			}
			if (matched) {
				this.parentNode.style.display="block";
			} else {
				this.parentNode.style.display="none";
			}
		})
		if (document.all) panelHeight();
	} else {
		$(".brands li a").each(function(){
	  	 	this.parentNode.style.display="block";
	  	 	this.innerHTML = this.innerHTML.replace(/<\/?[^>]+(>|$)/g, "");
   		})
   		if (document.all) panelHeight();
	}
}
function panelHeight(){
	$(".browsePanel ul.brands").each(function(){
		var e = this;
		e.style.height = "auto";
		e.style.height = (e.offsetHeight > 200)? "200px": "auto";
	})
}
$(document).ready(function(){
	if (document.all) panelHeight();
})