function base64Decode(str){str=str.replace(/[^a-zA-Z0-9\+\/\=]/g,"");var len=str.length,out="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i64=new Array(256),i;for(i=0;i<256;i++)i64[i]=-1;i64[43]=62;i64[47]=63;for(i=48;i<58;i++)i64[i]=i+4;for(i=65;i<91;i++)i64[i]=i-65;for(i=97;i<123;i++)i64[i]=i-71;i=0;do{enc1=i64[str.charCodeAt(i++)];enc2=i64[str.charCodeAt(i++)];enc3=i64[str.charCodeAt(i++)];enc4=i64[str.charCodeAt(i++)];chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;out+=String.fromCharCode(chr1);if(enc3!=-1)out+=String.fromCharCode(chr2);if(enc4!=-1)out+=String.fromCharCode(chr3);}while(i<len);
return out;};

function toggleVis(el){
	$(el).toggle();
}

function preprocessElements() {
	// hide content divs
	$("skillscontent","portfoliocontent","mugcontent","msgcontent","bookmarkcontent").invoke('toggle');
	if (!document.getElementsByTagName) return;
	// replace "rel='external'" with a DOM target, "target" is deprecated in xhtml
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel")) {
			var rel = anchor.getAttribute("rel");
			if (rel == "external") {
				anchor.target = "_blank";			
			} else if (rel.substring(0,9) == "external:") {
				anchor.target = rel.substring(9, rel.length);
			} 
		}
	}
}
window.onload = preprocessElements;
