function popup_image(url, w, h, name, author_name, owner, sel) {

	wWidth = w + 100;
	wHeight = h + 150;
	if (wWidth > screen.width) wWidth = screen.width - 100;
	if (wHeight > screen.height) wHeight = screen.height - 200;

	wnd=window.open("", "imgWin", 'width=' + wWidth + ',height=' + wHeight + ',resizable=1,scrollbars=1,toolbar=no,menubar=no');
	wnd.document.write('<html><head><title>'+name+' - Украинская селекция</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
//	if ( nocache == 'nocache' ) {
//		wnd.document.write('<meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Pragma" content="no-cache">');
//	}
	wnd.document.write('<link rel="StyleSheet" type="text/css" href="/main.css"></head><body>');
  wnd.document.write('<table border=0 width=100%><tr><td width=100% class=title-center>'+name+'</td></tr>');
  wnd.document.write('<table border=0 width=100%><tr><td width=100% class=title-center>Селекционер: '+sel+'</td></tr>');
  wnd.document.write('<tr><td class=title-center>Автор фото: '+author_name+'</td></tr>');
  wnd.document.write('<tr><td class=title-center>Коллекционер: '+owner+'</td></tr></table>');	
	wnd.document.write('<div align="center" class="mediumtext"><br><a class="small_link" href="javascript:window.close();">');
	//wnd.document.write('<img id="orImage" src="'+ url + '" width="' + w + '" height="' + h + '" border="0" alt="">');
  wnd.document.write('<img id="orImage" src="'+ url + '" border="0" alt="">');	
	wnd.document.write('<br><br>Закрыть окно</a>');
	wnd.document.write('</div>');
	wnd.document.write('</body></html>');
	wnd.document.close();
	wnd.focus();

}

function viewImage(src)
{
// загружаем изображение
 prevImg = new Image();
 prevImg.src = src;
// получаем высоту и ширину
 w = prevImg.width;
 h = prevImg.height;
 viewer = window.open(src, "win", "width=" + w + ",height=" + h + "toolbar=no,status=no,scrollbars=no,menubar=no,resizable=no");
}

function view1(name, x, y) {
newwin = window.open("","win","width="+(x+5)+",height="+(y+5));
newwin.document.write('<html><head><title>Screen</title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><a href="javascript:window.close()"><img src='+name+' alt="Закрыть окно" title="Закрыть окно"></a></body></html>');
}

function view(name, x, y) {
newwin = window.open("","win","width="+(x+5)+",height="+(y+5));
newwin.document.write('<html><head><title>Screen</title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><img src='+name+' alt="Закрыть окно"></body></html>');
}

function ViewImg(name, sort_name) {
MyImg = new Image();
MyImg.src=name;
X = MyImg.width;
Y = MyImg.height;
if (X==0||Y==0) {X=640; Y=480;}
//alert("width="+X+", heigth="+Y);
newwin = window.open("","win","width="+(X+5)+",height="+(Y+5));
newwin.document.write('<html><head><title>'+sort_name+'</title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0><img src='+name+' alt="Закрыть окно"></body></html>');
newwin.focus();
//alert(X);
}

function ShowImg(name, title, w, h) {
MyImg = new Image();
MyImg.src=name;
//w = MyImg.width;
//h = MyImg.height;
url = name;

	wWidth = w + 75;
	wHeight = h + 140;
	if (wWidth > screen.width) wWidth = screen.width - 100;
	if (wHeight > screen.height) wHeight = screen.height - 200;

	wnd=window.open("", "imgWin", 'width=' + wWidth + ',height=' + wHeight + ',resizable=1,scrollbars=1,toolbar=no,menubar=no');
	wnd.document.write('<html><head><title>Первая Всеукраинская Выставка Сенполий. Фоторепортаж.</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
//	if ( nocache == 'nocache' ) {
//		wnd.document.write('<meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Pragma" content="no-cache">');
//	}
	wnd.document.write('<link rel="StyleSheet" type="text/css" href="main.css"></head><body class="body_show">');
	wnd.document.write('<link rel="StyleSheet" type="text/css" href="fooby.css"></head><body>');
  wnd.document.write('<div class="center_show"><div id="pic" class="content_show" style="width: '+ w + 'px;"><img src="'+ url + '" width="' + w + '" height="' + h + '" alt="IMG_4172.JPG"><br></div>');	
  wnd.document.write('<div id="caption" class="content_show" style="width: '+ w + 'px;"><b>'+ title +'</b></div>');	
	wnd.document.write('<div><a class="small_link" href="javascript:window.close();"></div>');
	//wnd.document.write('<img id="orImage" src="'+ url + '" width="' + w + '" height="' + h + '" border="0" alt="">');
  //wnd.document.write('<img id="orImage" src="'+ url + '" border="0" alt="">');	
	wnd.document.write('<br>Закрыть окно</a>');
	wnd.document.write('</div>');
	wnd.document.write('</body></html>');
	wnd.document.close();
	wnd.focus();


}

