
var sp_wt = 330;
var imagesinrow =4;
if (screen.width < 1280 )
	{
	imagesinrow =3;
	sp_wt = 278;
	}

var osp_wt = sp_wt*2;



function pr(arrayName, value) 
 { var nextElement = arrayName.length;
 arrayName[nextElement] = value; };




var family_first = new Array();
var family_last = new Array();
var family_lat = new Array();
var family_rus = new Array();
var family_eng = new Array();



for ( var j = 0; j<= lat.length-1; j++)
	{
 	if (fam[j] != 0) 
		{
		for ( var k = 0; k<= fam_indic.length-1; k++)
		{
		if ( fam[j] == fam_indic[k] ) 
			{
			pr(family_lat, fam_lat[k]);
			pr(family_eng, fam_eng[k]); 
			pr(family_first, j);
			}
		}
		}
	}

var numb_family = family_lat.length;
for ( var k = 0; k< numb_family-1; k++)
	{
	pr(family_last, family_first[k+1]-1);
	}
pr(family_last, lat.length - 1 );



function print_species(i) 
{ 
var link_begin = '';
var link_end = '';
if (photo[i] != 0)
	{
	var addspace = '';
	if (photo[i] == 2) addspace = '<UL>';
	link_begin = addspace + '<A HREF="' + lat[i] + '/indexe.html">';
	link_end = "</A>";
	}
document.write( '<TR>');
document.write( '<TD ALIGN=LEFT VALIGN=TOP VALIGN=TOP WIDTH=' + sp_wt +'><I>' + link_begin + lat[i] + link_end + '</I></TD>');
document.write( '<TD ALIGN=LEFT VALIGN=TOP VALIGN=TOP WIDTH=' + sp_wt +'><B>' + link_begin + eng[i] + link_end + '</B></TD>');
document.write( '</TR>');

}


function print_image(i) 
{ 
link_begin = '<A HREF="' + lat[i] + '/indexe.html">';
link_end = "</A>";
document.write( '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3 ALIGN=LEFT WIDTH=100><TR><TD><CENTER>');
document.write( link_begin +'<IMG SRC="' + lat[i] + '.jpg" ALT="' + lat[i] + '" border=1 width=100><BR><SPAN CLASS=copyright>'+ eng[i]+ link_end);
document.write( '</CENTER></TD</TR></TABLE>');
}






function print_family(l) 

{ 
var first = family_first[l];
var last = family_last[l];
var counter = 0;

document.write( '<TABLE BORDER=0>');
document.write( '<TR><TD COLSPAN=2><A NAME="' + family_lat[l] + '"></A><DIV CLASS=research><B>' + family_lat[l] + '</B> |  ' + family_eng[l] + '</DIV><HR></TD></TR>' );

document.write( '<TR><TD WIDTH=' + osp_wt +' VALIGN=TOP><TABLE border=0>');
for ( var k1 = first; k1<= last; k1++)
	{
	print_species( k1 );
	}
document.write( '</TABLE></TD>');

document.write( '<TD VALIGN=TOP>');
for ( var k1 = first; k1<= last; k1++)
	{
	if (photo[k1] == 1)
		{	
		print_image( k1 );
		counter = counter + 1;
		}
	if ( counter == imagesinrow )
		{
		document.write ('<BR clear=all>');
		counter = 0;
		}
	}
document.write( '</TD></TR>');



document.write( '</TABLE>');
}

