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(".");
   document.write(now.getFullYear());
   return;
}


function globalPopup(url, wd, ht, 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, "popup", 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://volksgruppen.orf.at/popup?skin=" + str;
      for (var i in args)
         url += "&" + i + "=" + args[i];
   }
   globalPopup(url, args.width, args.height, args.options);
   return;
}


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


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


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;
}

