function photo_win(img_path,img_alt){
var str, StrBody;

	str = 'resizable=yes,width=100,height=100,screenX=100,screenY=100,left=100,top=100';
	
	if (document.all){ 
		StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White" onblur="self.window.close();" onresize="self.window.location.reload();">';
	} else {
		StrBody = '<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White" onblur="self.window.close();">';
	}
		
	var win_op = window.open('','show', str);
	win_op.document.open();
	win_op.document.writeln('<html>');
	win_op.document.writeln('<head>');
	win_op.document.writeln('<title>' + img_alt + '</title>');
	win_op.document.writeln('<script>');
	win_op.document.writeln('function resize_img() {');
	win_op.document.writeln('var width = document.image.width;');
	win_op.document.writeln('var height = document.image.height;');
	win_op.document.writeln('if (!(document.all)){ self.resizeTo(width,height); } else { self.resizeTo((width+12),(height + 61));');
	win_op.document.writeln(' }');
	win_op.document.writeln('}');
	win_op.document.writeln('</script>');	
	win_op.document.writeln('</head>');
	win_op.document.writeln(StrBody);
	win_op.document.writeln('<img name="image" src='+ img_path + ' border=0 alt="'+img_alt+'" onload="resize_img();">');
	win_op.document.writeln('</body>');
	win_op.document.writeln('</html>');		
	win_op.document.close();
}
function plan_win(img_path,img_alt){
var str, StrBody;

	str = 'scrollbars=yes, resizable=yes,width=800,height=600,screenX=10,screenY=10,left=10,top=10';
	StrBody = '<body  marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="White">';
	var win_op = window.open('','show_plan', str);
	win_op.document.open();
	win_op.document.writeln('<html>');
	win_op.document.writeln('<head>');
	win_op.document.writeln('<title>' + img_alt + '</title>');
	win_op.document.writeln('</head>');
	win_op.document.writeln(StrBody);
	win_op.document.writeln('<table height="100%" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><img name="image" src="'+ img_path + '" border="0" alt="'+img_alt+'"></td></tr></table>');
	win_op.document.writeln('</body>');
	win_op.document.writeln('</html>');		
	win_op.document.close();
}


// Проверка броузера и установка ширины окна открываемого в нем (для фотогалереи)
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
var agent = navigator.userAgent;

if (agent.indexOf("Opera") > -1) {
	var send_height = 400;
	var send_width = 827;
}
else if ((browserVer >3) && (browserName == "Microsoft Internet Explorer")) {
	var send_height = 400;
	var send_width = 827;
}
else if ((browserVer >3) &&(browserName == "Netscape")) {
	var send_height = 400;
	var send_width = 824;
}

function GetCenterPosition()
{
   var send_left = (screen.availWidth / 2) - (send_width / 2);
   var send_top = (screen.availHeight / 2) - (send_height / 2);

   return "height="+send_height+",width="+send_width+",top="+send_top+",left="+send_left+",toolbar=0,scrollbars=2,resizable=no";
}
function GetCenterPosition_resize()
{
   var send_left = (screen.availWidth / 2) - (send_width / 2);
   var send_top = (screen.availHeight / 2) - (send_height / 2);

   return "height="+send_height+",width="+send_width+",top="+send_top+",left="+send_left+",toolbar=0,scrollbars=2,resizable=yes";
}
