function Search(){
	if (document.frmSearch.cat.value == '') {
		alert('Please select a category!');
	}
	else if (document.frmSearch.key.value == '') {
		alert('Please enter a keyword!');
		document.frmSearch.key.focus();
	}
	else {
	    category = document.frmSearch.cat.value;
		keyword = document.frmSearch.key.value;
		//window.location = document.frmSearch.cat.value + '.php?k=' + keyword;
		window.location = 'searchproduct.php?cat=' + category + '&key=' + keyword;
	}
}

function CheckKey() {
	if (window.event.keyCode == 13) {
		Search();
	}
	return false;
}

function jsOpenhWnd (u) {
	p = "height=660,width=380,toolbar=no,directories=no,status=no,scrollbars=auto,resizable=no,menubar=no";
	hWnd = window.open (u, "Hwnd", p);
	hWnd.focus();
}

function OpenWindow(mypage, myname, w, h, scroll) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
    win = window.open(mypage, myname, winprops)
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function pop_window(url) {
    var popit = window.open(url,'console','menubar=no,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=no,width=300,height=500');
}

function setBookmark(url,str){
    if(str=='')str=url;
    if (document.all)window.external.AddFavorite(url,str);
    else alert('Press CTRL and D to add a bookmark to:\n"'+url+'".');
}
