function removeInputBlock(A){oFieldset=document.getElementById(A);oParent=document.getElementById("extraOntvangers");oParent.removeChild(oFieldset)}$(function(){function B(I,G,H){oDiv=document.createElement("div");oLabel=document.createElement("label");oLabel.setAttribute("for",G);oTxt=document.createTextNode(H);oLabel.appendChild(oTxt);oInput=document.createElement("input");oInput.setAttribute("id",G);oInput.setAttribute("class","text");oInput.className="text";oInput.setAttribute("type","text");oInput.setAttribute("name",I);oDiv.appendChild(oLabel);oDiv.appendChild(oInput);return oDiv}var F=new Object();F["txt"]=/^.{2,}$/;F["email"]=/^([\w-]+\.?)+@([\w-]+\.{1})+[A-Za-z]+$/;var A=new Object();A["ontvanger_naam"]=new Array();A["ontvanger_naam"]["rule"]="txt";A["ontvanger_naam"]["msg"]="geef naam op";A["ontvanger_email"]=new Array();A["ontvanger_email"]["rule"]="email";A["ontvanger_email"]["msg"]="geef email op";A["bericht"]=new Array();A["bericht"]["rule"]="txt";A["bericht"]["msg"]="geef bericht op";A["afzender_naam"]=new Array();A["afzender_naam"]["rule"]="txt";A["afzender_naam"]["msg"]="geef naam op";A["afzender_email"]=new Array();A["afzender_email"]["rule"]="email";A["afzender_email"]["msg"]="geef email op";defaultBlur=function(){var G=$(this).attr("name");if(A[G]){var H=F[A[G]["rule"]];if($(this).val().match(H)){$(this).parent().removeClass("error")}}};$("#formGaJeMee input, #formGaJeMee textarea").blur(defaultBlur);$("#formGaJeMee input[@name='ontvanger_naam'], #formGaJeMee input[@name='afzender_naam']").blur(function(){$("#templateContent-"+$(this).attr("name").replace("_","-")).html($(this).val())});var E;$("#formGaJeMee textarea").keypress(function(){window.clearTimeout(E);var G=$(this);E=window.setTimeout(function(){var H=G.val();var H=H.replace("<","&lt;");var H=H.replace(">","&gt;");var H=H.replace("\n","<br />");$("#templateContent-bericht").html(H)},1000)});$("#formGaJeMee").submit(function(){for(var G in A){var I=F[A[G]["rule"]];var H=$.trim(this[G].value);$(this[G]).val(H);if(!H.match(I)){alert(A[G]["msg"]);$(this[G]).parent().addClass("error");this[G].focus();return false}}});function C(H,G){alert(G);$(H).parent().addClass("error");H.focus();return false}var D=0;$("#formGaJeMee input[@name='toevoegenOntvanger']").click(function(){D++;var I="formGaJeMee-ontvanger"+D;var G="formGaJeMee-ontvanger-naam"+D;var H="formGaJeMee-ontvanger-email"+D;oFieldset=document.createElement("fieldset");oFieldset.setAttribute("class","sidebyside");oFieldset.className="sidebyside";oFieldset.setAttribute("id",I);oLegend=document.createElement("legend");oA=document.createElement("a");oA.setAttribute("href","javascript:removeInputBlock('"+I+"')");oTxt=document.createTextNode("rm");oA.appendChild(oTxt);oOuterSpan=document.createElement("span");oSpan=document.createElement("span");oSpan.setAttribute("class","label");oSpan.className="label";oTxt=document.createTextNode("ontvanger");oSpan.appendChild(oTxt);oOuterSpan.appendChild(oSpan);oSpan=document.createElement("span");oSpan.setAttribute("class","button");oSpan.className="button";oSpan.appendChild(oA);oOuterSpan.appendChild(oSpan);oLegend.appendChild(oOuterSpan);oFieldset.appendChild(oLegend);oDiv=B("ontvanger_xtra_naam[]",G,"naam ontvanger:");oFieldset.appendChild(oDiv);oDiv=B("ontvanger_xtra_email[]",H,"e-mail adres ontvanger:");oFieldset.appendChild(oDiv);oNewOntvanger=$("#extraOntvangers").get(0).appendChild(oFieldset);$("#"+G).focus();return false})})
