  active_id = "";
  main_active_id = "";
  
  function pagetop() {
   //OBEN = document.URL + "#pagetop";
   OBEN = document.URL + "";
   window.location.href = OBEN;
  }
  
 function pdf() {  seite = pdf.arguments[0];  pdf1= window.open ( seite, "pdf",'toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=auto,resizable=yes,copyhistory=no,WIDTH=500,HEIGHT=400');
   }
 
 function normal(image_name) {
    if (image_name != active_id && image_name != main_active_id) document[image_name].src = eval( image_name + '.src;' );
  }
  
  function over(image_name) {
    if (image_name != active_id && image_name != main_active_id) document[image_name].src = eval( image_name + '_ov.src;' );
  }
  
  function init_db_images(img_array) {
    for (var i=0 ; i < img_array.length ; i++) {
      eval( img_array[i][0] + ' = new Image();' );
      eval( img_array[i][0] + '.src = "images/' + img_array[i][1] + '/navi/";' );
      eval( img_array[i][0] + '_ov = new Image();' );
      eval( img_array[i][0] + '_ov.src = "images/' + img_array[i][1] + '/navi_roll/";' );
    }
  }
  
  function init_db_rollover_images(img_array) {
    for (var i=0 ; i < img_array.length ; i++) {
      eval( img_array[i][0] + ' = new Image();' );
      eval( img_array[i][0] + '.src = "images/' + img_array[i][1] + '/normal/";' );
      eval( img_array[i][0] + '_ov = new Image();' );
      eval( img_array[i][0] + '_ov.src = "images/' + img_array[i][1] + '/over/";' );
    }
  }
  
  function init_images(img_array) {
    for (var i=0 ; i < img_array.length ; i++) {
      eval( img_array[i][0] + ' = new Image();' );
      eval( img_array[i][0] + '.src = "pictures/' + img_array[i][1] + '.gif";' );
      eval( img_array[i][0] + '_ov = new Image();' );
      eval( img_array[i][0] + '_ov.src = "pictures/' + img_array[i][1] + '-over.gif";' );
    }
  }
  
  function glossar(id) {
    var popUpWidth	= 360
    var popUpHeight	= 330;
    var popUpPosX 	= (screen.width) ? (screen.width-popUpWidth)/2 : 0;
    var popUpPosY 	= (screen.height) ? (screen.height-popUpHeight)/2 : 0;
	 var popUpURL 	= "/php_logic/glossar.php?id=" + id;
	 if(self.location.host == "coder432.intranet.xoz") popUpURL = "/dradio" + popUpURL;
    var popUpName	= "Glossar";
    var popUpParams	= 'width='+popUpWidth+', height='+popUpHeight+', top='+popUpPosY+', left='+popUpPosX+', fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0';
    
    glossarWin = window.open(popUpURL,popUpName,popUpParams);
    glossarWin.blur();
    window.focus();
    glossarWin.focus();
  }
  
  function show_pic(pic_id,row_id,table,pic_field) {
    properties = "location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no";
    pop_width = 530;
    pop_height = 700;
    if (screen.availWidth <= pop_width || screen.availHeight <= pop_height) {
      left_pos = 1;
      oben = 1;
    }
    else { 
      left_pos = (screen.availWidth - pop_width) / 2;
      oben = (screen.availHeight - pop_height) / 2;
    }
	 
    var popUpURL 	= '/php_logic/bildpopup.php?id='+pic_id+'&table='+table+'&pic_field='+pic_field+'&row_id='+row_id+'';
    if(self.location.host == "coder432.intranet.xoz") popUpURL 	= "/dradio" + popUpURL;
	 
    popup_window=window.open(popUpURL,'pic_'+pic_id+'',''+properties+',width='+pop_width+',height='+pop_height+',left='+left_pos+',top='+oben+'');
    //popup_window=window.open('/php_logic/bildpopup.php?id='+pic_id+'&width='+pop_width+'&height='+pop_height+'','pic_'+pic_id+'',''+properties+',width='+pop_width+',height='+pop_height+',left='+left_pos+',top='+oben+'');
    popup_window.focus();
  }
  
  function kulturkalender_popup(seite) {                                                                                                                                                                                       
   kulturkalender1= window.open ( seite, "kulturkalender",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=700');                                              
       } 
         
  function wetter_popup(seite) {
    wetter1= window.open ( seite, "Wetter",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=580,height=480');
  }
  
  function popup_jetztimradio(seite) {
    popup_radio = window.open ( seite, "RadioNow",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=240,height=350');
  }  
  
  function popup_aodplayer(seite) {
    popup_aod = window.open ( seite, "AOD",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=766,height=530');
  } 

  
  function popup_streaming(seite) {
    popup_stream = window.open ( seite, "Streaming",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=240,height=350');
  } 


function archive_select_today(base_year) {
    var now = new Date;
    var now_hour = now.getHours();
    var i = 0;

    document.forms["archive"].hour.selectedIndex = 1;
    for(i=document.forms["archive"].hour.length-1; i>0; --i) {
          if(document.forms["archive"].hour.options[i].value < now_hour) {
              document.forms["archive"].hour.options[i].selected = true;
              break;
          }
    }
    document.forms["archive"].day.options[now.getDate()].selected = true;
    document.forms["archive"].month.options[now.getMonth()+1].selected = true;
    document.forms["archive"].year.options[now.getFullYear()-base_year+1].selected = true;
    return(1);
}

