var ajax_path_aquadeck = 'https://poolordertools.pwg.be/aquadeck/ajax/'; var dashboardLocation=''; var site=''; function back(){ window.location.href = dashboardLocation; } function validateEmail(email) { var re = /\S+@\S+\.\S+/; return re.test(email); } function request(){ var em = jQuery('#email').val(); var company = jQuery('#company').val(); var address = jQuery('#address').val(); var pcode = jQuery('#pcode').val(); var city = jQuery('#city').val(); var country = jQuery('#country').val(); var phone = jQuery('#phone').val(); if(jQuery('#request_partner').length > 0){ site = jQuery('#request_partner').val(); } if (em == "") { //scrollTop("#email"); alertDialog('Email address field can not be empty','Warning'); return; } if (validateEmail(em) == false) { alertDialog('Email address field is not formed correctly','Warning'); return; } if (company == "") { alertDialog('Company field can not be empty','Warning'); return; } if (address == "") { alertDialog('Address field can not be empty','Warning'); return; } if (pcode == "") { alertDialog('Postal code field can not be empty','Warning'); return; } if (city == "") { alertDialog('City field can not be empty','Warning'); return; } var data = {}; data.e = em; data.c = company; data.a = address; data.p = pcode; data.city = city; data.country = country; data.phone = phone; data.s = site; jQuery.post(ajax_path_aquadeck+'request.php', data).done(function(result) { alertDialog('Thank you for registering. We are reviewing your request and will get in touch as soon as possible. If you have any questions in the meantime, don’t hesitate to contact your local Pollet Pool Group office.'); }); } function alertDialog(message,title){ if(typeof title=='undefined'){ title=''; } $("#requestDialog").dialog('close'); $( "#requestDialog" ).remove(); var dialogWindow = '

'+message+'

'; $( "body" ).append(dialogWindow); $( "#requestDialog" ).dialog({modal: true}); $( ".ui-dialog" ).css('top','40px'); } function closeDialog(){ $("#requestDialog").dialog('close'); $( "#requestDialog" ).remove(); window.location.href = dashboardLocation; }