var openwindow;

function window_available() {
    if (!openwindow) {
        return false;
    }
    else if (openwindow.closed) {
        return false;
    }
    else {
        return true;
    }
}

function openFullPic(theURL,winName,w,h,title) {

  var left = ((screen.width-w)/2)-40;
  var top = ((screen.height-h)/2)-40;
  
  w=w+70;
  h=h+70; feat_full='resizable=no,location=no,menubar=yes,scrollbars=yes,status=yes,left='+left+',top='+top+',toolbar=yes,fullscreen=no, dependent=no, width='+w+', height='+h+'';
  
if (window_available()) {
   openwindow.close();
   }

	openwindow=window.open("","",feat_full);
	openwindow.document.write("<HTML><HEAD><TITLE>Полноразмерное изображение</TITLE> ");
	openwindow.document.write('<META http-equiv="Content-Type" content="text/html; charset=windows-1251"> ');
	openwindow.document.write("<STYLE> body {font-family: Arial, Verdana;}; </STYLE> ");
	openwindow.document.write('<LINK href="/css/main.css" type="text/css" rel="stylesheet">');
	openwindow.document.write("</HEAD><BODY style='margin-top: 10px; margin-bottom: 0px;'>");
	openwindow.document.write("<DIV align='center'><A style='color: #0000FF;' HREF='#' onclick='window.close();' title='Закрыть окно'><IMG style='border: 1px solid #999;' src='"+theURL+"'></A></DIV><DIV class='films' style='margin-top: 10px; margin-bottom: 0px;'>");
	if (title=="") {
	  	openwindow.document.write("<P align='center' style='font-size: 80%;'><A HREF='#' onclick='window.close();'>Закрыть окно</A></P>");
	} else {
	 	openwindow.document.write("<P align='center' style='font-size: 80%;'><A HREF='#' onclick='window.close();' title='Закрыть окно'>"+title+"</A></P>");
	}
	openwindow.document.write("</DIV></BODY></HTML>");
	openwindow.document.close();
  return false;
}
