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

