/*var isNS = (navigator.appName == "Netscape") ? 1 : 0;
var EnableRightClick = 0;
if(isNS) 
document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler(){
  if(EnableRightClick==1){ return true; }
  else {return false; }
}
function mousehandler(e){
  if(EnableRightClick==1){ return true; }
  var myevent = (isNS) ? e : event;
  var eventbutton = (isNS) ? myevent.which : myevent.button;
  if((eventbutton==2)||(eventbutton==3)) return false;
}
function keyhandler(e) {
  var myevent = (isNS) ? e : window.event;
  if (myevent.keyCode==96)
    EnableRightClick = 1;
  return;
}
document.oncontextmenu = mischandler;
document.onkeypress = keyhandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;

*/

function skiftIframeHeigth() {
	if (document.getElementById('kortIframe').style.height == '400px') {
		document.getElementById('kortIframe').style.height = '0px';
		document.getElementById('kortIframeTxt').innerText = 'Vis kortfunktion';
	  } else {
		document.getElementById('kortIframe').style.height = '400px';
		document.getElementById('kortIframeTxt').innerText = 'Skjul kortfunktion';
	}
}

var oldColor = "";
function skiftFarveOver(what) {
	oldColor = document.getElementById(what).style.backgroundColor;
	document.getElementById(what).style.backgroundColor = '#d2d2d2';
}

function skiftFarveOut(what) {
	document.getElementById(what).style.backgroundColor = oldColor;
}

function visDetails(what,what2) {
	document.getElementById('visVareIframe').style.display = 'block';
	document.getElementById('visVareIframe').src = 'VisKundeDetails.asp?KundeID=' + what + '&undergruppeID=' + what2;
}

var oldMenu = "";
function visSkjul(what) {
	if (document.getElementById(what).style.display != 'none') {
		document.getElementById(what).style.display = 'none';
	  } else {
		document.getElementById(what).style.display = 'block';
		if (oldMenu != "") {document.getElementById(oldMenu).style.display = 'none'};
		oldMenu = what;
	}
}

function skiftLinkBlok() {
	if (LinkBlok.style.display = "none") {
		 LinkBlok.style.display = "block";
	  } else {
		 LinkBlok.style.display = "none";
	}
}

var tabBaseName = "tab";
var tabContentBaseName = "content";
var tabNum = 4;

function setTab(tab) {
	for (i = 0; i < tabNum; i++ ) {
		document.all[tabBaseName + i].style.margin = "0";
		document.all[tabBaseName + i].style.marginBottom = "-2";
		document.all[tabBaseName + i].style.zIndex = "1";
		document.all[tabContentBaseName + i].style.display = "none";
	}
	if (tab > 0) document.all[tabBaseName + (tab-1)].style.marginRight = "-2";
	document.all[tabBaseName + tab].style.marginBottom = "0";
	document.all[tabBaseName + tab].style.zIndex = "2";
	document.all[tabContentBaseName + tab].style.display = "block";

	if (tab < (tabNum-1)) document.all[tabBaseName + (tab+1)].style.marginLeft = "-2";
}

