var minWidth=776;
var maxWidth=1000;

var dom=(document.getElementById) ? 1 : 0;
var nn4=(document.layers) ? 1 : 0;
var opera=(window.opera) ? 1 : 0; 
var ie=(document.all && !opera) ? 1 : 0;


function LivePageWidth() {
 if (window.innerWidth!= null)
  return window.innerWidth;
 if (document.body.clientWidth!= null)
  return document.body.clientWidth;
 return screen.availWidth;
}

function myResize(){
  var lm=0, intBox=0;
  var innerWidth=LivePageWidth();

  if (opera) innerWidth=innerWidth-9;
  else { if (!ie) innerWidth=innerWidth-20;}

  window.status=innerWidth;  

  var obj=document.getElementById('spacer1');
  if (!obj) return intBox;
  var img1=document.getElementById('tisch1');
  var img2=document.getElementById('tisch2');

  if (innerWidth>=minWidth) {
     if (innerWidth>maxWidth) {
       lm = 80; intBox=maxWidth;
     } else {   intBox=innerWidth;}
  }
  else { 
   lm=0; intBox=minWidth;
  } 
  obj.style.width=(intBox-45);

  if (!img1 || !img2) return (intBox-45);

  if (innerWidth>=minWidth && innerWidth<825) lm= innerWidth / 15 - 23;
  if (innerWidth>=825 && innerWidth<900) lm = innerWidth / 12 - 30;  /* // */
  if (innerWidth>=900 && innerWidth<960) lm = innerWidth / 10 - 36;  /* // */
  if (innerWidth>=960 && innerWidth<980) lm = innerWidth / 9 - 50;  /* // */
  if (innerWidth>=980 && innerWidth<1000) lm = innerWidth / 7 - 66;  /* // */
/*   window.status=innerWidth +'|'+ lm;  */
  if (img1) { img1.style.marginLeft= lm; }
  if (img2) { img2.style.marginLeft= lm; }

  return (intBox-45);;
}

//window.onresize = myResize;
//document.onload = myResize; window.onload = myResize;