function targetLinks() {
	var url
	for (i=0; i < document.links.length; i++) {
		url = document.links(i).href
		if (!((url.indexOf("pitbull.dk")>-1)||(url.indexOf("www.pitbull.dk")>-1)||(url.indexOf("javascript")>-1)||(url.indexOf("localhost")>-1))) {
			document.links(i).target = "_blank"
		}
	}
}

function removeCartItem(itemId) {
	document.all.universal.action='cart.asp?mode=remove&itemid='+itemId;
	document.all.universal.submit();
}

function popPage(pageURL) {
	popup(pageURL, "popup", 450, 300, 1)	
}

function popImage(imageId) {
	popup("/popupimage.asp?id="+imageId, "popup", 50, 50, 0)
}

function moveOptions(oSource, oTarget) {
	var oSourceItem, oTargetItem
	var aRemove = Array() // Array of item-indexes to be removed
	var iCount = 0 // Item-count
	var iNewIndex
	for (i=0; i < oSource.length; i++) {
		if (oSource.item(i).selected) {
			iCount++
			aRemove[iCount] = i
			oSourceItem = oSource.item(i)
			oTargetItem = document.createElement("OPTION")
			oTargetItem.text = oSourceItem.text
			oTargetItem.value = oSourceItem.value
			iNewIndex = oTarget.length
			
			// Find correct target position (sort)
			for (j=0; j < oTarget.length; j++) {
				if (oSource.item(i).text < oTarget.item(j).text) {
					iNewIndex = j
					break
				}
			}
			oTarget.add(oTargetItem, iNewIndex)
		}
	}
	
	// Remove selected items
	for (i=1; i <= iCount; i++) {
		oSource.remove(aRemove[i]-(i-1))
	}
}

function selectAllOptions(oSelect) {
	for (i=0; i < oSelect.length; i++) {
		oSelect.item(i).selected = true
	}
}

function sure() {
	return confirm("Er du sikker?")
}

function alignMenuRight(oMenu) {
	var oDiv
}

function showMenu(oMenu) {
	oMenu.className = "menuheaderhighlight"
	oMenu.all.menu.style.display = "";
}

function hideMenu(oMenu) {
	oMenu.all.menu.style.display = "none";
	oMenu.className = "menuheader"
}

function popup(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+50+',left='+50+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
