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+95; feat_full='resizable=0,location=0,menubar=0,scrollbars=0,status=0,left='+left+',top='+top+',toolbar=0,fullscreen=0, dependent=0, 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('<LINK href="/css/main.css" type="text/css" rel="stylesheet">');
	openwindow.document.write("</HEAD><BODY>");
	openwindow.document.write("<DIV align='center' style = 'margin-top : 25px;'><A HREF='#' onclick='window.close();' title='Закрыть окно'><IMG style='border: 1px solid #CCCCCC;' src='"+theURL+"'></A></DIV><DIV>");
	if (title=="") {
	  	openwindow.document.write("<P align='center'><A HREF='#' onclick='window.close();'>Закрыть окно</A></P>");
	} else {
	 	openwindow.document.write("<P align='center'><A HREF='#' onclick='window.close();' title='Закрыть окно'>"+title+"</A></P>");
	}
	openwindow.document.write("</DIV></BODY></HTML>");
	openwindow.document.close();
  return false;
}

