IU.mailForm = (function(){

var theTitle = "";
var theHeader = null;
var location = "includes/mailForm.php";

function maskInputs(){
  $("#mail_Telephone").mask("(999) 999-9999");
}  
  
//Public Members
return {
  initialize: function(options){
    theTitle = (options.title) ? options.title : "Email Form";
    theHeader = (options.header) ? options.header : null;
  },
  show: function(requestPage){
    if($(".dataContainer").length > 0){
      var container = $("#contentText");
      $.get("includes/coverageFormIcons.php", {}, function(data){
        container.html("");
        container.append(data);
        IU.updateNavigationIcons();
      }, "html");
    }
    Boxy.load(location, {
      afterShow: function() {
        if (theHeader){
          $("#mailFormHeader").html(theHeader);
        }
        var validator = jQuery.extend(true, {}, IU.formValidator);
        validator.prepareQuoteForm( 
          { validateFunction : IU.validateStep,
            submitFunction   : IU.submitForm,
            updateElement    : $(".mailForm"),
            caller           : requestPage }
        );
        maskInputs(); 
      },
      afterHide: function() {
        this.unload();
        theHeader = null;
      },
      title: theTitle,
      modal: true
    });
  }
};

})();