function checkformEmail ()
{
  // check of het emailadres is ingevuld en of deze correct ingevuld is
  if (document.vragenlijstform.emailadres.value == "") {
    alert( "U heeft geen emailadres ingevuld!" );
		
    document.vragenlijstform.emailadres.style.color="#b60637";
	document.vragenlijstform.emailadres.focus();
    document.vragenlijstform.emailadres.value = "Type hier uw emailadres";
	return false ;
  } else {
	  
	var email = document.vragenlijstform.emailadres.value;
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(email)) {
		alert('U heeft geen geldig emailadres ingevoerd!');
		document.vragenlijstform.emailadres.style.color="#b60637";
		document.vragenlijstform.emailadres.focus();
		document.vragenlijstform.emailadres.value = email;
		return false;
	}  else {

	   var answer = confirm("Is uw emailadres correct? " + document.vragenlijstform.emailadres.value)
		if (answer){
				
				// check of vraag 1 wel ingevuld is en zoja of dit antwoord 'Ja' is
				if (document.vragenlijstform.vraag1.value != 1) {
					alert( "U heeft bij vraag 1 geen JA ingevuld!" );
						
					document.vragenlijstform.vraag1.style.color="#b60637";
					document.vragenlijstform.vraag1.value = 1;
					document.vragenlijstform.vraag1.focus();
					//showhide3('deel1',vraag1.value);
					document.getElementById('deel1').style.display = 'inline';
					return false ;
				  } else {	
					
					// formulier verzenden
				 	window.document.vragenlijstform.submit();
					return true ;
				
				}
		 		return true ;
		}
		else{
			// wanneer er op nee is geklikt bij het vragen of het emailadres correct is
			alert("U kunt uw emailadres aanpassen.")
			document.vragenlijstform.emailadres.focus();
			document.vragenlijstform.emailadres.value = email;
		}
	 }
  }
  return true ;
}



var ol_fgcolor='#0C1C5D';
var ol_bgcolor='#E6EAF1';
var ol_textcolor='#FFFFFF';
var ol_textsize='1';

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function openfab() {
	var winleft;
	var wintop;
	var winheight;
	var winwidth=650;
	winleft=(screen.width - winwidth)/2;
	winheight=460; // default bij 800x600.
	wintop=1;
	if (screen.width>=1024 && screen.height>=768) {
		winheight=580;
		wintop=(screen.height - winheight)/2 - 70;
		if (screen.width>=1152 && screen.height>=864) {
			winheight=670;
			wintop=(screen.height - winheight)/2 - 70;
			if (screen.width>=1200 && screen.height>=1024) {
				winheight=760;
				wintop=(screen.height - winheight)/2 - 70;
			}
		}
	}
	fabwin=window.open("https://www2.axa.nl/fab/FAB0.aspx?intermediair=15619000&toonintermediair=N","FAB","scrollbars=1,status=1,toolbar=1,menubar=0,width="+winwidth+",height="+winheight+",top="+wintop+",left="+winleft);
	if (fabwin!=null && fabwin.opener==null) { 
		fabwin.opener=self;
	}
	fabwin.focus();
}

function tohex(str) {
strTemp='';
for (i=0;i<str.length;i++) {
	strTemp=strTemp + '%' + str.charCodeAt(i).toString(16);
}
return(strTemp);
}

function openPDF(src, titel) {
openWindow('http://www.axa.nl/algemeen/pdfview.cfm?src=' + src, tohex(titel));
}

function openWindow(url, titel) {
win=window.open(url + '&titel=' + titel, "PDFViewer", "scrollbars=1,width=640,height=480,resizable=1");
if (win != null && win.opener == null) {
	win.opener=self;
}
win.focus();
}

function showhide5(id,state)
{
	if ((state == "4"))
	{
		document.getElementById(id).style.display = 'inline';
	}
	else
	{
		document.getElementById(id).style.display = 'none';
	}
}

function showhide(id,state){
	var part = "0,1,4,6";
	if (part.indexOf(state) < 0){
		document.getElementById(id).style.display = 'inline';
		document.getElementById('partner2').style.display = 'inline';
	}
	else{
		document.getElementById(id).style.display = 'none';
		document.getElementById('partner2').style.display = 'none';
	}
}

function showhide3(id,state){
	if ((state == "1")){
		document.getElementById(id).style.display = 'inline';
	}else{
		document.getElementById(id).style.display = 'none';
	}
}

function showhide4(id,state){
	if ((state == "5") || (state == "1") || (state == "2") || (state == "3") || (state == "4") ){
		document.getElementById(id).style.display = 'inline';
	}else{
		document.getElementById(id).style.display = 'none';
	}
}


function showhide2(id,state){
	var part = "3,4,9,10";
	if (part.indexOf(state) < 0){
		document.getElementById(id).style.display = 'inline';
		document.getElementById('dv').style.display = 'inline';
	}
	else{
		document.getElementById(id).style.display = 'none';
		document.getElementById('dv').style.display = 'none';
	}
}


function addEvent(elm, evType, fn, useCapture)
{
	if(elm.addEventListener)
	{
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}
	else if (elm.attachEvent)
	{
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	}
	else
	{
		elm['on' + evType] = fn;
	}
}

function removeCheckBoxBorders()
{

var el = document.getElementsByTagName("input");

if (el.length > 0)
{
	for (i=0;i<el.length;i++)
	{
		var type = el[i].getAttribute("type");
						
			if((type=="checkbox")||(type=="radio"))
			{
				el[i].style.border = "none";
			}
		}
	}
}

addEvent(window, 'load', removeCheckBoxBorders, false);

// Stappenplan
function showhide2(id, opid)
{	
	document.getElementById(id).style.backgroundColor = '#b4cc2e';
	document.getElementById(id).style.color = '#af0101';
	document.getElementById(id + 'vervolg').style.display = 'inline';
	
	for (i=0;i<opid.length;i++)
	{
		document.getElementById(opid[i]).style.backgroundColor = '#122d16';	
		document.getElementById(opid[i]).style.color = '#999999';
		document.getElementById(opid[i] + 'vervolg').style.display = 'none';
	}
}

function alles_over_kredieten()
{
	window.location = "./krediet/1824/Alles+over+kredieten.html";
}