/***********************************************
* Encrypt Email script- Please keep notice intact
* Tool URL: http://www.dynamicdrive.com/emailriddler/
* **********************************************/
<!-- Encrypted version of: info [at] ***********************.** //-->

var emailriddlerarray=[105,110,102,111,64,112,115,121,99,104,111,116,104,101,114,97,112,105,101,107,114,97,108,105,110,103,101,110,46,110,108]
var encryptedemail_id64='' //variable to contain encrypted email 
for (var i=0; i<emailriddlerarray.length; i++)
 encryptedemail_id64+=String.fromCharCode(emailriddlerarray[i])

var oldContent = '';

function mailform(){
  //$("#content").find("p:last").prev().html('[Mailform hier]');
  /*
  $("body").append('<div id="ovl"></div>');
  $("body").append('<div id="avl">abc, <a id="close">Sluiten</a></div>');
  $("#ovl").css({'width' : '100%', 'height': '100%', 'position' : 'fixed', 'top' : '0px', 'left' : '0px', 'backgroundColor' : '#fff', 'opacity' : '0.9', 'filter' : 'alpha(opacity=90)'});
  $("#avl").css({'width' : '100%', 'height': '100%', 'position' : 'fixed', 'top' : '0px', 'left' : '0px', 'textAlign' : 'center'});
  $("#close").click(function(){
	$("#ovl").remove();
	$("#avl").remove();
  });
  */
  
  oldContent = $("#content").html();
  $("#content").find("h1").html('Contact opnemen');
  $("#content").find("p:first").before(
										  '<table cellpadding="0" cellspacing="0" border="0" width="100%">' +
										  '  <tr>'+
										  '  <td width="180">Uw naam</td>'+
										  '  <td><input type="text" /></td>'+
										  ' </tr>' +
										  '  <tr>'+
										  '  <td>Uw e-mailadres</td>'+
										  '  <td><input type="text" /></td>'+
										  ' </tr>' +
										  '  <tr>'+
										  '  <td>Uw telefoonnummer</td>'+
										  '  <td><input type="text" /></td>'+
										  ' </tr>' +
										  '  <tr>'+
										  '  <td valign="top">Uw vraag of reactie</td>'+
										  '  <td><textarea></textarea></td>'+
										  ' </tr>' +
										  '  <tr>'+
										  '  <td></td>'+
										  '  <td></td>'+
										  ' </tr>' +
										  '  <tr>'+
										  '  <td><a href="javascript:void(0);" class="formterug">&laquo; Terug</a></td>'+
										  '  <td align="right"><a href="javascript:void(0);" class="formsubmit"><b>Verstuur &raquo;</b></a></td>'+
										  ' </tr>' +
										  '</table>' + 
										  '<br><br>'
									  );
  $("#content").find("p").remove();
  $(".formterug").click(function(){
	$("#content").html(oldContent);
  });
  $(".formsubmit").click(function(){
	$("#content h1").after('<p style="border: 1px solid #398219; background-color: #c5e595; padding: 10px; text-align: center; font-weight: bold;">Bedankt, uw reactie is verzonden!</p>');
	$("#content table").fadeOut("slow");
	fN = $("#content table input:eq(0)").val();
	fE = $("#content table input:eq(1)").val(); 
	fT = $("#content table input:eq(2)").val();
	fV =  $("#content table textarea").val();
	$.post('http://www.psychotherapiekralingen.nl/mailer.php', {'n' : fN, 'e' : fE, 't' : fT, 'v' : fV}, function(){}, "json");
	setTimeout(function(){
	  $("#content p").fadeOut();
	  $("#content h1").fadeOut(function(){
		$("#content").html(oldContent);
	  });
	},3500);
  });
  
}
