");} switch(sale_clock.sale_clock_type){ case '1': if(ends_on.days > 0){ ends_message += ends_on.days+(ends_on.days == 1?'day, ':'days, '); } if(ends_on.hours > 0){ ends_message += ends_on.hours+(ends_on.hours == 1?'hour, ':'hours, '); } if(ends_on.minutes > 0){ var minutes = ends_on.minutes; if(minutes < 10){minutes = '0'+minutes;} ends_message += minutes+(ends_on.minutes == 1?'minute, ':'minutes, '); } if(ends_on.seconds >= 0){ var seconds = ends_on.seconds; if(seconds < 10){seconds = '0'+seconds;} ends_message += ''+seconds+''+(ends_on.seconds <= 1?'second':'seconds'); } break; case '2': if(ends_on.days > 0){ ends_message += ends_on.days+(ends_on.days == 1?' day':' days'); } else if(ends_on.days == 0){ if(ends_on.hours > 0){ ends_message += ends_on.hours+(ends_on.hours == 1?'hour':'hours'); } } else{ ends_message += ""; } break; case '3': var options = { timeZone:'America/New_York', weekday: 'long', year: 'numeric', month: 'long', day: 'numeric',hour:'numeric' ,minute:'numeric',second:'numeric' }; ends_message += new Date(estDateTime(item.end_date,item.end_time_est)).toLocaleDateString('en-UK', options); break; case '4': var options = { timeZone:'America/New_York', weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'}; ends_message += new Date(estDateTime(item.end_date,item.end_time_est)).toLocaleDateString('en-UK', options); break; case '5': var options = { timeZone:'America/New_York', year: 'numeric', month: 'long', day: 'numeric'}; ends_message += new Date(estDateTime(item.end_date,item.end_time_est)).toLocaleDateString('en-UK', options); break; case '6': var options = { timeZone:'America/New_York', year: 'numeric', month: 'short', day: 'numeric',hour:'numeric' ,minute:'numeric',second:'numeric' }; ends_message += new Date(estDateTime(item.end_date,item.end_time_est)).toLocaleDateString('en-UK', options); break; case '7': var options = { timeZone:'America/New_York', year: 'numeric', month: 'short', day: 'numeric'}; ends_message += new Date(estDateTime(item.end_date,item.end_time_est)).toLocaleDateString('en-UK', options); break; case '8': if(ends_on.days > 0){ ends_message += ends_on.days+'d:'; } if(ends_on.hours > 0){ ends_message += ends_on.hours+'h:'; } if(ends_on.minutes > 0){ var minutes = ends_on.minutes; if(minutes < 10){minutes = '0'+minutes;} ends_message += minutes+'m:'; } if(ends_on.seconds >= 0){ var seconds = ends_on.seconds; if(seconds < 10){seconds = '0'+seconds;} ends_message += ''+seconds+''+'s'; } break; case '9': if(ends_on.days > 0){ ends_message += ends_on.days+(ends_on.days == 1?'day ':'days '); } if(ends_on.hours > 0){ ends_message += ends_on.hours+(ends_on.hours == 1?'hour ':'hours '); } if(ends_on.minutes > 0){ var minutes = ends_on.minutes; if(minutes < 10){minutes = '0'+minutes;} ends_message += minutes+(ends_on.minutes == 1?'minute ':'minutes '); } if(ends_on.seconds >= 0){ var seconds = ends_on.seconds; if(seconds < 10){seconds = '0'+seconds;} ends_message += ''+seconds+''+(ends_on.seconds <= 1?'second':'seconds'); } break; default: if(ends_on.days > 0){ ends_message += ends_on.days+'d'; } if(ends_on.hours > 0){ ends_message += ends_on.hours+'h'; } if(ends_on.minutes > 0){ var minutes = ends_on.minutes; if(minutes < 10){minutes = '0'+minutes;} ends_message += minutes+'m ' } if(ends_on.seconds >= 0){ var seconds = ends_on.seconds; if(seconds < 10){seconds = '0'+seconds;} ends_message += ''+seconds+''+'s'; } } if(ends_message !== ''){ if(showMsg){ ends_message = sale_clock.sale_clock_text1+' '+ends_message+''+sale_clock.sale_clock_text2; } var s = sale_clock.style; var style = 'background:'+(s.hex_bg_color?s.hex_bg_color:'hsla('+s.bg_color[0].hue+','+s.bg_color[0].saturation*100+'%,'+s.bg_color[0].brightness*100+'%,1)')+';color:'+(s.hex_fg_color?s.hex_fg_color:'hsla('+s.fg_color[0].hue+','+s.fg_color[0].saturation*100+'%,'+s.fg_color[0].brightness*100+'%,1)')+';font-size:'+s.font_size+'px;border-radius:'+s.border_radius+'px;text-align:'+s.text_align+';padding:'+s.padding+';line-height:initial;'; var inte; if(CLOCKID == null){ inte = setInterval(showClockImediately,1000); } else{ if(styled){ CLOCKID.innerHTML = "