var now = new Date();
var hr = now.getHours();
var mm = now.getMinutes();
var dd = now.getDay();

function openRam(v_ramfile) {
  var ram_player = open("/ram/play_ram.asp?v_ramfile=" + v_ramfile,"RealPlayer","noscrollbars,toolbar=1");
}

function openNavigator() {
  var popup = open("/basic-e.aspx","PopUp","noscrollbars,resizable=yes,toolbar=0,top=10,left=10,height=500,width=250");
}

function openNavigator_i() {
//  var popup = open("/navtree/leftw-i.html","PopUp","noscrollbars,resizable=yes,toolbar=0,top=10,left=10,height=500,width=250");
  var popup = open("/basic.aspx","PopUp","noscrollbars,resizable=yes,toolbar=0,top=10,left=10,height=500,width=250");
}

function openNavigator_f() {
  var popup = open("/basic-f.aspx","PopUp","noscrollbars,resizable=yes,toolbar=0,top=10,left=10,height=500,width=250");
}


function PopUp(url)
{
var popup = open(url,"PopUp","noscrollbars,toolbar=1,top=0,left=490,height=220,width=280");
}

function getGreet() {
if ((hr > 19) || ( hr < 4)) {
  return "night";
}
else {
  if (hr < 10) 
    return "morning";
  else {
    if (hr < 15) 
     return "good day";
    else {
      if (hr <= 18)
        return "evening";
      else
        return "afternoon";
    }
  }
}
}

function getMyTime() {
  oth_msg="";
  if ((hr > 20) || (hr < 4)) { la_time="night";
    if (hr==0) la_time="midle of the night";    
  }
  else {
    if ((dd==0) || (dd==6)) { oth_msg=" It is weekend! Go play! "; }
    if (hr < 10) { la_time="morning"; 
     }
    else {
      if (hr <15) { la_time="noon"; }
      else { 
        if (hr < 18) {
          la_time="afternoon"; 
          if ((dd==0) || (dd==6)) { oth_msg=oth_msg + " or take a good nap on this lovely afternoon!"; }
        }
        else {
          la_time = "dusk";
        }
      }
    }
  }
  // now check for my own local time
  tz = now.getTimezoneOffset();
  hr_dif = tz/60;
  gmt_hr = hr + hr_dif;

  if (gmt_hr < 0) gmt_hr += 24;
  id_hr = gmt_hr + 7;
  if (id_hr >= 24) id_hr -= 24;  

  if ((id_hr  > 22) || (id_hr < 5)) {
    oth_msg += "It is my bed time at Indonesia, browse by yourself, please. Make yourself like at a homepage :) ";
  }
  else {
    if (id_hr < 11) {
      oth_msg += "It is a bright sunny morning at Jakarta (as predicted). ";
    }
    else {
      if (id_hr < 15) {
        oth_msg += "It is a hot noon at Jakarta. ";
      }
      else {
        if (id_hr < 18) {
          oth_msg += "It is a shady crowded afternoon at Jakarta. ";
        }
        else {
          if (id_hr < 20) {
            oth_msg += "It is dusk at Jakarta. Maghrib time. ";
          }
          else oth_msg += "It is a lovely young evening at Jakarta. ";
        }
      }
    }
  }
  
  // UK
  if ((gmt_hr  > 23) || (gmt_hr < 6)) {
    oth_msg += "My bed time at UK.";
  }
  else {
    if (gmt_hr < 12) {
      oth_msg += "A usual chilly sunshine but cloudy morning at UK";
    }
    else {
      if (gmt_hr < 15) {
        oth_msg += "A noon at UK. Not too hot. Depends on season.";
      }
      else {
        if (gmt_hr < 17) {
          oth_msg += "A shady afternoon at UK.";
        }
        else {
          if (gmt_hr < 18) {
            oth_msg += "Getting dark at UK.";
          }
          else oth_msg += "It is a lovely young evening at UK, too";
        }
      }
    }
  }
  // local GMT UK


  return hr+":"+mm+" in the " + la_time + ", and you come to my home! X-(<br /> " + oth_msg;
}


function getGreeti() {
if ((hr > 19) || ( hr < 4)) {
  return "malam";
}
else {
  if (hr < 10) 
    return "pagi";
  else {
    if (hr < 15) 
     return "siang";
    else {
      if (hr < 18) return "sore"; 
      else return "sore banget";
    } 
  }
} // else
} // func

function getMyTimei() {
  oth_msg="";
  if ((hr > 20) || (hr < 4)) { la_time="malam";
    if (hr==0) la_time="tengah malam";
  }
  else {
    if ((dd==0) || (dd==6)) { oth_msg="Weekend! Maen sana gih!"; }
    if (hr < 10) { la_time="pagi"; 
     }
    else {
      if (hr <15) { la_time="siang"; }
      else {
        if (hr < 18) { la_time="sore"; 
          if ((dd==0) || (dd==6)) { oth_msg=oth_msg + " atau tidur siang di sore yang indah ini!"; }
        }
        else { la_time="maghrib"; }
      }
    }
  }

  // now check for my own local time
  tz = now.getTimezoneOffset();
  hr_dif = tz/60;
  gmt_hr = hr + hr_dif;

  if (gmt_hr < 0) gmt_hr += 24;
  id_hr = gmt_hr + 7;
  if (id_hr >= 24) id_hr -= 24;  

  if ((id_hr  > 22) || (id_hr < 5)) {
    oth_msg += "Waktu tidur gua kalo di Indonesia. Nge-browse sendiri sana gih! ";
  }
  else {
    if (id_hr < 11) {
      oth_msg += "Pagi yang cerah hangat di Jakarta (seperti diramalkan). ";
    }
    else {
      if (id_hr < 15) {
        oth_msg += "Siang yang panas di Jakarta. ";
      }
      else {
        if (id_hr < 18) {
          oth_msg += "Sore yang berbayang-bayang di Jakarta. ";
        }
        else {
          if (id_hr < 20) {
            oth_msg += "Senja di Jakarta. Waktunya Maghrib. ";
          }
          else oth_msg += "Memasuki malam di Jakarta. ";
        }
      }
    }
  }

// UK
  if ((gmt_hr  > 23) || (gmt_hr < 6)) {
    oth_msg += "Waktunya tidur di Inggris.";
  }
  else {
    if (gmt_hr < 12) {
      oth_msg += "Pagi yang mendung seperti biasanya di Inggris. ";
    }
    else {
      if (gmt_hr < 15) {
        oth_msg += "Sudah siang di Inggris. Tidak panas juga. Tergantung musim. ";
      }
      else {
        if (gmt_hr < 17) {
          oth_msg += "Sore-sore di Inggris. ";
        }
        else {
          if (gmt_hr < 18) {
            oth_msg += "Mulai gelap di Inggris. ";
          }
          else oth_msg += "Memasuki malam di Inggris. ";
        }
      }
    }
  }
  // local GMT UK




  return hr+":"+mm + " " + la_time + ", dan elo datang ke sini! X-(<br /> " + oth_msg;
}



function getGreetf() {
if ((hr > 21) || ( hr < 4)) {
  return "bonne nuit";
}
else {
  if (hr < 10) 
    return "bonjour";
  else {
    if (hr < 15) 
     return "bonjour";
    else {
      if (hr < 18) 
        return "bonne après-midi";
      else
        return "bonsoir";
    }
  }
}
}

function getMyTimef() {
  oth_msg="";
  if ((hr > 21) || (hr < 4)) { la_time=" à nuit ";
  }
  else {
    if ((dd==0) || (dd==6)) { oth_msg="Weekend!"; }
    if (hr < 10) { la_time="le matin"; 
     }
    else {
      if (hr <15) { la_time="à midi"; }
      else { 
        if (hr < 18) {
          la_time="à l'après-midi"; 
          if ((dd==0) || (dd==6)) { oth_msg=oth_msg + " Prenez un petit somme d'après-midi!"; }
        }
        else {
          la_time = "à la soirée";
        }
      }
    }
  }
  // now check for my own local time
  tz = now.getTimezoneOffset();
  hr_dif = tz/60;
  gmt_hr = hr + hr_dif;

  if (gmt_hr < 0) gmt_hr += 24;
  id_hr = gmt_hr + 7;
  if (id_hr >= 24) id_hr -= 24;  

  if ((id_hr  > 22) || (id_hr < 5)) {
    oth_msg += "Je dors et rêve. ";
  }
  else {
    if (id_hr < 11) {
      oth_msg += "Je dors et rêve (toujours?) à Indonésie. ";
    }
    else {
      if (id_hr < 15) {
        oth_msg += " Un jour chaud à Jakarta. ";
      }
      else {
        if (id_hr < 18) {
          oth_msg += " Un après-midi à Jakarta (?). ";
        }
        else {
          if (id_hr < 20) {
            oth_msg += "C'est crépuscule à Jakarta. Temps de Maghrib. ";
          }
          else oth_msg += "C'est une belle soirée à Jakarta. ";
        }
      }
    }
  }

  // local GMT UK TODO
 oth_msg += "Mais, je suis chez le Royaume-Uni (GMT + 0)";

  return hr+":"+mm+" , " + la_time + ", et vous venez à ma maison!  X-(<br /> " + oth_msg;
}

