function position() {
   hoehe=(document.body.clientHeight-582)/2;
   if (hoehe>0) { document.getElementById('container').style.marginTop=hoehe+'px'; }
}

akt_pic = 0;
function picswitch(where,site,alt) {
  var picid = where.substr((where.length-3),1);
  var bla = where.substr(0,(where.length-3));
  if (akt_pic != picid) {
    document.getElementById('pic0').style.backgroundImage = 'url('+site+'/images/'+bla+picid+'.jpg)';
    document.getElementById(bla+akt_pic+'_k').src = site+'/images/'+bla+akt_pic+'_k.jpg';
    document.getElementById(bla+picid+'_k').src = site+'/images/'+bla+picid+'_k_on.jpg';
    if (alt) {
      document.getElementById('pic0').title = alt;
    }
    akt_pic = picid;
    if (bla == 'lage') {
      if (picid == '0') {
        document.getElementById('legende').style.visibility = 'visible';
      } else {
        document.getElementById('legende').style.visibility = 'hidden';
      }
      if (picid == '1') {
        document.getElementById('lupe').style.visibility = 'visible';
      } else {
        document.getElementById('lupe').style.visibility = 'hidden';
      }
    }
  }
}

function popup(site,picture,width,height) {
  F1=window.open('','','top=10,left=10,width='+width+',height='+height+',dependent=yes,location=no,hotkeys=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
  var html = '';
  html += '<html>';
  html += '  <head>';
  html += '    <title>Hotel Enzian</title>';
  html += '  </head>';
  html += '  <body style="cursor:pointer;margin:0px;padding:0px;background-image:url('+site+'/images/'+picture+');" onclick="self.close();">';
  html += '  </body>';
  html += '</html>';
  F1.document.write(html);
}

function init(sp) {
  overimg=0;
  browsertyp=1;
  scrollspeed=sp;
  if (document.getElementById) {
    browsertyp=3;
  } else if(document.layers) {
    browsertyp=2;
  } else if(document.all) {
    browsertyp=1;
  }
  pos=0;
  if (browsertyp==1) {
    if (inner) {
      inner.style.left=pos+'px';
    }
  } else if (browsertyp==2) {
    if(document.layers.inner) {
      document.layers.inner.style.left=pos+'px';
    }
  } else if (browsertyp==3) {
    if(document.getElementById('inner')) {
      document.getElementById('inner').style.left=pos+'px';
    }
  }
}

function scroll_left() {
  var flag=false;
  if (browsertyp==1 && inner.style.left) {
    x=inner.style.left;
    flag=true;
  } else if (browsertyp==2 && document.layers.inner.style.left) {
    x=document.layers.inner.style.left;
    flag=true;
  } else if (browsertyp==3 && document.getElementById('inner').style.left) {
    x=document.getElementById('inner').style.left;
    flag=true;
  }
  if (flag==true) {
    x=parseInt(x.substring(0, (x.length-2)));
    if (x<0) {
  	  x=x+2;
  	  if (browsertyp==1) {
  	    inner.style.left=x+'px';
  	  } else if (browsertyp==2) {
  	    document.layers.inner.style.left=x+'px';
  	  } else if (browsertyp==3) {
  	    document.getElementById('inner').style.left=x+'px';
  	  }
  	  if (over==1) {
  	    setTimeout("scroll_left();",scrollspeed);
  	  }
    }
  }
}

function scroll_right() {
  var iw=0;
  if (browsertyp==1 && tabelle.offsetWidth) {
    iw=tabelle.offsetWidth;
  } else if (browsertyp==2 && document.layers.tabelle.offsetWidth) {
    iw=document.layers.tabelle.offsetWidth;
  } else if (browsertyp==3 && document.getElementById('tabelle').offsetWidth) {
    iw=document.getElementById('tabelle').offsetWidth;
  }
  if (iw) {
    xlimit=iw-document.getElementById('outer').offsetWidth;
    if (xlimit>0) {
      xlimit=(-1)*xlimit;
    } else {
      xlimit=0;
    }
    if (browsertyp==1) {
      x=inner.style.left;
    } else if (browsertyp==2) {
      x=document.layers.inner.style.left;
    } else if (browsertyp==3) {
      x=document.getElementById('inner').style.left;
    }
    x=parseInt(x.substring(0, (x.length-2)));
    if (x>xlimit) {
  	  x=x-2;
  	  if (browsertyp==1) { inner.style.left=x+'px'; }
  	  else if (browsertyp==2) { document.layers.inner.style.left=x+'px'; }
  	  else if (browsertyp==3) { document.getElementById('inner').style.left=x+'px'; }
  	  if (over==1) { setTimeout("scroll_right("+xlimit+");",scrollspeed); }
    }
  }
}

init(20);

var scroll=1;
var merkpos=1;

function getposy() {
  var pos = 0;
  if (window.innerHeight) {
    pos = window.pageYOffset
  } else if (document.documentElement && document.documentElement.scrollTop) {
    pos = document.documentElement.scrollTop
  } else if (document.body) {
    pos = document.body.scrollTop
  }
  return pos;
}

function doscroll(pos,oldpos) {
  window.scrollTo(0,pos);
  if (oldpos==getposy()) {
    pos=0;
  }
  if (scroll==1) {
    setTimeout('doscroll('+(pos+1)+','+getposy()+')',20);
  }
}