<html>
<head>
<style type="text/css">
.a1{
position:relative;
font-family:Verdana;
font-size:20px;
color:#888888;
}
</style>
<script language="JavaScript">
var totalnumbers=4 //input total numbers to generate
var lowerbound=1 //input lower bound for each random number
var upperbound=49 //input upper bound for each random number
function lotto(){
B=' ';
LottoNumbers=new Array();
for (i = 1; i <= totalnumbers; i++)
{
RandomNumber = Math.round(lowerbound+Math.random()*(upperbound-lowerbound));
for (j = 1; j <= totalnumbers; j)
{
if (RandomNumber == LottoNumbers[j])
{
RandomNumber=Math.round(lowerbound+Math.random()*(upperbound-lowerbound));
j=0;
}
j++;
}
LottoNumbers=RandomNumber;
}
LottoNumbers=LottoNumbers.toString();
X=LottoNumbers.split(',');
for (i=0; i < X.length; i++)
{
X=X+' ';
if (X.length==2)
X='0'+X;
}
X=X.sort();
for (i=0; i < X.length; i++)
{
OutPut=B+=X;
}
if (document.all)document.all.layer1.innerHTML=OutPut;
if (document.getElementById)document.getElementById("layer1").innerHTML=OutPut;
if (document.layers){
document.layers.layer1.document.open();
document.layers.layer1.document.write("<span style='position:absolute;top:0px;left:0px;font-family:Verdana;font-size:20px;color:#888888;text-align:center'> "+OutPut+"</span>");
document.layers.layer1.document.close();
}
T=setTimeout('lotto()',20);
//window.status=OutPut;
}
function StOp(){
setTimeout('clearTimeout(T)',1000);
}
//-->
</script>
</head>
<body>
<table border='0' width=250 height=50>
<tr valign='middle'>
<td align='center'>
<form name=form>
<input type=button value='Lottery Number Picker' onClick="lotto();StOp()">
</form>
<span id=layer1 class=a1>Result</span>
</td>
</tr>
</table>
</body>
</html>