var y = 0;
var i ;
var x = 10;
var arr = [];
var z = 0;

pic_type = "small";
pic_count = "8";

if ( pic_count >= 10) { x = 100;}
else { x = 10;}

//document.write('<table border ="0" width="130" height="90"><tr>');
for (i=1;i<2;i++)
 {
        while ( y >= pic_count || y < 1 )
	{
	  y = Math.random();
	  y = y * x;
	  y = Math.round(y);
	}

        for (el in arr)
	{
	  if (arr[el] == y)
	  {
           i = i-1;
           z = 1;
          }
	}
        if (z == 0)
	{
	 arr[i] = y;
	 // document.write('<td width="25%" align ="center" style="padding-right:5px;"><img width="120" height="80" src=/'+pic_type+y+'.jpg></td>');
	 document.write('<img width="120" height="80" src=/'+pic_type+y+'.jpg>');
	 y = 0;
	}
        else
	{
          z = 0;
          y = 0;
	}

 }
 // document.write('</tr></table>');

