function targetLinks() {
	var url
	for (i=0; i < document.links.length; i++) {
		url = document.links(i).href
		if (!((url.indexOf("babesline.dk")>-1)||(url.indexOf("babesline.net")>-1)||(url.indexOf("javascript")>-1)||(url.indexOf("localhost")>-1))) {
			document.links(i).target = "_blank"
		}
	}
}

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='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function popupDescription(text) {
	//obj.onmouseout = "hideDescription();"
	divDescription.innerHTML = text
	divDescription.style.display = ""
	divDescription.style.left = event.x + 15
	divDescription.style.top = event.y + 15
}

function hideDescription() {
	divDescription.style.display = "none"
}
