function popup(url, name, w, h, l, t, scroll, status) {
	if (w == 'fullscreen') w = Math.floor(screen.availWidth * 0.99);
	if (h == 'fullscreen') h = Math.floor(screen.availHeight * 0.99);
	if (l == 'center') l = Math.floor((screen.availWidth - w) / 2);
	if (t == 'center') t = Math.floor((screen.availHeight - h) / 2);
	scroll =  scroll || 'yes';
	status =  status || 'no';
	arg = 'toolbar=no,menubar=no,location=no,scrollbars=' + scroll + ',personalbar=no,directories=no,status=' + status + ',resizable=yes,width=' + w + ',height=' + h + ',left=' + l + ',top=' + t;
	newWin = window.open(url, name, arg);
	newWin.resizeTo(w, h);
	newWin.focus();
}

function validateForm(obj) {
	str = obj.value.replace(/^(\s+)|(\s+)$/g, "");
	if (str != '') {
		obj.value = str;
		return true;
	}
	obj.value = '';
	obj.focus();
	return false;
}

function menuItem(obj, mode, menu) {
	if (obj.style && document.getElementById) {
		switch (menu) {
			case 'top':
				colors = new Array('#F3F3F3', '#000000', '#000000', '#FFFFFF');
				break;
			case 'left':
				colors = new Array('#D0D0D0', '#E4E4E4');
				break;
		}

		obj.style.backgroundColor = (mode == 'on') ? colors[0] : colors[1];
		if (menu == 'top')
			obj.childNodes[0].style.color = (mode == 'on') ? colors[2] : colors[3];
	}
}
