newWindowOpen = null;
function autoWindow(src,print)
{
	settings=
	"left=30, "
	+"top=30, "
	+"toolbar=no, "
	+"location=no, "
	+"directories=no, "
	+"status=no, "
	+"menubar=no, "
	+"scrollbars=yes, "
	+"width=100, "
	+"height=100, "
	+"resizable=yes"
	newWindowOpen = window.open("",'_blank',settings);

	if( print == true ){
		var strPrint = 'prePrint();window.close();';
	}else{
		var strPrint = '';
	}
		
	newWindowOpen.document.open();
	newWindowOpen.document.clear();
	newWindowOpen.document.write(
	"<html>\n"
	+"<head>\n"
	+"<title>" + src + "</title>\n"
	+"</head>\n"
	+"<script>\n"
	+"function prePrint() {\n"
	+"if (window.print) window.print();\n"
	+"else if (VBS) printIt();\n"
	+"else alert('This script does not work in your browser');\n"
	+"}\n"
	+"function resize() {\n"
	+"window.resizeTo(document.image.width+30, document.image.height+50);}\n"
	+"</script>\n"
	+"<body topmargin=0 leftmargin=0  bgcolor=#FFFFFF onLoad="+strPrint+">\n"
	+"<center>\n"
	+"<img onclick=\"window.close();\" src=" + src + " align=\"center\" valign=\"middle\" border=\"0\" name=\"image\" id=\"image\" onLoad=resize();><br>\n"
	+"</center>\n"
	+"</body>\n"
	+"</html>"
	);
	
		
	newWindowOpen.document.close();
	newWindowOpen.focus();
}


function autoContentWindow(content)
{
	settings=
	"left=50, "
	+"top=50, "
	+"toolbar=no, "
	+"location=no, "
	+"directories=no, "
	+"status=no, "
	+"menubar=no, "
	+"scrollbars=no, "
	+"width=340, "
	+"height=240, "
	+"resizable=no"
	newWindowOpen = window.open("",'_blank',settings);

	newWindowOpen.document.open();
	newWindowOpen.document.clear();
	newWindowOpen.document.write(
	"<html>\n"
	+"<head>\n"
	+"<title>Przypomnienie</title>\n"
	+"</head>\n"
	+"<body topmargin=0 leftmargin=0  bgcolor=#FFFFFF>\n"
	+"" + content + ""
	+"</body>\n"
	+"</html>"
	);
		
	newWindowOpen.document.close();
	newWindowOpen.focus();
}

function prePrint()
{
	if (window.print) window.print();
	else if (VBS) printIt();
	else alert('This script does not work in your browser');
}


