function openWindow(url)
{
	/*return openWindowEx(url, "Information", "800", "600");*/
	/*var wnd = window.open(url, "Information", "dependent=yes,location=no,menubar=no,resizeable=yes,scrollbars=yes,status=no,toolbar=yes");*/
	var wnd = window.open(url);
	if (wnd) {
		wnd.opener = this;
		wnd.focus();
	}
	return wnd;
}

function openWindowEx(url, title, width, height)
{
	var wnd = window.open(url, title, "dependent=yes,width=" + width + ",height=" + height + ",location=no,menubar=no,resizeable=yes,scrollbars=yes,status=yes,toolbar=yes");
	wnd.opener = this;
	wnd.focus();
	return wnd;
}

function openWindowRaw(url, title)
{
	window.open(url, title, "dependent=yes,location=yes,menubar=yes,resizeable=yes,scrollbars=yes,status=yes,toolbar=yes");
}

function openWindowRawEx(url, title, width, height)
{
	var wnd = window.open(url, title, "width=" + width + ",height=" + height + ",dependent=yes,location=yes,menubar=yes,resizeable=yes,scrollbars=yes,status=yes,toolbar=yes");
	wnd.opener = this;
	wnd.focus();
	return wnd;
}

function setImageAndOpenWindow(id, path, url)
{
	elements = document.getElementsByName('manual');
	for (pos = 0; pos < elements.length; pos++)
		elements[pos].setAttribute("src", path + "check0.png");
	document.getElementById(id).setAttribute("src", path + "check1.png");
	return openWindowEx(url, "Information", "800", "600");
}

function onCheckbox(url, itemMpID, korID)
{
	document.location.href = url;
}

function askPayment(text, urlOK, urlNotOK)
{
	res = confirm(text);
	if (res == true)
		document.location.href = urlOK.replace(/&amp;/g, "&");
	else
		document.location.href = urlNotOK.replace(/&amp;/g, "&");
	return res;
}

function askFluids(text, popupUrl) {
	var result = confirm(text);
	if (result == true)
		openWindow(popupUrl);
	return false;
}

function openNumberSearch(authId) {
	var url = "PartNumbers.aspx";
	url += "?authId=" + authId;
	openWindowEx(url, "", 800, 600);
}
