function makearray(n) 
{ 
	this.length = n;
	for(var i = 1; i <= n; i++) this[i] = 0;
	return this;
 } 

var lotnum=new makearray(6); 
var Yo=GetTheGreeting(); 
var CRState=CRStatement();
var num_games = 1;
var num_balls = 6;
var max_num = 49;
var tball = 1;

function arand(num) 
{ 
	var rand = 0;
	rand = Math.round(num * Math.random(num) + 1);
	return rand; 
 } 

function CheckTheNos(iterations,CheckNumber) 
{ 
	for(var i = 0; i < iterations; i++)
	   if(lotnum[i] == CheckNumber) return 0;
	return 1; 
 } 

function GetTheGreeting() 
{ 
	theDate = new Date();
	theTime = theDate.getTime();
	theDate.setTime(theTime);
	theHour = theDate.getHours();
	if(theHour > 17)
	  Greeting = "Evening";
	else if(theHour > 11)
	  Greeting = "Afternoon";
	else Greeting = "Morning";
	var DisplayIt = "Good " + Greeting +". ";
	return DisplayIt; 
 } 

function CRStatement() 
 {
	CRDate = new Date();
	CRYear = CRDate.getFullYear();
	return "&copy; 1998 - " + CRYear + "&nbsp;JQL, All Rights Reserved.";
 } 

function CreatetopofForm() 
{ 
document.write("\<HTML\>\n"+"\<HEAD\>\n"+"\<TITLE\>"+"JQL Lottery Generated Numbers"+"\<\/TITLE\>\n"+"\<link rel='stylesheet' href='style\/main.css'\>\n"+"\<\/HEAD\>\n"); 
document.write("\<BODY BGCOLOR=#FFFFFF TEXT=#000000 oncontextmenu='return false'\>\n"+"\<CENTER\>\n");
document.write("\<TABLE BORDER=0 WIDTH=576 CELLSPACING=5 CELLPADDING=2\>\n"+"\<TR\>\n");
document.write("\<TD ALIGN=center\>\<a href='http:\/\/tracker.tradedoubler.com\/click?p=754&a=243094&g=90310' target='_blank'\>\<img src='http:\/\/impgb.tradedoubler.com\/imp\/img\/90310\/243094' border=0\>\<\/a\>");
document.write("\<H1\>Free 30 Day Trial\<BR\>JQL Lottery \'The Program\'\<\/H1\>"+"\<H4>\<EM\>You\<\/EM\> could be a Millionaire before the end of the Trial Period!!\<\/H4>\<\/CENTER\>\n");
document.write("\<DIV ALIGN=center\>\nDownload your Trial Copy \<IMG SRC=images\/flshrbtn.gif BORDER=0\> \<A HREF=\"http:\/\/www.j-q-l.freeserve.co.uk\/response.htm\" target=_blank\>\n");
document.write("\<IMG SRC=images\/lottbtn.gif ALIGN=middle BORDER=0\>\<\/A\>\<BR\>\<FONT SIZE=1\>\(file size: 496KB, Download time about 2 minutes*\)\<\/FONT\>\n\<HR\>\<\/DIV\>");
document.write("\<P\>\<DIV ALIGN=left\>"+Yo+"\<P\>Thank you for using JQL\'s Lottery Number Generator,\n");
 } 


function CreatebottomofForm() 
{ 
document.write('\<br\>\<br\>\<center\>\<a href="http:\/\/www.jql.co.uk\/jqlhfl.htm" title="seriously increase your chances of winning" target="_top"\>\<strong\>\<font size="5"\>J.Q.L. Horse Form Lite is back\<\/font\>\<\/strong\>\<\/a\>');
document.write('\<p class="dashedbox">JQL Horse Form Lite\<br\>Reviewed by Robin Lloyd in ODDS ON magazine:\<br\>\<br\>\<em\>&quot;.. the program, which I like very much, gave me three winners out of five races checked. Evaluation is quick and easy. Latest form is sensibly combined with earlier placings.&quot;\<\/em\>\<\/p\>');
document.write("\<br\>\<br\>\<a href='http:\/\/www.madbonus.com\/?affiliate_id=232012&campaign_id=5'\>\<img src='http:\/\/www.madbonus.com\/img\/promo\/mb_ban4.gif' width=234 height=60 border=0\>\<\/a\>&nbsp\;\<a href='http:\/\/www.onlinesportscenter.com\/?affiliate_id=232012&campaign_id=10'\>\<img src='http:\/\/www.onlinesportscenter.com\/promo\/osc234x60.gif' width=234 height=60 border=0\>\<\/a\>\<\/center\>\n");
document.write("\<DIV ALIGN=left\>\n");
document.write('\<BR\>\<HR\>\<BR\>\<CENTER\>\<H5\>\<a href="http:\/\/www.jql.co.uk\/visualaccounts\/varespns.htm" title="Powerful, easy to use, Accounting Software, Users Love!" target="_blank"\>FREE &quot;Test Drive&quot; of Visual Accounts 2000\<\/a\>\<\/H5\>\<\/CENTER\>');
document.write('\<FONT SIZE=2\>\<b\>Very powerful, extremely easy to use and designed to save you time and money, \<a href="http:\/\/www.jql.co.uk\/visualaccounts\/index.htm" title="Bookkeeping and Accounting Software&#10;&#13;No Accountancy Knowledge Needed." target="_blank"\>Visual Accounts\<\/\a> makes \<i\>&quot;doing your accounts&quot;\<\/i\> so easy you will wonder how you managed without it!\<\/b\>\<\/FONT\>'); 
document.write("\<BR\>\<HR\>\<BR\>\<FONT SIZE=1\>"+"To return to the JQL Lottery Page please press the \"Back\" button on your browser\'s tool bar.\<BR\>\<BR\>This page does not print out because it was Auto-Generated. If you wish to print out the Numbers, highlight the Table with your Mouse and select Copy from your Browser\'s Menu, then Paste the Table into a Text Editor like Notepad.\n");
document.write("\<BR\>\<BR\>Disclaimer: You use any information, programmes, ideas and anything else downloaded and\/or used on or from this site entirely and totally at your own risk. JQL does not accept any liability whatsoever for anything which may or may not happen ever.\n"+"\<BR\>\n"); 
document.write("\<BR\>\<\/FONT\>"); 
document.write("\<\/DIV\>\n"); 
document.write("\<BR\>"+"\<DIV ALIGN=center\>\n"+"\<FONT SIZE=1\>\n"); 
document.write("\<BR\>\n"+"\:\-\)\&nbsp\;\&nbsp\;"+"\<A HREF=mailto:jql@FSBDial.co.uk\>"); 
document.write("When you win, all donations will be gratefully recieved\!"); 
document.write("\<\/A\>\n"+"\&nbsp\;\&nbsp\;\:\-\)"+"\<BR\>\n"+"\<BR\>\n"); 
document.write("\<A HREF=terms.htm\>"+"JQL\'s Standard Terms and Conditions"+"\<\/A\>\n"); 
document.write("\<\/DIV\>\n");
document.write("\<BR\>\<HR\>* Approximate download time based on a 33.6KB modem. Times may vary depending\<BR\>on Line Speed, Line Quality, Network Load, Modem Speed and various other factors.\<BR\>\<BR\>\n"+"Generated\:\&nbsp\;"+Date()+".\&nbsp\;\&nbsp\;" + CRState + "\<\/FONT\>\n"); 
document.write("\<BR\>\<BR\>\<IMG SRC=images\/created.gif ALT=Logo BORDER=0\>\<\/DIV\>\n"); 
document.write("\<\/TD\>\<\/TR\>\<\/TABLE\>\n");
document.write("\<\/BODY\>\n"+"\<\/HTML\>\n"); 
 } 

function MakeTheReply(form_name, menu_name) 
{ 
	var acount = 0; 
	num_balls = form_name.balls.options[form_name.balls.selectedIndex].value;
	max_num = form_name.numbers.options[form_name.numbers.selectedIndex].value;
	num_games = form_name.games.options[form_name.games.selectedIndex].value;
	//alert(num_balls + " : " + max_num + " : " + num_games);
	CreatetopofForm();
	if(num_games == 1) { 
	document.write("here is your "+"\<FONT COLOR=#FF0000\>"+"\<B\>" + num_games + " Game of " + num_balls + " from "+ max_num+"\<\/B\>"+"\<\/FONT\>"+" Lottery Numbers.\<P\>Good Luck!\n"+"\<\/P\>\n"); }
	else {
	document.write("here are your "+"\<FONT COLOR=#FF0000\>"+"\<B\>" + num_games + " Games of " + num_balls + " from "+ max_num+"\<\/B\>"+"\<\/FONT\>"+" Lottery Numbers.\<P\>Good Luck!\n"+"\<\/P\>\n"); } 
	document.write("\<\/DIV\>\n"); 
	for(var j = 1; j <= num_games; j++) { 
	   for(var i = 0; i < num_balls ; i++) { 
	      lotnum[i] = arand(max_num - 1);
	      acount=0; 
	      while (CheckTheNos(i, lotnum[i]) == 0 && acount < 10000) { 
		lotnum[i] = arand(max_num - 1); 
		acount++; 
	      } 
	      if(acount >= 10000) {
	        alert("Unable to generate the numbers please try again later."); 
	        return; 
	      } 
	   } 
	   document.write("\<CENTER\>\n"+"\<TABLE BORDER=0 BGCOLOR=#FFB5CE CELLSPACING=3 CELLPADDING=2\>"+"\<TR BGCOLOR=#FFE0E0\>\n"+"\<TD WIDTH=90 ALIGN=left\>\<FONT COLOR=#FF0000\>\<STRONG\>"+"Game "+j+"\<\/STRONG\>\<\/FONT\>\<\/TD\>\n");
	   for (var i = 0; i < num_balls; i++) document.write("\<TD WIDTH=40 ALIGN=center\>\<FONT SIZE=-1\>\<STRONG\>"+lotnum[i]+"\<\/STRONG\>\<\/FONT\>\<\/TD\>\n");
	   document.write("\<\/TR\>\n"+"\<\/TABLE\>\n"+"\<\/CENTER\>\n");
	} 
	CreatebottomofForm(); 
 } 

function PickTBall(Form_name) 
{ 
	var acount = 0; 
	CreatetopofForm();
             document.write("here are your\&nbsp\;\<FONT COLOR=#FF0000\>\<B\>THUNDERBALL\<\/B\>\<\/FONT\>\&nbsp\;Numbers.\<P\>Good Luck!\n\<\/P\>\n"); 
	document.write("\<\/DIV\>\n");
	document.write("\<CENTER\>\n\<TABLE BORDER=0 BGCOLOR=#FAB5CE ALIGN=center CELLSPACING=3 CELLPADDING=2\>\<TH WIDTH=90 ALIGN=left\>Game No\<TH WIDTH=40 ALIGN=center\>B-1\<TH WIDTH=40 ALIGN=center\>B-2\<TH WIDTH=40 ALIGN=center\>B-3\<TH WIDTH=40 ALIGN=center\>B-4\<TH WIDTH=40 ALIGN=center\>B-5\<TH WIDTH=40 ALIGN=center BGCOLOR=#FF0000\>TB\n");
	for(var j = 1; j <= tball; j++) { 
	   for(var i = 0; i < 5; i++) { 
	      lotnum[i] = arand(33); 
	      acount = 0; 
	      while (CheckTheNos(i,lotnum[i]) == 0 && acount < 10000) { 
		 lotnum[i] = arand(33); 
		 acount++; 
	      } 
	      if (acount >= 10000) { 
		 alert("Unable to generate the numbers for Thunderball please try again later."); 
		 return; 
	      } 
	   } 
	   document.write("\<TR BGCOLOR=#FFE0E0\>\n"+"\<TD WIDTH=90 ALIGN=left\>"+"\<FONT COLOR=#FF0000\>Game "+j+"\<\/FONT\>\<\/TD\>"+"\<TD WIDTH=35 ALIGN=right\>"+"\<B\>"+lotnum[0]+"\<\/B\>"+"\<\/TD\>"+"\<TD WIDTH=35 ALIGN=right\>"+"\<B\>"+lotnum[1]+"\<\/B\>"+"\<\/TD\>"+"\<TD WIDTH=35 ALIGN=right\>"+"\<B\>"+lotnum[2]+"\<\/B\>"+"\<\/TD\>"+"\<TD WIDTH=35 ALIGN=right\>"+"\<B\>"+lotnum[3]+"\<\/B\>"+"\<\/TD\>"+"\<TD WIDTH=35 ALIGN=right\>"+"\<B\>"+lotnum[4]+"\<\/B\>"+"\<\/TD\>"); 
	   for(var i = 5; i < 6; i++) { 
	     lotnum[i] = arand(13); 
	     acount=0; 
	     while (CheckTheNos(i, lotnum[i]) == 0 && acount < 10000) { 
		lotnum[i] = arand(13); 
		acount++; 
	     }
	     if(acount >= 10000) { 
	       alert("Unable to generate the THUNDERBALL please try again later.");
	       return; 
	     } 
	   }
	   document.write("\<TD WIDTH=35 BGCOLOR=#FF0000 ALIGN=right\>"+"\<FONT COLOR=White\>\n"+"\<B\>\n"+lotnum[5]+"\<\/B\>"+"\<\/FONT\>"+"\<\/TD\>\n"+"\<\/TR\>\n"); 
	}
	document.write("\<\/TABLE\>\n"+"\<\/CENTER\>\n"); 
	document.write("\<BR\>\<DIV ALIGN=left\>"+"To re-generate another set of Thunderball numbers you \<B\>must\<\/B\> click on the Radio Button for the Number of Games when you go back to the Lottery Page, otherwise only the numbers for one game will be generated regardless of the Radio Button settings."+"\<\/DIV\>\n");
	CreatebottomofForm(); 
 } 
 
