	// Static Javascript Library
	
	// browser check
	var imgdir = "/images/templates/standard/";
	var w3c=(document.getElementById)? true: false;
	
	var ie=(document.all)? true: false;
	var ie5=(w3c && document.all)? true : false;
	
	var ns4=(document.layers)? true: false;
	var ns6=(w3c && (navigator.appName=="Netscape"))? true: false;
	
	// mouseovers
	var preloadFlag = false;
	
	// pulldown menu
	var enableMenu = false;
	var use_timeout = true;
	var menuArray = Array();
	var menuCounter = 0;
	var menu_obj = false;
	var lastX = 0;
	var lastY = 0;
	var bTranState = 0;
	
	// countdown script
	var timerID;
	var timerRunning = false;
	var now = 0;
	var lastday = new Date();
	var secPerDay = 0;
	var minPerDay = 0;
	var hourPerDay = 0;
	var secsLeft = 0;
	var secsRound = 0;
	var secsRemain = 0;
	var minLeft = 0;
	var minRound = 0;
	var minRemain = 0;
	var timeRemain = 0;
	var decremain = 0;
	var decround = 0;
	var cntdnobj;
	var caretPos;
	var normalstatus = "K.S.V. Woord & Daad";
	
	//popup move spul
	var mx = 0; var my = 0; // muispositie bepaler
	var ex = 0; var ey = 0;
	var curwidth = 320; var curheight = 240;
	var mvpop = false; var mvinit = true;
	var rspop = false; var rsinit = true;
	var sminit = true;
	var smcontentobj = null; var crossobj = null;
	var poptitleobj = null; var popcloseobj = null;
	var popresizeobj = null;
	var smPopZIndex = 333;
	
	var offsetxpoint=-60; //Customize x offset of tooltip
	var offsetypoint=20; //Customize y offset of tooltip
	var enabletip=false;
		
	function show_smileys() {
		crossobj = ns6? document.getElementById("smileypopup") : document.all.smileypopup;
		crossobj.style.zIndex = smPopZIndex;
		crossobj.style.visibility = "visible";
		if (sminit) {
			crossobj.innerHTML = smileyboardText;
			smcontentobj = ns6? document.getElementById("smileycontent") : document.all.smileycontent;
			poptitleobj = ns6? document.getElementById("pop_title") : document.all.pop_title;
			popcloseobj = ns6? document.getElementById("pop_close") : document.all.pop_close;
			popresizeobj = ns6? document.getElementById("pop_resize") : document.all.pop_resize;
			smcontentobj.style.border =  "0px";
			smcontentobj.style.overflow = "auto";
			smcontentobj.style.height = (curheight-20)+"px";
			crossobj.style.width = curwidth+"px";
			crossobj.style.height = curheight+"px";
			crossobj.style.top = "415px";
			crossobj.style.left = "290px";
			poptitleobj.style.width = (curwidth-20)+"px";
			popcloseobj.style.left = (curwidth-20)+"px";
			popresizeobj.style.left = (curwidth-7)+"px";
			popresizeobj.style.top = (curheight-1)+"px";
			sminit = false;
		}
		mvinit = true;
		rsinit = true;
	}
	
	function smileypop_mousedown(evt){
		if (mvinit) {
			ex = mx - findPosX(crossobj);
			ey = my - findPosY(crossobj);
			mvinit = false;
		}
		mvpop = true;
		return false;
	}
	
	function smileypop_resize(evt){
		if (rsinit) {
			ex = mx - curwidth;
			ey = my - curheight;
			rsinit = false;
		}
		rspop = true;
	}
	
	function smileypop_mouseup() {
		mvpop = false;
		mvinit = true;
		rspop = false;
		rsinit = true;
		return false;
	}
	
	function smileypop_move() {
		if (mvpop) {
			var x = mx - ex;
			var y = my - ey;
			crossobj.style.left=x+'px';
			crossobj.style.top=y+'px';
		}else if (rspop) {
			curwidth = Math.max((mx - ex), 20);
			curheight = Math.max((my - ey), 20);
			crossobj.style.width=curwidth+'px';
			crossobj.style.height=curheight+'px';
			poptitleobj.style.width = (curwidth-20)+"px";
			popcloseobj.style.left = (curwidth-20)+"px";
			smcontentobj.style.height = (curheight-20)+"px";
			popresizeobj.style.left = (curwidth-7)+"px";
			popresizeobj.style.top = (curheight-1)+"px";
		}
	}
	
	function smileypop_mousemove(evt){
		mx = (ie5)?event.clientX+ietruebody().scrollLeft:evt.pageX;
		my = (ie5)?event.clientY+ietruebody().scrollTop:evt.pageY;
		if(!ns6)smileypop_move();
		if(!mvpop && !rspop)return false;
	}
	
	function hidebox(){
		crossobj.style.visibility = "hidden";
	}
	
	function store_ta_pos(text) {
		if (text.createTextRange) {
			text.caretPos = document.selection.createRange().duplicate();
		}
	}

	function add_ta_text(formname, taname, text) {
		e = eval("document."+formname+"."+taname);
		if (e.createTextRange && e.caretPos) {
			var caretPos = e.caretPos;
			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
			text + ' ' : text;
		}else {
			e.value += text;
		}
		e.focus(caretPos);
		return;
	}
	
	// clear input
	function clearme(form,iput,def) {
		e = eval("document."+form+"."+iput);
		if (e.value == def)
			e.value="";
	}
	
	// set input
	function setme(form,iput,def) {
		e = eval("document."+form+"."+iput);
		if (e.value=="")
			e.value=def;
	}
  	
  	// mouseover window status
	function hrefMouseOver(txt) {
		window.status = txt;
	}
	
	// clear window status
	function hrefMouseOut() {
		window.status = normalstatus;
	}
  
	// bla
	function MM_jumpMenu(targ,selObj,restore){ //v3.0
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore)
			selObj.selectedIndex=0;
	}
	
	// image mouseover
	function newImage(arg) {
		if (document.images) {
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}
	}
	
	// image mouseover
	function changeImages() {
		if (document.images && (preloadFlag == true)) {
			for (var i=0; i<changeImages.arguments.length; i+=2) {
				document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			}
		}
	}
	
	// enter new menu in array
	function menu_enter(TContent) {
		menuArray[menuCounter++] = TContent;
	}
	
	// clear en unset timeout
	function menu_clear_timeout() {
		if (use_timeout) {
			menu_clear();
			use_timeout = false;
		}
	}
	
	// unset timeout
	function menu_unset_timeout() {
		use_timeout = false;
	}
	
	// set timeout
	function menu_set_timeout() {
		use_timeout = true;
		setTimeout('menu_clear_timeout()',500);
	}
	
	// really ie?
	function ietruebody(){
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}
	
	// verplaats de menulayer naar een nieuwe positie.
	// het punt linksboven van het menu wordt gebruikt hier.
	function menu_move(menuId, posX, posY){
		menu_obj = getObj(menuId);
		
		menu_obj.style.left = posX;
		menu_obj.style.right = posX + menu_obj.offsetWidth;
		menu_obj.style.top = posY;
		menu_obj.style.bottom = posY + menu_obj.offsetHeight;
	}
	
	function menu_pos(menuId, cur) {
		menu_obj = getObj(menuId);
		
		lastX = findPosX(cur) + cur.offsetWidth;
		lastY = findPosY(cur);
		
		menu_obj.style.left = lastX ;
		menu_obj.style.top = lastY;
	}
	
	function menu_pos_2(menuId, cur) {
		menu_obj = getObj(menuId);
		
		lastX = findPosX(cur) - 6;
		lastY = findPosY(cur) + cur.offsetHeight + 3;
		
		menu_obj.style.left = lastX;
		menu_obj.style.top = lastY;
		
		lastX += menu_obj.offsetWidth;
	}
	
	function findPosX(obj){
		var curleft = 0;
		if (obj.offsetParent){
			while (obj.offsetParent){
				curleft += obj.offsetLeft;
				obj = obj.offsetParent;
			}
		}else if (obj.x){
			curleft += obj.x;
		}
		return curleft;
	}

	function findPosY(obj){
		var curtop = 0;
		if (obj.offsetParent){
			while (obj.offsetParent){
				curtop += obj.offsetTop;
				obj = obj.offsetParent;
			}
		}else if (obj.y){
			curtop += obj.y;
		}
		return curtop;
	}
	
	function getObj(name){
		obj = '';
		if (ie){
			obj = document.all[name];
		}else if (ns6){
			obj = document.getElementById(name);
		}else if (document.layers){
			if (document.layers[name]){
				obj = document.layers[name];
			}
		}
		return obj;
	}
	
	function menu_show(menuId, menuNumber) {
		if (menuId == "pd_menu") menu_clear();
		use_timeout = false;
		menu_obj = getObj(menuId);
		menu_obj.innerHTML = menuArray[menuNumber];
		menu_obj.style.visibility = "visible";
	}
	
	// hierin even alle menu's zetten
	function menu_clear() {
		menu_clear_2("pd_menu");
		menu_clear_2("pd_menu_2");
	}
	
	
	function menu_clear_2(menuId) {
		menu_obj = getObj(menuId);
		
		menu_obj.innerHTML = '';
		menu_obj.style.visibility = "hidden";
	}
	
	function newMenu(nw) {
		if (ns6) nw += 5; //vieze mozilla rekent anders dan ie ofzo :-)
		return '<table width="'+nw+'" class="pd_menu_tbl">';
	}
	
	// url = href link
	// dt = tekst
	// lm = links naar menu (-1 als het geen link naar een menu is)
	// le = link object
	function menuCol(url, dt, lm, le, nw, opts) {
		var ret = '';
		
		if (lm > -1) {
			ret = '<tr onMouseOver="menu_show(\'pd_menu_2\','+lm+');menu_pos(\'pd_menu_2\', '+le+');" onMouseOut="menu_set_timeout();">';
			ret += '<td class="pd_menu_entry"><a class="pd_menu_entry" onclick="javascript:window.location=\''+url+'\';" href="#" onMouseOver="hrefMouseOver(\''+dt+'\');return true;" onMouseOut=\"hrefMouseOut();\">'+dt+'</a></td>';
			ret += '<td align="right" class="pd_menu_entry"><img src="'+imgdir+'menu/arrow.gif" border="0">&nbsp;</td>';
			ret += '</tr>';
		}else {
			ret = '<tr>';
			ret += '<td class="pd_menu_entry"><a class="pd_menu_entry" onclick="window.open(\''+url+'\', \''+nw+'\', \''+opts+'\');" href="#" onMouseOver="hrefMouseOver(\''+dt+'\');return true;" onMouseOut=\"hrefMouseOut();\">'+dt+'</a></td>';
			ret += '</tr>';
		}
		return ret;
	}
	
	function endMenu() {
		return '</tr></table>';
	}
	
	function stopclock (){
		if(timerRunning)
			clearTimeout(timerID);
		timerRunning = false;
	}
	
	function startclock () {
		cntdnobj = document.getElementById("countdown");
		stopclock();
		showtime();
	}
	
	function showtime () {
		now = new Date();
	
		secsPerDay = 1000 ;
		minPerDay = 60 * 1000 ;
		hoursPerDay = 60 * 60 * 1000;
		PerDay = 24 * 60 * 60 * 1000;
		
		/*Seconds*/
		secsLeft = (lastday.getTime() - now.getTime()) / minPerDay;
		decremain = (lastday.getTime() - now.getTime()) / secsPerDay;
		decround = Math.round(decremain);
		decremain = decround + " seconds";
		secsRound = Math.round(secsLeft);
		secsRemain = secsLeft - secsRound;
		secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
		secsRemain = Math.round(secsRemain);
		
		/*Minutes*/
		minLeft = ((lastday.getTime() - now.getTime()) / hoursPerDay);
		minRound = Math.round(minLeft);
		minRemain = minLeft - minRound;
		minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
		minRemain = Math.round(minRemain - 0.495);
		
		/*Hours*/
		hoursLeft = ((lastday.getTime() - now.getTime()) / PerDay);
		hoursRound = Math.round(hoursLeft);
		hoursRemain = hoursLeft - hoursRound;
		hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
		hoursRemain = Math.round(hoursRemain - 0.5);
		
		/*Days*/
		daysLeft = ((lastday.getTime() - now.getTime()) / PerDay);
		daysLeft = (daysLeft - 0.5);
		daysRound = Math.round(daysLeft);
		daysRemain = daysRound;
		
		/*Time*/
		timeRemain = daysRemain + " dagen, " + hoursRemain + " uur, " + minRemain + " min, " + secsRemain + " sec ";
		
		cntdnobj.innerHTML = timeRemain;
		
		timerID = setTimeout("showtime()",1000);
		timerRunning = true;
		
		if (daysRemain < 0) {
			clearTimeout(timerID);
			timerRunning = false;
			cntdnobj.innerHTML = "Nu! Jaaaa hoera!";
		}
	}
	
	if(ns6)setInterval('smileypop_move()',40);

	var scrollerdelay='3000';
	var scrollerwidth='100%';
	var scrollerheight='50px';
	var scrollerbgcolor='#FFFFFF';
	var scrollerbackground='';
	
	var scroll_messages=new Array();
	if (scroll_messages.length>2) sc_msgcnt=2;
	else sc_msgcnt=0;
	
	function tt_deActivate(){
		if (ns6||ie){
			enabletip=false
			tipobj.style.visibility="hidden"
			tipobj.style.left="-1000px"
			tipobj.style.backgroundColor=''
			tipobj.style.width=''
		}
	}
	
	function tt_enter_col(TTitle, TContent, thecolor, thewidth){
		tt_content = 
			'<table width="100%" cellspacing="0" cellpadding="0" class="omlijnd">'+
			'<tr>'+
				'<td width="100%">'+
					'<table width="100%" cellspacing="0">'+
						'<tr>'+
							'<td width="100%" class="tt_title">&nbsp;'+TTitle+ '</td>'+
						'</tr>'+
					'</table>'+
				'</td>'+
			'</tr>'+
			'<tr>'+
				'<td width="100%">'+
					'<table cellspacing="0" cellpadding="3" width="100%">'+
						'<tr>'+
							'<td width="100%" class="tt_content">'+TContent+'</td>'+
						'</tr>'+
					'</table>'+
				'</td>'+
			'</tr>'+
			'</table>';
		
		if (ns6||ie){
			if (typeof thewidth!="undefined") {
				tipobj.style.width = thewidth + "px";
			}else {
				tipobj.style.width = "250px";
			}
			if (typeof thecolor!="undefined" && thecolor!="") {
				ipobj.style.backgroundColor = thecolor;
			}
			tipobj.innerHTML = tt_content;
			enabletip=true;
		}
	}
	
	function tt_enter(TTitle, TContent){
		tt_enter_col(TTitle, TContent, "", "250");
	}
	
	function tt_overhere(e){
		if (enabletip){
			var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
			var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
			//Find out how close the mouse is to the corner of the window
			var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
			var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
	
			var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
	
			//if the horizontal distance isn't enough to accomodate the width of the context menu
			if (rightedge<tipobj.offsetWidth)
				//move the horizontal position of the menu to the left by it's width
				tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
			else if (curX<leftedge)
				tipobj.style.left="5px"
			else
				//position the horizontal position of the menu where the mouse is positioned
				tipobj.style.left=curX+offsetxpoint+"px"
	
			//same concept with the vertical position
			if (bottomedge<tipobj.offsetHeight)
				tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
			else
				tipobj.style.top=curY+offsetypoint+"px"
				tipobj.style.visibility="visible"
			}
	}

	function MM_findObj(n, d) { //v4.01
		var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
		var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

	function MM_swapImgRestore() { //v3.0
		var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_preloadImages() { //v3.0
		var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
