// JavaScript Document

var active = false;

function shownav(reference){
	reference.className = "navibox";
}

function hidenav(reference){
	reference.className = "navibox_closed";
}

function init(){
	if(active && document.getElementById(active)){
		var node = document.getElementById(active).lastChild;
		while(node.nodeName.toLowerCase() != "a"){
			node = node.previousSibling;
		}
		node.style.backgroundPosition = "0px -46px";
	}
}

b64s='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';

function decode(t){
	var r=''; var m=0; var a=0; var c;
	for(n=0; n<t.length; n++){
		c=b64s.indexOf(t.charAt(n));
		if(c >= 0){
			if(m) r+=String.fromCharCode((c << (8-m))&255 | a);
			a = c >> m;
			m+=2;
			if(m==8) m=0;
		}
	}
	return r;
}

function insertMailto(str, subj){
	document.write('<a href="mailto:' + decode(str) + '?subject=' + subj + '">' + decode(str) + '<\/a>');
}

function insertAddress(str){
	document.write(decode(str));
}
