var ContactRequest=new Class({initialize:function(container){var submit=container.getElement('input.submit');var form=container.getElement('form');var select=container.getElement('select');var answerBox=container.getElement('.contact-box');if(submit&&form&&select&&answerBox){var request=new Request({url:(form.get('action')?form.get('action'):location.href),method:'get',onComplete:function(responseText,responseXML){answerBox.set('html',responseText);answerBox.getElements('.popupImage').each(function(element){element.addEvent('click',function(event){var event=new Event(event).stop();if(null==element.popup){element.popup=new Popup(element);}else{element.popup.close();element.popup=new Popup(element);}});});}});submit.destroy();form.addEvent('submit',function(event){event.stop();}) select.addEvent('change',function(event){request.send('request=true&contact_id='+select.get('value'));});}}});window.addEvent('load',function(event){$$('.contact-module').each(function(contactModule){new ContactRequest(contactModule);});});