var loop;
var randy;

function make_array(size)	
{
	this.length = size;
    	for (a=0; a<size; a++) this[a]="";
}

function generieren()	
{
	hold = new make_array(document.lotto.max_number.value);
	
	document.lotto.numbers.value = "";  


	for(loop=0;loop<document.lotto.balls_drawn.value;loop++)
	{
		randy = Math.round(Math.random()*(document.lotto.max_number.value-1));
		randy++;	
		
		if(hold[randy]==1)
		{
			loop--;		
			continue;		
		}

		if(hold[randy]!=1)
		{
			hold[randy]=1;	
		}
		
	
	}

	
	for(loop=0;loop<=document.lotto.max_number.value;loop++)	
	{
		if(hold[loop]==1)
			document.lotto.numbers.value = document.lotto.numbers.value + loop + ", ";
	}
	
}	

