
function top_category_change(dropdown) {
	var myindex = dropdown.selectedIndex;

	if (myindex != 0) {
		var SelValue = dropdown.options[myindex].value;
		var baseURL = "http://www.kitchenyourway.com/cabinet/index.php?catid=" + SelValue;
		top.location.href = baseURL;
	}

	return true;
}

function verify_dialog(msg) {
	return confirm(msg);
}

function open_dialog(url, name, width, height) {
	var baseoptions = "directories=no,location=no,personalbar=no,scrollbars=yes,toolbar=no,status=yes";
	if ((width > 0) && (height > 0)) {
		baseoptions += ",width=" + width + "," + "height=" + height;
	}
	var win = window.open(url, name, baseoptions);
	win.focus();
	return win;
}

function open_window(url, name) {
	var baseoptions = "directories=no,location=yes,personalbar=no,scrollbars=yes,toolbar=yes,status=yes";
	var win = window.open(url, name, baseoptions);
	win.focus();
	return win;
}

function form_checkall(frm,target) {
	var len = frm.elements.length;
	for (var i = 0; i < len; i++) {
		var e = frm.elements[i];
		if (e.name == target) {
			e.checked = true;
		}
	}
}

function form_clearall(frm,target) {
	var len = frm.elements.length;
	for (var i = 0; i < len; i++) {
		var e = frm.elements[i];
		if (e.name == target) {
			e.checked = false;
		}
	}
}

function form_countchecked(frm,target) {
	var len = frm.elements.length;
	var counter = 0;
	for (var i = 0; i < len; i++) {
		var e = frm.elements[i];
		if ((e.name == target) && e.checked) {
			counter++;
                }
        }
	return counter;
}
