JavaScript / Windows / Greetings

Web-master / Resources / JavaScript

JavaScript / Windows / Greetings

The greeting varies depending on the time of day, for example. In the morning - good morning, in the afternoon - good afternoon, in the evening - good evening

<script language="JavaScript">
 <!--
 function display_title() {
 var hours = date.getHours(); 
 var message = '';
 
 
 if (hours >= 6) { message_t = 'Доброго утречка'; message='mm';}
  if ((hours >= 12) && (hours < 17)) { message_t = 'Уж время обеда'; message='am'}
  if (hours >= 17) { message_t = 'Доброго вам вечера'; message='em';} 
  if ((hours >= 0) && (hours < 6)){ message_t = 'Пусть ночь для вас будет приятной'; message='nm';} 
 document.write('Хочется сказать вам по простому, ' + message_t + '');
    }
 function display_date() {
    date = new Date();
 } //
 -->
 </script> 
 
 
</HEAD>
 <style type="text/css">
 A:link {
  color: #003399;
  text-decoration: underline
 }
 A:visited {
  color:#003399;
  text-decoration: underline
 }
 A:hover {
  color:#003399;
  text-decoration: none
 }
 .copy {
  font: 8pt/normal Verdana, Arial, Helvetica, sans-serif; 
  text-transform: super; 
  text-decoration: none;
  color: #333333
 }
 .copy1 {
  font: bold 10pt/normal  Verdana, Arial, Helvetica, sans-serif; 
  text-transform: super; 
  text-decoration: none; 
  color: #333333
 }
 .copy2 {
  font: 9pt/normal  Verdana, Arial, Helvetica, sans-serif; 
  text-transform: super; 
  text-decoration: none; color: #333333
 }
 </style>
 
 
<script language="JavaScript">
     display_date();
     display_title();
 </script>       font: 8pt/normal Verdana, Arial, Helvetica, sans-serif; 
  text-transform: super; 
  text-decoration: none;
  color: #333333
 }
 .copy1 {
  font: bold 10pt/normal  Verdana, Arial, Helvetica, sans-serif; 
  text-transform: super; 
  text-decoration: none; 
  color: #333333
 }
 .copy2 {
  font: 9pt/normal  Verdana, Arial, Helvetica, sans-serif; 
  text-transform: super; 
  text-decoration: none; color: #333333
 }
 </style>
 
 
<script language="JavaScript">
     display_date();
     display_title();
 </script> 

Example

font: 8pt/normal Verdana, Arial, Helvetica, sans-serif; text-transform: super; text-decoration: none; color: #333333 } .copy1 { font: bold 10pt/normal Verdana, Arial, Helvetica, sans-serif; text-transform: super; text-decoration: none; color: #333333 } .copy2 { font: 9pt/normal Verdana, Arial, Helvetica, sans-serif; text-transform: super; text-decoration: none; color: #333333 }