
/*highlight: endre rad farge*/
function hl(rowid,on){
	// var xceptclr = '#dcdcdc'; //unntaksfarge
	var xceptclr = '#E7FFE7'; //unntaksfarge
	var hlclr = '#efefef'; //markeringsfarge
	var normclr = '#ffffff';
	for (var i=0;i<document.getElementById(rowid).childNodes.length;i++)
		{
		if(!on){
			if (document.getElementById(rowid).childNodes[i].style.background!=xceptclr){
				document.getElementById(rowid).childNodes[i].style.background=normclr;
			}
		}else{
			if (document.getElementById(rowid).childNodes[i].style.background!=xceptclr){
				document.getElementById(rowid).childNodes[i].style.background=hlclr;
			}
		}
	}	
}
function hl(rowid,on,onclr,offclr,xclr){
	var oTR = typeof(rowid)=='object'?rowid:document.getElementById(rowid);
	if(!oTR)return;
	
	//standarder
	if(!onclr)onclr='#f5f5f5';   //mouseover
	if(!offclr)offclr='#ffffff'; //mouseout
	if(!xclr)xclr='#dcdcdc';     //exception
	
	
	if((onclr.substring(0,1)!='#')||(offclr.substring(0,1)!='#')){
		// Bruk css-klasser
		if(!on){
			if(EditCSS('check',oTR,xclr)==false)EditCSS('remove',oTR,onclr);
		}else{
			if(EditCSS('check',oTR,xclr)==false)EditCSS('add',oTR,onclr);
		}
	}else{
		//løp gjennom alle celler i rad
		for (var i=0;i<oTR.childNodes.length;i++){
			TD=oTR.childNodes[i];
			if(TD.style){
				if(!on){
					if (TD.style.background!=xclr||oTR.style.background!=xclr)TD.style.background=offclr;
				}else{
					if (TD.style.background!=xclr||oTR.style.background!=xclr)TD.style.background=onclr;
				} //on
			}
		}	//for
	}//css?
}
function show(objid){
	document.getElementById(objid).style.display='';
	// document.getElementById(objid).style.position='';
}
function hide(objid){
	document.getElementById(objid).style.display='none';
	// document.getElementById(objid).style.position='absolute';
}
//vis/skjul detaljer
function detail(detailid, rowid, xid){
	if (xid!="") {
		re=/pluss/
		txt=document.getElementById(xid).src
      	if (txt.search(re)!=-1) {
      		document.getElementById(xid).src='images/minus.gif'
      	}
      	else {
      		document.getElementById(xid).src='images/pluss.gif'
      	}
	}
	if(document.getElementById(detailid).style.display=='none'){		
		/*for (var i=0;i<document.getElementById(rowid).childNodes.length;i++)
		{document.getElementById(rowid).childNodes[i].style.background='#dcdcdc';}*/
		show(detailid);
	}else{
		/*for (var i=0;i<document.getElementById(rowid).childNodes.length;i++)
		{document.getElementById(rowid).childNodes[i].style.background='#ffffff';}*/
		hide(detailid);
		}	
}