text: var TCOSite="https://tcocertified.com/",EpeatSite="https://epeat.net",working_days_company_init=215,working_days_company=215,nb_working_week=47,CO2GigaByteCloud=.33,CO2kmcar=.253,CO2kmtrain=.037,CO2kmtrainBus=.093,CO2kmairtravel=.138,CO2kwh=.5,CO2MoyEuropean=9e3,CO2MoyFrench=12e3,CO2streaming=.057,CO2TreeYear=20,CO2Fleece=11,CO2Visio=3.6;$(document).ready(function(){var a,e,r,t=0,n=0,i=0,l=0;!function(){for(var e,t={},a=device,r=[],n=0;e=a[n++];){var i=e.brand;i in t||(t[i]=1,r.push(i))}}();function o(r,e,n){$.each(e,function(e,t){var a="";t.key==n&&(a="selected"),r.append("<option value="+t.key+" "+a+">"+t.name+"</option>")})}function c(){t=Number($("#laptop_impact_annuel").html())+Number($("#screen_total_year").html())+Number($("#phone_total_year").html())+Number($("#storage_google_year").html())+Number($("#impact_email_year").html())+Number($("#impact_stream_year").html())+Number($("#impact_homework_year").html()),(n=Number($("#impact_car_year").html())+Number($("#impact_public_transport_year").html())+Number($("#impact_plane_year").html())+Number($("#impact_train_year").html()))<0&&(n=0),i=t+n,$("#total_impact_digital").html(t.toFixed(2)),$("#total_impact_trip").html(n.toFixed(2)),$("#total_impact").html(i.toFixed(2)),nb_tree=i.toFixed(2)/CO2TreeYear/50,nb_fleece=i.toFixed(2)/CO2Fleece,nb_bulb=1e3*i.toFixed(2)/19/24/365,l=i.toFixed(2)/CO2MoyFrench*100,$("#nb_tree").html(nb_tree.toFixed(2)),$("#nb_fleece").html(nb_fleece.toFixed(2)),$("#nb_bulb").html(nb_bulb.toFixed(2)),$("#percent_conso").html(l.toFixed(2))}function _(){var e=$.grep(device,function(e,t){return e.key===$("#sel_laptop").val()}),t=$("#sel_lastingLaptop").val(),a=Number(e[0].use*t*CO2kwh),r=Number(e[0].production),n=e[0].TCO,i=e[0].epeat;if($("#laptop_total").html((a+r).toFixed(2)),$("#laptop_production").html(r),$("#laptop_use").html(a.toFixed(2)),$("#laptop_impact_annuel").html(((a+r)/t).toFixed(2)),""!=e[0].link&&($("#device_link").attr("href",e[0].link),$("#device_link").css("display","inline")),$("#tco").hide(),$("#epeat").hide(),"YES"==n&&($("#tco").html("").show(),$("#tco").append("<a href='"+TCOSite+"' alt='TCO Website' target='_blank'><img src='./Images/tco_label.png' title='Label TCO' alt='Label TCO' class=''></a>")),""!=i)switch($("#epeat").html("").show(),i){case"Gold":$("#epeat").append("<a href='"+EpeatSite+"' alt='EPEAT Website' target='_blank'><img src='./Images/epeat_label_gold.png' title='Epeat Gold' alt='Epeat Gold' class=''></a>");break;case"Silver":$("#epeat").append("<a href='"+EpeatSite+"' alt='EPEAT Website' target='_blank'><img src='./Images/epeat_label_silver.png' title='Epeat Gold' alt='Epeat Silver' class=''></a>");break;case"Bronze":default:$("#epeat").append("<a href='"+EpeatSite+"' alt='EPEAT Website' target='_blank'><img src='./Images/epeat_label_bronze.png' title='Epeat Bronze' alt='Epeat Bronze' class=''></a>")}c()}function p(){100<Number($("#percent_bike").val())+Number($("#percent_public_transport").val())+Number($("#pourcent_car").val())?$(".percent").css("background-color","red"):Number($("#percent_bike").val())+Number($("#percent_public_transport").val())+Number($("#pourcent_car").val())<100?$(".percent").css("background-color","orange"):$(".percent").css("background-color","#ffffff")}function m(e){-1==jQuery.inArray(e,language)&&(e="fr"),$(".lng").css("font-weight",""),$("[data-trad]").each(function(){""!=translation[$(this).attr("data-trad")][e]?$(this).html(translation[$(this).attr("data-trad")][e]):$(this).html(translation[$(this).attr("data-trad")].en)}),$("html").attr("lang",e)}a=$("#sel_laptop"),e=device,r="",e.sort(function(e,t){return e.brand.localeCompare(t.brand)}),$.each(e,function(e,t){r!=t.brand?a.append("<optgroup label="+t.brand+">"):a.append("</optgroup>"),a.append("<option value="+t.key+">"+t.name+"</option>"),r=t.brand}),o($("#sel_emails"),impactEmails),o($("#pourcent_car"),percentage,100),o($("#percent_public_transport"),percentage),o($("#percent_bike"),percentage),$("#sel_laptop").change(function(){_()}),$("#sel_lastingLaptop").change(function(){_()}),$("#screen").change(function(){var e,t;"0"!=$("#screen").val()?(e=Number($("#screen").val()),t=ecran[0].total*e,$("#screen_total").html(t),$("#screen_total_year").html((t/ecran[0].lasting).toFixed(2))):($("#screen_total").html(""),$("#screen_total_year").html("")),c()}),$("#phone").change(function(){"yes"==$("#phone").val()?($("#phone_total").html(phone[0].total),$("#phone_total_year").html((phone[0].total/phone[0].lasting).toFixed(2))):($("#phone_total").html(""),$("#phone_total_year").html("")),c()}),$("#storage_google").change(function(){""!=$("#storage_google").val()?$("#storage_google_year").html($("#storage_google").val()*CO2GigaByteCloud):$("#storage_google_year").html("0"),c()}),$("#sel_emails").change(function(){var e=$.grep(impactEmails,function(e,t){return e.key===$("#sel_emails").val()});""!=$(sel_emails).val()?($("#impact_email_daily").html(e[0].total),$("#impact_email_year").html(e[0].total*working_days_company)):($("#impact_email_daily").html("0"),$("#impact_email_year").html("0")),c()}),$("#sel_stream").change(function(){""!=$("#sel_stream").val()?($("#impact_stream_daily").html(Number($("#sel_stream").val()*CO2streaming).toFixed(0)),$("#impact_stream_year").html(Number($("#sel_stream").val()*CO2streaming*working_days_company).toFixed(0))):($("#impact_stream_daily").html("0"),$("#impact_stream_year").html("0")),c()}),$("#trip_airplane").change(function(){var e;""!=$("#trip_airplane").val()?(e=Number($("#trip_airplane").val()*CO2kmairtravel).toFixed(2),$("#impact_plane_year").html(Number(e).toFixed(2))):$("#impact_plane_year").html("0"),c()}),$("#trip_train").change(function(){var e;""!=$("#trip_train").val()?(e=Number($("#trip_train").val()*CO2kmtrain).toFixed(2),$("#impact_train_year").html(Number(e).toFixed(2))):$("#impact_train_year").html("0"),c()}),$("#trip_car").change(function(){var e,t;""!=$("#trip_car").val()?(e=Number($("#trip_car").val()*CO2kmcar).toFixed(2),t=$("#pourcent_car").val(),$("#impact_car_daily").html(e),$("#impact_car_year").html(Number(e*working_days_company*(t/100)).toFixed(2))):($("#impact_car_daily").html("0"),$("#impact_car_year").html("0")),c()}),$("#pourcent_car").change(function(){100<$("#pourcent_car").val()&&$("#pourcent_car").val(100),$("#trip_car").change(),p()}),$("#day_homework_by_week").change(function(){var e=$("#day_homework_by_week").val();$("#impact_homework_daily").html(CO2Visio),$("#impact_homework_year").html(Number(CO2Visio*e*nb_working_week).toFixed(2)),function(){working_days_company=working_days_company_init;var e=$("#day_homework_by_week").val();(working_days_company-=e*nb_working_week)<0&&(working_days_company=0);$("#trip_car").change(),$("#trip_train").change(),$("#trip_public_transport").change()}(),c()}),$("#pourcent_car").click(function(){$("#pourcent_car").change()}),$("#trip_public_transport").change(function(){var e,t;""!=$("#trip_public_transport").val()?(e=Number($("#trip_public_transport").val()*CO2kmtrainBus).toFixed(2),t=$("#percent_public_transport").val(),$("#impact_public_transport_daily").html(e),$("#impact_public_transport_year").html(Number(e*working_days_company*(t/100)).toFixed(2))):($("#impact_public_transport_daily").html("0"),$("#impact_public_transport_year").html("0")),c()}),$("#percent_public_transport").change(function(){100<$("#percent_public_transport").val()&&$("#percent_public_transport").val(100),$("#trip_public_transport").change(),p()}),$("#percent_public_transport").click(function(){$("#percent_public_transport").change()}),$("#percent_bike").change(function(){100<Number($("#percent_bike").val())&&$("#percent_bike").val(100),$("#impact_bike_daily").html("0"),$("#impact_bike_year").html("0"),p()}),$(".lng").click(function(){m($(this).attr("id")),$(this).css("font-weight","bold")}),$("#sel_laptop").change(),$("#screen").change(),$("#phone").change(),$("#sel_emails").change(),$("#sel_stream").change(),$("#storage_google").change(),$("#trip_public_transport").change(),$("#trip_car").change(),$("#percent_bike").change(),$("#trip_airplane").change(),$("#trip_train").change();var s=document.location.href;m(s.substring(s.indexOf("#")+1).toLowerCase()),$("#score_env").html(localStorage.note),$("#note_env").html(localStorage.eco_index),$("#reduce_intro").click(function(){$("#intro").toggle()}),$("#detail_source").click(function(){return $(".co2_explaination").toggle(),!1})});