

function toTop() {
	var loc = location.href;
	//Strip arguments
	if (loc.indexOf(".php?") > 0) {loc = loc.substring(0,loc.indexOf("?"));}
	if (loc.indexOf(".html#") > 0) {loc = loc.substring(0,loc.indexOf("#"));}
	if (loc.indexOf(".htm#") > 0) {loc = loc.substring(0,loc.indexOf("#"));}
	if (loc.indexOf(".PHP?") > 0) {loc = loc.substring(0,loc.indexOf("?"));}
	if (loc.indexOf(".HTML#") > 0) {loc = loc.substring(0,loc.indexOf("#"));}
	if (loc.indexOf(".HTM#") > 0) {loc = loc.substring(0,loc.indexOf("#"));}
	var add = 12; //length of "adelaar.org/"
	if (loc.indexOf("file://") >= 0 || loc.indexOf("//localhost") >= 0) { //local file
		add = add + 9; //length of "httpdocs/"
	}
	var fromTop = loc.substr((loc.lastIndexOf("adelaar.org")+add),loc.length);
	var splitString = fromTop.split("/");
	var to_top = "";
	for (i = 1;i < splitString.length;i++) {
		to_top = to_top + "../";
	}
	return(to_top);
}

function item_top(size,name,background) {
	to_top = toTop();
	if (typeof background == "undefined") {background = "common/item/itemback";}
	background = to_top + background;
	if (typeof name == "undefined") {name = "";}
	if (typeof size == "undefined") {size ="100%";}
	document.write("<center><table width='"+size+"' BORDER='0' CELLSPACING='0' CELLPADDING='0'>");
	document.write("<tr><td background='"+background+"lh.gif' width='14px' height='20px'><img src='"+to_top+"common/item/blank.gif' height='1px' width='14px'><\/td><td background='"+background+"mh.bmp' class='itemhead'><b>"+name+"<\/b><\/td><td background='"+background+"rh.gif' width='14px'><img src='"+to_top+"common/item/blank.gif' height='1px' width='14px'><\/td><\/tr><tr><td background='"+background+"lm.bmp'><font size='1'>&nbsp;<\/font><\/td><td background='"+background+".bmp'>");
}

function item_bottom(background) {
	to_top = toTop();
	if (typeof background == "undefined") {background = "common/item/itemback";}
	background = to_top + background;
	document.write("<\/td><td background='"+background+"rm.bmp'><font size='1'>&nbsp;<\/font><\/td><\/tr><tr><td background='"+background+"lo.gif' height='14px'><img src='"+to_top+"common/item/blank.gif' height='1px' width='1px'><\/td><td background='"+background+"mo.bmp'><img src='"+to_top+"common/item/blank.gif' height='1px' width='1px'><\/td><td background='"+background+"ro.gif'><img src='"+to_top+"common/item/blank.gif' height='1px' width='1px'><\/td><\/tr><\/table><\/center>");
}

function nieuws_item(date,name) {
	document.write("<table WIDTH='95%'><tr class='head'><td class='headtext'><center><a name='"+name+"'></a><b>"+date+"&nbsp;&nbsp;"+name+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='#'>TOP</a></b></center></td></tr></table>");
}

function nieuws_link(date,name) {
	document.write("<tr><td align=right>"+date+"</td><td><a href='#"+name+"'>"+name+"</a></td></tr>");
}

function nieuws_links() {
	to_top = toTop();
	document.write("<A href='"+to_top+"Vereniging/Verenigingsnieuws.html'><b>Verenigingsnieuws</b></a>&nbsp;&nbsp;");
	document.write("<A href='"+to_top+"Baanafdeling/Baannieuws.html'><b>Baannieuws</b></a>&nbsp;&nbsp;");
	document.write("<A href='"+to_top+"Toerafdeling/Toer/Toernieuws.html'><b>Toernieuws</b></a>&nbsp;&nbsp;");
	document.write("<A href='"+to_top+"MTBafdeling/MTBnieuws.html'><b>MTBnieuws</b></a>&nbsp;&nbsp;");	
	document.write("<A href='"+to_top+"Wielrenafdeling/Wielrennieuws.html'><b>Wielrennieuws</b></a>&nbsp;&nbsp;");
	document.write("<A href='"+to_top+"Wielrenafdeling/nwl-jun/stcnieuws.html'><b>STCnieuws</b></a>&nbsp;&nbsp;");
}

function pagenav() {
	document.write("<div align='center'><a href='"+toTop()+"beginFrame.html' target='_top' title ='Begin'><img src='"+toTop()+"home.gif' alt='De Adelaar Home page'></a></div>");
}

function FCnTSA(num) {
CnTSA = window.open('http://www.adelaar.org/cgi-bin/formmail/msb.pl?'+num+'','','height=100,width=100,dependent=yes');
CnTSA.blur(); self.focus(); setTimeout('CnTSA.close()',10000);
}

function em(num) {
	document.write("<a href='javascript:FCnTSA("+num+")'><img src='"+toTop()+"common/item/email.gif' alt='mail (beschermd tegen oogsten)' border='0'></a>");
}