function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
document.getElementById(d).style.visibility = "hidden";
}

function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
document.getElementById(d).style.visibility = "visible";
}


function ToggleContent(d) {
	if(d.length < 1) { return; }
	if (document.getElementById(d).style.display=="block") {
		document.getElementById(d).style.display = "none";
		document.getElementById(d).style.visibility = "hidden";	
	} else {
		document.getElementById(d).style.display = "block";
		document.getElementById(d).style.visibility = "visible";
	}
}


function showWachtenAndSubmit(form){
  ShowContent('wachten');
  ShowContent('wachtentekst');
  setTimeout('document.images["loading"].src = document.images["loading"].src', 1);
  form.submit();return false;
}

/*
Deze functie wordt gebruikt in het domeinmenu waarbij de radiobutton
wordt geslecteerd wanneer op een type tld wordt geklikt (standaard, europa, etc.)
*/
function selectRadio(id){
	document.getElementById(id).checked = true;
}

/* Deze functie wordt gebruikt om formuliervelden te verbergen en zichtbaar te maken */
function typeKlant(obj){
	// Startpositie
	document.getElementById('login').style.display = "none";
	document.getElementById('persoonsgegevens').style.display = "none";
	document.getElementById('bedrijfsgegevens').style.display = "none";
	document.getElementById('bezoekadres').style.display = "none";
	document.getElementById('bedrijfsgegevensoverig').style.display = "none";
		if ( obj.selectedIndex == 0 ){
			// Het is een bestaande klant
			document.getElementById('login').style.display = "block";
		} else {
			// Het is een nieuwe klant
			document.getElementById('persoonsgegevens').style.display = "block";
			document.getElementById('bezoekadres').style.display = "block";
			if ( obj.selectedIndex == 2 ){
			// Extra gegevens tonen bij een zakelijke klant
				document.getElementById('bedrijfsgegevens').style.display = "block";
				document.getElementById('bedrijfsgegevensoverig').style.display = "block";
			}
		}
}

function copy_address_fields(){
     from = new Array('adres', 'adresnummer', 'adresnummertoevoeging', 'postcode', 'plaatsnaam');
     to = new Array('post_adres', 'post_adresnummer', 'post_adresnummertoevoeging', 'post_postcode', 'post_plaatsnaam');

     for(var i=0;i<=4;i++){
         document.getElementsByName(to[i])[0].value =
         document.getElementsByName(from[i])[0].value;
     }
     document.getElementsByName('post_land')[0].selectedIndex =
     document.getElementsByName('land')[0].selectedIndex;
}














function changeClass(en,cn) {
if(!document.getElementById) return;
var element = document.getElementById(en);    
    element.className = cn;
}

function ganaar(form)
{
  var whereto=form.openen.selectedIndex
  if (form.openen.options[whereto].value != 0)
    {
      location=form.openen.options[whereto].value;
    }
}

function open_instructie_window(url)
{ 
instructie_window = window.open(url,'window_name','toolbar=0,menubar=0,resizable=0, scrollbars=1,dependent=0,status=0,width=801,height=593,left=0,top=0')
}

function open_new_window(url)
{ 
new_window = window.open(url,'window_name','toolbar=0,menubar=0,resizable=0, scrollbars=1,dependent=0,status=0,width=565,height=500,left=10,top=10')
}

function open_whois_window(url)
{ 
whois_window = window.open(url,'window_name','toolbar=0,menubar=0,resizable=0, scrollbars=1,dependent=0,status=0,width=700,height=500,left=10,top=10')
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
       anchor.target = "_blank";
 }
}


function openWindow(URL,width,height) {
  return window.open(URL,'window_name','toolbar=,menubar=0,resizable=0,scrollbars=1,dependent=0,status=0,width='+width+',height='+height+',left=10,top=10')
}


window.onload = function(){ 
  externalLinks()
  }

function addBookmark()
{
	bookmarkurl=self.location.href;
	bookmarktitle=document.title;
	if (document.all) {
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
	} else alert("Druk op CTRL-D om toe te voegen aan uw favorieten"); 
}

function really_logout(href){
   antwoord = confirm('Weet u zeker dat u het besloten deel van deze website wilt verlaten?\n');
   if ( antwoord ) {
     location.href = href;
   }
}
function _createRequestObject(){
	if ( window.XMLHttpRequest){
		return new XMLHttpRequest();
	}else if ( window.ActiveXObject){
		return new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		alert("can't find XMLHttpRequest or ActiveXObject");
		return null;
	}
}
function doHTTPRequest(method, url, data, callback){
	method = method.toUpperCase();
	req = _createRequestObject();
	if ( callback != null ){
		req.onreadystatechange = callback;
	}
	req.open(method, url, true);
	req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	req.send(data);
}
