var X_IT = 'it'; var X_EN = 'en'; var X_FR = 'fr'; var X_ES = 'es'; var X_DE = 'de'; var isMultilingua = 0; var LANG_CURRENT = 'it'; var blnStandalone = ( window.navigator.standalone ); $(function() { var oPreload = $('#oPreload'); if ( oPreload.hasClass('d-none') ) oPreload.removeClass('d-none'); else oPreload.addClass('d-none'); $('a').focus(function() { if ( ! $(this).hasClass('notloading') && ! $(this).find('img').hasClass('social_check') ) $('#oPreload').removeClass('d-none'); }); fPreloadImmagine( 'https://www.con.today/tpl/default/assets/images/site-share.jpg' ); }); function fPreloadImmagine( pstrImg ) { var oImmagine = new Image(); oImmagine.src = pstrImg; } /* LOADING */ function fLoading( pintAction ) { if ( pintAction > 0 ) { $('#oLoadingTop').css('left', (($(document).width()/2)-22)+'px'); $('#oLoadingTop .lt-bg').css('margin-top', (getScrollTop() + (($(window).height()/2)-44))+'px'); $('#oLoading, #oLoadingTop').css('height', $(document).height()+'px').removeClass('d-none'); } else { $('#oLoading, #oLoadingTop').addClass('d-none'); } } function getScrollTop() { if(typeof pageYOffset!= 'undefined'){ //most browsers return pageYOffset; } else{ var B= document.body; //IE 'quirks' var D= document.documentElement; //IE with doctype D= (D.clientHeight)? D: B; return D.scrollTop; } } function Right(str, n) { if (n <= 0) return ""; else if (n > String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n); } } // formatta valuta function fCurrency( pstr ) { var oCurrency = ( String( pstr ) ).replace(/[a-zA-Z-_*]/g, ''); if ( oCurrency == "" ) oCurrency = "0,00"; oCurrency = oCurrency.replace(".", ""); oCurrency = oCurrency.replace(",", "."); oCurrency = parseFloat( oCurrency ).toFixed(2); if ( oCurrency == "NaN" ) oCurrency = "0.00"; var parteIntera = new String( Math.floor( oCurrency ) ); var parteDecimale = Right( oCurrency, 2 ); var strCurrency = parteIntera; var strResult = ""; var str = ""; for ( i = 0 ; i <= parteIntera.length; i = i + 3 ) { str = Right( strCurrency, 3 ); if ( i > 0 && str.length > 0 ) strResult = "." + strResult; strResult = str + strResult; strCurrency = strCurrency.replace( str, "" ); } strResult = strResult + "," + parteDecimale; return strResult; } Number.prototype.formatMoney = function(c, d, t){ var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); };