// JavaScript Document

window.onload = function() {
  
  /* Start: Sprachwahl Button ----------------------------------------------- */
  
  if(document.getElementById('btn_deutsch')) { // Sprachwahl Button
    document.getElementById('btn_deutsch').onclick = function() {
      window.location.href = 'news.php';
    }
  }
  
  if(document.getElementById('btn_english')) { // Sprachwahl Button
    document.getElementById('btn_english').onclick = function() {
      window.location.href = 'news.en.php';
    }
  }
  
  /* Ende: Sprachwahl Button ------------------------------------------------ */
  
  
  
  /* Start: Navigation Button ----------------------------------------------- */
  
  if(document.getElementById('btn_home')) { // Navigation Button
    document.getElementById('btn_home').onclick = function() {
      window.location.href = 'index.php';
    }
  }
  
  if(document.getElementById('btn_news')) { // Navigation Button
    document.getElementById('btn_news').onclick = function() {
      if(document.URL.indexOf('.en.') < 0) { // deutsch
        window.location.href = 'news.php';
      }
      else { // englisch
        window.location.href = 'news.en.php';
      }
    }
  }
  
  if(document.getElementById('btn_ueberuns')) { // Navigation Button
    document.getElementById('btn_ueberuns').onclick = function() {
      if(document.URL.indexOf('.en.') < 0) { // deutsch
        window.location.href = 'ueberuns.php';
      }
      else { // englisch
        window.location.href = 'aboutus.en.php';
      }
    }
  }
  
  if(document.getElementById('btn_konzerte')) { // Navigation Button
    document.getElementById('btn_konzerte').onclick = function() {
      if(document.URL.indexOf('.en.') < 0) { // deutsch
        window.location.href = 'konzerte.php';
      }
      else { // englisch
        window.location.href = 'concerts.en.php';
      }
    }
  }
  
  if(document.getElementById('btn_musik')) { // Navigation Button
    document.getElementById('btn_musik').onclick = function() {
      if(document.URL.indexOf('.en.') < 0) { // deutsch
        window.location.href = 'musik.php';
      }
      else { // englisch
        window.location.href = 'music.en.php';
      }
    }
  }
  
  if(document.getElementById('btn_texte')) { // Navigation Button
    document.getElementById('btn_texte').onclick = function() {
      if(document.URL.indexOf('.en.') < 0) { // deutsch
        window.location.href = 'texte.php';
      }
      else { // englisch
        window.location.href = 'lyrics.en.php';
      }
    }
  }
  
  if(document.getElementById('btn_medien')) { // Navigation Button
    document.getElementById('btn_medien').onclick = function() {
      if(document.URL.indexOf('.en.') < 0) { // deutsch
        window.location.href = 'medien.php';
      }
      else { // englisch
        window.location.href = 'media.en.php';
      }
    }
  }
  
  if(document.getElementById('btn_downloads')) { // Navigation Button
    document.getElementById('btn_downloads').onclick = function() {
      if(document.URL.indexOf('.en.') < 0) { // deutsch
        window.location.href = 'downloads.php';
      }
      else { // englisch
        window.location.href = 'downloads.en.php';
      }
    }
  }
  
  if(document.getElementById('btn_kontakt')) { // Navigation Button
    document.getElementById('btn_kontakt').onclick = function() {
      if(document.URL.indexOf('.en.') < 0) { // deutsch
        window.location.href = 'kontakt.php';
      }
      else { // englisch
        window.location.href = 'contact.en.php';
      }
    }
  }
  
  /* Ende: Navigation Button ------------------------------------------------ */
  
  
  
  /* Start: URL-Text als Home-Button ---------------------------------------- */
  
  if(document.getElementById('home_top')) { // URL-Text als Home-Button
    document.getElementById('home_top').onclick = function() {
      window.location.href = 'index.php';
    }
  }
  
  if(document.getElementById('home_bottom')) { // URL-Text als Home-Button
    document.getElementById('home_bottom').onclick = function() {
      window.location.href = 'index.php';
    }
  }
  
  /* Ende: URL-Text als Home-Button ----------------------------------------- */
  
  
  
  /* Start: CD Bestellbutton ------------------------------------------------ */
  
  if(document.getElementById('cd_Heartbeat')) { // CD: Heartbeat
    document.getElementById('cd_Heartbeat').onclick = function() {
      orderCD('Heartbeat');
    }
  }
  
  if(document.getElementById('cd_Blue_Planet')) { // CD: Blue Planet
    document.getElementById('cd_Blue_Planet').onclick = function() {
      orderCD('Blue_Planet');
    }
  }
  
  if(document.getElementById('cd_Barakan')) { // CD: Barakan
    document.getElementById('cd_Barakan').onclick = function() {
      orderCD('Barakan');
    }
  }
  
  if(document.getElementById('cd_Emotions_2007')) { // CD: Emotions 2007
    document.getElementById('cd_Emotions_2007').onclick = function() {
      orderCD('Emotions_2007');
    }
  }
  
  if(document.getElementById('cd_Best_of_5_Years')) { // CD: Best of 5 Years
    document.getElementById('cd_Best_of_5_Years').onclick = function() {
      orderCD('Best_of_5_Years');
    }
  }
  
  if(document.getElementById('cd_Freedom')) { // CD: Freedom
    document.getElementById('cd_Freedom').onclick = function() {
      orderCD('Freedom');
    }
  }
  
  if(document.getElementById('cd_Red_Cosmic_Earth')) { // CD: Red Cosmic Earth
    document.getElementById('cd_Red_Cosmic_Earth').onclick = function() {
      orderCD('Red_Cosmic_Earth');
    }
  }
  
  if(document.getElementById('cd_Indigo')) { // CD: Indigo
    document.getElementById('cd_Indigo').onclick = function() {
      orderCD('Indigo');
    }
  }
  
  if(document.getElementById('cd_Dreamscape')) { // CD: Dreamscape
    document.getElementById('cd_Dreamscape').onclick = function() {
      orderCD('Dreamscape');
    }
  }
  
  if(document.getElementById('cd_Eternity')) { // CD: Eternity
    document.getElementById('cd_Eternity').onclick = function() {
      orderCD('Eternity');
    }
  }
  
  /* Ende: CD Bestellbutton ------------------------------------------------- */
}



function orderCD(cd) {
  window.open('order.php?article='+cd,'','top=20,left=20,width=580,height=740,scrollbars=yes');
}
