function position() {
  document.getElementById('bg_left_'+seitenlayout).style.width=document.getElementById('alldiv').offsetLeft+'px';
  document.getElementById('bg_right_'+seitenlayout).style.left=document.getElementById('alldiv').offsetLeft+922+'px';
  if (document.getElementById('widthtest').offsetWidth-(document.getElementById('alldiv').offsetLeft+922) > 0) {
    document.getElementById('bg_right_'+seitenlayout).style.width=document.getElementById('widthtest').offsetWidth-(document.getElementById('alldiv').offsetLeft+922)+'px';
  }
  if ((navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/7\.0/)) || (navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/8\.0/)) || (navigator.userAgent.match(/opera/i)) || (navigator.userAgent.match(/firefox/i))) {
    var tmp=document.getElementById('alldiv').offsetHeight;
    document.getElementById('menue_links_'+seitenlayout).style.height=(tmp-321)+'px';
    document.getElementById('menue_rechts_'+seitenlayout).style.height=(tmp-606)+'px';
    document.getElementById('bg_left_var').style.height=(tmp-274)+'px';
    document.getElementById('bg_right_var').style.height=(tmp-274)+'px';
  } else if (navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6\.0/)) {
    var tmp=document.getElementById('alldiv').offsetHeight;
    document.getElementById('menue_links_'+seitenlayout).style.height=(tmp-274)+'px';
    document.getElementById('menue_rechts_'+seitenlayout).style.height=(tmp-606)+'px';
    document.getElementById('bg_left_var').style.height=(tmp-274)+'px';
    document.getElementById('bg_right_var').style.height=(tmp-274)+'px';
  }
}

function menueOn(id,seitenlayout) {
  document.getElementById('menue_links_'+id).className='menue_linie_on_'+seitenlayout;
}

function menueOff(id,seitenlayout) {
  document.getElementById('menue_links_'+id).className='menue_linie_off_'+seitenlayout;
}

function popup(picture,width,height) {
  width=parseInt(width)+parseInt(60);
  height=parseInt(height)+parseInt(60);
  F1=window.open('','F1','width='+width+',height='+height+',top=50,left=50,dependent=yes,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
  var str='';
  str+='<?xml version="1.0" encoding="utf-8"?>';
  str+='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
  str+='<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">';
  str+='  <head>';
  str+='    <title>Hotel Lagorai</title>';
  str+='  </head>';
  str+='  <body style="padding:0px;margin:0px;background-image:url(\''+picture+'\');background-repeat:no-repeat;background-position: 30px 30px;">';
  str+='  </body>';
  str+='</html>';
  F1.document.write(str);
}

function popupHTML(html,width,height) {
  window.open('zimmerfoto_'+html+'.htm','F1','width='+width+',height='+height+',top=0,left=0,dependent=yes,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
}

function scroll_left() {
  if (navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6\.0/i)) {
    x=parseInt(document.getElementById('inner').style.left);
  } else {
    x=parseInt(document.getElementById('inner').style.marginLeft);
  }
  if (x>((document.getElementById('tabelle').offsetWidth-document.getElementById('outer').offsetWidth)*-1)) {
	  x=x-2;
	  if (navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6\.0/i)) {
	    document.getElementById('inner').style.position='relative';
	    document.getElementById('inner').style.left=x+'px';
	  } else {
	    document.getElementById('inner').style.marginLeft=x+'px';
	  }
	  if (over==1) {
	    setTimeout("scroll_left();",1);
	  }
  }
}

function scroll_right() {
  iw=document.getElementById('tabelle').offsetWidth;
  if (iw) {
    xlimit=iw-document.getElementById('outer').offsetWidth;
    if (xlimit>0) {
      xlimit=(-1)*xlimit;
    } else {
      xlimit=0;
    }
    if (navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6\.0/i)) {
      x=parseInt(document.getElementById('inner').style.left);
    } else {
      x=parseInt(document.getElementById('inner').style.marginLeft);
    }
    if (x<0) {
  	  x=x+2;
  	  if (navigator.userAgent.match(/msie/i) && navigator.userAgent.match(/6\.0/i)) {
  	    document.getElementById('inner').style.left=x+'px';
  	  } else {
	      document.getElementById('inner').style.marginLeft=x+'px';
  	  }
  	  if (over==1) {
  	    setTimeout("scroll_right("+xlimit+");",1);
  	  }
    }
  }
}
