
var img_base;
var pic_dir;

/*********************************************************************
	mixes up n elements of nArray starting at element startAt
**********************************************************************/
function shuffle( nArray, startAt, n )
{
	var i, j, swap;
	
	for (i = startAt; i < startAt + n; i++)
	{
		j = startAt + Math.round(Math.random() * (n - 1));
		swap = nArray[i];
		nArray[i] = nArray[j];
		nArray[j] = swap;
	}
}

function showGreek( str, max, colour )
{
	var	i;

	for (i=0; i < str.length; i++)
	{
		n = str.charCodeAt( i ) & 0xff;
		n = n.toString(16);
		document.images[img_base+i].src = pic_dir + n +
			colour + ".png";
	}
	for (i=str.length; i<max; i++)
	{
		document.images[img_base+i].src = pic_dir + "20.png";
	}
}

function showGreekRJ( str, max, colour )
{
	var	i, offset;

	offset = max - str.length;
	for (i=0; i<offset; i++)
	{
		document.images[img_base+i].src = pic_dir + "20.png";
	}

	for (i=0; i < str.length; i++)
	{
		n = str.charCodeAt( i ) && 0xff;
		if (n > 128)
		{
			n -= 0x30;
		}
		n = n.toString(16);
		document.images[img_base+(offset+i)].src = pic_dir + n +
			colour + ".png";
	}
}



