<!--#include virtual="/includes/sprog.asp"-->


//subMenu script
var lastOpenItem
function toggleMenu(obj) {
var menuItem = "menu" + obj;
var menuSubItem = "subMenu" + obj;
	if (document.getElementById(menuSubItem).style.display == "none") {
		document.getElementById(menuSubItem).style.display = "";
		if (lastOpenItem || "") {
			document.getElementById(lastOpenItem).style.display = "none";
			lastOpenItem = menuSubItem;
		}
		else {
			lastOpenItem = menuSubItem;
		}
	}
	else {
		document.getElementById(menuSubItem).style.display = "none";
		lastOpenItem = "";
	}
return false;
}

//suSubMenu script
var lastOpenSubItem
function toggleSubMenu(obj) {
var menuSubItem = "subMenu" + obj;
var menuSubSubItem = "subSubMenu" + obj;
	if (document.getElementById(menuSubSubItem).style.display == "none") {
		document.getElementById(menuSubSubItem).style.display = "";
		if (lastOpenSubItem || "") {
			document.getElementById(lastOpenSubItem).style.display = "none";
			lastOpenSubItem = menuSubSubItem;
		}
		else {
			lastOpenSubItem = menuSubSubItem;
		}
	}
	else {
		document.getElementById(menuSubSubItem).style.display = "none";
		lastOpenSubItem = "";
	}
return false;
}


//Toggle script
function toggleItem(obj) {
	if (document.getElementById(obj).style.display == "none") {
		document.getElementById(obj).style.display = "";
	}
	else {
		document.getElementById(obj).style.display = "none";
	}
}


//Popup script

// Variables:

// 750 - width
// 450 - height
// resizable - window can be resized
// scrollbars - window displays the scrollbar on the right
// status - window displays the status bar at the bottom
// toolbar - window displays the toolbar at the top
//<a href="#null" onClick="newWindow('/pages/bruger/retFoto.asp','','650','250','resizable,scrollbars,status,toolbar')">Click Here</a>
// Note: href="#null" makes the link display as a link. Don't leave it out!

var win = null;
function newWindow(mypage,myname,w,h,features) {
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}


/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

//var clickmessage="Billedet er beskyttet af ophavsret!"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()


/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"

}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip
