<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">jQuery(document).ready(function($){
    var post_id = 0;
    
   $('#register-form').on('submit',function(){
       post = $('#register-form').serialize();
       var formData = new FormData(this);
        $('.login_area').append('&lt;div id="load_registrazione" style="position:absolute;top:0;left:0;width:100%;background:#ffffffc9;height: 100%;z-index: 100;"&gt;&lt;span style="display:block; position:absolute; top:30%; width:100%; text-align:center; font-size:30px;"&gt;Registrazione in corso ...&lt;/span&gt;&lt;/div&gt;');
      // $('.btn-register').attr('disabled', 'disabled');
        $.ajax({
                     type:'POST',
            url: "/wp-content/themes/bingo-child/unipro/registrazione-ajax.php",
            data:formData,
            cache:false,
            contentType: false,
            processData: false
                    
                   // data: post
            })
        .done(function( result ) {
            $('#load_registrazione').remove();
         result_j = result.split('##');
         if (result_j[0] == ''){
            // html_success = '&lt;div class="alert alert-success"&gt;Registrazione effetttuato con successo&lt;br /&gt;Riceverai una mail con i dati per accedere all\'area riservata&lt;/div&gt;';
           // $('#register-form').html(html_success);
            
             
              post_id = result_j[1];
              $('#register-form').css('display', 'none');
            
            if ($("input[name='tipo_registrazione']:checked").val() == 1 || $("input[name='tipo_registrazione']:checked").val() == 2){
               tipo_registrazione = 'Professionista';
               $('#descrizione_area_professionista').css('display', 'block');
            }else{
               tipo_registrazione = 'Azienda';
               $('#descrizione_area_azienda').css('display', 'block');
            }
            dataLayer.push({
                'event': 'gtm.registrazione',
                'gtm.registrazione_tipo':tipo_registrazione
            });
         }else{
            $('#error_registrazione').html(result_j[0]);
          $('.btn-register').removeAttr('disabled');
         }
        });
       return false;
   });
   
   
   $('#descrizione_area_professionista').on('submit',function(){
       $('#descrizione_area_professionista').append('&lt;input type="hidden" name="post_id" value="'+post_id+'"/&gt;')
      post = new FormData(this);
      $.ajax({
                    method: "POST",
                    url: "/wp-content/themes/bingo-child/unipro/registrazione-scheda-ajax.php",
                    data:post,
            cache:false,
            contentType: false,
            processData: false
            })
        .done(function( result ) {
             redirect = $('input[name="redirect"]').val();
         redirect_txt = '';
           if (redirect != '0'){
               redirect_txt = ', oppure torna alla &lt;a href="' + redirect + '" style="text-decoration:underline;"&gt;pagina che stavi visitando&lt;/a&gt;.';
           }
          html_success = '&lt;div class="alert alert-success"&gt;Registrazione effettuata con successo&lt;br /&gt;Riceverai una mail con i dati per accedere all\'area riservata&lt;br /&gt;&lt;br /&gt;&lt;a href="https://www.' + _dominio + '.com/scheda-professionista/"&gt;Vai nella tua area riservata&lt;/a&gt;' + redirect_txt + '&lt;/div&gt;';
          $('#descrizione_area_professionista').html(html_success);
        });
       return false;
    });
    
    
    $('#descrizione_area_azienda').on('submit',function(){
       $('#descrizione_area_azienda').append('&lt;input type="hidden" name="post_id" value="'+post_id+'"/&gt;')
      post = new FormData(this);
      $.ajax({
                    method: "POST",
                    url: "/wp-content/themes/bingo-child/unipro/registrazione-scheda-ajax.php",
                    data:post,
            cache:false,
            contentType: false,
            processData: false
    })
        .done(function( result ) {
            redirect = $('input[name="redirect"]').val();
         redirect_txt = '';
           if (redirect != '0'){
               redirect_txt = ', oppure torna alla &lt;a href="' + redirect + '" style="text-decoration:underline;"&gt;pagina che stavi visitando&lt;/a&gt;.';
           }
          html_success = '&lt;div class="alert alert-success"&gt;Registrazione effettuata con successo&lt;br /&gt;Riceverai una mail con i dati per accedere all\'area riservata&lt;br /&gt;&lt;br /&gt;&lt;a href="https://www.' + _dominio + '.com/area-riservata/?x=scheda"&gt;Vai nella tua area riservata&lt;/a&gt;' + redirect_txt + '&lt;/div&gt;';
          $('#descrizione_area_azienda').html(html_success);
        });
       return false;
    });
  
	//cami problema febbraio 2024
   jQuery('.btn-login').click(function(e){
		
		e.preventDefault();
		
		var username = jQuery('#username').val();
		var password = jQuery('#password').val();
		var remember = jQuery('#remember').is(':checked');
		
		post = jQuery(this).parent().parent().serialize();
		
		jQuery.ajax({
			method: "POST",
			url: "/wp-content/themes/bingo-child/unipro/login-ajax-new.php",
			data: post,
			dataType: "JSON",
			success: function(response){
				location.href = response;
			},
			error: function(error){
				console.log(error);
				location.href = '/profilo-shop/';
			}
        });
	});
   
   /* $('.btn-login').click(function(){
       post = $(this).parent().parent().serialize();
        $.ajax({
                    method: "POST",
                    url: "/wp-content/themes/bingo-child/unipro/login-ajax.php",
                    data: post
            })
        .done(function( result ) {
         result_j = result.split('##');
		 
		 console.log(result);
		 
         if (result_j[1] === undefined){
            //cami debug errore login
			location.href = '/profilo-shop/';
			
			//alert(result);
         }else{
           location.href = result_j[1];
         }
        });
       return false;
   }); */
   
   $('.forgot-password').click(function(){
      $('#login-form').css('display', 'none');
      $('#password-form').css('display', 'block');
      return false;
   });
   
   $('.form-login-link').click(function(){
      $('#login-form').css('display', 'block');
      $('#password-form').css('display', 'none');
      return false;
   });
   
   
   $('.btn-password').click(function(){
       post = $('#password-form').serialize() + '&amp;recupera_password=1';
        $.ajax({
                    method: "POST",
                    url: "/wp-content/themes/bingo-child/unipro/login-ajax.php",
                    data: post
            })
        .done(function( result ) {
         if(result != 1){
            alert(result);
         }else{
            $('#password-form').html('&lt;div class="alert alert-success"&gt;Abbiamo inviato la nuova password alla tua email!&lt;/div&gt;');
         }
        });
       return false;
   });
   
  
   $('.menu-item-1419 a[href="#"]').removeAttr('href');
  
  /*
   Scroll
  */
  
  $(window).scroll(function(){
        scrollTop = parseFloat($(window).scrollTop());
        width_window = $(window).width();
        if (width_window &gt; 700){
            if (scrollTop &gt; 30){
               $('.topbar-wrap').addClass('fixed')
            }else{
               $('.topbar-wrap').removeClass('fixed')
            }
        }
    });
   
   
   

   
   
   $('input[name="tipo_registrazione"]').click(function(){
     tipo_registrazione = $('input[name="tipo_registrazione"]:checked').val();
     if (tipo_registrazione == 1){
        $('#registrazione_professionista').css('display', 'block');
        $('#registrazione_azienda').css('display', 'none');
        $('#registrazione_studio_tecnico').css('display', 'none');
     }else if(tipo_registrazione == 2){
        $('#registrazione_studio_tecnico').css('display', 'block');
        $('#registrazione_professionista').css('display', 'none');
        $('#registrazione_azienda').css('display', 'none');
     }else{
        $('#registrazione_azienda').css('display', 'block');
        $('#registrazione_professionista').css('display', 'none');
        $('#registrazione_studio_tecnico').css('display', 'none');
     }
   });
   
   $('.btn-richiesta').click(function(){
       post = $('.form-info-scheda').serialize();
       $('.btn-register').attr('disabled', 'disabled');
        $.ajax({
                    method: "POST",
                    url: "/wp-content/themes/bingo-child/unipro/richiesta-ajax.php",
                    data: post + '&amp;page_form=' + page_form
            })
        .done(function( result ) {
            if (result != ''){
                         $('.btn-register').removeAttr('disabled');
                  $('.form-info-scheda .form_error').html(result);       
            }else{
                         $('.form-info-scheda .form_error').html(result);
                         $('#form_content').remove();
                        $('#invio_form_corretto').css('display', 'block');
                        dataLayer.push({
                            'event': 'gtm.invio_richiesta',
                            'titolo_scheda': $('.single-title h1').text()
                    });
            }
        
        });
       return false;
   });
   
   $('#link_web').click(function(){
        dataLayer.push({
               'event': 'gtm.click_sito_web',
               'titolo_scheda': $('.single-title h1').text()
       });
   });
   
   $('.navbar-social-wrap .icon-social').click(function(){
        dataLayer.push({
               'event': 'gtm.click_social_top',
               'tipo_social': $(this).attr('original-title')
       });
   });
   
   
    $('.footer-social-inner .icon-social').click(function(){
        dataLayer.push({
               'event': 'gtm.click_social_bottom',
               'tipo_social': $(this).attr('original-title')
       });
   });
    
    $('#ruby-subscribe .button-text').click(function(){
        dataLayer.push({
               'event': 'gtm.click_accedi_top'
       });
   });
    
    $('#ruby-registrati .button-text').click(function(){
        dataLayer.push({
               'event': 'gtm.click_registrati'
       });
   });
    
    
   
   
   
   
   $('.widget.widget_text').addClass('clearfix');
   
   $('.main_img_azienda img').each(function(){
      _height = $(this).height();
      maargin_top = (100 - parseFloat(_height)) / 2
      console.log(_height);
      $(this).css('margin-top', maargin_top);
   });
   
   $('#img_profilo img').each(function(){
      _height = $(this).height();
      maargin_top = (100 - parseFloat(_height)) / 2
      console.log(_height);
      $(this).css('margin-top', maargin_top);
   });
   
   
   /*
    Normative popup
   */
   $('#close_login_normativa').click(function(){
        $('#login_normativa_bg, #login_normativa').css('display', 'none');
        return false;
    });
    $('.scarica_allegato_accedi').click(function(){
            $('#login_normativa_bg, #login_normativa').css('display', 'block');
            return false;
    });
    
    /*
     Premium
    */
    $('#close_login_post').click(function(){
        $('#login_post_bg, #login_post, #login_premium').css('display', 'none');
        return false;
    });
    
    
    $('#close_login_premium').click(function(){
        $('#login_post_bg, #login_premium').css('display', 'none');
        return false;
    });
    $('.premium_accedi').click(function(){
            $('#login_post_bg, #login_post').css('display', 'block');
            return false;
    });
    
    
    $('.premium_accedi_mail').click(function(){
            if ($(this).hasClass('pdf')){
                $('#intro_premium').html('Per scaricare l\'allegato, lascia la tua email');
            }
            $('#login_post_bg, #login_premium').css('display', 'block');
            return false;
    });
    
    $('.form-premium').submit(function(){
        post = $(this).serialize();
        $.ajax({
                    method: "POST",
                    url: "/wp-content/themes/bingo-child/unipro/premium-ajax.php",
                    data: post
            })
        .done(function( result ) {
            if(result != ''){
                alert(result);
            }else{
                location.reload();
            }
        });
        return false;
    });
    
    
    
    $('#scarica_allegato_premium').click(function(){
            $('#login_post_bg, #login_premium').css('display', 'block');
            return false;
    });
    
    $('.form-premium-cad').submit(function(){
        post = $(this).serialize();
        $.ajax({
                    method: "POST",
                    url: "/wp-content/themes/bingo-child/unipro/premium-cad-ajax.php",
                    data: post
            })
        .done(function( result ) {
            if(result != ''){
                alert(result);
            }else{
                location.reload();
            }
        });
        return false;
    });
    
   
   
   $('.btn-newsletter').click(function(){
      post = $(this).parent().serialize();
       $('.btn-newsletter').attr('disabled', 'disabled');
        
        $.ajax({
                    method: "POST",
                    url: "/wp-content/themes/bingo-child/unipro/newsletter-ajax.php",
                    data: post
            })
        .done(function( result ) {
         $('.btn-newsletter').removeAttr('disabled');
            if (result != ''){
                  $('.btn-newsletter').parent().find('.error_newslleter').css('display', 'block').html(result);
            }else{
               dataLayer.push({
                'event': 'gtm.iscrizione_newsletter'
            });
               $('.content_newsletter').css('display', 'none'); 
                $('.btn-newsletter').parent().parent().parent().append('&lt;div class="alert alert-success"&gt;Iscrizione alla newsletter &lt;br /&gt;avvenuta con successo!&lt;/div&gt;');
                setTimeout(function(){
                  $('.widget_unipro_newsletter .alert.alert-success').css('display', 'none');
                  $('.content_newsletter').css('display', 'block');
                  $('#email_newsletter').val('');
                }, 5000);
            }
        
        });
       return false;
   });

   $('#filtro_azienda').change(function(){
      url = '?faz=' + $(this).val();
      if ($('#prodotti_acquistabili_check').prop('checked')){
       url = url + '&amp;facq=1';
      }
      
      location.href = url;
      return false;
   });
   
   if ($('#prodotti_acquistabili_check').prop('checked')){
       $('.prodotto').css('display', 'none');
       $('.prodotto-acquista').css('display', 'block');
      }else{
          $('.prodotto').css('display', 'block');
      }
   
   $('#prodotti_acquistabili_check').click(function(){
        url = '?faz=' + $('#filtro_azienda').val();
      if ($(this).prop('checked')){
         url = url + '&amp;facq=1';
      }else{
          url = url + '&amp;facq=0';
      }
      location.href = url;
      return false;
   });
   
var left_shop = 0;
var tot = $('.content-shop .box-prodotto-home').size();
var current_pos = 0;

var stop_shop_home = 0;

$('.box-prodotto-home a.img_product img').each(function(){
    height_img = parseFloat($(this).height());
    //console.log(height_img);   
    bottom_img = (246 - height_img) / 2;
    if (bottom_img &gt; 20) bottom_img = 20;
    $(this).css('bottom', bottom_img);
});

setInterval(function(){
    if (stop_shop_home == 1) return;
   current_pos++;
      left_shop = left_shop - 286;
      if (current_pos &gt; tot - 4){
         left_shop = 0;
         current_pos = 0;
      }
      $('.container-shop .content-shop').animate({'left': left_shop + 'px'});
}, 4000);
 
 $('#right_shop_home').click(function(){
    stop_shop_home = 1;
   current_pos++;
      left_shop = left_shop - 286;
      if (current_pos &gt; tot - 4){
         left_shop = 0;
         current_pos = 0;
      }
      $('.container-shop .content-shop').animate({'left': left_shop + 'px'});
      return false;
 });
 
 $('#left_shop_home').click(function(){
  stop_shop_home = 1;
   current_pos--;
      left_shop = left_shop + 286;
      if (current_pos &lt; 0){
         left_shop = 0;
         current_pos = 0;
      }
      $('.container-shop .content-shop').animate({'left': left_shop + 'px'});
      return false;
 });
 
 
 $('.page-id-514 #nome-portale, .page-id-8841 #nome-portale, .page-id-8844 #nome-portale').val(_dominio);

//Evidenziato rosso se non completo in scheda professionisti
$('.page-id-4173 .content form .row .form-control').each(function(){
		val = $(this).val();
		if (val == '' || val == '0'){
			$(this).addClass('valore_mancante');
		}
	});
	$(document).on('click','.valore_mancante',function(){
		$(this).removeClass('valore_mancante')	
	});
 
  
 jQuery('.btn_send_promo').click(function(){
  jQuery('.btn_send_promo').attr('disabled', 'disabled');
    form_promo = jQuery(this).parent();
    post = jQuery(form_promo).serialize() + '&amp;action=invia_form_promo';	
    jQuery.ajax({
        type:"POST",
        url: my_ajax_object.ajax_url,
        data: post
    }).done(function( response ) {
         jQuery('.btn_send_promo').removeAttr('disabled');
        if (response != ''){
	    jQuery(form_promo).find('.errors_promo').css('display', 'block').html(response);
	}else{
	    jQuery(form_promo).html('&lt;span style="display:block; text-align:center;"&gt;Grazie, ti invieremo una mail con i dettagli della promozione speciale per il Cyber Monday di Novembre appena sar&amp;agrave; disponibile sul nostro sito.&lt;/span&gt;');
            window.dataLayer.push({
		'event' : 'invio_promozione',
		'titolo_pagina': jQuery('h1').text()
	    });
        }
    });
    return false;
});
 jQuery('.btn_send_webinar').click(function(){
 // jQuery('.btn_send_webinar').attr('disabled', 'disabled');
    form_promo = jQuery(this).parent();
    post = jQuery(form_promo).serialize() + '&amp;action=invia_form_webinar';	
    jQuery.ajax({
        type:"POST",
        url: my_ajax_object.ajax_url,
        data: post
    }).done(function( response ) {
         jQuery('.btn_send_webinar').removeAttr('disabled');
        if (response != ''){
	    jQuery(form_promo).find('.errors_promo').css('display', 'block').html(response);
	}else{
	    jQuery(form_promo).html('&lt;span style="display:block; text-align:center;"&gt;Grazie, ti invieremo una mail con i dettagli per vedere il webinar.&lt;/span&gt;');
            window.dataLayer.push({
		'event' : 'invio_promozione',
		'titolo_pagina': jQuery('h1').text()
	    });
        }
    });
    return false;
});
 
 
    

jQuery('.btn_send_promo_fastweb').click(function(){
    form_promo = jQuery(this).parent();
    post = jQuery(form_promo).serialize() + '&amp;action=invia_form_promo_fastweb';
     jQuery('.btn_send_promo').attr('disabled', 'disabled');
    jQuery.ajax({
        type:"POST",
        url: my_ajax_object.ajax_url,
        data: post
    }).done(function( response ) {
        if (response != ''){
	     jQuery('.btn_send_promo').removeAttr('disabled', 'disabled'); 
	    jQuery(form_promo).find('.errors_promo').css('display', 'block').html(response);
	}else{
	    jQuery(form_promo).html('&lt;span style="display:block; text-align:center;"&gt;Grazie, riceverai i dettagli per accedere alla promozione sulla casella mail da te indicata.&lt;/span&gt;');
	     window.dataLayer.push({
		'event' : 'invio_fastweb',
		'titolo_pagina': jQuery('h1').text()
	    });
	}
    });
    return false;
});
 
 
  jQuery('.btn_send_promo_bim').click(function(){
  jQuery('.btn_send_promo_bim').attr('disabled', 'disabled');
    form_promo = jQuery(this).parent().parent();
    post = jQuery(form_promo).serialize() + '&amp;action=invia_form_promo_bim';	
    jQuery.ajax({
        type:"POST",
        url: my_ajax_object.ajax_url,
        data: post
    }).done(function( response ) {
         jQuery('.btn_send_promo_bim').removeAttr('disabled');
        if (response != ''){
	    jQuery(form_promo).find('.errors_promo').css('display', 'block').html(response);
	}else{
	    jQuery(form_promo).html('&lt;span style="display:block; text-align:center;"&gt;Grazie per l\'interesse dimostrato per le novit&amp;agrave; BIM.&lt;br /&gt;Sar&amp;agrave; nostra premura tenerti informato/a su tutte le novit&amp;agrave; in arrivo appena saranno rese disponibili&lt;/span&gt;');
            window.dataLayer.push({
		'event' : 'invio_promozione',
		'titolo_pagina': jQuery('h1').text()
	    });
        }
    });
    return false;
});
    
   
});



document.addEventListener( 'wpcf7mailsent', function( event ) {
   if (jQuery('h1').text()== 'Contattaci'){
        dataLayer.push({
             'event': 'gtm.invio_form_contatti'
         });
    }
    
      }, false );
 
</pre></body></html>