function wopen(url, w, h)
{
        // Fudge factors for window decoration space.
	// In my tests these work well on all platforms & browsers.
        w += 26;
        h += 46;
	var win = window.open(url,
		'popup', 
		'width=' + w + ', height=' + h + ', ' +
		'location=no, menubar=no, ' +
		'status=no, toolbar=no, scrollbars=no, resizable=yes');
	//win.resizeTo(w, h);
	win.focus();
}

function menu_switchActiveItem(a_new_item,a_items)
{
	position_highlight = '0px -20px';
	position_normal = '0px 0px';
	item_prefix = 'menu_item_';

	for(i=0;i<a_items.length;i++) {
		if (typeof(document.getElementById(item_prefix + a_items[i])) != 'undefined') {
    		//document.getElementById(item_prefix + a_items[i]).style.backgroundPosition = position_normal;
    		document.getElementById(item_prefix + a_items[i]).className = "";
    	}
    }
    
	//document.getElementById(item_prefix+a_new_item).style.backgroundPosition = position_highlight;
    document.getElementById(item_prefix+a_new_item).className = "active";

	return true;
}

function setCheckboxes(a_form, a_varname, a_elements, a_check)
{
	for(i=0;i<a_elements.length;i++) {
		if (typeof(document.forms[a_form].elements[a_varname + a_elements[i]]) != 'undefined') {
    		document.forms[a_form].elements[a_varname + a_elements[i]].checked = a_check;
    	}
    }

    return true;
}


function btn_on(a_item)
{
	position_highlight = '0px -20px';
	position_normal = '0px 0px';
	item_prefix = 'menu_item_';
	
	//document.getElementById(item_prefix+a_item).style.backgroundPosition = position_highlight;
}

function btn_off(a_item)
{
	position_highlight = '0px -20px';
	position_normal = '0px 0px';
	item_prefix = 'menu_item_';
	
	//document.getElementById(item_prefix+a_item).style.backgroundPosition = position_normal;
}

