function goto_page(page, xid, target, fo) {
	var usefo
	if(fo)
		usefo = fo
	else
		usefo = 'basic display'
	setCookie('tab', '0', null, null, null, null, page + '_' + xid);
	if (target == 'parent')
		parent.location.href='display.asp?key=' + page + '&fo=' + usefo + '&rm=page&xID=' + xid
	else
		window.location.href='display.asp?key=' + page + '&fo=' + usefo + '&rm=page&xID=' + xid
	
}
function JS_on_switch_clear() {
	var cmds = document.getElementById('divUICommandBar')
	var form = cmds.getElementsByTagName('FORM')[0];
	//alert(form.innerHTML);
	var anchors = form.getElementsByTagName('A');
	for (var j=0; j < anchors.length; j++)
		if (anchors[j].getAttribute('nonstandard') == 'true') anchors[j].style.display = 'none';
	var anchors = form.getElementsByTagName('TABLE');
	for (var j=0; j < anchors.length; j++)
		if (anchors[j].getAttribute('nonstandard') == 'true') anchors[j].style.display = 'none';

}
function addButton_st(id) {
	var button = document.getElementById(id);
	if (!button) return;
	var cmds = document.getElementById('divUICommandBar')
	var form = cmds.getElementsByTagName('FORM')[0];
	//alert(form.innerHTML);
	var anchors = form.getElementsByTagName('A');
	var tables = form.getElementsByTagName('TABLE');
	for (var j=0; j < anchors.length; j++) //check for button already there
		if (anchors[j].id == id) {
			anchors[j].style.display = '';
			return;
		}
	for (var j=0; j < tables.length; j++) //check for button already there
		if (tables[j].id == id) {
			tables[j].style.display = '';
			return;
		}
	
	form.appendChild(button);
	button.style.display = '';
	button.setAttribute('nonstandard', 'true');
	//alert(form.innerHTML);
}
function hideButton_st(id) {
	var button = document.getElementById(id)
	if (!button) return;
	button.style.display = 'none';
}

