function isNumeric(form_value) 
{ 
    if (form_value.match(/^\d+$/) == null) 
        return false; 
    else 
        return true; 
} 


function postme() {

	var curid;
	var name;
	var msg;
	var proceed = true ;
  	
  	$('#errorline').hide("slow");
		
	$("#contact_form input").each(function(){ 
		
		curid = $(this).attr('id');
		
		if (isNumeric(curid)) {
			if (curid>1000) {
				// controleer of dit veld is ingevuld
				
				name = $(this).attr('name');
				
				if ($(this).attr('type') == 'checkbox') {
				
					if(!$(this).is(':checked')) { 
					
						if (name=='') {
							 msg='Velden met * zijn verplicht in te vullen.'	
							} else {
								msg = 'Het veld ' + name + ' is verplicht aan te geven.';
							}

							$('#errorline').text(msg);
							$('#errorline').show("slow");
							$(this).focus();
						
							proceed = false
							return false
					
					
					}
							
				}
				
				if ($(this).val() == '') {
						
						
						if (name=='') {
						 msg='Velden met * zijn verplicht in te vullen.'	
						} else {
							msg = 'Het veld ' + name + ' is verplicht in te vullen.';
						}
						
						$('#errorline').text(msg);
						$('#errorline').show("slow");
						$(this).focus();
						
						proceed = false
						return false
				
				}
			}
	     } // end isNumeric
	}); // end contact_from input


	
	if (!proceed) return;
	
	
	var dataString = $('#contact_form input').serialize(); 
	
	//alert (dataString);//return false;
	

	$.ajax({
			type: "POST",
			data: dataString,
			url: "admin/process.php",
			success: function(data) {
				$('#contenttekst').html(data);
			} 
	}); // end ajaz
	
} // end function 

runOnLoad(function(){
  $("input#name").select().focus();
});

