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;
  divw=w-150;
  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_in.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: 0' src='"+theURL+"' alt=''></A></DIV><DIV align='center' style='width:"+divw+"px'>");
	if (title=="") {
	} else {
	 	/*openwindow.document.write("<P style='color:#9e9e9e; font-size: 80%'>"+title+"<br><A HREF='#' onclick='window.close();' title='Закрыть окно'>Закрыть окно</A></P>");*/
	}
	openwindow.document.write("</DIV></BODY></HTML>");
	openwindow.document.close();
  return false;
}
