function sendFormDataTmp(field,value,target){var data={},form=target.closest("form");data.form_update_from_script=1;data.request_id=tmp_data_request_id;data.form_data={};switch(field){case"name":if(value.length>4){data.fio=value;}break;case"phone":if(value.length>8){data.phone=value;}break;case"country":if(value.length==2){data.country=value;}break;}if(isJsonEnable){try{var dataRow=form.serializeArray(),addressIsset=false,fieldsDisabled=['s1','s2','s3','offer_id','landing','campaign','order_source','request_id','return_url','timezone','jswork','frompopup','address','client_data'];$(dataRow).each(function(item,itemData){if(itemData.name=="address"){addressIsset=true;}if(fieldsDisabled.includes(itemData.name)){delete dataRow[item];}});if(!addressIsset){form.append("<input name='address' type='hidden'>");}form.find("input[name='address']").val($.JSON.encode(dataRow));}catch(e){console.log(e.toString());}}$("input",form).each(function(){var name=$(this).attr("name"),value=$(this).val();if(typeof name!="undefined"&&name!=""&&typeof value!="undefined"&&value!=""){data.form_data[name]=value;}});$("select",form).each(function(){var name=$(this).attr("name"),value=$(this).val();if(typeof name!="undefined"&&name!=""&&typeof value!="undefined"&&value!=""){data.form_data[name]=value;}});$.get(tmp_data_to_server,data);}$(document).ready(function(){$("form").sisyphus({excludeFields:$("[name=country], [name=language], [name=s1], [name=s2], [name=s3], [name=offer_id], [name=landing], [name=campaign], [name=request_id], [name=referer], [name=order_source], [name=return_url], [name=timezone], [name=jswork], [name=frompopup]"),});$("input[type=text],input[type=tel]").blur(function(event){var target=$(event.currentTarget);if(target.attr("name")=="name"||target.attr("name")=="phone"){if(typeof target.attr("oldvalue")=="undefined"){oldval="";}else{oldval=target.attr("oldvalue");}if(oldval!=target.val()){target.attr("oldvalue",target.val());sendFormDataTmp(target.attr("name"),target.val(),target);}}});$("input[type=text],input[type=tel]").each(function(){var target=$(this);if(target.attr("name")=="name"||target.attr("name")=="phone"){target.attr("oldvalue",target.val());if(target.val()!=""){sendFormDataTmp(target.attr("name"),target.val(),target);}}});$("form input, form select").not("input[name='name'], input[name='phone'], select[name='country']").blur(function(){var target=$(this);if(target.val()!=""){sendFormDataTmp(target.attr("name"),target.val(),target);}});});