function setTargets() {
  for (i=0; i < document.links.length; i++) {
   	if (document.links[i].target == "XXbackXX") {
     	document.links[i].target=opener.name;
   	}
  }
}

function open_window(page,breite,hoehe,name){
  var popup = window.open(page,name,"width=" + breite + ",height=" + hoehe + ",scrollbars=no,resizable=yes,menubar=no,locationbar=no");
	popup.focus();
}

function open_audio(page,breite,hoehe,name){
		var popup = window.open(page,name,"width=" + breite + ",height=" + hoehe + ",scrollbars=no,resizable=no,menubar=no,locationbar=no,left=200,top=200");
		popup.focus();
}

function open_search(page,breite,hoehe){
	var popup = window.open(page,"search","width=" + breite + ",height=" + hoehe + ",scrollbars=yes,resizable=no,menubar=no,locationbar=no,left=570,top=130");
	popup.focus();
}

function open_kaffa(page){
  var popup = window.open(page,"kaffa","width=717,height=717,scrollbars=yes,resizable=yes,menubar=no,locationbar=no");
	popup.focus();
}

function open_galerie(page){
  var popup = window.open(page,"kaffa","width=965,height=725,scrollbars=yes,resizable=yes,menubar=no,locationbar=no");
	popup.focus();
}

function open_lexikon(page){
  var popup = window.open(page,"kaffa","width=717,height=717,scrollbars=yes,resizable=yes,menubar=no,locationbar=no");
	popup.focus();
}

function submitQuery(formular){
		var query   = document.forms[formular].elements["q"].value;
    open_search("http://www.geo.de/search/webshop.html?q="+query,"637","650");
}

function writeMediaCode(extension, source, width, height, id, display) {
  if (extension == "mpeg" || extension == "avi") extension = "mpg";
  if (extension == "swf") extension = "flv";
  if(extension != "flv") height = parseInt(height) + 15;
  switch(extension) {
    case "flv":
      document.writeln('<object id="'+id+'" type="application/x-shockwave-flash" data="'+source+'" width="'+width+'" height="'+height+'">');
      document.writeln('<param name="movie" value="'+source+'" \/>');
      document.writeln('<param name="wmode" value="transparent" \/>');
      document.writeln('Für die Darstellung des Inhalts ist der Flash Player von Adobe erforderlich, den Sie unter folgender Adresse kostenlos herunterladen können:<br /> <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=German" target="_blank">&raquo; Adobe Flash Player Download-Center</a><br \/><br \/>');
	  document.writeln('<\/object>');
      break;
    case "wmv":
      height = parseInt(height) + 44;
      document.writeln('<object id="'+id+'" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" type="application/x-oleobject" standby="Der Microsoft Windows Media Player wird geladen..." width="'+width+'" height="'+height+'">');      
        document.writeln('<param name="fileName" value="'+source+'" />');
        document.writeln('<param name="autostart" value="1" />');
        document.writeln('<param name="AnimationatStart" value="0" />');
        document.writeln('<param name="TransparentatStart" value="0" />');
        document.writeln('<param name="ShowControls" value="1" />');
        document.writeln('<param name="ShowPositionControls" value="0" />');
        document.writeln('<param name="ShowStatusBar" value="0" />');
        document.writeln('<embed id="'+id+'2" type="application/x-mplayer2" showcontrols="1" showpositioncontrols="0" animationatstart="0" transparentatstart="0" showstatusbar="0" src="'+source+'" width="'+width+'" height="'+height+'"></embed>');
      document.writeln('<\/object>');
      break;
    case "mpg":
      document.writeln('<object id="'+id+'" type="video/mpeg" data="'+source+'" autostart="true" width="'+width+'" height="'+height+'" style="display:'+display+'">');      
        document.writeln('<param name="type" value="video/mpeg" />');
        document.writeln('<param name="src" value="'+source+'" />');
        document.writeln('<param name="controls" value="ImageWindow" />');
        document.writeln('<param name="autostart" value="true" />');
        document.writeln('Für die Darstellung des Videos ist der Quicktime-Player von Apple erforderlich, den Sie unter folgender Adresse herunterladen können:<br /> <a href="http://www.apple.com/de/quicktime/download/" target="_blank">&raquo; http://www.apple.com/de/quicktime/download/</a>');
      document.writeln('<\/object>');
      break;
    case "mov":
      document.writeln('<object id="'+id+'" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" data="'+source+'" autostart="true" width="'+width+'" height="'+height+'" style="display:'+display+'">');
        document.writeln('<param name="controller" value="true" />');
        document.writeln('<param name="kioskmode" value="true" />');
        document.writeln('<param name="wmode" value="transparent" \/>');
        document.writeln('<param name="src" value="'+source+'" />');
        document.writeln('<param name="autostart" value="true" />');
        document.writeln('<object type="video/quicktime" data="'+source+'" autostart="true" width="'+width+'" height="'+height+'" class="mov">');
          document.writeln('<param name="controller" value="true" />'); 
          document.writeln('<param name="kioskmode" value="true" />');
          document.writeln('<param name="src" value="'+source+'" />');
          document.writeln('<param name="autostart" value="true" />');
          document.writeln('Für die Darstellung des Videos ist der Quicktime-Player von Apple erforderlich, den Sie unter folgender Adresse herunterladen können:<br /> <a href="http://www.apple.com/de/quicktime/download/" target="_blank">&raquo; http://www.apple.com/de/quicktime/download/</a>');
        document.writeln('</object>'); 
      document.writeln('</object>');
      break;
    case "rm":
      document.writeln('<object id="'+id+'" type="audio/x-pn-realaudio-plugin" data="'+source+'" autostart="true" width="'+width+'" height="'+height+'" style="display:'+display+'">');      
        document.writeln('<param name="type" value="audio/x-pn-realaudio-plugin" />');
        document.writeln('<param name="src" value="'+source+'" />');
        document.writeln('<param name="controls" value="ImageWindow" />');
        document.writeln('<param name="autostart" value="true" />');
        document.writeln('Für die Darstellung des Videos ist der RealPlayer erforderlich, den Sie unter folgender Adresse herunterladen können:<br /> <a href="http://de.real.com/player/" target="_blank">&raquo; http://de.real.com/player/</a>');
      document.writeln('<\/object>');
      break;
    case "mp3":
      var real_source = source.replace(/\/_components\/GEO\/article\/audio_player\/geo_audioplayer\.swf\?audio_file=/i,"");
      real_source = real_source.replace(/\&rubrik.*$/i,"");
      document.writeln('<object id="'+id+'" type="application/x-shockwave-flash" data="'+source+'" width="'+width+'" height="'+height+'">');
        document.writeln('<param name="movie" value="'+source+'" \/>');
        document.writeln('Zum Abspielen der Audio-Datei ist der Flash Player von Macromedia erforderlich, den Sie unter folgender Adresse herunterladen können: <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=German" target="_blank">&raquo; Macromedia Flash Player Download-Center</a><br \/><br \/>');
        document.writeln('Alternativ können Sie auch folgende Datei aufrufen:<br /> <a href="'+real_source+'">&raquo; Audio starten</a>');
      document.writeln('<\/object>');
      break;
  }
}