<div class="modalData">
<div id="ModalTopLeftCorner"></div>
<div id="ModalTopBorder"></div>
<div id="ModalTopRightCorner"></div>
<div id="ModalLeftBorder"></div>
<div id="ModalRightBorder"></div>
<div id="ModalBottomLeftCorner"></div>
<div id="ModalBottomRightCorner"></div>
<div id="ModalBottomBorder"></div>
<div id="ModalContentContainer">
<div class="ModalTitle">Formas de Envio aceitas:</div>
<div class="ModalContent ModalContentWithButtons">

<style type="text/css">
	body,table td { font-size:11px; font-family:Tahoma, Geneva, sans-serif; }
	.conteudo { padding:10px; }
	.nome_products { font-size:18px;padding:15px 0 15px 0; border-bottom:1px solid silver }
	.linha { BORDER-BOTTOM:1px solid silver;PADDING-TOP:5px;PADDING-BOTTOM:5PX;PADDING-LEFT:5px;PADDING-RIGHT:5px; }
	select { border:1px solid silver; background:#FFF; font-size:12px; padding:2px; font-family:tahoma;  }
	.botao_cinza { border:1px solid silver; color:#000; font-size:11px; padding:3px; font-family:tahoma; background:#E8E8E8; }
</style>
<script type="text/javascript">
function formatar_mascara(src, mascara) {
	var campo = src.value.length;
	var saida = mascara.substring(0,1);
	var texto = mascara.substring(campo);
	if(texto.substring(0,1) != saida) {
		src.value += texto.substring(0,1);
	}
}

var http_request = false;
function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         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) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('myspan').innerHTML = result;            
         } else {
            alert('Erro no pedido.');
         }
      }
   }
   
   function get(obj) {
      var poststr = "cep=" + encodeURI( document.getElementById("cep").value ) +
                    "&qtda=" + encodeURI( document.getElementById("quantidade").value ) +
					"&id_products=%%GLOBAL_ProdutoId%%&de=%%GLOBAL_CepOrigem%%&valor=%%GLOBAL_Valor%%&peso=%%GLOBAL_Peso%%";      
	   loadingAjax("myspan","Calculando Taxas Aguarde...");
       makePOSTRequest('%%GLOBAL_ShopPath%%/modificacoes/call.php', 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>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="32%" rowspan="7" align="center" valign='top'>
					<img src="%%GLOBAL_ShopPath%%/product_images/%%GLOBAL_Imagem%%" border="0" width="180"  hspace="5" vspace="5" />        </td>

        <td colspan="2"></td>
      </tr>
      <tr>
        <td colspan="2" style="font-size:17px; font-weight:bold; letter-spacing:-0.6px">%%GLOBAL_Produto%%</td>
      </tr>
           
            <tr>
        <td bgcolor="#F5F5F5" class="linha">Quantidade:</td>
        <td bgcolor="#F5F5F5" class="linha"><b>
          <select name="quantidade" id="quantidade"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option><option value="32">32</option><option value="33">33</option><option value="34">34</option><option value="35">35</option><option value="36">36</option><option value="37">37</option><option value="38">38</option><option value="39">39</option><option value="40">40</option><option value="41">41</option><option value="42">42</option><option value="43">43</option><option value="44">44</option><option value="45">45</option><option value="46">46</option><option value="47">47</option><option value="48">48</option><option value="49">49</option><option value="50">50</option></select>        </b></td>

      </tr>
      <tr>
        <td class="linha" bgcolor="#F5F5F5">CEP destino: </td>
        <td class="linha" bgcolor="#F5F5F5">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td>
                <input autocomplete="off" type="text" name="cep" id="cep" class="campo_texto"  onkeypress="formatar_mascara(this, '#####-###')" size="9" maxlength="9">            </td>

            <td>&nbsp;&nbsp;N&atilde;o sabe seu CEP ? Ent&atilde;o clique <a href="https://www.correios.com.br/servicos/cep/cep_loc_log.cfm" target="_blank">AQUI</a></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="50" colspan="2">
		
		
		<center><input type="button" name="button" value="Simular Frete" onclick="javascript:get(this.parentNode);"></center>

</form>


		
		</td>
 </tr>
    </table>
	<span name="myspan" id="myspan"></span>

</div>
</div>
</div>
<div class="ModalButtonRow">
<input class="botao" value="Fechar" onclick="$.iModal.close();" type="button">
</div>
