function $( id ) {
	return document.getElementById(id);
}
function over_item( e ) {
	e.style.backgroundColor = "#6699CC";
}
function leave_item( e ) {
	e.style.backgroundColor = "#b79ab9";
}
function build_menu() {
	var modified_short = "11.03.2010";
	var modified = modified_short+"&nbsp;19:30&nbsp;GMT+1";
	var items = [
		{Text: "Home", Link: "index.html"},
		{Text: "<b>Aktuelles</b>&nbsp;(<b><span style=\"color:#990000;font-size:11px;\"><i>"+modified_short+"</i></span></b>)", Link: "aktuelles.html?t=031110_4"},
		{Text: "Wie&nbsp;kann&nbsp;ich&nbsp;helfen?<br ><span style=\"font-size:9px\">(Anmeldung&nbsp;als&nbsp;Spender)</span>", Link: "wie_kann_ich_helfen.html"},
//		{Text: "Termine<br /><span style=\"font-size:9px\">(Spenden&nbsp;vor&nbsp;Ort)</span>", Link: "termine.html"},
		{Text: "Keine&nbsp;Angst&nbsp;vor&nbsp;der&nbsp;Spende", Link: "keine_angst_vor_der_spende.html"},
		{Text: "Spendenkonto", Link:"spendenkonto.html"},
		{Text: "Aufruf<br />von&nbsp;Dr.&nbsp;Thomas&nbsp;Schmidt", Link: "aufruf_schmidt.html"},
//		{Text: "Wie kann ich spenden?", Link:"wie_kann_ich_spenden.html"},
		{Text: "Reise&nbsp;nach&nbsp;Paris<br />für&nbsp;Spender", Link:"reise_nach_paris.html"},
		{Text: "Kontakte&nbsp;und<br />Ansprechpartner", Link:"kontakt.html"},
		{Text: "G&auml;stebuch", Link:"gaestebuch.html"},
		{Text: "Forum", Link:"forum.html"},
		{Text: "Namen&nbsp;von&nbsp;Spendern", Link:"namen_von_spendern.html"},
		{Text: "Presse&nbsp;aktuell", Link:"presse.html"},
		{Text: "Links", Link:"links.html"},
		{Text: "Galerie", Link:"galerie.html"},
		{Text: "Impressum", Link:"impressum.html"},
		{Text: "<b>Andere&nbsp;Betroffene:</b>", Link: "#", NoLink:true},
		{Text: "<img src=\"images/juergen_pusch.jpg\" width=\"25\" height=\"31\" vspace=\"0\" hspace=\"0\" border=\"0\"><span style=\"margin-left:10px;font-size:11px;color:#903030;\">J&uuml;rgen&nbsp;Pusch&nbsp;<span style=\"color:#000;font-size:9px;\">(02.12.07)</span>", Link: "http://www.vilvo.de/pusch/"}
	];
	var s = [];
	var item = null;
	for( var i=0; i < items.length; i++ ) {
		item = items[i];
		if( item["NoLink"] )
			s[s.length++] = '<tr><td height="23" class="nolink">'+item.Text+'</td></tr>';
		else
			s[s.length++] = '<tr><td height="23" onmouseover="over_item(this)" onmouseout="leave_item(this)" onclick="window.location.href=\''+item.Link+'\';"><a href="'+item.Link+'" target="_top">'+item.Text+'</a></td></tr>';
	}
	s[s.length++] = '<tr><td><img src="images/logos/winthrop.gif" vspace="0" style="cursor:pointer;cursor:hand;margin-left:15px;" onclick="window.open(\'http://www.winthrop.de\');" />'+
					'<p style="cursor:default;color:#ffffff;font-size:10px;">Sponsor der Aktion "Hilfe für Dr. Thomas Rösch und andere" bei der DKMS.</p></td></tr>';
	s[s.length++] = '<tr><td style="cursor:default;"><img src=\"/tinc?key=V3xYbiZj\" /></td></tr>';
	s[s.length++] = '<tr><td style="cursor:default;font-size:9px;color:#000000;">Zuletzt&nbsp;Aktuallisiert&nbsp;am<br />'+modified+'</td></tr>';
	document.getElementById("menu_content").innerHTML = '<table id="menu" cellpadding="5" cellspacing="0" border="0">'+s.join("")+'</table>';
}
function replace_mail() {
	var data = [
		["i","n","f","o","yyyyy","k","n","o","c","h","e","n","m","a","r","k","s","p","e","n","d","e",".","d","e"],
		["d","r",".","t","h","o","m","a","s",".","s","c","h","m","i","d","t","yyyyy","f","r","e","e","n","e","t",".","d","e"],
		["r","d","i","yyyyy","d","r","-","t","h","o","m","a","s","-","r","o","e","s","c","h",".","d","e"],
		["i","n","f","o","yyyyy","n","k","r","-","m","h","h",".","d","e"],
		["k","o","n","t","a","k","t","yyyyy","u","l","r","i","k","e","-","k","r","i","v","e","c",".","e","u"]
	];
	try {
		document.getElementById("dontspamus").href="mailto:"+data[0].join("").replace("yyyyy","@");
		document.getElementById("dontspamus").innerHTML = data[0].join("").replace("yyyyy","@");
	}catch(e) {}
	try {
		document.getElementById("dontspamus2").href="mailto:"+data[1].join("").replace("yyyyy","@");
		document.getElementById("dontspamus2").innerHTML = data[1].join("").replace("yyyyy","@");
	}catch(e) {}
	try {
		document.getElementById("dontspamus3").href="mailto:"+data[2].join("").replace("yyyyy","@");
		document.getElementById("dontspamus3").innerHTML = data[2].join("").replace("yyyyy","@");
	}catch(e) {}
	try {
		document.getElementById("dontspamus4").href="mailto:"+data[3].join("").replace("yyyyy","@");
		document.getElementById("dontspamus4").innerHTML = data[3].join("").replace("yyyyy","@");
	}catch(e) {}
	try {
		document.getElementById("dontspamus5").href="mailto:"+data[3].join("").replace("yyyyy","@");
		document.getElementById("dontspamus5").innerHTML = data[3].join("").replace("yyyyy","@");
	}catch(e) {}
}
var currentHeight = 0;
function resize_forum() {
	try {
		var height = 0;
		if( !isNaN(window.innerHeight) )
			height = window.innerHeight - 40;
		else
			height = screen.availHeight - 200;
		if( Math.round( height/10 )!= Math.round(currentHeight/10) ) {
			currentHeight = height;
			document.getElementById("forum").style.height = currentHeight+"px";
		}
	}catch(e){}
	setTimeout(resize_forum,500);
}
var picnames_by_id = {
	"pic1": "images/IMG_0533.JPG",
	"pic2": "images/IMG_0535.JPG",
	"pic3": "images/IMG_0537.JPG"
};
var bigpic_node = null;
function show_big_pic( id ) {
	if( bigpic_node!=null ) return;
	if( typeof id!="string" ) return;
	if( !picnames_by_id[id] ) return;
	
	bigpic_node = document.createElement("IMG");
	bigpic_node.style.position = "absolute";
	bigpic_node.style.top = "10px";
	bigpic_node.style.left = "10px";
	bigpic_node.style.width = "640px";
	bigpic_node.style.height = "480px";
	bigpic_node.src = picnames_by_id[id];
	document.getElementById("outerdiv").appendChild( bigpic_node );
}
function hide_big_pic() {
	if( bigpic_node ) {
		try {
			document.getElementById("outerdiv").removeChild( bigpic_node );
		}catch(e){}
		bigpic_node = null;
	}
}
function init( t, url ) {
	if( typeof t=="string" && t=="spenden" ) {
/*
		if( Math.random() > 0.5 ) {
			var tmpDKMS = $("Konto_DKMS").innerHTML;
			var tmpAKB = $("Konto_AKB").innerHTML;
			$("Konto_DKMS").innerHTML = tmpAKB;
			$("Konto_AKB").innerHTML = tmpDKMS;
		}
*/
	}
	if( typeof t=="string" && t=="forum" ) {
		if( typeof url!="string" ) url = "http://drtom2.carookee.com/";
		setTimeout(resize_forum, 500);
		document.getElementById("forum").src = url;
	}
	var m = ["a","n","i","t","a",".","w","e","b","e","r","yyyyy","x","-","a","x","i","s",".","n","e","t"];
	try {
		document.getElementById("spamer").href = "mailto:"+m.join("").replace("yyyyy","@");
		document.getElementById("spamer").innerHTML = ""+m.join("").replace("yyyyy","@");
	}catch(e) {}
	build_menu();
	replace_mail();
}

