function urldecode(s)
{
  s2 = s.replace("+"," ");
  while (s2!=s){s=s2;s2 = s.replace("+"," ");}
  return unescape(s2);
}

function zufall()
{
zuffi = " " + Math.random();
zuffi = zuffi.substring(3,10);
}

// target blank ersatz
function newpop(ziel)
{
zufall();
fenster = window.open(ziel,zuffi);
fenster.focus();
}


//Popup-Fenster mit flexibler Breite und Hoehe
function pop(ziel,w,h)
{
zufall();

fenster = window.open(ziel,zuffi,'width=' + w + ',height=' + h + ',resizable=yes,scrollbars=no');
fenster.focus();
}

function popnoresize(ziel,w,h)
{
zufall();
fenster = window.open(ziel,zuffi,'width=' + w + ',height=' + h + ',resizable=no,scrollbars=no');
fenster.focus();
}

//Popup-Fenster mit flexibler Breite und Hoehe und Scrollbars
function popscroll(ziel,w,h)
{
zufall();
fenster = window.open(ziel,zuffi,'width=' + w + ',height=' + h + ',resizable=yes,scrollbars=yes');
fenster.focus();
}






// Podcast-Fenster
function popupPodcast()
{
fenster = window.open ("width=300 height=200, resizable=no,scrollbars=no");
fenster.focus();
}


// Script by Thomas Stich
// http://www.stichpunkt.de/beitrag/popup.html
// use it if you like it
// 
// <a href="html-or.jpg" onclick="return popup(this,123,456)" title="..."
// or
// <a href="html-or.jpg" onclick="return popup(this)" title="..."


var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popupPodcast(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 500;  // 150px*150px is the default size
  h = (h) ? h += 25 : 359;
  var args = 'width='+w+',height='+h+',resizable';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;


function popupPodcastURL(obj) 
{
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 500;  // 150px*150px is the default size
  h = (h) ? h += 25 : 359;
  var args = 'width='+w+',height='+h+',resizable';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}



// Download-Fenster
function popupDownload(obj)
{
var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
 if (!url) return true;
fenster = window.open (url,"", "width=500, height=290, resizable=no,scrollbars=no");
fenster.focus();

}




//Popup-Fenster mit Statuszeile
function popstatus(ziel,w,h)
{
zufall();
fenster = window.open(ziel,zuffi,'width=' + w + ',height=' + h + ',resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=yes,menubar=no');
fenster.focus();
}

//Popup-Fenster mit allem
function popall(ziel,w,h)
{
zufall();
fenster = window.open(ziel,zuffi,'width=' + w + ',height=' + h + ',resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes');
fenster.focus();
}

function sprung(formname,selectname)
   {
   zufall();
   var mindex = window.document.forms[formname][selectname].selectedIndex;
   url = window.document.forms[formname][selectname].options[mindex].value;
   //wenn in url kein # vorkommt wird target -1, falls es ungleich -1 ist wird es blank, ansonsten top

   var target = (url.indexOf("#") != "-1") ? "blank" : "top";
   if(url=='radionet') pop('/radio/radionet/index_alle.html',450,520);
   else
      {
      if(url!='dummy')
         {
         if(target =='blank')
            {
            var fenster = window.open(url, 'zuffi', 'width=700,height=500,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes'); fenster.focus();
            }
         if(target =='top')

           {
            window.location.href = url;
            }
         }
      }
  if(url=='programm') {window.location.href = 'http://rpg.ard.de';}
  }

function zoompop(ziel,w,h,hz)
{

if (typeof (hz) == "undefined")
{
hz=12
}
zufall();
hp = h + 40 + hz;
fenster = window.open(ziel,'zuffi','width=' + w + ',height=' + hp + ',resizable=no,scrollbars=no');
fenster.focus();
}





