<div class="modal-header">
  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <h4 class="modal-title" id="myModalLabel">Recomendar Produto</h4>
</div>
<div class="modal-body">
  <script type="text/javascript">
    var http_request = false;
    function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) {
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
          http_request.overrideMimeType('text/html');
        }
      } else if (window.ActiveXObject) {
        try {
          http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
          try {
            http_request = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (e) {}
        }
      }
      if (!http_request) {
        alert('Cannot create XMLHTTP instance');
        return false;
      }

      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
      }

      function alertContents() {
        if (http_request.readyState == 4) {
          if (http_request.status == 200) {
            result = http_request.responseText;
            document.getElementById('myspan').innerHTML = result;
          } else {
            alert('Erro no pedido.');
          }
        }
      }

      function get(obj) {
        var poststr = "nomede=" + encodeURI( document.getElementById("nomede").value ) +
          "&emailde=" + encodeURI( document.getElementById("emailde").value ) +
          "&nomepara=" + encodeURI( document.getElementById("nomepara").value ) +
          "&emailpara=" + encodeURI( document.getElementById("emailpara").value ) +
          "&mensagem=" + encodeURI( document.getElementById("mensagem").value ) +"";      
          loadingAjax("myspan","<center>Procesando Envio de Mensagem...Aguarde...</center>");
          makePOSTRequest('%%GLOBAL_ShopPath%%/remote.php?w=recomendar&id=%%GLOBAL_ProdutoIdn%%&acao=enviar', poststr);
      }

      function loadingAjax(obj,msg,float){
        float = float || 'left';
        msg = msg || "Calculando Taxas Aguarde...";
        if (document.getElementById(obj)){
          document.getElementById(obj).innerHTML = "<div style='float:"+float+";'><font color=\'#000000\' face='Trebuchet MS, Arial' size=2>"+msg+"</font></div>";
        }
      }
  </script>
  <div class="form-group">
    <label for="exampleInputEmail1">Produto</label>
    <input type="text" value="%%GLOBAL_Produton%%" disabled class="form-control" id="exampleInputEmail1" placeholder="Email">
  </div>

  <div class="form-group">
    <label for="exampleInputEmail1">Seu Nome</label>
    <input type="text" class="form-control" id="nomede" name="nomede">
  </div>

  <div class="form-group">
    <label for="exampleInputEmail1">Seu Email</label>
    <input type="text" class="form-control" id="emailde" name="emailde">
  </div>

  <div class="form-group">
    <label for="exampleInputEmail1">Nome do Amigo</label>
    <input type="text" class="form-control" id="nomepara" name="nomepara">
  </div>

  <div class="form-group">
    <label for="exampleInputEmail1">Email do Amigo</label>
    <input type="text" class="form-control" id="emailpara" name="emailpara">
  </div>

  <div class="form-group">
    <label for="exampleInputEmail1">Mensagem</label>
    <textarea rows="3" cols="30" class="form-control" name="mensagem" id=mensagem></textarea>
  </div>
</div>

<div class="modal-footer">
  <p><span name="myspan" id="myspan"></span></p>
  <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
  <button type="button" class="btn btn-primary" onclick="javascript:get(this.parentNode);">Recomendar Produto</button>
</div>