function printDate() {
   var now = new Date();
   var daynames = new Array("SO", "MO", "DI", "MI", "DO", "FR", "SA");
   var day = now.getDay();
   document.write(daynames[day]);
   document.write(" | ");
   var date = now.getDate();
   if (date < 10)
      document.write("0");
   document.write(date);
   document.write(".");
   var month = now.getMonth()+1;
   if (month < 10)
      document.write("0");
   document.write(month);
   document.write(".");
   return;
}


function printTime() {
   var now = new Date();
   var hour = now.getHours();
   if (hour < 10)
      document.write("0");
   document.write(hour);
   document.write(":");
   var minute = now.getMinutes();
   if (minute < 10)
      document.write("0");
   document.write(minute);
   return;
}


function globalPopup(url, wd, ht, name, options) {
   if (!url)
      return;
   if (wd == null)
      wd = "400";
   if (ht == null)
      ht = "300";
   if (!options)
      var options = "resizable=yes,status=yes,scrollbars=yes";
   options += ",width=" + wd + ",height=" + ht;
   self.open(url, name, options);
   return;
}


function popup(str) {
   // FIXME: remove backwards-compatibility
   if (arguments.length > 2) {
      var args = {
         width: arguments[1],
         height: arguments[2],
         options: arguments[3]
      };
   } else
      var args = arguments[1] || {};
   if (str.indexOf("http") == 0)
      var url = str;
   else {
      var url = "http://oe3.orf.at/popup?skin=" + str;
      for (var i in args)
         url += "&" + i + "=" + args[i];
   }
   globalPopup(url, args.width, args.height, "popup", args.options);
   return;
}


function vc(name) {
   if (!name)
      return;
   var url = "http://my.orf.at/" + encodeURIComponent(name);
   globalPopup(url, 440, 490, "vcpopup");
   return;
}


function confirmAction(msg) {
   return confirm(msg) == true;
   return;
}


function reloadImage(id) {
   if (document.getElementById)
      var img = document.getElementById(id);
   else
      var img = document.images[id];
   if (img == null)
      return;
   var newImg = new Image();
   var pos = img.src.indexOf("?");
   var src = (pos > 0) ? img.src.substring(0, pos) : img.src;
   newImg.src = src + "?" + (new Date()).getTime();
   img.src = newImg.src;
   setTimeout("reloadImage('" + id + "')", 5000);
   return;
}


function hilite(obj, color) {
return; // FIXME: disabled due to annoyance
   if (color)
      obj.style.backgroundColor = color;
   else
      obj.style.backgroundColor = "";
   return;
}
