function $(elem) {
	return document.getElementById(elem);
}

function go(loc)
{
	document.location.href = loc;
}

function goHide(obj)
{
	obj.style.display = 'none';
}

function goFocus(obj)
{
	obj.focus();
}

function goToggle(id)
{
	elem = $(id);

	if (elem.style.display == 'none') {
		elem.style.display = 'block';
	} else {
		elem.style.display = 'none';
	}
}

function goShow(obj)
{
	obj.style.display = 'block';
}

function goDisable(obj)
{
	obj.disabled = true;
}

function goEnable(obj)
{
	obj.disabled = false;
}

function goClearField(obj, text)
{
	if (obj.value == text) obj.value = '';
}

function goFillField(obj, text)
{
	if (obj.value == '') obj.value = text;
}

function goPopup(where)
{
	window.open(where);
}

function goPopupMinimal(loc)
{
	window.open (loc, 'new_window', 'toolbar=no,status=no,resizable=yes,menubar=no,location=no,scrollbars=yes');
}

function launchDownload(fileurl)
{
	setTimeout('goShow($(\'advice\'))','2000');

	go(fileurl);
}

function resizeWindow(w, h)
{
	var leftVal = Math.round((screen.width / 2) - (w/2));
	var topVal = Math.round((screen.height / 2) - (h/2));

	window.resizeTo(w,h);
	window.moveTo(leftVal, topVal);
}