<!--

waJSQuery(window).load(function(){
initializeAllWA_form();
});
function wINfS(oemiN)
{
var lpJSk=oemiN.find('select,input,textarea');
lpJSk.each(function(i)
{
var QDBGa=lpJSk[ i ];
if(QDBGa.type=='checkbox'){
QDBGa.checked=false;
}
else if(QDBGa.type.startsWith('select')){
var saCQP=QDBGa.options.selectedIndex;
if(saCQP!=-1){
QDBGa.options.selectedIndex=-1;
QDBGa.options[ saCQP ].selected=false;
}
}
else{
QDBGa.value='';
}
});
}
function Ktlnr(oemiN)
{
var lpJSk=oemiN.find('select,input[type!=checkbox],textarea,div[class*=divCheckBox]')
var CArrW=extractParamInfo(oemiN,"url")
var VmrlG=extractParamInfo(oemiN,"email_valid")
var Svhgm=false;
var backgroundError="#f8c7c7";
lpJSk.each(function(i)
{
var QDBGa=lpJSk[ i ];
var MduQC=waJSQuery(this);
var ixYTh=parseInt(extractParamInfo(MduQC,"max"))
var mUZGk=extractParamInfo(MduQC,"mandatory")
var JhQpQ=extractParamInfo(MduQC,"email")
if(QDBGa.tagName.toLowerCase()=='div'){
if(mUZGk=="1")
{
var checkedCount=MduQC.find("input[type=checkbox]:checked").size();
if(checkedCount==0)
{
MduQC.css("backgroundColor",backgroundError);
MduQC.focus();
Svhgm=true;
return false;
}
}
}
else
{
MduQC.val(waJSQuery.trim(MduQC.val())) 
var NGwvi=MduQC.val();
var BnRKD=NGwvi!=undefined?NGwvi.length:0;
if(ixYTh>0)
{
if(BnRKD>ixYTh)
{
MduQC.css("backgroundColor",backgroundError)
MduQC.focus()
Svhgm=true;
return false;
}
}
if(mUZGk=="1")
{
var hasValidLength=BnRKD>0;
if(!hasValidLength)
{
MduQC.css("backgroundColor",backgroundError)
MduQC.focus()
Svhgm=true;
return false;
}
}
if(JhQpQ=="1")
{
if((BnRKD>0)&&(isValidEmailAddress(NGwvi)==false))
{
MduQC.css("backgroundColor",backgroundError)
MduQC.focus()
Svhgm=true;
return false;
}
}
}
});
if(Svhgm) return false;
if(document.webaca_is_preview)
{
WA_Dialog.alert(Translator.tr("Operation not allowed in preview mode"));return false;
}
WA_Dialog.progress();
var SgqTr="";
lpJSk.each(function(i)
{
var pfVPa=waJSQuery(this)
var QDBGa=lpJSk[ i ];
if(SgqTr.length>0)
{
SgqTr+=","
}
var erfda=pfVPa.attr("name");
var NGwvi='';
if(QDBGa.tagName.toLowerCase()=='div'){
var eFTaV=pfVPa.find("input[type=checkbox]:checked");
eFTaV.each(function(j)
{
var atYIL=eFTaV[ j ];
if(NGwvi.length>0)
{
NGwvi+=', '
}
NGwvi+=atYIL.value;
});
if(eFTaV.length>0){
erfda=pfVPa.find("input[type=checkbox]")[ 0 ].name;
}
else{
erfda='';
}
}
else
{
NGwvi=pfVPa.val();
}
NGwvi=NGwvi.replace(/\n/gi,"\\n")
NGwvi=NGwvi.replace(/"/gi,"\\\"")
if(erfda!=''){
SgqTr+="\""+erfda+"\":\""+NGwvi+"\"";
}
});

var kfrJV=waJSQuery.parseJSON("{"+SgqTr+"}");
waJSQuery.post(CArrW,kfrJV,function(data){
if(data.indexOf("<?php")>-1)
{
WA_Dialog.alert(Translator.tr("Error:No php on server"));
}
else
{
var PmATe=waParseCleanStringJSON(data);
if(PmATe==null)
{
WA_Dialog.alert(Translator.tr("Error:Malformed response !"));
}
else
{
if(PmATe.success==true)
{
wINfS(oemiN)
var EHrkx=Translator.tr("Success:Mail sended");
if(PmATe.error.length>0)
{
EHrkx+="<br>"
EHrkx+="<br>"
EHrkx+=PmATe.error
}
WA_Dialog.alert(EHrkx);
}
else
{
WA_Dialog.alert(PmATe.error);
}
}
}
}).success(function(){
}).error(function(){WA_Dialog.alert("*error send mail!");}).complete(function(){
});
return true;
};
function initializeAllWA_form()
{
waJSQuery(".wa-form").each(function(i)
{
var oemiN=waJSQuery(this)
var lpJSk=oemiN.find('select,input[type!=checkbox],textarea,div[class*=divCheckBox]')
var CArrW=extractParamInfo(oemiN,"url")
var VmrlG=extractParamInfo(oemiN,"email_valid") 
lpJSk.each(function(i)
{
var MduQC=waJSQuery(this);
var oldBg=MduQC.attr("oldBackgroundColor");
if(oldBg==undefined){
oldBg=MduQC.css("backgroundColor");
MduQC.attr("oldBackgroundColor",oldBg);
}
MduQC.keypress(function(e){
var MduQC=waJSQuery(this)
if(e.which==13)
{
if(MduQC.prop('tagName')=="TEXTAREA")
{
return true;
}
return false;
}
return true;
});
var ixYTh=parseInt(extractParamInfo(MduQC,"max"))
if(ixYTh>0)
{
MduQC.keyup(function(e){
var pfVPa=waJSQuery(this)
var ixYTh=parseInt(extractParamInfo(pfVPa,"max"))
var NGwvi=MduQC.val()
var BnRKD=NGwvi!=undefined?NGwvi.length:0;
if(BnRKD>ixYTh)
{
pfVPa.val(NGwvi.substring(0,ixYTh))
}
});
}
MduQC.change(function()
{
var oldBg=MduQC.attr("oldBackgroundColor");
MduQC.css("backgroundColor",oldBg)
});
});
});
waJSQuery(".wa-form-button-reset").each(function(i)
{
var gIqbP=waJSQuery(this) 
var NwniJ=gIqbP;
NwniJ.css("cursor","pointer")
gIqbP.css("cursor","pointer")
NwniJ.click(function()
{
var oemiN=waJSQuery(this).parents("form") 
wINfS(oemiN)
return false;
});
});
waJSQuery(".wa-form-button-submit").each(function(i)
{
var gIqbP=waJSQuery(this)
var NwniJ=gIqbP;
NwniJ.css("cursor","pointer")
gIqbP.css("cursor","pointer") 
NwniJ.click(function()
{
var oemiN=waJSQuery(this).parents("form")
Ktlnr(oemiN)
return false;
});
});
}

-->
