function openPic(srcObj, strExt, copyRight) {
	var text = srcObj.alt
	var fileName = srcObj.src.replace("-thmb", "")
	var strOldExt
	
	if (strExt != undefined) {
		strOldExt = fileName.slice(-3)
		fileName = fileName.replace(strOldExt, strExt)
	}
	
	var oWindow = window.open("about:blank","_blank")
	
	oWindow.document.open()
	oWindow.document.writeln("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'")
	oWindow.document.writeln("'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>")
	oWindow.document.writeln("<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='ru' lang='ru'>")
	oWindow.document.writeln("	<head>")
	oWindow.document.write("		<title>")
	oWindow.document.write(fileName)
	oWindow.document.writeln("</title>")
	oWindow.document.writeln("		<meta http-equiv='content-type' content='text/html; charset=utf-8' />")
	oWindow.document.writeln("		<style type='text/css'>")
	oWindow.document.writeln("			BODY {")
	oWindow.document.writeln("				background-color: #AFAF99;")
	oWindow.document.writeln("				text-align: center;")
	oWindow.document.writeln("			}")
	oWindow.document.writeln("			TABLE {")
	oWindow.document.writeln("				background-color: #ECE8CB;")
	oWindow.document.writeln("				border: 0px solid #2D4747;")
	oWindow.document.writeln("				margin: 0 auto 10px auto;")
	oWindow.document.writeln("			}")
	oWindow.document.writeln("			TD.text {")
	oWindow.document.writeln("				text-align: left;")
	oWindow.document.writeln("				padding: 2px;")
	oWindow.document.writeln("				font: small sans-serif;")
	oWindow.document.writeln("				border: 0px solid black;")
	oWindow.document.writeln("			}")
	oWindow.document.writeln("			TD.copyright {")
	oWindow.document.writeln("				font: italic small arial;")
	oWindow.document.writeln("				background-color: black;")
	oWindow.document.writeln("				color: white;")
	oWindow.document.writeln("				text-align: right;")
	oWindow.document.writeln("			}")
	oWindow.document.writeln("			TD.copyright A {")
	oWindow.document.writeln("				color: yellow;")
	oWindow.document.writeln("				text-decoration: none;")
	oWindow.document.writeln("			}")
	oWindow.document.writeln("			TD.copyright A:hover {")
	oWindow.document.writeln("				text-decoration: underline;")
	oWindow.document.writeln("			}")
	oWindow.document.writeln("		</style>")
	oWindow.document.writeln("	</head>")
	oWindow.document.writeln("	<body>")
	oWindow.document.writeln("		<table id='bigPicTable' cellpadding='1px' cellspacing='0' width='400px'>")
	oWindow.document.writeln("			<tr>")
	oWindow.document.write("				<td style='text-align: center;'><img src='")
	oWindow.document.write(fileName)
	oWindow.document.writeln("' alt='' /></td>")	
	oWindow.document.writeln("			</tr>")
	if (text != undefined) {
		oWindow.document.writeln("			<tr>")
		oWindow.document.write("				<td class='text'>")
		oWindow.document.write(text)
		oWindow.document.writeln("</td>")
		oWindow.document.writeln("			</tr>")
	}
	if (copyRight != undefined) {
		oWindow.document.writeln("			<tr>")
		oWindow.document.write("				<td class='copyright'>")
		oWindow.document.write(copyRight)
		oWindow.document.writeln("</td>")
		oWindow.document.writeln("			</tr>")
	}
	oWindow.document.writeln("		</table>")
	oWindow.document.writeln("		<form action=''><input type='button' value='Закрыть' onclick='self.close()' /></form>")
	oWindow.document.writeln("	</body>")
	oWindow.document.writeln("</html>")
	oWindow.document.close()
	
	if (window.focus) {
		oWindow.focus()
	}
}

