function updateForm(value, plaats, adres){
	var zoekopdracht 	= document.getElementById("zoekopdracht").style;
	var informatie		= document.getElementById("meerInfo").style;
	
	var opmerking 	= document.getElementById("opmerking");
	
	if(value == 0){
		zoekopdracht.display 	= "none";
		informatie.display 		= "none";		
		opmerking.innerHTML 	= plaats + " + " + adres;			
		document.getElementById('maincontent_title').innerHTML = "Aanvraag contact";
	}
	if(value == 1){
		zoekopdracht.display 	= "none";
		informatie.display 		= "block";
		document.getElementById('maincontent_title').innerHTML = "Aanvraag informatie";
	}
	if(value == 2){
		zoekopdracht.display 	= "block";
		informatie.display 		= "none";
		document.getElementById('maincontent_title').innerHTML = "Zoekopdracht plaatsen";
	}
}

function display(id){
	var container = document.getElementById(id).style;
	container.display = "block";
}

function hide(id){
	var container = document.getElementById(id).style;
	container.display = "none";
}

function clicked(option){
	this.click = 1;
	this.clickOpt = option;
	this.selectedArray = "";
	
	var container = document.getElementById(option);
	var inputArray = container.getElementsByTagName("input");
	var i = 0;
	
	for(i=0; i<inputArray.length; i++){
		var value = container.getElementsByTagName("input")[i].checked;
		if(value){
			var name = container.getElementsByTagName("input")[i].name;
			name = name.replace(option,'');
			this.selectedArray += name+",";
		}
	}
	
	alert(this.selectedArray);
}

function observate(option){
		this.busy = option;
}

function update(option){
	var url="/site/module/updateAanbod.php";
	url=url+"?option="+table;
	url=url+"&id="+id;
	url=url+"&imgId="+imgId;
	url=url+"&action=delete";

	var xmlHttp = createXMLHttpRequest();
	xmlHttp.onreadystatechange = function(){vervolgfunctie(xmlHttp);}
	xmlHttp.open("GET", url, true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.send(null);
}

function createXMLHttpRequest(){
	if(window.ActiveXObject){
		var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if(window.XMLHttpRequest){
		var xmlHttp = new XMLHttpRequest();
	}
	return xmlHttp;
}

function delImg(table, id, imgId){
	var url="Processimage.php";
	url=url+"?table="+table;
	url=url+"&id="+id;
	url=url+"&imgId="+imgId;
	url=url+"&action=delete";

	var xmlHttp = createXMLHttpRequest();
	xmlHttp.onreadystatechange = function(){vervolgfunctie(xmlHttp);}
	xmlHttp.open("GET", url, true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.send(null);
}
