//This script formats the action of FormToMail according
//to the other input variables in order to operate
//uniformmail.cgi correctly

function MailerVars(to, cc, bcc, from, replyto, subject, FormToMail, success, failure) {
  /*for(var i = 0;i < (arguments.length - 1);i++) {
    while(arguments[i].indexOf(" ") != -1) {
	  arguments[i] = arguments[i].replace(" ","%20");
    }
  }*/
  if(to != "" && from != "") {
    var act_str = "/Executable/CGI/ASPMailer/sendForm.asp?";
    act_str += "to=" + to + "&";
    act_str += "cc=" + cc + "&";
    act_str += "bcc=" + bcc + "&";
    act_str += "from=" + from + "&";
    act_str += "replyto=" + replyto + "&";
    act_str += "subject=" + subject;
   
    if(success != "") {
        act_str += "&success=" + success;
    }
    else {
        act_str += "&success=" + encodeURIComponent("/Executable/CGI/MailResponses/Response.asp?suc=y&srcURL=" + location.href);
    }
    if(failure != "") {
        act_str += "&failure=" + failure;
    }
    else {
        act_str += "&failure=" + encodeURIComponent("/Executable/CGI/MailResponses/Response.asp?suc=n&srcURL=" + location.href);
    }

    FormToMail.setAttribute("action", act_str);
    //return act_str;
  }
}