function goToLocation(loc) {
	window.location=loc;
}

function setFocus(field) {
	un = document.getElementById(field);
	un.focus();
}

function dialog(filter, w, h, scroll, winname) {
	var s = scroll == "undefined" ? 0 : scroll;
	var wname = winname == "undefined" ? "" : winname;
	openwindow("index.php?page=" + filter, wname, w, h, s);
}

function dialog_pic(filter, w, h, scroll, winname) {
	var s = scroll == "undefined" ? 0 : scroll;
	var wname = winname == "undefined" ? "" : winname;
	openwindow(filter, wname, w, h, s);
}


function openwindow(url, where, sizeX, sizeY, scrollbar, resize) {
		if (document.all) var xMax = screen.width, yMax = screen.height;
		else
			if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight;
			else var xMax = 800, yMax=600;
		var xOffset = (xMax - sizeX)/2, yOffset = (yMax - sizeY)/2;
		if (yOffset > 30) yOffset = yOffset - 30;
		else yOffset = 0;
		resolveit = 'width=' + sizeX + ', height=' + sizeY + ', directories=0, hotkeys=0, location=0, menubar=0, resizable='+ resize +', screenX='+ xOffset +', screenY=' + yOffset +', scrollbars=' + scrollbar +', status=0, toolbar=0, left=' + xOffset +', top=' + yOffset;
		nWin = window.open(url, where, resolveit);
		nWin.focus();
}