function initIframe() {
     var h = 0;
     (document.getElementById('iframeloader').style.height = h +"px");
     (document.getElementById('iframetd').style.height = h +"px");
     (document.getElementById('iframe').style.height = h +"px");
}

function setCookie(linkname){
  var ablauf = new Date();
  var inTagen = ablauf.getTime() + (13200 * 24 * 60 * 60 * 1000);
  ablauf.setTime(inTagen);
  document.cookie = "visitet="+linkname+".php; expires="+ablauf.toGMTString()+";"
}

function wait(){
setTimeout("LadeInfo()",1250);
}
function LadeInfo() {
if (document.getElementById) {  // DOM3 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
}
}

function getCookie(){
  var gespeichert = "";
  if (document.cookie) {
  gespeichert = document.cookie;
  } else {
    var ablauf = new Date();
    var inTagen = ablauf.getTime() + (13200 * 24 * 60 * 60 * 1000);
    ablauf.setTime(inTagen);
    document.cookie = "visitet=home.php; expires="+ablauf.toGMTString()+";"
    gespeichert = document.cookie;
  }
  var a = document.cookie;
  var cookiewert = a.substr(a.search('=')+1);
  if(cookiewert.match(';')){
    cookiewert = cookiewert.replace(cookiewert.substring(cookiewert.indexOf(';'),cookiewert.length),'')
  }
  var arr = new Array("home.php", "studio.php", "aerobic.php", "fitness.php", "wellness.php", "galerie.php", "kontakt.php", "impressum.php", "bodypump.php", "milonzirkel.php", "video.php", "sommer.php", "winter.php", "pilates.php", "wochenplan.php", "brainlight.php", "kinder.php", "news.php", "team.php", "fitatall.php", "biosaktiv.php", "gesundheit.php", "fusspflege.php", "rehasport.php");
  if(arr.join().indexOf(cookiewert)>=0)
  {
  document.getElementById('iframe').src = cookiewert;
  }else{
  document.getElementById('iframe').src = 'home.php';//home-err.php
  }
}

function HideIframeLoader() {  
  /* document.getElementById('iframeloader').style.visibility = 'hidden' */
}
function ShowIframeLoader() {  
  /* document.getElementById('iframeloader').style.visibility = "visible"; */
}

function sizeIFrame() {
var helpFrame = $("#iframe");
var helpFrameLoader = $("#iframeloader");
var innerDoc = (helpFrame.get(0).contentDocument) ? helpFrame.get(0).contentDocument : helpFrame.get(0).contentWindow.document;
helpFrame.height(innerDoc.body.scrollHeight + 35);
helpFrameLoader.height(innerDoc.body.scrollHeight + 35);
setTimeout("HideIframeLoader();", 500);
}
$(function(){sizeIFrame();$("#iframe").load(sizeIFrame);});
