var timer_id;
function scroll_iframe(frm,inc,dir) {
  if (timer_id)
		clearTimeout(timer_id);
  if (window.frames[frm]) {
    if (dir == "v")
			window.frames[frm].scrollBy(0, inc);
    else
			window.frames[frm].scrollBy(inc, 0);
    timer_id = setTimeout("scroll_iframe('" + frm + "'," + inc + ",'" + dir + "')", 20);
  }
}

function stopScroll() {
  if (timer_id) clearTimeout(timer_id);
}

function last_update() {
  date = new Date(document.lastModified);
  dato = write_date_danish(date);
 	document.getElementById("last_update").innerHTML = dato;
}

function write_date_danish(date) {
	var day = date.getDate();

	var mon = date.getMonth() + 1;
  switch(mon) {
    case 1:
      month = "januar"
      break;
    case 2:
      month = "februar"
      break;
    case 3:
      month = "marts"
      break;
    case 4:
      month = "april"
      break;
    case 5:
      month = "maj"
      break;
    case 6:
      month = "juni"
      break;
    case 7:
      month = "juli"
      break;
    case 8:
      month = "august"
      break;
    case 9:
      month = "september"
      break;
    case 10:
      month = "oktober"
      break;
    case 11:
      month = "november"
      break;
    case 12:
      month = "december"
      break;
  }

	var year = date.getYear();
	if (year < 2000) {
		year = (year + 1900).toString();
	}
	var dato = day + ". " + month + " " + year;
  return dato;

}

function vis_infoside(side, infotitel) {
	frames['infoiframe'].location.href = side;
	document.getElementById("info_titel").innerHTML = infotitel;
	document.getElementById("info_titel").className = "col_titel";
}

function skjul_infoside() {
	frames['infoiframe'].location.href = "empty.php";
	document.getElementById("info_titel").innerHTML = "";
	document.getElementById("info_titel").className = "skjult";
}

function resize_iframe(){  //"udefra", dvs. fra hovedsiden
	ifr = document.getElementById('infoiframe');

	if (!document.all) {  //for Firefox
		h = ifr.contentDocument.getElementById('ifrbody').clientHeight + 100;
		document.getElementById('infoiframe').style.height = h + 'px';
	}
	else {  //for IE
		h = ifr.document.body.scrollHeight + 100;  //tager højden af indholdet af dokumentet i iframen
		ifr.style.height = h + 'px';  //og sætter iframe-højden til indholdets højde
	}
}

function resize_iframe_within(){  //"indefra", dvs. fra en iframe-body
	ifr = parent.document.getElementById('infoiframe');
	if (!document.all) {  //for Firefox
		h = ifr.contentDocument.getElementById('ifrbody').clientHeight + 100;
		parent.document.getElementById('infoiframe').style.height = h + 'px';
	alert(h);
	}
	else {  //for IE
		h = parent.ifr.document.body.scrollHeight + 100;  //tager højden af indholdet af dokumentet i iframen
		parent.ifr.style.height = h + 'px';  //og sætter iframe-højden til indholdets højde
	alert("IE");
	}
}


function show_umenu(menu) {
	menu.id = 'menu_hl';
	for(i=0;i<menu.childNodes.length;i++) {
		if (menu.childNodes[i].nodeName == "DIV") {  //kun de nodes der er element nodes
      menu.childNodes[i].className = 'umenu_show';
		}
	}
}

function hide_umenu(menu) {
	menu.id = 'menu_no_hl';
	for(i=0;i<menu.childNodes.length;i++) {
		if (menu.childNodes[i].nodeName == "DIV") {
      menu.childNodes[i].className = 'umenu_hide';
		}
	}
}

function menu_hl(umenu) {
	umenu.style.backgroundColor = '#f067a4';
}

function menu_no_hl(umenu) {
	umenu.style.backgroundColor = '#BFDCDC';
}


