function newWin(foto, d)
{
	nImage = new Image();
  	nImage.src = foto;
  	width = screen.width;
  	height = screen.height;
  	i = nImage.width;
  	j = nImage.height;
  	k = 'no';
   	while (i >= width || j >= height)
    {
       		if (i > j )
       		{
       			i = i - 40;
       			j = j - 30;
       		}
       		else
       		{
       			j = j - 40;
       			i = i - 30;
       		}
       		k = 'yes';
    }
    if (width == 0 || height == 0 )
    {
       	i = 800;
        j = 600;
        k = 'yes';
    }
    if (i > j)
    {
    	i = i - 80;
    	j = j - 60;
    }
    else
    {
    	j = j - 80;
       	i = i - 60;
    }
    
  	myWin= open("", "_blank", 
  	"width="+i+",height="+j+",status=no,toolbar=no,menubar=no,scrollbars="+k+",resizable="+k+"");
  	myWin.document.open();
  	myWin.document.write("<html><head><title>");
  	if (foto.charAt(9) == "k")
  	{
  		myWin.document.write("День ",foto.charAt(12));
  		if (foto.charAt(13) =="0")
  		{
  			myWin.document.write("0");	
  		}
  		myWin.document.write(" -- ",d.toString());
  	}
  	else myWin.document.write(" Фото ");
  	
  	myWin.document.write("</title></head><body bgcolor='#C0C0C0' leftmargin='7'><div align='center' style='margin-left: 10; margin-top: 10'><img border='0' width="+i+" height="+j+" src=' ");
  	myWin.document.write(foto);
  	myWin.document.write("'></div></body></html>");
  	myWin.document.close();}
 
function statusbar(n)
{
	if(n ==1)
	{
		status = "  Нажмите для просмотра фотографии полного размера в новом окне"
	}
	else
	{
		status = "  © zorkKiy 2005"
	}}
