// togle text size
function txtUp() { 
	var main=document.getElementById('site');	
	main.style.fontSize="105%";	
	
	document.getElementById('txtu').blur(); 
}
function txtDown() { 
	var main=document.getElementById('site');	
	main.style.fontSize="95%";	
	
	document.getElementById('txtd').blur(); 
}

// open search suggestions
function openSuggestions() {
	if (document.getElementById('suggestions').style.display=='none') {
		document.getElementById('searchbottom').style.display='none';
		document.getElementById('suggestions').style.display='block';
	} else {
		document.getElementById('searchbottom').style.display='block';
		document.getElementById('suggestions').style.display='none';
	}
}

// add bookmark
function bookMark() {
    var linkUrl=document.location;
	if (!document.all) { alert('selecteer ctrl-b om deze pagina favoriet te maken'); } 
	else { external.AddFavorite(linkUrl); }
    return false;
}

// Faq box code
var oid='a0';
function openbox(id) {
	if (document.getElementById(id).lastChild.style.display != "block") {
		document.getElementById(id).firstChild.style.backgroundImage="url(" + staticUrl + "/images/arrow_down.gif)";
		//document.getElementById(id).firstChild.style.backgroundPosition="top right";
		document.getElementById(id).firstChild.style.backgroundRepeat="no-repeat";
		document.getElementById(id).lastChild.style.display="block";
	} else {
		document.getElementById(id).firstChild.style.backgroundImage="url(" + staticUrl + "/images/arrow_right.gif)";
		//document.getElementById(id).firstChild.style.backgroundPosition="top right";
		document.getElementById(id).firstChild.style.backgroundRepeat="no-repeat";
		document.getElementById(id).lastChild.style.display="none";
	}
	// call closeBox(oid) to close open box after opening a new one
	if (id!=oid) { closeBox(oid);oid=id; }
}
// function used to close open box after opening a new one
function closeBox(oid) {
	if (oid=='a0') { return; }
	document.getElementById(oid).firstChild.style.backgroundImage="url(" + staticUrl + "/images/arrow_right.gif)";
	//document.getElementById(oid).firstChild.style.backgroundPosition="top right";
	document.getElementById(oid).firstChild.style.backgroundRepeat="no-repeat";
	document.getElementById(oid).lastChild.style.display="none";
}

// Faq suggestion box code
function suggestionOpen(id) {
	if (document.getElementById(id).style.display != "block") {
		document.getElementById(id).style.display="block";
	}
}
// function used to close suggestion box
function suggestionClose(id) {
	if (document.getElementById(id).style.display == "block") {
		document.getElementById(id).style.display="none";
	}
}

// lightview style pop up
var pid;
function hidePop() { document.getElementById('bopop').style.visibility = 'hidden';document.getElementById(pid).style.display = 'none';ie6Form('visible'); }
function showPop(nid) { getPageSize();document.getElementById('fade').style.height=pageHeight;document.getElementById(nid).style.display = 'block';document.getElementById('bopop').style.visibility = 'visible';pid=nid;ie6Form('hidden'); } 
var pageWidth,pageHeight;
function getPageSize() {	        
    var xScroll, yScroll;	
	if (window.innerHeight && window.scrollMaxY) {	xScroll = window.innerWidth + window.scrollMaxX;yScroll = window.innerHeight + window.scrollMaxY; } 
	else if (document.body.scrollHeight > document.body.offsetHeight){ xScroll = document.body.scrollWidth;yScroll = document.body.scrollHeight; } 
	else { xScroll = document.body.offsetWidth;yScroll = document.body.offsetHeight; }	
	var windowWidth, windowHeight;	
	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){ windowWidth = document.documentElement.clientWidth; } 
		else { windowWidth = self.innerWidth;	}
		windowHeight = self.innerHeight;
	} 
	else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth;windowHeight = document.documentElement.clientHeight; } 
	else if (document.body) { windowWidth = document.body.clientWidth;windowHeight = document.body.clientHeight; }		
	if(yScroll < windowHeight){	pageHeight = windowHeight; } else { pageHeight = yScroll; }
	if(xScroll < windowWidth){ 	pageWidth = xScroll; } else { pageWidth = windowWidth; }
	return [pageWidth,pageHeight];	
}

function ie6Form(state) {	
	if (document.all) {
		var version=/MSIE \d+.\d+/;var brwsr=navigator.appVersion.match(version);
		if ((""+brwsr).indexOf("6")>0) {
			var frmInput=new Array();frmInput=document.getElementsByTagName("input");var stop1=frmInput.length;
			for (var i=0;i<stop1;i++) { frmInput[i].style.visibility=state;	}
			var frmSelect=new Array();frmSelect=document.getElementsByTagName("select");var stop2=frmSelect.length;
			for (var i=0;i<stop2;i++) { frmSelect[i].style.visibility=state; }
			var frmTextarea=new Array();frmTextarea=document.getElementsByTagName("textarea");var stop3=frmTextarea.length;
			for (var i=0;i<stop3;i++) { frmTextarea[i].style.visibility=state; }
		}
	}
}

function showExample() {
	document.getElementById('mailform').style.display='none';
	document.getElementById('mailexample').style.display='block';
}
function showForm() {
	document.getElementById('mailexample').style.display='none';
	document.getElementById('mailform').style.display='block';
}



// image viewer with film strip
// Image viewer code
function showImg(img,title,author) {
	var str=new RegExp("293");
	if (str.test(img)==true) { document.getElementById('contentShown').style.width='293px'; }
	else { document.getElementById('contentShown').style.width='520px'; }
	document.getElementById('imgShown').innerHTML=img;
	document.getElementById('titleShown').innerHTML=title;
	document.getElementById('authorShown').innerHTML='&copy; '+author;
}
// agenda month scroller
// items visible when scroller does not move
var itemsshown=3;
// width of each item within the scroller
var myitem=160;
// amount of items to be scrolled when moved
var scrollby=1;
var scrollnr=(scrollby*myitem);
var mybox;var myleft;var theleft;var timer;var trgt;var busy=false;
function moveinplace() {
	if (document.getElementById('ainner')) {
		document.getElementById('ainner').style.left='0px';
		var i=document.getElementById('ainner').getElementsByTagName('div');
		mybox=-(((i.length-1)*myitem)-(itemsshown*myitem));
		var actlft=0;
		for (x=0;x<i.length;x++) {
			if (i[x].className=='active') { actlft=-(x*myitem);	}
		}
		if (actlft>-(myitem*itemsshown)) {
			document.getElementById('ainner').style.left=actlft+'px'; 
		} else { document.getElementById('ainner').style.left=-(myitem*itemsshown)+'px'; }
		myleft=document.getElementById('ainner').style.left;
		theleft=parseInt(myleft);
		showButtons(theleft);
	}
}
onload=moveinplace;
function moveOn() {	
	trgt=theleft-scrollnr;
	if (trgt>=mybox && busy==false) { timer=setInterval("moveLeft("+trgt+");",5);busy=true; }
	else if (busy==false) { trgt=mybox;timer=setInterval("moveLeft("+trgt+");",5);busy=true; }
}
function moveLeft(trgt) {
	if (theleft>trgt) {	theleft=theleft-10; document.getElementById('ainner').style.left=(theleft+'px');	} 
	else { clearInterval(timer); showButtons(theleft);busy=false; }	
}
function moveBack() {
	trgt=theleft+scrollnr;
	if (trgt<=0 && busy==false) { timer=setInterval("moveRight("+trgt+");",5);busy=true; }
	else if (busy==false) { trgt=0;timer=setInterval("moveRight("+trgt+");",5);busy=true; }
}
function moveRight(trgt) {
	if (theleft<trgt) {	theleft=theleft+10; document.getElementById('ainner').style.left=(theleft+'px'); } 
	else { clearInterval(timer); showButtons(theleft);busy=false; }	
}
function showButtons(theleft) {
	if (theleft==0) { document.getElementById('aprv').style.backgroundImage='url(' + staticUrl + '/images/spacer.gif)';document.getElementById('aprv').style.cursor='default'; }
	else { document.getElementById('aprv').style.backgroundImage='url(' + staticUrl + '/images/aprev.jpg)';document.getElementById('aprv').style.cursor='pointer'; }
	if (theleft==mybox) { document.getElementById('anxt').style.backgroundImage='url(' + staticUrl + '/images/spacer.gif)';document.getElementById('anxt').style.cursor='default'; }
	else { document.getElementById('anxt').style.backgroundImage='url(' + staticUrl + '/images/anext.jpg)';document.getElementById('anxt').style.cursor='pointer'; }
}
