/* use with id */
function view_address() {
	if(!document.getElementById("e"))return;
	address_to_replace=document.getElementById("e").childNodes[1];
	real_address=address_to_replace.nodeValue.replace("[at]", "@");
	address_to_replace.nodeValue=real_address; 
	address_to_replace.parentNode.setAttribute("href", "mailto:"+real_address); 

	if(!document.getElementById("e2"))return;
	address_to_replace=document.getElementById("e2").childNodes[0];
	real_address=address_to_replace.nodeValue.replace("[at]", "@");
	address_to_replace.nodeValue=real_address; 
	address_to_replace.parentNode.setAttribute("href", "mailto:"+real_address); 
}

window.onload = function() { view_address();}


/* use with class, not done yet though... */
function addressFix(){
	if (document.getElementsByTagName) {
		var a = document.getElementsByTagName("a")
		var i
		for (i = 0; i < a.length; i++) {
			if (a[i].className && a[i].className == "e") {
				address_to_replace = a[i]
			}
		}
	}
}


function highlight_menu(id){ hm(id);}
function hm(id){
	var menu_item = document.getElementById(id);
	menu_item.className = 'menu_selected';
}

function slettFaq(){
	var hilsen = document.forms[0].pageid.value;
	if(confirm("Vil du virker slette hilsen nr"+hilsen)){
		location.href="faq.php?action=delete&id="+hilsen;
	}
	else 
		return false;
}
