var x,y;

function qbInnerWidthHeight(){
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	return new Array(x,y);
}

function qbWin(url,w,h,name,modus) {
if(!name) name = "_qbWinOnFly";
  if (document.images){
    if(modus == 'max' || modus == 'maxWidth' || modus == 'maxHeight') aInnerWidthHeight = qbInnerWidthHeight();
    if(modus == 'max' || modus == 'maxWidth') w = (w > aInnerWidthHeight[x]-20) ? aInnerWidthHeight[x]-20 : w;
    if(modus == 'max' || modus == 'maxHeight') h = (h > aInnerWidthHeight[y]-20) ? aInnerWidthHeight[y]-20 : h;
    qbWinOnFly=window.open(url, name ,'width=' + w + ',height=' + h + ',screenX=10,screenY=10,status=yes,menubar=no,resizable=yes,locationbar=no,scrollbars=yes');
    setTimeout("qbWinOnFly.focus()",300);
    return false;
	}
  return true;
}
