function Request_Taxatie()
{
	var ThisForm = document.frmTaxatie;
  	var blnValid = true;
  	var strError = "";
  	
  	if(ThisForm.Opdrachtgever_initialen.value == "")
  	{		
		strError += "Initialen opdrachtgever zijn verplicht \n";
		blnValid = false;
	}
	if(ThisForm.Opdrachtgever_achternaam.value == "")
  	{		
		strError += "Achternaam opdrachtgever is verplicht \n";
		blnValid = false;
	}
	if(ThisForm.Opdrachtgever_postcode.value == "")
  	{		
		strError += "Postcode opdrachtgever is verplicht \n";
		blnValid = false;
	}
	if(ThisForm.Opdrachtgever_woonplaats.value == "")
  	{		
		strError += "Woonplaats opdrachtgever is verplicht \n";
		blnValid = false;
	}
	if(ThisForm.Opdrachtgever_mobiel.value == "")
  	{		
		strError += "Telefoon mobiel opdrachtgever is verplicht \n";
		blnValid = false;
	}
	if(ThisForm.Opdrachtgever_email.value == "")
  	{		
		strError += "Email opdrachtgever is verplicht \n";
		blnValid = false;
	}
	if(ThisForm.Taxatieobject_Adres.value == "")
  	{		
		strError += "Adres taxatieobject is verplicht \n";
		blnValid = false;
	}
	if(ThisForm.Taxatieobject_woonplaats.value == "")
  	{		
		strError += "Woonplaats taxatieobject is verplicht \n";
		blnValid = false;
	}
	
	if(blnValid)
	{		
		ThisForm.submit();
	}
	else
	{
	  alert(strError);
	  return false;
	}
	
  	
}
function ShowHideSubform(subform, checkboxitem)
{
	if(document.getElementById(checkboxitem).checked)
	{
		document.getElementById(subform).style.display = "block";
	}
	else
	{
		document.getElementById(subform).style.display = "none";
	}
}
function Request_Notary(step)
{
	var ThisForm = document.frmNotary;
  	var blnValid = true;
  	var strError = "";
  	
  	switch(step)
  	{
  		case 1:
  		if(ThisForm.Initialen1.value == "")
	  	{		
			strError += "Initialen hoofdaanvrager zijn verplicht \n";
			blnValid = false;
		}
		if(ThisForm.Naam1.value == "")
	  	{		
			strError += "Naam hoofdaanvrager is verplicht \n";
			blnValid = false;
		}	
		if(ThisForm.Adres.value == "")
	  	{		
			strError += "Adres hoofdaanvrager is verplicht \n";
			blnValid = false;
		}
		if(ThisForm.Postcode.value == "")
	  	{		
			strError += "Postcode hoofdaanvrager is verplicht \n";
			blnValid = false;
		}
		if(ThisForm.Woonplaats.value == "")
	  	{		
			strError += "Woonplaats hoofdaanvrager is verplicht \n";
			blnValid = false;
		}
		if(ThisForm.Mobiel.value == "")
	  	{		
			strError += "Mobiel nummer hoofdaanvrager is verplicht \n";
			blnValid = false;
		}
		if(ThisForm.Email.value == "")
	  	{		
			strError += "Email hoofdaanvrager is verplicht \n";
			blnValid = false;
		}
		if(ThisForm.Adres_woning.value == "")
	  	{		
			strError += "Adres aangekochte woning is verplicht \n";
			blnValid = false;
		}
		if(ThisForm.Postcode_woning.value == "")
	  	{		
			strError += "Postcode aangekochte woning is verplicht \n";
			blnValid = false;
		}
		if(ThisForm.Woonplaats_woning.value == "")
	  	{		
			strError += "Woonplaats aangekochte woning is verplicht \n";
			blnValid = false;
		}
  		break;
  		case 2: 
  		blnValid = false; 		
  		for(i=1;i<9;i++)
  		{  			
  			if(ThisForm["product" + i].checked)
  			{
  				blnValid = true;
  			}
  		}
  		if(!blnValid)
  		{
  			strError += "U dient minimaal een product te selecteren.";
  		}
  		else
  		{
  			if(ThisForm.product1.checked)
	  		{
	  			if(ThisForm.Akte_van_Levering_koopsom.value == "")
			  	{		
					strError += "Koopsom bij akte van levering is verplicht \n";
					blnValid = false;
				}
	  		}
	  		if(ThisForm.product2.checked)
	  		{
	  			if(ThisForm.HypotheekAkte_hypotheek.value == "")
			  	{		
					strError += "Hypotheek bij hypotheekakte is verplicht \n";
					blnValid = false;
				}
				if(ThisForm.HypotheekAkte_afschrijving.value == "")
			  	{		
					strError += "Afschrijving bij hypotheekakte is verplicht \n";
					blnValid = false;
				}
	  		}
	  		if(ThisForm.product3.checked)
	  		{
	  			if(ThisForm.Royeren_financiers.value == "")
			  	{		
					strError += "Financiers bij royement  is verplicht \n";
					blnValid = false;
				}
	  		}
	  		if(ThisForm.product4.checked)
	  		{
	  			if(ThisForm.Aflossing_financiers.value == "")
			  	{		
					strError += "Financiers bij aflossing is verplicht \n";
					blnValid = false;
				}
	  		}  		
  		}
  		
  		break;
  	}  	
  	
	
	if(blnValid)
	{  	
		ThisForm.step.value = step;
		ThisForm.submit();
	}
	else
	{
	  alert(strError);
	  return false;
	}
	
  		
}

function ValidateCalcMax()
{
   
	var ThisForm = document.frmCalculatieForm;
  var blnValid = true;
  var strError = "";	
	
	//Eigen salaris is minimaal
	if(ThisForm.gross1.value == "")
  {		
		strError += "Salaris aanvrager dient minimaal ingevuld te zijn \n";
		blnValid = false;
	}	
	
	if(blnValid)
	{
	  strError += "De volgende velden dienen numeriek te zijn: \n"
	  
		if(ThisForm.gross1.value != "")
		{
		  if(!IsMoney(ThisForm.gross1.value))
		  {
			  strError += "- Salaris aanvrager \n";
				blnValid = false;
			}
		}
		if(ThisForm.gross2.value != "")
		{
		  if(!IsMoney(ThisForm.gross2.value))
		  {
			  strError += "- Salaris partner \n";
				blnValid = false;
			}
		}
		if(ThisForm.vacation1.value != "")
		{
		  if(!IsMoney(ThisForm.vacation1.value))
		  {
			  strError += "- Vakantiegeld aanvrager (%) \n";
				blnValid = false;
			}
		}
		if(ThisForm.vacation2.value != "")
		{
		  if(!IsMoney(ThisForm.vacation2.value))
		  {
			  strError += "- Vakantiegeld partner (%) \n";
				blnValid = false;
			}
		}
		if(ThisForm.month1.value != "")
		{
		  if(!IsMoney(ThisForm.month1.value))
		  {
			  strError += "- 13e maand aanvrager \n";
				blnValid = false;
			}
		}
		if(ThisForm.month2.value != "")
		{
		  if(!IsMoney(ThisForm.month2.value))
		  {
			  strError += "- 13e maand partner  \n";
				blnValid = false;
			}
		}
		if(ThisForm.overtime1.value != "")
		{
		  if(!IsMoney(ThisForm.overtime1.value))
		  {
			  strError += "- Overwerk aanvrager \n";
				blnValid = false;
			}
		}
		if(ThisForm.overtime2.value != "")
		{
		  if(!IsMoney(ThisForm.overtime2.value))
		  {
			  strError += "- Overwerk partner \n";
				blnValid = false;
			}
		}
		if(ThisForm.provision1.value != "")
		{
		  if(!IsMoney(ThisForm.provision1.value))
		  {
			  strError += "- Provisie aanvrager \n";
				blnValid = false;
			}
		}
		if(ThisForm.provision2.value != "")
		{
		  if(!IsMoney(ThisForm.provision2.value))
		  {
			  strError += "- Provisie partner \n";
				blnValid = false;
			}
		}		
	}
	
	if(blnValid)
	{  	
		return true;
	}
	else
	{
	  alert(strError);
	  return false;
	}
}

function SubmitForm(frm)
{	
	
	var ThisForm = frm;
  var blnValid = true;
  var strError = "";	
		
	if(blnValid)
	{  	
		ThisForm.submit();
	}
	
}

function ValidateMonthly()
{
  var ThisForm = document.frmMonthlyCost;
  var blnValid = true;
  var strError = "";
  
  if(ThisForm.max.value == "")
  {
	  strError += "Gewenst hypotheekbedrag is verplicht";
	  blnValid = false;
	}
	if(blnValid)
	{
	  if(ThisForm.max.value < 50000)
	  {
	    strError += "Gewenst hypotheekbedrag is niet realistisch (lager dan € 50.000,--)";
		  blnValid = false;
		}
	}
	
	if(blnValid)
	{
	  if(!IsMoney(ThisForm.max.value))
		{
		  strError += "Gewenst hypotheekbedrag dient numeriek te zijn";
		  blnValid = false;
		}
	}
	
	
	if(blnValid)
	{
	  return true;
	}
	else
	{
	  alert(strError);
	  return false;
	}
}


function IsMoney(int)
{
   var ValidChars = "0123456789.,";
   var IsNumber=true;
   var Char;
 
   for (i = 0; i < int.length && IsNumber == true; i++) 
   { 
      Char = int.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
      {
         IsNumber = false;
      }
   }
   
	 return IsNumber;   
}

function redirect(action)
{
  if(action == "monthlycost")
  {
	  document.location.href= 'index.php?group=Advies&content=Maandlasten&pageid=38&articleid=48&agr=11';
	}
	else if(action == "request")
	{
	  document.location.href= 'index.php?group=Maximale_hypotheek&pageid=40&articleid=123&agr=48';
	}	
}

function ReasonSelected()
{
  var ThisForm = document.frmQuotation;	                      
  ThisForm.reden_aanvraag.value = ThisForm.drdReason.options[ThisForm.drdReason.options.selectedIndex].innerHTML;	
}

function SexSelected()
{
  var ThisForm = document.frmQuotation;	                      
  ThisForm.geslacht.value = ThisForm.drdGeslacht.options[ThisForm.drdGeslacht.options.selectedIndex].innerHTML;	
}


function SituationSelected()
{
  var ThisForm = document.frmQuotation;	                      
  ThisForm.woonsituatie.value = ThisForm.drdWoonsituatie.options[ThisForm.drdWoonsituatie.options.selectedIndex].innerHTML;	
}

function IncomeSelected()
{
  var ThisForm = document.frmQuotation;	                      
  ThisForm.inkomsten.value = ThisForm.drdIncome.options[ThisForm.drdIncome.options.selectedIndex].innerHTML;	
}

function IncomePartnerSelected()
{
  var ThisForm = document.frmQuotation;	                      
  ThisForm.inkomsten_partner.value = ThisForm.drdIncome_partner.options[ThisForm.drdIncome_partner.options.selectedIndex].innerHTML;	
}

function DaySelected()
{
  var ThisForm = document.frmQuotation;	                      
  ThisForm.dag.value = ThisForm.drdDay.options[ThisForm.drdDay.options.selectedIndex].innerHTML;	
}

function MonthSelected()
{
  var ThisForm = document.frmQuotation;	                      
  ThisForm.maand.value = ThisForm.drdMonth.options[ThisForm.drdMonth.options.selectedIndex].innerHTML;	
}
 
function YearSelected()
{
  var ThisForm = document.frmQuotation;	                      
  ThisForm.jaar.value = ThisForm.drdYear.options[ThisForm.drdYear.options.selectedIndex].innerHTML;	
}

function Send()
{
  var ThisForm = document.frmQuotation;
  var blnValid = true;
  var strError = "";
  var strDefaultMessage = " is een verplicht veld"  
  
	if(ThisForm.reden_aanvraag.value == "")
  {
	  strError += "Reden aanvraag" + strDefaultMessage + "\n";
	  blnValid = false;
	}
	if(ThisForm.geslacht.value == "")
  {
	  strError += "Geslacht" + strDefaultMessage + "\n";
	  blnValid = false;
	}
	if(ThisForm.achternaam.value == "")
  {
	  strError += "Naam" + strDefaultMessage + "\n";
	  blnValid = false;
	}		
	if(ThisForm.address.value == "")
  {
	  strError += "Adres/huisnummer" + strDefaultMessage + "\n";
	  blnValid = false;
	}
	if(ThisForm.postcode.value == "")
  {
	  strError += "Postcode" + strDefaultMessage + "\n";
	  blnValid = false;
	}
	if(ThisForm.woonplaats.value == "")
  {
	  strError += "Woonplaats" + strDefaultMessage + "\n";
	  blnValid = false;
	}
	if(ThisForm.mobiel.value == "")
  {
	  strError += "Telefoon mobiel" + strDefaultMessage + "\n";
	  blnValid = false;
	}
	if(ThisForm.email.value == "")
  {
	  strError += "Email" + strDefaultMessage + "\n";
	  blnValid = false;
	}
	if(ThisForm.woonsituatie.value == "")
  {
	  strError += "Woonsituatie" + strDefaultMessage + "\n";
	  blnValid = false;
	}	
	if(ThisForm.inkomsten.value == "")
  {
	  strError += "Inkomsten" + strDefaultMessage + "\n";
	  blnValid = false;
	}
	if(ThisForm.inkomsten_partner.value == "")
  {
	  strError += "Inkomsten partner" + strDefaultMessage + "\n";
	  blnValid = false;
	}
	if(ThisForm.dag.value == "" || ThisForm.maand.value == "" || ThisForm.jaar.value == "")
  {
	  strError += "Geboortedatum is onjuist \n";
	  blnValid = false;
	}
	
	
	if(blnValid)
	{
	  ThisForm.submit();
	}
	else
	{
	  alert(strError);
	  strError = "";
	}
  
}

