{"version":3,"sources":["script/social.js","script/bundle.js"],"names":["socialAPIs","Facebook","name","farm","order","accessButtonDefaultImageUrl","deferredInit","$","Deferred","init","d","s","id","js","fjs","def","inited","logged","window","fbAsyncInit","FB","appId","fbAppId","cookie","xfbml","version","getLoginStatus","response","console","log","status","resolve","error","document","getElementsByTagName","getElementById","createElement","src","parentNode","insertBefore","promise","login","dataLayer","push","event","reject","scope","getSocialData","api","SocialData","email","first_name","last_name","LinkedIn","getScript","IN","Event","on","User","isAuthorized","api_key","li_api_key","authorize","credentials_cookie","lang","fail","API","Profile","fields","result","me","userData","values","emailAddress","nome","firstName","cognome","lastName","socialINITs","socialConfig","networkname","this","Id","Email","Nome","Cognome","Farm","NetworkName","initSocialAPIs","WKIlogged","configuration","checkIdentitysUrl","registrationUrl","buttons","socialSpinnerImageUrl","sessionCheckFunction","SessionRemoteCheck","accessWithLabelHtml","disableUnbind","map","when","apply","done","socialLoggeds","toString","anySocialLodded","inArray","manualLogout","grep","sort","a","b","socialdata","getJSON","socialBackEndUrl","socialDataJson","encodeURIComponent","JSON","stringify","isAutomatic","wkiSessionCookieValue","getCookie","data","Command","x","Cookies","c","setCookie","Name","Value","Expire","location","pathname","postToUrl","socialLogin","containerSelector","errorsContainerSelector","socialName","errorElementSelector","loginOkUrl","social","hide","show","always","generateSocialAccessButtons","socialAPIsInitedSorted","length","html","sb","buttonsWrapperClass","append","i","fromHtml","buttonsHtml","buttonHtml","button","clickable","attr","bind","socialname","currentTarget","imageUrl","img","generateSocialBinderButtons","isAlx","socialfarms","socialFarmsJson","ui","getSocialBindLinkHtmlAlx","getSocialBindLinkHtml","toLowerCase","socialBind","element","insertAfter","parent","socialFarm","socialId","next","detach","replaceWith","url","json","input","val","form","submit","cname","ca","split","charAt","substring","indexOf","cvalue","expirationdate","expires","Date","parseInt","substr","toUTCString","removeDiacritics","str","diacriticsMap","A","AA","AE","AO","AU","AV","AY","B","C","D","DZ","Dz","E","F","G","H","I","J","K","L","LJ","Lj","M","N","NJ","Nj","O","OI","OO","OU","P","Q","R","S","T","TZ","U","V","VY","W","X","Y","Z","aa","ae","ao","au","av","ay","dz","e","f","g","h","hv","j","k","l","lj","m","n","nj","o","oi","ou","oo","p","q","r","ss","t","tz","u","v","vy","w","y","z","replace","closeProductSelectableBox","elem","fadeOut","showBox","fadeIn","setIeStyle","css","toCart","preventDefault","href","ready","IeLegacy","user_agent","ActiveXObject","navigator","userAgent","product_selectable_box_list","after","click","each","undefined","find","finalString","text","hrefVars","uniqueId","valuesSplitted","prepend","urlToCall","self","checked","siblings","parents","ajax","success","checkboxId","product_title","product_price","width","height","position","top","product_selectable_box_list_pos_left","proceed","trim","text_to_parse","has","remove_li_span","remove","alert"],"mappings":"AAAA,IAAAA,WAAA,GAEAA,WAAAC,SAAA,CACAC,KAAA,WACAC,KAAA,WACAC,MAAA,EACAC,4BAAA,2DACAC,aAAAC,EAAAC,WACAC,KAAA,WACA,IA6BAC,EAAAC,EAAAC,EACAC,EAAAC,EA9BAC,EAAAf,WAAAC,SAAAK,aACAN,WAAAC,SAAAe,QAAA,EACAhB,WAAAC,SAAAgB,QAAA,EAEAC,OAAAC,YAAA,WACA,IAEAC,GAAAX,KAAA,CACAY,MAAAC,QACAC,QAAA,EACAC,OAAA,EACAC,QAAA,SAGAL,GAAAM,eAAA,SAAAC,GACA3B,WAAAC,SAAAe,QAAA,EACAY,QAAAC,IAAA,wBACA7B,WAAAC,SAAAgB,OAAA,cAAAU,EAAAG,OACAf,EAAAgB,QAAA/B,WAAAC,SAAAgB,UAGA,MAAAe,GACAhC,WAAAC,SAAAe,QAAA,EACAD,EAAAgB,SAAA,GACAH,QAAAI,MAAAA,KAIA,IACAtB,EAMAuB,SANAtB,EAMA,SANAC,EAMA,iBALAE,EAAAJ,EAAAwB,qBAAAvB,GAAA,GACAD,EAAAyB,eAAAvB,MACAC,EAAAH,EAAA0B,cAAAzB,IAAAC,GAAAA,EACAC,EAAAwB,IAAA,sCACAvB,EAAAwB,WAAAC,aAAA1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A,wBAAA3J,KAAA,WAAA","file":"bundleLowPriority.js","sourcesContent":["var socialAPIs = {};\r\n\r\nsocialAPIs.Facebook = {\r\n name: \"Facebook\",\r\n farm: \"FACEBOOK\",\r\n order: 1,\r\n accessButtonDefaultImageUrl: 'www.altalex.it/Content/Altalex/images/social/fblogin.png',\r\n deferredInit: $.Deferred(),\r\n init: function () {\r\n var def = socialAPIs.Facebook.deferredInit;\r\n socialAPIs.Facebook.inited = false;\r\n socialAPIs.Facebook.logged = false;\r\n\r\n window.fbAsyncInit = function () {\r\n try {\r\n // call facebook init\r\n FB.init({\r\n appId: fbAppId,\r\n cookie: true, // enable cookies to allow the server to access the session\r\n xfbml: true, // parse social plugins on this page\r\n version: 'v2.1' // use version 2.1\r\n });\r\n\r\n FB.getLoginStatus(function (response) {\r\n socialAPIs.Facebook.inited = true;\r\n console.log(\"FACEBOOK API INITED!\"); //Facebook � inizializzato\r\n socialAPIs.Facebook.logged = response.status === 'connected';\r\n def.resolve(socialAPIs.Facebook.logged);\r\n });\r\n }\r\n catch (error) {\r\n socialAPIs.Facebook.inited = false;\r\n def.resolve(false); //In caso di errore, comunque risolvo\r\n console.error(error);\r\n }\r\n };\r\n\r\n try {\r\n (function (d, s, id) {\r\n var js, fjs = d.getElementsByTagName(s)[0];\r\n if (d.getElementById(id)) return;\r\n js = d.createElement(s); js.id = id;\r\n js.src = \"//connect.facebook.net/it_IT/all.js\";\r\n fjs.parentNode.insertBefore(js, fjs);\r\n }(document, 'script', 'facebook-jssdk'));\r\n }\r\n catch (error) {\r\n socialAPIs.Facebook.inited = false;\r\n def.resolve(false); //In caso di errore, comunque risolvo\r\n console.error(error);\r\n }\r\n\r\n return def.promise();\r\n },\r\n login: function () {\r\n var def = $.Deferred();\r\n try {\r\n FB.getLoginStatus(function (response) {\r\n socialAPIs.Facebook.logged = response.status === 'connected';\r\n \r\n if (socialAPIs.Facebook.logged) {\r\n window.dataLayer.push({ 'event': 'login-facebook-ok' });\r\n def.resolve(); \r\n }\r\n else\r\n FB.login(function (response) {\r\n if (response.status === 'connected') {\r\n def.resolve(response);\r\n } else {\r\n def.reject(response);\r\n }\r\n }, { scope: 'public_profile,email' });\r\n });\r\n }\r\n catch (error) {\r\n def.reject(error);\r\n window.dataLayer.push({ 'event': 'login-facebook-error' });\r\n console.error(error);\r\n }\r\n return def.promise();\r\n },\r\n getSocialData: function () {\r\n var def = $.Deferred();\r\n try {\r\n FB.api('/me', function (response) {\r\n def.resolve(new SocialData(response.id, response.email, response.first_name, response.last_name, socialAPIs.Facebook.farm, socialAPIs.Facebook.name));\r\n });\r\n }\r\n catch (error) {\r\n def.reject(error);\r\n console.error(error);\r\n }\r\n return def.promise();\r\n }\r\n};\r\n\r\nsocialAPIs.LinkedIn = {\r\n name: \"LinkedIn\",\r\n farm: \"LINKEDIN\",\r\n order: 2,\r\n accessButtonDefaultImageUrl: 'www.altalex.it/Content/Altalex/images/social/lilogin.png',\r\n deferredInit: $.Deferred(),\r\n init: function () {\r\n var def = socialAPIs.LinkedIn.deferredInit;\r\n socialAPIs.LinkedIn.inited = false;\r\n socialAPIs.LinkedIn.logged = false;\r\n\r\n $.getScript(\"//platform.LinkedIn.com/in.js?async=true\", function success() {\r\n try {\r\n IN.Event.on(IN, 'systemReady', function () {\r\n socialAPIs.LinkedIn.inited = true;\r\n console.log(\"LINKEDIN API INITED!\");\r\n socialAPIs.LinkedIn.logged = IN.User.isAuthorized();\r\n def.resolve(socialAPIs.LinkedIn.logged);\r\n });\r\n\r\n IN.init({\r\n api_key: li_api_key,\r\n //onLoad: \"lnAPILoaded\",\r\n authorize: true,\r\n credentials_cookie: true,\r\n lang: 'it_IT'\r\n });\r\n }\r\n catch (error) {\r\n socialAPIs.LinkedIn.inited = false;\r\n def.resolve(false); //In caso di errore, comunque risolvo\r\n console.error(error);\r\n }\r\n }).fail(function (error) {\r\n socialAPIs.LinkedIn.inited = false;\r\n def.resolve(false); //In caso di errore, comunque risolvo\r\n console.error(error);\r\n });\r\n return def.promise();\r\n },\r\n login: function () {\r\n var def = $.Deferred();\r\n try {\r\n if (IN.User.isAuthorized()) {\r\n window.dataLayer.push({ 'event': 'login-linkedin-ok' });\r\n def.resolve();\r\n }\r\n else {\r\n //var x = IN.UI.Authorize().place();\r\n //debugger;\r\n IN.User.authorize(function (response) {\r\n def.resolve();\r\n });\r\n }\r\n }\r\n catch (error) {\r\n def.reject(error);\r\n window.dataLayer.push({ 'event': 'login-linkedin-error' });\r\n console.error(error);\r\n }\r\n return def.promise();\r\n },\r\n getSocialData: function () {\r\n var def = $.Deferred();\r\n IN.API.Profile(\"me\")\r\n .fields(\"id,emailAddress,first-name,last-name,siteStandardProfileRequest\")\r\n .result(function (me) {\r\n var userData = me.values[0];\r\n var id = userData.id;\r\n var email = userData.emailAddress;\r\n var nome = userData.firstName;\r\n var cognome = userData.lastName;\r\n def.resolve(new SocialData(id, email, nome, cognome, socialAPIs.LinkedIn.farm, socialAPIs.LinkedIn.name));\r\n })\r\n .error(function (error) {\r\n def.reject(error);\r\n console.error(error);\r\n });\r\n return def.promise();\r\n }\r\n};\r\n\r\nvar SocialData = function (id, email, nome, cognome, farm, networkname) {\r\n this.Id = id;\r\n this.Email = email;\r\n this.Nome = nome;\r\n this.Cognome = cognome;\r\n this.Farm = farm;\r\n this.NetworkName = networkname;\r\n};\r\n\r\n//ALL SOCIALS INITED\r\n\r\n/*\r\nconfiguration deve contenere:\r\n- le url dele immagini dei pulsanti di accesso social, per ciascun social es. { Facebook: 'url1.jpg', Linkedin: 'url2.jpg' }\r\n- la url della pagina di registrazione (Command = fill_registration_form)\r\n- la url della pagina di inserimento credenziali (Command = require_login)\r\n*/\r\n\r\nvar socialINITs;\r\n\r\nvar socialConfig;\r\n\r\nvar initSocialAPIs = function (WKIlogged, configuration) {\r\n socialConfig = configuration;\r\n\r\n if (!socialConfig)\r\n socialConfig = {};\r\n\r\n if (!socialConfig.checkIdentitysUrl)\r\n socialConfig.checkIdentitysUrl = 'www.altalex.it/confermaIdentita';\r\n\r\n if (!socialConfig.registrationUrl)\r\n socialConfig.registrationUrl = 'www.altalex.it/area-personale/registrazione';\r\n\r\n if (!socialConfig.buttons)\r\n socialConfig.buttons = {};\r\n\r\n if (!socialConfig.socialSpinnerImageUrl)\r\n socialConfig.socialSpinnerImageUrl = '/Content/images/spinner.gif';\r\n\r\n if (!socialConfig.sessionCheckFunction)\r\n socialConfig.sessionCheckFunction = SessionRemoteCheck;\r\n\r\n if (!socialConfig.accessWithLabelHtml)\r\n socialConfig.accessWithLabelHtml = \"Accedi con:\";\r\n\r\n if (!socialConfig.disableUnbind)\r\n socialConfig.disableUnbind = false;\r\n\r\n socialINITs = $.map(socialAPIs, function (api) {\r\n return api.init();\r\n });\r\n $.when.apply($, socialINITs).done(function () {\r\n var socialLoggeds = $.map(socialAPIs, function (api) {\r\n return \" \" + api.name + \": \" + api.logged;\r\n });\r\n console.log(\"SOCIAL APIS INITED! WKIlogged: \" + WKIlogged + \",\" + socialLoggeds.toString());\r\n\r\n //Nel caso in cui non si � loggati in WKI ma si � loggati in almeno un social, tento il login automatico solo se non � stato appena fatto un logout manuale\r\n var anySocialLodded = $.inArray(true, $.map(socialAPIs, function (api) { return api.logged; })) > -1;\r\n\r\n if (!WKIlogged && anySocialLodded && manualLogout == false) {\r\n //TENTO IL LOGIN AUTOMATICO con la prima social API logged (utilizzo order per ordinare)\r\n var socialAPIsLoggedSorted = $.grep($.map(socialAPIs, function (api) { return api; }), function (api) { return api.logged; }).sort(function (a, b) { return a.order - b.order; });\r\n\r\n var social = socialAPIsLoggedSorted[0];\r\n\r\n social.getSocialData().done(function (socialdata) {\r\n //CHIAMATA JSONP\r\n $.getJSON(socialBackEndUrl + \"SocialWS.asmx/SocialLogin?jsoncallback=?\", { socialDataJson: encodeURIComponent(JSON.stringify(socialdata)), isAutomatic: true, wkiSessionCookieValue: getCookie('WKISESSION') })\r\n .done(function (data) {\r\n if (data.Command == \"logged\") {\r\n for (var x in data.Cookies) {\r\n var c = data.Cookies[x];\r\n setCookie(c.Name, c.Value, c.Expire);\r\n }\r\n socialConfig.sessionCheckFunction(); //L'utente � stato loggato: ricarico la pagina\r\n }\r\n else if (data.Command == \"require_login\") {\r\n if (socialConfig.checkIdentitysUrl == window.location.pathname || socialConfig.registrationUrl == window.location.pathname)\r\n return;\r\n postToUrl(socialConfig.checkIdentitysUrl, socialdata);\r\n }\r\n });\r\n });\r\n }\r\n });\r\n};\r\n\r\n//function richiamata dai pulsanti di accesso col social network\r\nvar socialLogin = function(containerSelector, errorsContainerSelector, socialName, errorElementSelector, registrationUrl, checkIdentitysUrl, sessionCheckFunction, loginOkUrl) {\r\n var social = socialAPIs[socialName];\r\n\r\n //$(containerSelector).html(\"
Caricamento delle funzionalità social...
\");\r\n\r\n //$.when.apply($, socialINITs).done(function() {\r\n\r\n $(containerSelector + \" .socialButtons\").hide();\r\n $(containerSelector + \" .socialSpinner\").show();\r\n\r\n $.when(social.deferredInit).done(function() { //Per sicurezza chiamo l'api dopo che l'sdk � gi� stato caricato\r\n social.login()\r\n .done(function() {\r\n $(containerSelector + \" .socialButtons\").hide();\r\n $(containerSelector + \" .socialSpinner\").show();\r\n \r\n social.getSocialData().done(function(socialdata) {\r\n //CHIAMATA JSONP\r\n $.getJSON(socialBackEndUrl + \"SocialWS.asmx/SocialLogin?jsoncallback=?\", { socialDataJson: encodeURIComponent(JSON.stringify(socialdata)), isAutomatic: false, wkiSessionCookieValue: getCookie('WKISESSION') })\r\n .done(function(data) {\r\n if (data.Command == \"logged\") {\r\n for (var x in data.Cookies) {\r\n var c = data.Cookies[x];\r\n setCookie(c.Name, c.Value, c.Expire);\r\n }\r\n\r\n sessionCheckFunction ? sessionCheckFunction() : socialConfig.sessionCheckFunction(); //L'utente � stato loggato: ricarico la pagina\r\n }\r\n else if (data.Command == \"fill_registration_form\") {\r\n postToUrl(registrationUrl || socialConfig.registrationUrl, socialdata);\r\n }\r\n else if (data.Command == \"require_login\") {\r\n socialdata.loginOkUrl = loginOkUrl;\r\n postToUrl(checkIdentitysUrl || socialConfig.checkIdentitysUrl, socialdata);\r\n }\r\n\r\n $(containerSelector + \" .socialSpinner\").hide();\r\n $(containerSelector + \" .socialButtons\").show();\r\n })\r\n .fail(function() {\r\n $(containerSelector + \" .socialSpinner\").hide();\r\n $(containerSelector + \" .socialButtons\").show();\r\n });\r\n })\r\n .fail(function() {\r\n $(containerSelector + \" .socialSpinner\").hide();\r\n $(containerSelector + \" .socialButtons\").show();\r\n });\r\n });\r\n }).always(function() {\r\n $(containerSelector + \" .socialSpinner\").hide();\r\n $(containerSelector + \" .socialButtons\").show();\r\n });\r\n};\r\n\r\n//function che genera i pulsanti di accesso social all'interno di un elemento\r\nvar generateSocialAccessButtons = function(containerSelector, errorsContainerSelector, accessWithLabelHtml, registrationUrl, checkIdentitysUrl, sessionCheckFunction, loginOkUrl) {\r\n\r\n //$(containerSelector).html(\"
Caricamento delle funzionalità social...
\");\r\n\r\n //$.when.apply($, socialINITs).done(function() {\r\n\r\n var socialAPIsInitedSorted = $.grep($.map(socialAPIs, function(api) { return api; }), function(api) { return true; /*api.inited;*/ }).sort(function(a, b) { return a.order - b.order; });\r\n\r\n if (socialAPIsInitedSorted.length > 0) {\r\n $(containerSelector).html('
' + (accessWithLabelHtml ? accessWithLabelHtml : socialConfig.accessWithLabelHtml) + '
');\r\n var sb = $(\"
)\");\r\n $(containerSelector).append(sb);\r\n\r\n //html += \"
\";\r\n for (var i = 0; i < socialAPIsInitedSorted.length; i++) {\r\n var social = socialAPIsInitedSorted[i];\r\n\r\n var fromHtml = false;\r\n if (socialConfig.buttonsHtml) {\r\n var buttonHtml = socialConfig.buttonsHtml[social.name];\r\n if (buttonHtml) {\r\n fromHtml = true;\r\n var button = $(buttonHtml);\r\n sb.append(button);\r\n var clickable = $(\".socialclick\", button);\r\n if (clickable.length == 0)\r\n clickable = button;\r\n clickable.attr(\"data-socialname\", social.name);\r\n clickable.bind(\"click\", function(event) {\r\n var socialname = $(event.currentTarget).attr(\"data-socialname\");\r\n socialLogin(containerSelector, errorsContainerSelector, socialname, errorsContainerSelector, registrationUrl, checkIdentitysUrl, sessionCheckFunction, loginOkUrl);\r\n });\r\n }\r\n }\r\n\r\n if (!fromHtml) {\r\n\r\n var imageUrl = socialConfig.buttons[social.name];\r\n if (!imageUrl)\r\n imageUrl = social.accessButtonDefaultImageUrl;\r\n\r\n var img = $('');\r\n sb.append(img);\r\n img.bind(\"click\", function(event) {\r\n var socialname = $(event.currentTarget).attr(\"data-socialname\");\r\n socialLogin(containerSelector, errorsContainerSelector, socialname, errorsContainerSelector, registrationUrl, checkIdentitysUrl, sessionCheckFunction, loginOkUrl);\r\n });\r\n }\r\n //html += '';\r\n }\r\n //html += \"
\";\r\n $(containerSelector).append(\"\");\r\n }\r\n //});\r\n};\r\n\r\nvar generateSocialBinderButtons = function (containerSelector, errorsContainerSelector, isAlx) {\r\n\r\n if (typeof isAlx == 'undefined') {\r\n isAlx = false;\r\n }\r\n\r\n $(containerSelector).html(\"
Caricamento delle funzionalità social...
\");\r\n\r\n //$.when.apply($, socialINITs).done(function () {\r\n\r\n var html = \"\";\r\n\r\n var socialAPIsInitedSorted = $.grep($.map(socialAPIs, function(api) { return api; }), function(api) { return true; /*api.inited;*/ }).sort(function(a, b) { return a.order - b.order; });\r\n\r\n if (socialAPIsInitedSorted.length > 0) {\r\n\r\n var socialfarms = $.map(socialAPIsInitedSorted, function(api) { return api.farm; });\r\n\r\n //CHIAMATA JSONP\r\n $.getJSON(socialBackEndUrl + \"SocialWS.asmx/GetSocialBinded?jsoncallback=?\", { socialFarmsJson: encodeURIComponent(JSON.stringify(socialfarms)), ui: getCookie(\"WKITICKET\") })\r\n .done(function(data) {\r\n for (var x in socialAPIsInitedSorted) {\r\n var api = socialAPIsInitedSorted[x];\r\n\r\n var bind = $.inArray(api.farm, data) > -1;\r\n if (isAlx) {\r\n html += getSocialBindLinkHtmlAlx(api, !bind);\r\n }\r\n else {\r\n html += getSocialBindLinkHtml(api, !bind);\r\n }\r\n \r\n }\r\n\r\n //html += \"\";\r\n $(containerSelector).html(html);\r\n });\r\n }\r\n //});\r\n};\r\n\r\nvar getSocialBindLinkHtml = function (api, bind) {\r\n if (!bind && socialConfig.disableUnbind)\r\n return \"\";\r\n\r\n return '
' + (bind ? 'Collega' : 'Scollega') + ' il tuo account ' + api.name + '
'\r\n};\r\n\r\nvar getSocialBindLinkHtmlAlx = function (api, bind) {\r\n if (!bind && socialConfig.disableUnbind)\r\n return \"\";\r\n\r\n return '
' + (bind ? 'Collega' : 'Scollega') + ' il tuo account ' + api.name + '
'\r\n};\r\n\r\nvar socialBind = function (element, socialName, bind) {\r\n var social = socialAPIs[socialName];\r\n $(\"\").insertAfter($(element).parent());\r\n $.when(social.deferredInit).done(function () { //Per sicurezza chiamo l'api dopo che l'sdk � gi� stato caricato\r\n social.login()\r\n .done(function () {\r\n $(\"\").insertAfter($(element).parent());\r\n $(element).parent().hide();//.append(\"\");\r\n\r\n social.getSocialData().done(function (socialdata) {\r\n //CHIAMATA JSONP\r\n $.getJSON(socialBackEndUrl + \"SocialWS.asmx/SocialBind?jsoncallback=?\", { socialFarm: social.farm, socialId: socialdata.Id, bind: bind, ui: getCookie(\"WKITICKET\") })\r\n .done(function (data) {\r\n if (data == \"BOUND\") {\r\n $(element).parent().next().detach();\r\n $(element).parent().replaceWith(getSocialBindLinkHtml(social, false));\r\n }\r\n else if (data == \"UNBOUND\") {\r\n $(element).parent().next().detach();\r\n $(element).parent().replaceWith(getSocialBindLinkHtml(social, true));\r\n }\r\n else {\r\n $(element).parent().next().detach();\r\n $(element).parent().show();\r\n }\r\n })\r\n .fail(function () {\r\n $(element).parent().next().detach();\r\n $(element).parent().show();\r\n });\r\n })\r\n .fail(function () {\r\n $(element).parent().next().detach();\r\n $(element).parent().show();\r\n });\r\n });\r\n }).always(function() {\r\n $(element).parent().next().detach();\r\n $(element).parent().show();\r\n });\r\n};\r\n\r\n//function che reindirizza ad una url inviando un JSON\r\nvar postToUrl = function (url, data) {\r\n var json = JSON.stringify(data);\r\n var input = $('');\r\n input.val(json);\r\n var form = $('
');\r\n form.append(input);\r\n $(\"body\").append(form);\r\n form.submit();\r\n};\r\n\r\nfunction getCookie(cname) {\r\n var name = cname + \"=\";\r\n var ca = document.cookie.split(';');\r\n for (var i = 0; i < ca.length; i++) {\r\n var c = ca[i];\r\n while (c.charAt(0) == ' ') c = c.substring(1);\r\n if (c.indexOf(name) == 0) return c.substring(name.length, c.length);\r\n }\r\n return \"\";\r\n}\r\n\r\nfunction setCookie(cname, cvalue, expirationdate) {\r\n var d = new Date(parseInt(expirationdate.substr(6)));\r\n //d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\r\n var expires = \"expires=\" + d.toUTCString();\r\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires;\r\n}","\r\n/*** STEFANO GIANNI SILVA ***/\r\n/*** Prodotti bundle selezionabili separatamente ***/\r\n\r\nfunction removeDiacritics(str) {\r\n var diacriticsMap = {\r\n A: /[\\u0041\\u24B6\\uFF21\\u00C0\\u00C1\\u00C2\\u1EA6\\u1EA4\\u1EAA\\u1EA8\\u00C3\\u0100\\u0102\\u1EB0\\u1EAE\\u1EB4\\u1EB2\\u0226\\u01E0\\u00C4\\u01DE\\u1EA2\\u00C5\\u01FA\\u01CD\\u0200\\u0202\\u1EA0\\u1EAC\\u1EB6\\u1E00\\u0104\\u023A\\u2C6F]/g,\r\n AA: /[\\uA732]/g,\r\n AE: /[\\u00C6\\u01FC\\u01E2]/g,\r\n AO: /[\\uA734]/g,\r\n AU: /[\\uA736]/g,\r\n AV: /[\\uA738\\uA73A]/g,\r\n AY: /[\\uA73C]/g,\r\n B: /[\\u0042\\u24B7\\uFF22\\u1E02\\u1E04\\u1E06\\u0243\\u0182\\u0181]/g,\r\n C: /[\\u0043\\u24B8\\uFF23\\u0106\\u0108\\u010A\\u010C\\u00C7\\u1E08\\u0187\\u023B\\uA73E]/g,\r\n D: /[\\u0044\\u24B9\\uFF24\\u1E0A\\u010E\\u1E0C\\u1E10\\u1E12\\u1E0E\\u0110\\u018B\\u018A\\u0189\\uA779]/g,\r\n DZ: /[\\u01F1\\u01C4]/g,\r\n Dz: /[\\u01F2\\u01C5]/g,\r\n E: /[\\u0045\\u24BA\\uFF25\\u00C8\\u00C9\\u00CA\\u1EC0\\u1EBE\\u1EC4\\u1EC2\\u1EBC\\u0112\\u1E14\\u1E16\\u0114\\u0116\\u00CB\\u1EBA\\u011A\\u0204\\u0206\\u1EB8\\u1EC6\\u0228\\u1E1C\\u0118\\u1E18\\u1E1A\\u0190\\u018E]/g,\r\n F: /[\\u0046\\u24BB\\uFF26\\u1E1E\\u0191\\uA77B]/g,\r\n G: /[\\u0047\\u24BC\\uFF27\\u01F4\\u011C\\u1E20\\u011E\\u0120\\u01E6\\u0122\\u01E4\\u0193\\uA7A0\\uA77D\\uA77E]/g,\r\n H: /[\\u0048\\u24BD\\uFF28\\u0124\\u1E22\\u1E26\\u021E\\u1E24\\u1E28\\u1E2A\\u0126\\u2C67\\u2C75\\uA78D]/g,\r\n I: /[\\u0049\\u24BE\\uFF29\\u00CC\\u00CD\\u00CE\\u0128\\u012A\\u012C\\u0130\\u00CF\\u1E2E\\u1EC8\\u01CF\\u0208\\u020A\\u1ECA\\u012E\\u1E2C\\u0197]/g,\r\n J: /[\\u004A\\u24BF\\uFF2A\\u0134\\u0248]/g,\r\n K: /[\\u004B\\u24C0\\uFF2B\\u1E30\\u01E8\\u1E32\\u0136\\u1E34\\u0198\\u2C69\\uA740\\uA742\\uA744\\uA7A2]/g,\r\n L: /[\\u004C\\u24C1\\uFF2C\\u013F\\u0139\\u013D\\u1E36\\u1E38\\u013B\\u1E3C\\u1E3A\\u0141\\u023D\\u2C62\\u2C60\\uA748\\uA746\\uA780]/g,\r\n LJ: /[\\u01C7]/g,\r\n Lj: /[\\u01C8]/g,\r\n M: /[\\u004D\\u24C2\\uFF2D\\u1E3E\\u1E40\\u1E42\\u2C6E\\u019C]/g,\r\n N: /[\\u004E\\u24C3\\uFF2E\\u01F8\\u0143\\u00D1\\u1E44\\u0147\\u1E46\\u0145\\u1E4A\\u1E48\\u0220\\u019D\\uA790\\uA7A4]/g,\r\n NJ: /[\\u01CA]/g,\r\n Nj: /[\\u01CB]/g,\r\n O: /[\\u004F\\u24C4\\uFF2F\\u00D2\\u00D3\\u00D4\\u1ED2\\u1ED0\\u1ED6\\u1ED4\\u00D5\\u1E4C\\u022C\\u1E4E\\u014C\\u1E50\\u1E52\\u014E\\u022E\\u0230\\u00D6\\u022A\\u1ECE\\u0150\\u01D1\\u020C\\u020E\\u01A0\\u1EDC\\u1EDA\\u1EE0\\u1EDE\\u1EE2\\u1ECC\\u1ED8\\u01EA\\u01EC\\u00D8\\u01FE\\u0186\\u019F\\uA74A\\uA74C]/g,\r\n OI: /[\\u01A2]/g,\r\n OO: /[\\uA74E]/g,\r\n OU: /[\\u0222]/g,\r\n P: /[\\u0050\\u24C5\\uFF30\\u1E54\\u1E56\\u01A4\\u2C63\\uA750\\uA752\\uA754]/g,\r\n Q: /[\\u0051\\u24C6\\uFF31\\uA756\\uA758\\u024A]/g,\r\n R: /[\\u0052\\u24C7\\uFF32\\u0154\\u1E58\\u0158\\u0210\\u0212\\u1E5A\\u1E5C\\u0156\\u1E5E\\u024C\\u2C64\\uA75A\\uA7A6\\uA782]/g,\r\n S: /[\\u0053\\u24C8\\uFF33\\u1E9E\\u015A\\u1E64\\u015C\\u1E60\\u0160\\u1E66\\u1E62\\u1E68\\u0218\\u015E\\u2C7E\\uA7A8\\uA784]/g,\r\n T: /[\\u0054\\u24C9\\uFF34\\u1E6A\\u0164\\u1E6C\\u021A\\u0162\\u1E70\\u1E6E\\u0166\\u01AC\\u01AE\\u023E\\uA786]/g,\r\n TZ: /[\\uA728]/g,\r\n U: /[\\u0055\\u24CA\\uFF35\\u00D9\\u00DA\\u00DB\\u0168\\u1E78\\u016A\\u1E7A\\u016C\\u00DC\\u01DB\\u01D7\\u01D5\\u01D9\\u1EE6\\u016E\\u0170\\u01D3\\u0214\\u0216\\u01AF\\u1EEA\\u1EE8\\u1EEE\\u1EEC\\u1EF0\\u1EE4\\u1E72\\u0172\\u1E76\\u1E74\\u0244]/g,\r\n V: /[\\u0056\\u24CB\\uFF36\\u1E7C\\u1E7E\\u01B2\\uA75E\\u0245]/g,\r\n VY: /[\\uA760]/g,\r\n W: /[\\u0057\\u24CC\\uFF37\\u1E80\\u1E82\\u0174\\u1E86\\u1E84\\u1E88\\u2C72]/g,\r\n X: /[\\u0058\\u24CD\\uFF38\\u1E8A\\u1E8C]/g,\r\n Y: /[\\u0059\\u24CE\\uFF39\\u1EF2\\u00DD\\u0176\\u1EF8\\u0232\\u1E8E\\u0178\\u1EF6\\u1EF4\\u01B3\\u024E\\u1EFE]/g,\r\n Z: /[\\u005A\\u24CF\\uFF3A\\u0179\\u1E90\\u017B\\u017D\\u1E92\\u1E94\\u01B5\\u0224\\u2C7F\\u2C6B\\uA762]/g,\r\n a: /[\\u0061\\u24D0\\uFF41\\u1E9A\\u00E0\\u00E1\\u00E2\\u1EA7\\u1EA5\\u1EAB\\u1EA9\\u00E3\\u0101\\u0103\\u1EB1\\u1EAF\\u1EB5\\u1EB3\\u0227\\u01E1\\u00E4\\u01DF\\u1EA3\\u00E5\\u01FB\\u01CE\\u0201\\u0203\\u1EA1\\u1EAD\\u1EB7\\u1E01\\u0105\\u2C65\\u0250]/g,\r\n aa: /[\\uA733]/g,\r\n ae: /[\\u00E6\\u01FD\\u01E3]/g,\r\n ao: /[\\uA735]/g,\r\n au: /[\\uA737]/g,\r\n av: /[\\uA739\\uA73B]/g,\r\n ay: /[\\uA73D]/g,\r\n b: /[\\u0062\\u24D1\\uFF42\\u1E03\\u1E05\\u1E07\\u0180\\u0183\\u0253]/g,\r\n c: /[\\u0063\\u24D2\\uFF43\\u0107\\u0109\\u010B\\u010D\\u00E7\\u1E09\\u0188\\u023C\\uA73F\\u2184]/g,\r\n d: /[\\u0064\\u24D3\\uFF44\\u1E0B\\u010F\\u1E0D\\u1E11\\u1E13\\u1E0F\\u0111\\u018C\\u0256\\u0257\\uA77A]/g,\r\n dz: /[\\u01F3\\u01C6]/g,\r\n e: /[\\u0065\\u24D4\\uFF45\\u00E8\\u00E9\\u00EA\\u1EC1\\u1EBF\\u1EC5\\u1EC3\\u1EBD\\u0113\\u1E15\\u1E17\\u0115\\u0117\\u00EB\\u1EBB\\u011B\\u0205\\u0207\\u1EB9\\u1EC7\\u0229\\u1E1D\\u0119\\u1E19\\u1E1B\\u0247\\u025B\\u01DD]/g,\r\n f: /[\\u0066\\u24D5\\uFF46\\u1E1F\\u0192\\uA77C]/g,\r\n g: /[\\u0067\\u24D6\\uFF47\\u01F5\\u011D\\u1E21\\u011F\\u0121\\u01E7\\u0123\\u01E5\\u0260\\uA7A1\\u1D79\\uA77F]/g,\r\n h: /[\\u0068\\u24D7\\uFF48\\u0125\\u1E23\\u1E27\\u021F\\u1E25\\u1E29\\u1E2B\\u1E96\\u0127\\u2C68\\u2C76\\u0265]/g,\r\n hv: /[\\u0195]/g,\r\n i: /[\\u0069\\u24D8\\uFF49\\u00EC\\u00ED\\u00EE\\u0129\\u012B\\u012D\\u00EF\\u1E2F\\u1EC9\\u01D0\\u0209\\u020B\\u1ECB\\u012F\\u1E2D\\u0268\\u0131]/g,\r\n j: /[\\u006A\\u24D9\\uFF4A\\u0135\\u01F0\\u0249]/g,\r\n k: /[\\u006B\\u24DA\\uFF4B\\u1E31\\u01E9\\u1E33\\u0137\\u1E35\\u0199\\u2C6A\\uA741\\uA743\\uA745\\uA7A3]/g,\r\n l: /[\\u006C\\u24DB\\uFF4C\\u0140\\u013A\\u013E\\u1E37\\u1E39\\u013C\\u1E3D\\u1E3B\\u017F\\u0142\\u019A\\u026B\\u2C61\\uA749\\uA781\\uA747]/g,\r\n lj: /[\\u01C9]/g,\r\n m: /[\\u006D\\u24DC\\uFF4D\\u1E3F\\u1E41\\u1E43\\u0271\\u026F]/g,\r\n n: /[\\u006E\\u24DD\\uFF4E\\u01F9\\u0144\\u00F1\\u1E45\\u0148\\u1E47\\u0146\\u1E4B\\u1E49\\u019E\\u0272\\u0149\\uA791\\uA7A5]/g,\r\n nj: /[\\u01CC]/g,\r\n o: /[\\u006F\\u24DE\\uFF4F\\u00F2\\u00F3\\u00F4\\u1ED3\\u1ED1\\u1ED7\\u1ED5\\u00F5\\u1E4D\\u022D\\u1E4F\\u014D\\u1E51\\u1E53\\u014F\\u022F\\u0231\\u00F6\\u022B\\u1ECF\\u0151\\u01D2\\u020D\\u020F\\u01A1\\u1EDD\\u1EDB\\u1EE1\\u1EDF\\u1EE3\\u1ECD\\u1ED9\\u01EB\\u01ED\\u00F8\\u01FF\\u0254\\uA74B\\uA74D\\u0275]/g,\r\n oi: /[\\u01A3]/g,\r\n ou: /[\\u0223]/g,\r\n oo: /[\\uA74F]/g,\r\n p: /[\\u0070\\u24DF\\uFF50\\u1E55\\u1E57\\u01A5\\u1D7D\\uA751\\uA753\\uA755]/g,\r\n q: /[\\u0071\\u24E0\\uFF51\\u024B\\uA757\\uA759]/g,\r\n r: /[\\u0072\\u24E1\\uFF52\\u0155\\u1E59\\u0159\\u0211\\u0213\\u1E5B\\u1E5D\\u0157\\u1E5F\\u024D\\u027D\\uA75B\\uA7A7\\uA783]/g,\r\n s: /[\\u0073\\u24E2\\uFF53\\u015B\\u1E65\\u015D\\u1E61\\u0161\\u1E67\\u1E63\\u1E69\\u0219\\u015F\\u023F\\uA7A9\\uA785\\u1E9B]/g,\r\n ss: /[\\u00DF]/g,\r\n t: /[\\u0074\\u24E3\\uFF54\\u1E6B\\u1E97\\u0165\\u1E6D\\u021B\\u0163\\u1E71\\u1E6F\\u0167\\u01AD\\u0288\\u2C66\\uA787]/g,\r\n tz: /[\\uA729]/g,\r\n u: /[\\u0075\\u24E4\\uFF55\\u00F9\\u00FA\\u00FB\\u0169\\u1E79\\u016B\\u1E7B\\u016D\\u00FC\\u01DC\\u01D8\\u01D6\\u01DA\\u1EE7\\u016F\\u0171\\u01D4\\u0215\\u0217\\u01B0\\u1EEB\\u1EE9\\u1EEF\\u1EED\\u1EF1\\u1EE5\\u1E73\\u0173\\u1E77\\u1E75\\u0289]/g,\r\n v: /[\\u0076\\u24E5\\uFF56\\u1E7D\\u1E7F\\u028B\\uA75F\\u028C]/g,\r\n vy: /[\\uA761]/g,\r\n w: /[\\u0077\\u24E6\\uFF57\\u1E81\\u1E83\\u0175\\u1E87\\u1E85\\u1E98\\u1E89\\u2C73]/g,\r\n x: /[\\u0078\\u24E7\\uFF58\\u1E8B\\u1E8D]/g,\r\n y: /[\\u0079\\u24E8\\uFF59\\u1EF3\\u00FD\\u0177\\u1EF9\\u0233\\u1E8F\\u00FF\\u1EF7\\u1E99\\u1EF5\\u01B4\\u024F\\u1EFF]/g,\r\n z: /[\\u007A\\u24E9\\uFF5A\\u017A\\u1E91\\u017C\\u017E\\u1E93\\u1E95\\u01B6\\u0225\\u0240\\u2C6C\\uA763]/g\r\n };\r\n for (var x in diacriticsMap) {\r\n // Iterate through each keys in the above object and perform a replace\r\n str = str.replace(diacriticsMap[x], x);\r\n }\r\n return str;\r\n}\r\n\r\n/*function testCheckbox() {\r\n $('.bundle_absolute input[type=checkbox]').each(function () { console.log($(this).is(':checked'), $(this).attr('id')) });\r\n}*/\r\n\r\nfunction closeProductSelectableBox(elem) {\r\n $(elem).parent().parent().parent().fadeOut(function () {\r\n $('#overlayMask').hide();\r\n });\r\n}\r\n\r\n/*function setBox(product_title, product_price, checked, showBox) {\r\n $('#product_selectable_box_list h4#removed_product_title').text('');\r\n $('#product_selectable_box_list #separator').hide();\r\n $('#product_selectable_box_list ul#removed_product_list').html('');\r\n var proceed = true;\r\n product_title = product_title.trim();\r\n //if (checked) {\r\n if (!checked || checked === undefined) {\r\n $('#product_selectable_box_list h4#added_product_title').text('Prodotti aggiunti al carrello');\r\n if ($('#product_selectable_box_list ul#added_product_list li').length > 0) {\r\n $('#product_selectable_box_list ul#added_product_list li').each(function () {\r\n var text_to_parse = $(this).has('span.title_cut') ? $(this).find('span.title_cut').attr('alt') : $(this).text().trim();\r\n proceed = text_to_parse === product_title ? false : proceed;\r\n });\r\n }\r\n if (proceed) {\r\n if (product_title.length > 48) {\r\n var original_product_title = product_title;\r\n product_title = product_title.substr(0, 48) + '...';\r\n product_title = '' + product_title + '';\r\n }\r\n $('#product_selectable_box_list ul#added_product_list').append('
  • ' + product_title + '   
    ' + product_price + '
  • ');\r\n $('#product_selectable_box_list button#btn_acquista').show();\r\n }\r\n }\r\n //if (!checked || checked === undefined) {\r\n if (checked) {\r\n\r\n var remove_li_span = false;\r\n $('#product_selectable_box_list ul#added_product_list li').each(function () {\r\n if ($(this).find('span.title_cut').attr('alt') === product_title) {\r\n $(this).remove();\r\n remove_li_span = true;\r\n }\r\n });\r\n if (!remove_li_span) {\r\n $('#product_selectable_box_list ul#added_product_list li:contains(\"' + product_title + '\")').remove();\r\n }\r\n if ($('#product_selectable_box_list ul#added_product_list li').length === 0) {\r\n $('#product_selectable_box_list h4#added_product_title').text('');\r\n $('#product_selectable_box_list button#btn_acquista').hide();\r\n } else {\r\n $('#product_selectable_box_list #separator').show();\r\n }\r\n $('#product_selectable_box_list h4#removed_product_title').text('Prodotti rimossi dal carrello');\r\n $('#product_selectable_box_list ul#removed_product_list').append('
  • ' + product_title + '
  • ');\r\n }\r\n\r\n showBox();\r\n}*/\r\nfunction showBox() {\r\n $('#product_selectable_box_list').fadeIn();\r\n}\r\n\r\nfunction setIeStyle() {\r\n $('#product_selectable_box_list ul#added_product_list').css('list-style-position', 'outside').css('margin-left', '24px');\r\n}\r\n//var test = false;\r\n$(document).ready(function () {\r\n if ($('#bundle_product_selectable').length > 0 || $('#cluster_product_selectable').length > 0 || $('#collana_product_selectable').length > 0) {\r\n //if(test){ \r\n var IeLegacy = false;\r\n var user_agent = '';\r\n if (window.ActiveXObject && \"ActiveXObject\" in window) {\r\n IeLegacy = true;\r\n if ($('#bundle_product_selectable').length > 0) {\r\n $('#bundle_product_selectable').attr('data-useragent', navigator.userAgent);\r\n user_agent = $('#bundle_product_selectable').attr('data-useragent');\r\n }\r\n if ($('#cluster_product_selectable').length > 0) {\r\n $('#cluster_product_selectable').attr('data-useragent', navigator.userAgent);\r\n user_agent = $('#cluster_product_selectable').attr('data-useragent');\r\n }\r\n if ($('#collana_product_selectable').length > 0) {\r\n $('#collana_product_selectable').attr('data-useragent', navigator.userAgent);\r\n user_agent = $('#collana_product_selectable').attr('data-useragent');\r\n }\r\n }\r\n\r\n var product_selectable_box_list = '
    ';\r\n product_selectable_box_list += '
    ';\r\n product_selectable_box_list += '
    ';\r\n product_selectable_box_list += '';\r\n product_selectable_box_list += '
    ';\r\n product_selectable_box_list += '

    ';\r\n product_selectable_box_list += '';\r\n product_selectable_box_list += '';\r\n product_selectable_box_list += '
    ';\r\n product_selectable_box_list += '

    ';\r\n product_selectable_box_list += '';\r\n product_selectable_box_list += '
    ';\r\n\r\n if ($('#bundle_product_selectable').length > 0) {\r\n $('#bundle_product_selectable').next('.titolo').append('SELEZIONA PRODOTTI SINGOLARMENTE');\r\n }\r\n if ($('#cluster_product_selectable').length > 0 || $('#collana_product_selectable').length > 0) {\r\n $('div.main_titolo').after('SELEZIONA PRODOTTI SINGOLARMENTE');\r\n }\r\n\r\n $('a#bundle_product_selectable_show').click(function () {\r\n $('.bundle_absolute').fadeIn();\r\n });\r\n\r\n $('div.boundle div.prodotti div.prodotto').each(function () {\r\n if ($(this).find('.dettagli .addcart a').attr(\"href\") === undefined) {\r\n return;\r\n }\r\n var product_title = $(this).find('div.titolo a').text();\r\n var punctuationless = product_title.replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g, \"\");\r\n var finalString = punctuationless.replace(/\\s{2,}/g, \"_\");\r\n finalString = finalString.replace(/\\s/g, \"_\");\r\n finalString = removeDiacritics(finalString);\r\n finalString = finalString.toLowerCase();\r\n\r\n /* PER RICAVARE ID DAL JSON NEL VALUE - può servire in futuro\r\n var jsonValueString = $(this).find('.jsonProdotto.jsonOption input').attr(\"value\");\r\n var jsonValue = $.parseJSON(jsonValueString);\r\n var productId = jsonValue.id;*/\r\n\r\n var addCartHref = $(this).find('.dettagli .addcart a').attr(\"href\");\r\n var addCartHrefSplitted = addCartHref.split('?');\r\n var hrefVars = addCartHrefSplitted[1].split('&');\r\n var uniqueId = '';\r\n for (i = 0; i < hrefVars.length; i++) {\r\n var values = hrefVars[i];\r\n var valuesSplitted = values.split('=');\r\n var valueToAdd = i + 1 === hrefVars.length ? valuesSplitted[1] : valuesSplitted[1]+'_' ;\r\n uniqueId += valueToAdd;\r\n }\r\n\r\n $(this).prepend('
    ');\r\n });\r\n\r\n if ($('#cluster_product_selectable').length > 0 || $('#collana_product_selectable').length > 0) {\r\n $('.bundle_absolute').fadeIn();\r\n }\r\n\r\n $('.bundle_absolute label').click(function () {\r\n\r\n var self = $(this);\r\n var checked = self.siblings('input[type=checkbox]').attr('checked');\r\n\r\n var urlToCall;\r\n if (!checked || checked === undefined) { // add to cart\r\n urlToCall = self.parents('.prodotto').find('.dettagli .addcart a').attr(\"href\");\r\n } else { // remove from cart\r\n urlToCall = self.parents('.prodotto').find('.dettagli .addcart a').attr(\"href\") + \"&action=delete\";\r\n }\r\n\r\n $.ajax({\r\n url: urlToCall,\r\n IeLegacy: IeLegacy,\r\n user_agent: user_agent,\r\n product_selectable_box_list: product_selectable_box_list,\r\n self: self,\r\n success: function (response) { // success\r\n // tuo codice\r\n $('.mp_header_carrello').html($(response).find(\".mp_header_carrello\"));\r\n\r\n if (IeLegacy) {\r\n if (user_agent.indexOf('MSIE 8.0') !== -1) {\r\n var checkboxId = self.siblings('input[type=\"checkbox\"]').attr('id');\r\n if ($('#' + checkboxId).attr('checked') === undefined || $('#' + checkboxId).attr('checked') === false) {\r\n $('#' + checkboxId).attr('checked', true);\r\n self.css('background', 'url(\"../Images_net/checkbox_checked.png\") no-repeat');\r\n } else {\r\n $('#' + checkboxId).attr('checked', false);\r\n self.css('background', 'url(\"../Images_net/checkbox.png\") no-repeat');\r\n }\r\n }\r\n }\r\n\r\n var product_title = self.parent().parent().parent().find('div.info div.titolo').text();\r\n var product_price = self.parent().parent().parent().find('div.info #pricebox span.prezzofinale').text();\r\n if ($('#product_selectable_box_list').length === 0) {\r\n self.parent().parent().parent().prepend(product_selectable_box_list);\r\n if (IeLegacy) {\r\n setIeStyle();\r\n }\r\n }\r\n var w = $('.boundle').width();\r\n var h = $('.boundle').height() + $('.mp_contenuto_estesacompleta').height();\r\n var position = $('#overlayMask').parent().position();\r\n\r\n if ($('#cluster_product_selectable').length > 0 || $('#collana_product_selectable').length > 0) {\r\n position = $('#overlayMask').siblings('div.titolobox').position();\r\n }\r\n\r\n $('#overlayMask').css('top', position.top).width(w).height(h).show();\r\n var product_selectable_box_list_pos_left = ($(window).width() / 2) - ($('#product_selectable_box_list').width() / 2);\r\n $('#product_selectable_box_list').css('left', product_selectable_box_list_pos_left + 'px');\r\n //var checked = $(this).siblings('input[type=checkbox]').attr('checked');\r\n\r\n /*if (IeLegacy) { => da scommentare se si chiama setBox in callback\r\n if (user_agent.indexOf('MSIE 8.0') !== -1) {\r\n checked = checked ? false : true;\r\n }\r\n }*/\r\n\r\n //setBox(product_title, product_price, checked, showBox);\r\n\r\n $('#product_selectable_box_list h4#removed_product_title').text('');\r\n $('#product_selectable_box_list #separator').hide();\r\n $('#product_selectable_box_list ul#removed_product_list').html('');\r\n var proceed = true;\r\n product_title = product_title.trim();\r\n /*if (checked) {*/\r\n if (!checked || checked === undefined) {\r\n $('#product_selectable_box_list h4#added_product_title').text('Prodotti aggiunti al carrello');\r\n if ($('#product_selectable_box_list ul#added_product_list li').length > 0) {\r\n $('#product_selectable_box_list ul#added_product_list li').each(function () {\r\n var text_to_parse = $(this).has('span.title_cut') ? $(this).find('span.title_cut').attr('alt') : $(this).text().trim();\r\n proceed = text_to_parse === product_title ? false : proceed;\r\n });\r\n }\r\n if (proceed) {\r\n if (product_title.length > 48) {\r\n var original_product_title = product_title;\r\n product_title = product_title.substr(0, 48) + '...';\r\n product_title = '' + product_title + '';\r\n }\r\n $('#product_selectable_box_list ul#added_product_list').append('
  • ' + product_title + '   
    ' + product_price + '
  • ');\r\n $('#product_selectable_box_list button#btn_acquista').show();\r\n }\r\n }\r\n /*if (!checked || checked === undefined) {*/\r\n if (checked) {\r\n\r\n var remove_li_span = false;\r\n $('#product_selectable_box_list ul#added_product_list li').each(function () {\r\n if ($(this).find('span.title_cut').attr('alt') === product_title) {\r\n $(this).remove();\r\n remove_li_span = true;\r\n }\r\n });\r\n if (!remove_li_span) {\r\n $('#product_selectable_box_list ul#added_product_list li:contains(\"' + product_title + '\")').remove();\r\n }\r\n if ($('#product_selectable_box_list ul#added_product_list li').length === 0) {\r\n $('#product_selectable_box_list h4#added_product_title').text('');\r\n $('#product_selectable_box_list button#btn_acquista').hide();\r\n } else {\r\n $('#product_selectable_box_list #separator').show();\r\n }\r\n $('#product_selectable_box_list h4#removed_product_title').text('Prodotti rimossi dal carrello');\r\n $('#product_selectable_box_list ul#removed_product_list').append('
  • ' + product_title + '
  • ');\r\n }\r\n\r\n showBox();\r\n\r\n },\r\n error: function () { // error\r\n alert(\"Si è verificato un errore\");\r\n self.siblings('input[type=checkbox]').attr('checked', false);\r\n }\r\n });\r\n\r\n });\r\n }\r\n});\r\n\r\nfunction toCart(event) {\r\n /* shop.wki.it/carrello.aspx */\r\n event.preventDefault();\r\n document.location.href = 'http://shop.wki.it/carrello.aspx';\r\n}\r\n\r\n/*** /STEFANO GIANNI SILVA ***/"]}