//openwindow

function openWindow(url){
	window.open(url,"WPopup",'location=yes,scrollbars=yes,resizable=yes,status=yes,menubar=yes,toolbar=yes');
}

//hoogtecontainer

function hoogteContainer(){
	var hoogtescherm = document.body.clientHeight;   
	var container = document.getElementById('container');
	var mainleft = document.getElementById('mainleft');
	var mainright = document.getElementById('mainright');
	
	if ((mainleft.clientHeight+345) > hoogtescherm){
		if(container.clientHeight < (mainleft.clientHeight+345)){
			container.style.height = (mainleft.clientHeight+345) + 'px';
		}
		if((mainright.clientHeight+345) > (mainleft.clientHeight+345)){
			mainleft.style.height = (mainright.clientHeight+345) + 'px';
		}
	}
	else{
		if(container.clientHeight < (hoogtescherm)){
			container.style.height = (hoogtescherm - 20) + 'px';
		}
	}
}

function sluitenDiv(deze){
	deze.parentNode.style.display="none";
	document.getElementById('zwart_transparant').style.display="none";
}


function placeFrame () {
    var frame = document.getElementById('google');
    var div = document.createElement('div');
    frame.appendChild(div);
    div.innerHTML = '<iframe width="585" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.nl/maps?f=q&amp;source=s_q&amp;hl=nl&amp;geocode=&amp;q=Catharinastraat+2+breda&amp;sll=52.469397,5.509644&amp;sspn=5.248352,9.84375&amp;ie=UTF8&amp;z=14&amp;iwloc=A&amp;ll=51.595948,4.780684&amp;output=embed"></iframe>';
	//innerdiv.style.marginLeft = (document.body.offsetWidth - img.clientWidth) / 2 + "px";
	//innerdiv.style.marginTop = (document.body.offsetHeight - img.clientHeight) / 2 + "px";
}

function postForm(formnaam){
    var output = '';
    var inputs = formnaam.getElementsByTagName('input');
    for(var i=0; i<inputs.length; i++){
        output += inputs[i].name+"="+inputs[i].value;
        output += "&";
    }
    var inputs = formnaam.getElementsByTagName('textarea');
    for(var i=0; i<inputs.length; i++){
    	if(document.all){
        	output+=inputs[i].name+"="+inputs[i].innerHTML;
        }
        else{
        	output+=inputs[i].name+"="+inputs[i].value;
        }
    }
    xmlHttpRequest(formnaam.action+"?"+output);
}

/* XML HTTP REQUEST */
var xmlhttp = null;
function xmlHttpRequest(url){
	xmlhttp=null;
	if (window.XMLHttpRequest){// code voor Firefox, Opera, IE7, etc.
		xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject){// code voor IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null){
		//xmlhttp.url = url
		xmlhttp.onreadystatechange=state_Change;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
	else{
		//alert("Er is een fout opgetreden.");
	}
}

function state_Change(){
	if (xmlhttp.readyState==4){// 4 = "loaded"
		if (xmlhttp.status==200){// 200 = "OK"
			//ReplaceContent(xmlhttp.responseText, this.url);
			alert(xmlhttp.responseText);
			document.getElementById('form1').style.display = 'none';
		}
		else{
			//alert("Er is een fout opgetreden: " + xmlhttp.statusText);
		}
	}
}

																													  
