/* takumi.js  page reloader and flash communicator.
copyright ingodesign.de 2006 */





/* 
FINDE IM URL DIE URL-VARIABLE - DEN ZU AKTIVIERENDEN SUB-BUTTON
************************************************************** */
function findURLVar() {

  var search_str = window.location.search.toString();  
  var search_stripped = search_str.substring(1);
  return search_stripped;
}

/*
SCHICKE DEN ZU AKTIVIERENDEN SUB-BUTTON NAMEN AN FLASH ********************************************************** */
function writeFlash() {

  var activSubBtn = findURLVar();

  var flashFilm = '\<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="800" height="70" id="navi" align="middle"> \n';
  flashFilm += '<param name="allowScriptAccess" value="sameDomain" /> \n';
  flashFilm += '<param name="movie" value="../swfs/navi07.swf?activated='+ activSubBtn +'" /> \n';
  flashFilm += '<param name="quality" value="high" />  \n';
  flashFilm += '<param name="bgcolor" value="#5e6e21" />  \n';
  flashFilm += '<embed src="../swfs/navi07.swf?activated='+ activSubBtn +'" quality="high" bgcolor="#5e6e21" width="800" height="70" name="navi" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />  \n';
  flashFilm += '</object>  \n'; 

  return flashFilm;
}

/*
SCHREIBE DEN FILM IN DAS ELEMENT MIT DER ID "film"
********************************************************** */
function showFlash() {
  var filmTd = document.getElementById("film");
  filmTd.innerHTML = writeFlash();
}






/* 
ENTFERNE URL-VARIABLE AUS DEM URL 
*************************************/
function stripURLofVars() {

 /* var theURL =document.URL;*/  var theURL = window.location;
  var theURL_str = theURL.toString();
  var varIndex = theURL_str.indexOf("?");
  var strippedURL_str;
  if(varIndex!=-1) {
     strippedURL_str = theURL_str.substr(0, varIndex);
  } else {
     strippedURL_str = theURL_str;
  }
  return strippedURL_str;
}



/* 
RELOAD PAGE FUNKTION 
************************/
function reloadPage(subBtn) {

  var theURL = stripURLofVars(); 
  var newURL =theURL + "?" + subBtn;

  /* JS1.0 
   macht eintrag in history 
  **************************************/
   window.location.href =  newURL;

  /* JS1.1 
  macht keinen eintrag in history 
  ***************************************
  window.location.replace(theURL); */

  /* JS1.1 
  (true) erzwingt das neuladen der seite vom server, 
  (false) laedt nur bei aenderung der seite vom server
  [ANMERKUNG! aug. 2006 nach 12 stunden!]
  will man diesen reload befehl zum refreshen der seiten-URL
  bei klick z.B. auf einen a-link der html seite nutzen,
  darf href="#" nicht im a stehen!!! der href muss leer sein:
  href="" und dazu nach dem onclick event, auch return false!
  ****************************************************
 location.reload();*/

  /* ****************************************
  var newWin = window.open(newURL,"_blank"); */

}


