function openWin(href,w,h,scroll)
{
	var left=(window.screen.width-w)>>1;
	var top=(window.screen.height-h)>>1;
	window.open(href,"_blank","left="+left+",top="+top+",width="+w+",height="+h+",toolbar=no,scrollbars="+scroll+",location=no,resizable=yes");
//	return false;
}


var isNN,isIE;
if ( parseInt( navigator.appVersion.charAt( 0 ) ) >= 4 ){
	isNN = ( navigator.appName == "Netscape" ) ? 1 : 0;
	isIE = ( navigator.appName.indexOf( "Microsoft" ) != -1 ) ? 1 : 0;
}
function reSizeToImage( ){
	if ( isNN ){
		width = document.images["obrazek"].width;
		height = document.images["obrazek"].height;

		if( width > screen.availWidth ){
			width = screen.availWidth - screen.availWidth/5;
			document.body.scroll = "yes";
		}
		if( height > screen.availHeight ){
			height = screen.availHeight - screen.availHeight/5;
		document.body.scroll = "yes";
		}
		window.innerWidth =		width;
		window.innerHeight =	height;
	}
	else {
		window.resizeTo( 100, 100 );
		width =		100 - ( document.body.clientWidth - document.images[0].width );
		height =	100 - ( document.body.clientHeight - document.images[0].height );

		if( width > screen.availWidth ){
			width = screen.availWidth - screen.availWidth / 5;
			document.body.scroll = "yes";
		}
		if( height > screen.availHeight ){
			height = screen.availHeight - screen.availHeight / 5;
		document.body.scroll = "yes";
		}
		window.resizeTo( width, height );
	}

  moveWindowToImage( width, height );

}
function moveWindowToImage( iWindowWidth, iWindowHeight ){

  var iPosX = ( screen.availWidth - iWindowWidth ) / 2;
  var iPosY = ( screen.availHeight - iWindowHeight ) / 2;

  window.moveTo( iPosX, iPosY );

} // end function moveWindowImage
function doTitle( ){
	document.title = "Foto";
}
