PDA

View Full Version : California Super Lottery Plus Number Picker



cucunusa
09-10-2006, 07:58 PM
1) California Super Lottery Plus Number Picker:

2) Code from Kurt at kurt.grigg@virgin.net-Dynamic Drive:
I downloaded the code from Dynamic Drive and modified for California Super Lottery Plus which have 5 numbers from 1 to 47 and 1 Mega number from 1 to 27

3) URL TO CODE: http://www.cu-cun.com/calottery/



<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>California Super Lottery Numbers Generator</title>
<style type="text/css">
.a1{
position:relative;
font-family:Verdana;
font-size:20px;
color:#888888;
}
.a2{
position:relative;
font-family:Verdana;
font-size:20px;
color:#ff0000;
}

</style>

<script language="JavaScript">

/*****************************************
* Lottery Picker (By Kurt at kurt.grigg@virgin.net)
* Featured on/available at http://www.dynamicdrive.com/
* Modified by DynamicDrive.com for below config options
* Modified again by Cu-Cun for CA Super Lottery Plus
* This notice must stay intact for use.
*****************************************/

var totalnumbers=5 //input total numbers to generate
var lowerbound=1 //input lower bound for each random number
var upperbound=47 //input upper bound for each random number

var meganumbers=1 //input total mega numbers to generate
var lowerboundm=1 //input lower bound for each random number
var upperboundm=27 //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[i]=RandomNumber;
}
LottoNumbers=LottoNumbers.toString();
X=LottoNumbers.split(',');
for (i=0; i < X.length; i++)
{
X[i]=X[i]+' ';
if (X[i].length==2)
X[i]='0'+X[i];
}
X=X.sort();
for (i=0; i < X.length; i++)
{
OutPut=B+=X[i];
}
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);
}
//-->

function mega(){
B=' ';
LottoNumbers=new Array();
for (i = 1; i <= meganumbers; i++)
{
RandomNumber = Math.round(lowerboundm+Math.random()*(upperboundm-lowerboundm));
for (j = 1; j <= meganumbers; j)
{
if (RandomNumber == LottoNumbers[j])
{
RandomNumber=Math.round(lowerboundm+Math.random()*(upperboundm-lowerboundm));
j=0;
}
j++;
}
LottoNumbers[i]=RandomNumber;
}
LottoNumbers=LottoNumbers.toString();
X=LottoNumbers.split(',');
for (i=0; i < X.length; i++)
{
X[i]=X[i]+' ';
if (X[i].length==2)
X[i]='0'+X[i];
}
X=X.sort();
for (i=0; i < X.length; i++)
{
mOutPut=B+=X[i];
}
if (document.all)document.all.layer2.innerHTML=mOutPut;
if (document.getElementById)document.getElementById("layer2").innerHTML=mOutPut;
if (document.layers){
document.layers.layer2.document.open();
document.layers.layer2.document.write("<span style='position:absolute;top:0px;left:0px;font-family:Verdana;font-size:20px;color:#ff0000;text-align:center'> "+mOutPut+"</span>");
document.layers.layer2.document.close();
}
T=setTimeout('mega()',20);
//window.status=OutPut;
}
function StOp(){
setTimeout('clearTimeout(T)',1000);
}
//-->


</script>
</head>

<body>
<p align="center"><u><font face="Verdana" size="2"><b>CA Super Lottery Plus
Number Picker</b></font></u></p>
<table border="1" width="100%" id="table5" style="border-width: 0px" height="80">
<tr>
<td style="border-style: none; border-width: medium" align="center">
<img border="0" src="logo.gif" width="96" height="114"><img border="0" src="SLPbannerLogo-left.gif" width="253" height="107"><img border="0" src="bannerright.jpg" width="205" height="107"><table border="1" width="39%" cellspacing="1" id="table6">
<tr>
<td align="center">
<table border='0' width=297 height=116 id="table7">
<tr valign='middle'>
<td align='center' style="border-style: solid; border-width: 1px">
<font size="1">
<input type=button value='5 Number Picker' onClick="lotto();StOp()"></font></td>
</tr>
<tr valign='middle'>
<td align='center' style="border-style: solid; border-width: 1px">
<font size="1">
<input type=button value='Mega Number Picker' onClick="mega();StOp()"></font></td>
</tr>
<tr valign='middle'>
<td align='center' style="border-top-style: solid; border-top-width: 1px">
<table border="1" width="100%" cellspacing="1" id="table8">
<tr>
<td>
<p align="center"><span id=layer1 class=a1><font color="#0000FF">5 Numbers</font></span><span id=layer2 class=a2><font color="#FF0000">
Mega</font></span> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>

</html>