
  /**
   * contains functions called by the contact page
   */
  function ContactPage() {
    
  }
  
  
  /**
   * called on a server reply
   * @param XMLHTTPRequest xmlhttp
   * @return void
   */
  ContactPage.prototype.onSendEmailReply = function(xmlhttp) {
    if ( xmlhttp.responseXML && xmlhttp.responseXML.documentElement ) {
      var xml = xmlhttp.responseXML.documentElement;
      if ( !YSNumbers.checkInt(YSXML.getChildAttribute(xml, 'error', 'code')) ) {
        YSDOM.setValue('from', '');
        YSDOM.setValue('subject', '');
        YSDOM.setValue('emailcontent', '');
        YSConfirm.createAlert("Bedankt voor het verzenden van uw bericht.<br />"+
          "Indien nodig, nemen wij zo spoedig mogelijk contact met u op.")
      }
      else YSConfirm.createAlert(YSXML.getChildText(xml, 'error'));
    }
  };
  
  
  /**
   * sends email
   * @return void
   */
  ContactPage.prototype.sendEmail = function() {
    YSAJAX.sendRequest(BASE_PATH+'scripts/Front/contact.php', 
      'tEmail='+YSDOM.getValue('from', true)+
      '&tSubject='+YSDOM.getValue('subject', true)+
      '&tContents='+YSDOM.getValue('emailcontent', true), true, 
      ContactPage.onSendEmailReply, this);
  };
  
  
  
  var ContactPage = new ContactPage();
