// norsjo.js

// 2006-05-14 19:28:29 (Jake): created
// 2006-10-23 23:29:28 (Jake): added
// 2007-01-01 13:54:16 (Jake): added support for IE
// 2007-03-13 21:30:08 (Jake): added confirmRemoval

function confirmRemoval(name, theUrl)
{
	if (confirm("Vill du verkligen ta bort " + name + "?"))
		location.href=theUrl;
}

function buyItem(pid, search)
{
	var num;

	eval("num = document.webshopform.num" + pid + ".value");

	location.href = "webshop.php?pid=" + pid + "&num=" + num + "&action=buy" + "&search=" + search;
}

function orderConfirm(theUrl)
{
	if (confirm("OK att skicka beställning?")) {
		location.href=theUrl;
	}
}

function doPopup(link, name)
{
  var type, win, w, h;
	var ww, wh;
	
  w = screen.width;
	h = screen.height;

	if (w > 1024) {
		link = link + "&maxi=1";
		ww = 820;
		wh = 650;
	}
	else {
		ww = 640;
		wh = 540;
	}

	type = 'menubar=yes,resizable=yes,width=' + ww + ',height=' + wh;

	win = window.open(link, 'reservdel_popup', type);

	if (win == 0) {
		alert("Din webbläsare har förhindrat öppnandet av ett popupfönster.");
	}
}
