var Controller=Class.create({initialize:function(){var arr=$$('li.productGroep');for(var index=0,len=arr.length;index<len;++index){var item=arr[index];var func=this.displayChildren.bind(this,item.id);$(item.id).observe('click',func,true);}this.initEmail();},displayChildren:function(li){$(li+'_div').show();var func=this.hideChildren.bind(this,li);$(li).observe('click',func,false);},hideChildren:function(li){$(li+'_div').hide();var func=this.displayChildren.bind(this,li);$(li).observe('click',func,false);},initEmail:function(){if($('buttonone')){var func=this.saveSubscriber.bind(this);$('buttonone').observe('click',func,false);}},emailCheck:function(email){var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return(filter.test(email));},saveSubscriber:function(){if($F('emailadres').length>3&&this.emailCheck($F('emailadres'))){var obj={};obj.subscriber='test';obj.email=$F('emailadres');obj.newType='Account';obj.newMethod='addSubscriber';var func=this.response.bind(this);ARRM.jsonRequest(obj,func);}else{alert('Voer een geld emailadres in a.u.b.');}},response:function(obj){if(obj){alert("U bent toegevoegd aan ons emailbestand");$('emailadres').value="";}}});var overlayDiv={build:function(){this.createOverlay();if(!document.getElementById("floatDiv")){var h=document.createElement('div');h.id='floatWrap';document.body.appendChild(h);var y=document.createElement('div');y.id='floatDiv';h.appendChild(y);}},createOverlay:function(){if(!document.getElementById('overlay')){var x=document.createElement('div');x.id='overlay';document.body.appendChild(x);}},close:function(){if(document.getElementById('overlay')){document.body.removeChild(document.getElementById('overlay'));}if(document.getElementById('floatWrap')){document.body.removeChild(document.getElementById('floatWrap'));}if($('floatDiv')){$('floatDiv').hide();}}};Event.onDOMReady(function(){controller=new Controller();});