-->
<!-- Enviar -->
if (getParameter("artigo").length>0){
document.getElementById("ref").value =getParameter("artigo");
}
if (getParameter("design").length>0){
document.getElementById("des").value =getParameter("design");
}
//if (getParameter("tipoloja").length>0){
//document.getElementById("textoCAT3").innerHTML=getParameter("tipoloja");
//}
function enviamailcont(){
var inpObj1 = document.getElementById("nome");
var inpObj2 = document.getElementById("email");
var inpObj4 = document.getElementById("obs");
var url="&email="+document.getElementById("email").value;
url+="&nome="+document.getElementById("nome").value;
url+="&obs="+document.getElementById("obs").value.replace(/\n/g, "
");
url+="&nif="+document.getElementById("nif").value;
url+="&tel="+document.getElementById("tel").value;
if (inpObj1.checkValidity() && inpObj2.checkValidity() && inpObj4.checkValidity()) {
document.getElementById("botenviar").value ="Aguarde, processando o pedido...";
document.getElementById("botenviar").disabled = true;
//window.location.replace("https://loja.emetres.pt/loja/Store/Catalog?"+document.getElementById("email").value);}
var last=document.referrer
window.location.replace("../programs/gensel.aspx?cscript=enviamailcont"+url+"&last="+last);}
else
{
if (!inpObj1.checkValidity()){document.getElementById("nome").placeholder="Digite o nome...";document.getElementById("nome").style.backgroundColor = "#ffd9b3";}
if (!inpObj2.checkValidity()){document.getElementById("email").placeholder="Digite o email...";document.getElementById("email").style.backgroundColor = "#ffd9b3";}
if (!inpObj4.checkValidity()){document.getElementById("obs").placeholder="Digite a mensagem...";document.getElementById("obs").style.backgroundColor = "#ffd9b3";}
else {document.getElementById("obs").style.backgroundColor = "#E9E9E9";}
}
}
function getParameter(theParameter) {
var params = window.location.search.substr(1).split("&");
for (var i = 0; i < params.length; i++) {
var p = params[i].split("=");
if (p[0] == theParameter) {
return decodeURIComponent(p[1]);
}
}
return false;}