<!-- Begin

var InLottery = prompt ("What is the name for your lottery?","");

document.write('<font size=4>'+"Here are the results of the"+'<br>'+InLottery+'</font>');

var InNumPrizes = prompt ("How many prizes are up for grab?","");

Prizes= new Array();

for(tell=0;tell<InNumPrizes;tell+=1){
	var InPrize = prompt ("Name of Prize? (max 20 characters)","");
	Prizes[tell]=InPrize;
	}

var InNumLots = prompt ("How many lots did you sell?","");

Lots= new Array();

for(tell=0;tell<InNumLots;tell+=1){
	var InLots = prompt ("Lot identification - type name or number","");
	Lots[tell]=InLots;
	}

if(Lots.length>Prizes.length){


Winner= new Array();

for(kont=0;kont<InNumPrizes;kont+=1){
	Winner[kont]="";
	}

for(tell=0;tell<InNumPrizes;tell+=1){
	var rand_int= Math.floor(Math.random()*Lots.length);
	status=1;
	for(kontroll=0;kontroll<InNumPrizes;kontroll+=1){
		if(Lots[rand_int]==Winner[kontroll]){	status=0;	}
		}
	if(status==1){
		Winner[tell]=Lots[rand_int];
		}
	else{	
		tell-=1;
		//document.write("ERROR");
		}
	}

for(tell=0;tell<InNumPrizes;tell+=1){
	document.write('<p><b>'+(tell+1)+". Prize: "+Prizes[tell]+":"+'<p>'+"Winner: "+Winner[tell]+'<b>');
	}

}

else{
	document.write('<p><p>'+"Sorry, but you sold only "+InNumLots+" lots for "+InNumPrizes+" prizes. That is not enough."+'<p>');
	}


// End -->


