	function valid_email(email)
	{
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(email)) return true;
		return false;
	}
	function validate_appointment()
	{
		var error='';
		if(document.send_appointment.lastname.value=='')
			error=error+'Uw achternaam is een verplicht veld\n';
		if(document.send_appointment.email.value==''||!valid_email(document.send_appointment.email.value))
			error=error+'Geen geldig emailadres ingevuld\n';
		if(document.send_appointment.ctype[0].checked==false&&document.send_appointment.ctype[1].checked==false)
			error=error+'Wilt u a.u.b. aangeven hoe wij het beste contact met u op kunnen nemen.\n';
		if (error=='')  return true;
				else	{
							alert(error);
							return false;
						}
	}
	function loadChilds(ind,pages)
	{
		if(eval('document.send_appointment.select'+(ind-1)+'.value')!='')
		{
			y=eval('document.send_appointment.select'+(ind-1)+'.value');
			for(j=0;j<pages.length;j++)
				if(pages[j][0]==y)
					document.send_appointment.issue.value=pages[j][2];
		}
		else
			document.send_appointment.issue.value='';
		
		
		for(i=ind;i<4;i++)
		{
			sel_obj=eval('document.send_appointment.select'+i);
			sel_obj.options.length = 0;
			sel_obj.options[0] = new Option('-','');
			x=eval('document.send_appointment.select'+(i-1)+'.value');
			
			if(i==ind&&x!='')
			{
				k=1;
				for(j=0;j<pages.length;j++)
				{
					if(pages[j][1]==x)
					{	
						sel_obj.options[k] = new Option(pages[j][2],pages[j][0]);
						k++;
					}
				}
			}
		}
	}
	
	
	function showDataAppointment(subject,pages) {
		shadowObj=document.getElementById("appointment_transp");
		
		
		if(document.getElementById("third_left")!=undefined)
		{
			shadowObj.style.height=document.getElementById("third_left").offsetHeight;
		}
		
		
		dataObj=document.getElementById("appointment_data");
		shadowObj.style.visibility='visible';
		dataObj.style.visibility='visible';
		var htmlCode='';
		htmlCode=htmlCode+'<div id="inner_data_appointment">'; 
		
		
		if(subject!='home')
		{
		htmlCode=htmlCode+'<div id="appointment_title">Afspraak maken</div>';
			htmlCode=htmlCode+'<div id="appointment_text1">U geeft aan een afspraak te willen maken om te praten over:<br> <span id="appointment_text_selected">'+subject+'</span></div>';
			htmlCode=htmlCode+'<input type="hidden" value="'+subject+'" name="issue">';
			htmlCode=htmlCode+'<div id="appointment_text2">Hiervoor hebben wij een aantal gegevens van u nodig.<br> Als u deze invult, nemen wij z.s.m. contact met u op</div>';
		}
		else
		{
		htmlCode=htmlCode+'<div id="appointment_title">Offerte aanvragen</div>';
			htmlCode=htmlCode+'<input type="hidden" value=""  name="issue">';
			htmlCode=htmlCode+'<div id="appointment_text1">U geeft aan een offerte te willen aanvragen betreffende:<br><br>'
			htmlCode=htmlCode+'<select id="appointment_select" name="select0" onchange="loadChilds(1,pages);"><option value="" >-</option><option value="1">Particulier</option><option value="2">Zakelijk</option></select><br>';
		
			htmlCode=htmlCode+'<select id="appointment_select" name="select1" onchange="loadChilds(2,pages);"><option value="">-</option></select>';
			htmlCode=htmlCode+'<select id="appointment_select" name="select2" onchange="loadChilds(3,pages);"><option value="">-</option></select>';
			htmlCode=htmlCode+'<select id="appointment_select" name="select3" ><option value="">-</option></select>';
		
		
		htmlCode=htmlCode+'</div>';
		}
		
		htmlCode=htmlCode+'<div id="close_button_appointment"><a href="#" onClick="JavaScript:hideDataAppointment();return false;" id="offer_text_selected">sluiten <img src="images/blocks_green.gif" border="0"></a></div>';
		htmlCode=htmlCode+'<div id="appointment_form_container">';
		htmlCode=htmlCode+'<p><span id="appointment_cell_left_bullet">Voorletter(s):</span><input type="text" id="appointment_input" name="firstname" ><br>';
		htmlCode=htmlCode+'<span id="appointment_cell_left_bullet">Achternaam:</span><input type="text" id="appointment_input"  name="lastname"><br>';
		htmlCode=htmlCode+'</p><p><span id="appointment_cell_left_bullet">Telefoon:</span><input type="text" id="appointment_input"  name="phone"><br>';
		htmlCode=htmlCode+'<span id="appointment_cell_left_bullet">E-mail:</span><input type="text" id="appointment_input"  name="email"><br>';
		htmlCode=htmlCode+'<span id="appointment_cell_left_bullet">Contact per:</span><input  type="radio" id="appointment_radio" name="ctype" value="t" >';
		htmlCode=htmlCode+'&nbsp;Telefoon&nbsp;<input  type="radio" id="appointment_radio" name="ctype" value="e" >&nbsp;E-mail</p><p>';
		htmlCode=htmlCode+'<span id="appointment_cell_left_bullet">Opmerking:</span><textarea  id="appointment_textarea" name="observation">Eventuele opmerkingen</textarea>';
		htmlCode=htmlCode+'<div id="send_button_appointment"><a href="#" onClick="if(validate_appointment()){document.send_appointment.submit();}" class="blink">verzenden <img src="images/blocks_green.gif" border="0"></a></div>';
		htmlCode=htmlCode+'</div>';
		htmlCode=htmlCode+'</div>';
		dataObj.innerHTML=htmlCode;
		return false;
	}

	function hideDataAppointment() {
		shadowObj=document.getElementById("appointment_transp");
		dataObj=document.getElementById("appointment_data");
		shadowObj.style.visibility='hidden';
		dataObj.style.visibility='hidden';
		return false;
	}

	//-->


