
$(function()
{$("label span a").click(function(){$(this).parent().children("span ul").slideToggle('slow');$(this).hide();return false;});$("fieldset select").change(function(){$(this).parent().children("label").children("span").children("ul:visible").slideUp('slow').parent().children("a").show();});$("span ul").click(function(){$(this).parent().children("ul").slideUp('slow').parent().children("a").show();});$('.step-5').unbind();$('#stappenmenu li a').click(function(){var stepID=parseInt($(this).attr('class').replace(' current','').replace('step-',''))
switch(stepID){case 1:hypotheekwijzer_stappen('algemeen');break;case 2:hypotheekwijzer_stappen('hypotheek');break;case 3:hypotheekwijzer_stappen('aflosplan');break;case 4:hypotheekwijzer_stappen('rentevast-periode');break;case 5:alert('Zorg ervoor dat alle voorgaande stappen volledig zijn ingevuld.');return false;break;}
$.stappenMenu.gotoStep(stepID)
return false;})});function hypotheekwijzer_stappen(link)
{check=true;$("fieldset.top:visible").find("fieldset:visible").children("select[value=]").addClass('formerror');$("fieldset.top:visible").find("fieldset:visible").children("select[value!=]").removeClass('formerror');endvar="";$('select.formerror').each(function()
{val=$(this).attr('id');if($("label[for="+val+"]").children('strong').text()!=null){endvar+="- "+$("label[for="+val+"]").children('strong').text();endvar+="\n";}});if(check==true)
{if(link=='submit')
{$("#pform").submit();}
else
{$("fieldset.top").hide();elm(link).style.display='block';}}
else
{alert('U dient de volgende velden nog in te vullen: \n'+endvar);}}
