parent.name="start"; 
geoeffnet = false;
pruefung ="";
scaled=false;

wantedwidth=1050;
wantedheight=720;

restorewidth=1000;
restoreheight=700;

function init()
 {
 ie = (document.all)? true:false;
 ns = (document.layers)? true:false;
 
/* if (ns)
 {
  restorex=parent.outerWidth;
  restorey=parent.outerHeight;
 }
 if (ie)
 {
  restorex=document.body.offsetWidth;
  restorey=document.body.offsetHeight+100;
 }
 alert(restorex);
 alert(restorey);
 
 if (!restorex)
  restorex=restorewidth;
 if (!restorey)
  restorey=restoreheight;
 restorewidth=restorex;
 restoreheight=restorey;
*/
 if (restorewidth+20>screen.availWidth)
   restorewidth=screen.availWidth-20;
 if (restoreheight+20>screen.availHeight)
   restoreheight=screen.availHeight-20;
 if (wantedwidth+20>screen.availWidth)
 {
  scaled=true;
  width=screen.availWidth-20;
  height=Math.round(width*(wantedheight/wantedwidth));
 }
 else
 {
  width=wantedwidth;  
  height=wantedheight;
 } 
}

function openpage(html, htmlscaled)
 {
 init();
 geoeffnet = true;
  {
  width=screen.availWidth-50;
  height=screen.availHeight-50;

  x=Math.round(screen.availWidth/2-width/2);
  y=Math.round(screen.availHeight/2-height/2);
  command="height="+height+",width="+width+",hotkeys=no,locationbar=no,menubar=no,resizable=no,status=no";
  if (!scaled) 
   inhalt=window.open(html,"inhalt",command);

  else
   inhalt=window.open(htmlscaled,"inhalt",command);
 
//  inhalt=window.open(html,"inhalt","height=200,width=300,hotkeys=no,locationbar=no,menubar=no,resizable=no,status=no");
  // inhalt.innerHeight=height;	
 // inhalt.innerWidth=width;
  }
 if (String(inhalt) != "undefined" && String(inhalt) != "null" && String(inhalt) != "")
 {
  inhalt.stamm=parent;
  inhalt.moveTo(x,y);
  parent.resizeTo(100,100);
  parent.outerHeight=100;
  parent.outerWidth=100;
  parent.moveTo(x+50,y+50);
  zeige();
  //if (resetpruefung != Null) clearInterval(resetpruefung);
  resetpruefung = setInterval("checkstatus()",500); 
 }
 else
 {
  parent.location.href = htmlscaled;
 }
}
 
function checkstatus()
 {
 if (inhalt.closed)
  {
  reset();
  }
 }
 
function reset()
 {
// alert(pruefung);
// alert(restoreheight);
 clearInterval(resetpruefung);
  {
  x=Math.round(screen.availWidth/2-restorewidth/2);
  y=Math.round(screen.availHeight/2-restoreheight/2);
  
  parent.resizeTo(restorewidth,restoreheight);
  parent.outerHeight=restoreheight;
  parent.outerWidth=restorewidth;
  parent.moveTo(x,y);
  }
 geoeffnet = false;
 parent.focus();
 }
function zeige()
 {
 inhalt.focus();
 }