


function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}


function elf_proef(bankrekeningnummer) 
{
	aantal_tekens=bankrekeningnummer.length;
	var som=0;
	for (i=1; i<10; i++) 
	{
		getal=bankrekeningnummer.charAt(i-1);
		som+=getal*(10-i);
	} 
	
	if (som % 11==0 && aantal_tekens==9) 
		return true
	else
		return false
}

var SERVER = {
 loaded : false,
 requestobj : false,
 load : function() {
	 if( SERVER.loaded == false ) {
		 this.loaded = SERVER.loadrequestobj(); //probeer te laden
	 }
	 return this.loaded;
 },
 loadrequestobj : function () {
	 if (window.XMLHttpRequest){ // if Mozilla, Safari etc or IE7
		 this.requestobj = new XMLHttpRequest();
		 if (this.requestobj.overrideMimeType) this.requestobj.overrideMimeType('text/xml');
		 return true;
	 }
	 else if (window.ActiveXObject){ // if IE, not IE7
		 try {
			 this.requestobj = new ActiveXObject("Msxml2.XMLHTTP");
		 }
		 catch (e) {
			 try {
				 this.requestobj = new ActiveXObject("Microsoft.XMLHTTP");
			 }
			 catch (e) {
				 return false;
			 }
		 }
		 return true;
	 }
	 return false;
 },
     GETrequest : function(url,data,func) {
         if( !this.load() ) return false;
         this.requestobj.open('GET', url+'?'+data, true);
         if( func  ) this.requestobj.onreadystatechange = func;
         this.requestobj.send(null);
         return true;
     },
	 Ontvangst : function() {
         if( this.requestobj.readyState != 4 ) return false;
         else if( this.requestobj.status != 200 ) return 'Fout: '+this.requestobj.statusText;
         else return this.requestobj.responseText;
     }

}
 


var specialcase = ((navigator.userAgent.indexOf('Mac') != -1) || document.all)
var flag = 0;
var msg = 'Deze foto is beschermd!\nDok kunstcentrum';
var x,y,x1,y1,copyAttempt;

function init() 
{
	if (!(document.getElementById || document.all || document.layers)) return;
	if (specialcase && document.layers)
	{
		document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = special;
	}
	for (i=0;i<document.images.length;i++)
	{
		document.images[i].onmousedown = checkIt;
		document.images[i].onmouseup = function() {return false};
		if (specialcase)
		{
			document.images[i].onmousemove = special;
			document.images[i].onclick = clearIt;
		}
	}
}

function checkIt(e)
{
	copyAttempt = 0;
	if (window.Event)
	{
		x = e.screenX;
		y = e.screenY;
		theButt = (e.which == 3);
	}
	else
	{
		x = window.event.clientX;
		y = window.event.clientY;
		theButt = (window.event.button == 2);
	}
	if (theButt)
	{
		copyAttempt = 1;
		flag = 0;
		alert(msg);
		return false; // NN4 only
	}
	if (specialcase) flag = 1;
	return false;
}

function special(e)
{
	theObj = '';
	if (window.Event)
	{
		x1 = e.screenX;
		y1 = e.screenY;
		if (e.target.parentNode) theObj = e.target.parentNode.tagName;
	}
	else
	{
		x1 = window.event.clientX;
		y1 = window.event.clientY;
		theObj = window.event.srcElement.parentElement.tagName;
	}
	var isLink = (theObj == 'A');
	if (flag && (!isLink || ((Math.abs(x-x1) > 10) || (Math.abs(y-y1) > 10))))
	{
		copyAttempt = 1;
		flag = 0;
		alert(msg);
		return false;
	}
}

function clearIt()
{
	flag = 0;
	if (copyAttempt)
	{
		copyAttempt = 0;
		return false;
	}
}




