function toggleCheckboxes() {
// written by Daniel P 3/21/07
// toggle all checkboxes found on the page
  	var inputlist = document.getElementsByTagName("input");
  	for (i = 0; i < inputlist.length; i++) {
   	if ( inputlist[i].getAttribute("type") == 'checkbox' ) {	// look only at input elements that are checkboxes
			if (inputlist[i].checked)	inputlist[i].checked = false
			else								inputlist[i].checked = true;
		}
	}
}

//here you place the ids of every element you want.

//var ids=new Array('adverteren','privacystatement','disclaimer','contact','aanmelden','wijzigen','faq','yournumber');
var ids=new Array('adverteren','privacystatement','disclaimer','contact');
var test=new Array('aanmelden','toevoegen','veranderen','wachtwoord','faq','wijzigen','verwijderen','yournumber','blox');

function switchid(id){	
	hideallids();
	appeardiv(id);
}
function show(id){
	hidebloxs();
	showdiv(id);
}

function hidebloxs(){
	//loop through the array and hide each element by id
	for (var i=0;i<test.length;i++){
		hidediv(test[i]);
	}
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}
}
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) {
	if(document.getElementById(id + '_item'))
	{
		document.getElementById('active').setAttribute('id','normal');
		document.getElementById(id + '_item').getElementsByTagName('a')[0].setAttribute('id','active');
	}
	Effect.BlindDown(id);
}
function appeardiv(id) {
	Timer=0;
	Effect.toggle(id,'appear');
	new Effect.ScrollTo('indigio');
}

function timer() {
	Timer=0;
	Effect.BlindDown('results');
	Timer=setTimeout("hideresults()",7000);	
}
function hideresults() {
	Effect.BlindUp('results');
}

sfHover = function() {
	var sfEls = document.getElementById("mainnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function maps(id) {
	Effect.toggle('maps','appear');
	document.getElementById('maps').innerHTML = '<div id="closemaps"><a href="#" onclick="Effect.toggle(\'maps\',\'appear\');"></a></div><iframe width="381" height="349" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.yournumber.nl/maps.php?userid='+id+'"></iframe>';
	Effect.toggle('maps','appear');
}
function addnr() {
	if(document.getElementById('countnrs').value<10) {
		var nr =  parseInt(document.getElementById('countnrs').value)+1;
		var addnummers = document.getElementById('addnummers');
		var new_nr = document.createElement('div');
	
		new_nr.setAttribute('id', 'nummer_'+nr);
		new_nr.setAttribute('className', 'nummers');
		new_nr.setAttribute('class', 'nummers');

		new_nr.innerHTML = '<label for="nummer'+nr+'">Nummer '+nr+':</label><span class="input_small"><input name="mobnumber'+nr+'" id="nummer'+nr+'" type="text" /></span>';
		addnummers.appendChild(new_nr);
	
		document.getElementById('countnrs').value = nr;
		return false;
	}
}