window.google_analytics_uacct = "UA-5869894-9";
var ad_type_blank = 0;
var ad_type_wwl760x60 = 25;
var ad_type_addotcom728x90 = 1;
var ad_type_cpx728x90 = 20;
var ad_type_cpxint728x90 = 27;
var ad_type_addotcom468x60 = 3;
var ad_type_cpx468x60 = 4;
var ad_type_cpxint468x60 = 28;
var ad_type_mc_468x60 = 18;
var ad_type_cpx300x250 = 5;
var ad_type_cpxint300x250 = 13;
var ad_type_pulse160x600 = 6;
var ad_type_google160x600 = 7;
var ad_type_cpx160x600 = 14;
var ad_type_cpxint160x600 = 29; 
var ad_type_pch600x100 = 30;
var ad_type_pch2600x100 = 31;
var ad_type_mc_120x600 = 17;
var ad_type_google120x240 = 8;
var ad_type_erdrct120x90 = 10;
var ad_type_freelotto120x90 = 12;
var ad_type_google125x125 = 9;
var ad_type_mc_125x125 = 19;
var ad_type_textlinks4 = 15;
var ad_type_textlinks1 = 16;
var ad_type_lottolove120x90 = 32;
var ad_type_lottolove728x90 = 33;
var ad_type_directguy = 34;
var ad_type_wwl1 = 35;
var ad_type_wwl2 = 36;
var ad_type_wwl3 = 37;
var ad_type_wwl4 = 38;

if(altAds == "1"){//International Rotation
	document.write('<script type="text/javascript" src="http://www.tinbuserver.com/clients/sys/php/getstladType.php?chadfl=ad3"></script>');
}
else if(altAds == "2"){// Test Rotation
	document.write('<script type="text/javascript" src="http://www.tinbuserver.com/clients/sys/php/getstladType.php?chadfl=ad0"></script>');
}
else{// Us/Canada Rotation
	stlcr_g8rr8y("stlad");
	var stladtype = stll_gc00k1e("stlad");
	if(stladtype == null){
		 stllcr_sc00k1e("stlad", "1");
		 stlcr_g8rr8y("stlad");
		 stladtype = stll_gc00k1e("stlad");
	}
	if(stladtype=="1"){
		document.write('<script type="text/javascript" src="http://www.tinbuserver.com/clients/sys/php/getstladType.php?chadfl=ad1"></script>');
		stllcr_sc00k1e("stlad", "2");	
	}
	else{
		document.write('<script type="text/javascript" src="http://www.tinbuserver.com/clients/sys/php/getstladType.php?chadfl=ad2"></script>');
		stllcr_sc00k1e("stlad", "1");
	}
}
stlcr_g8rr8y("stlad");
stladtype = stll_gc00k1e("stlad");
// Ads
function showTop1(){
	switch (top1_ad){
		case ad_type_blank:
		showBlankAd();
		break;
		case ad_type_addotcom728x90:
		showAdDotCom728x90();
		break;
		case ad_type_cpx728x90:
		showCPX(3);
		break;
		case ad_type_cpxint728x90:
		showCPXInt(3);
		break;
		case ad_type_lottolove728x90:
		showlovelotto728();
		break;
		case ad_type_wwl2:
		adfunc_wwl2();
		break;
		default:
		showBlankAd();
		break;
	}
}

function showTop2(){
	switch (top2_ad){
		case ad_type_blank:
		showBlankAd();
		break;
		case ad_type_textlinks1:
		showTextLinksTop();
		break;
		case ad_type_addotcom728x90:
		showAdDotCom728x90();
		break;
		case ad_type_cpx728x90:
		showCPX(3);
		break;
		case ad_type_cpxint728x90:
		showCPXInt(3);
		break;
		case ad_type_wwl760x60:
		showWWL760x60();
		break;
		case ad_type_pch600x100:
		pubch_600x100();
		break;
		case ad_type_pch2600x100:
		pubch_600x100(2);
		break;
		case ad_type_wwl2:
		adfunc_wwl2();
		break;
		default:
		showBlankAd();
		break;
	}
}

function showLeft(adType){
	document.write('<br><center>');
	var newCase = 0;
	if(adType == 1){
		newCase = left1_ad;
	}
	else if(adType == 2){
		newCase = left2_ad;
	}
	else if(adType == 3){
		newCase = left3_ad;
	}
	switch (newCase){
		case ad_type_blank:
		showBlankAd();
		break;
		case ad_type_pulse160x600:
		showPulse160x600();
		break;
		case ad_type_google160x600:
		google_160x600();
		break;
		case ad_type_cpx160x600:
		showCPX(4);
		break;
		case ad_type_cpxint160x600:
		showCPXInt(4);
		break;
		case ad_type_mc_120x600:
		showMC120x600();
		break;
		case ad_type_google120x240:
		showGoogle120x240();
		break;
		case ad_type_google125x125:
		showGoogle125x125();
		break;
		case ad_type_mc_125x125:
		showMC125x125();
		break;
		case ad_type_erdrct120x90:
		showErdrct120x90();
		break;
		case ad_type_freelotto120x90:
		showFreeLotto120x90();
		break;
		case ad_type_textlinks4:
		showTextLinks4();
		break;
		case ad_type_wwl3:
		adfunc_wwl3();
		break;
		case ad_type_wwl4:
		adfunc_wwl4();
		break;
		default:
		showBlankAd();
		break;
	}
	document.write('</center>');
}

function showMid1(){
	document.write('<br><center>');
	switch (mid1_ad){
		case ad_type_blank:
		showBlankAd();
		break;
		case ad_type_addotcom468x60:
		showAdDotCom468x60();
		break;
		case ad_type_cpx300x250:
		showCPX(1);
		break;
		case ad_type_cpxint300x250:
		showCPXInt(1);
		break;
		case ad_type_cpx468x60:
		showCPX(2);
		break;
		case ad_type_cpxint468x60:
		showCPXInt(2);
		break;
		default:
		showBlankAd();
		break;
	}
	document.write('</center>');
}

function showRight(adType){
	document.write('<br><center>');
	var newCase = 0;
	if(adType == 1){
		newCase = right1_ad;
	}
	else if(adType == 2){
		newCase = right2_ad;
	}
	else if(adType == 3){
		newCase = right3_ad;
	}
	switch (newCase){
		case ad_type_blank:
		showBlankAd();
		break;
		case ad_type_pulse160x600:
		showPulse160x600();
		break;
		case ad_type_google160x600:
		google_160x600();
		break;
		case ad_type_cpx160x600:
		showCPX(4);
		break;
		case ad_type_cpxint160x600:
		showCPXInt(4);
		break;
		case ad_type_mc_120x600:
		showMC120x600();
		break;
		case ad_type_google120x240:
		showGoogle120x240();
		break;
		case ad_type_google125x125:
		showGoogle125x125();
		break;
		case ad_type_mc_125x125:
		showMC125x125();
		break;
		case ad_type_erdrct120x90:
		showErdrct120x90();
		break;
		case ad_type_freelotto120x90:
		showFreeLotto120x90();
		break;
		case ad_type_textlinks4:
		showTextLinks4();
		break;
		case ad_type_lottolove120x90:
		ShowLottoLove120x90();
		break;
		case ad_type_wwl3:
		adfunc_wwl3();
		break;
		case ad_type_wwl4:
		adfunc_wwl4();
		break;
		default:
		showBlankAd();
		break;
	}
	document.write('</center>');
}

function showBottom1(){
	document.write('<br><center>');
	switch (bottom1_ad){
		case ad_type_blank:
		showBlankAd();
		break;
		case ad_type_cpx300x250:
		showCPX(1);
		break;
		case ad_type_cpxint300x250:
		showCPXInt(1);
		break;
		case ad_type_cpx468x60:
		showCPX(2);
		break;
		case ad_type_cpxint468x60:
		showCPXInt(2);
		break;
		case ad_type_addotcom468x60:
		showAdDotCom468x60();
		break;
		case ad_type_mc_468x60:
		showMC468x60();
		break;
		case ad_type_directguy:
		showDirectSaleBanner();
		break;
		case ad_type_wwl1:
		adfunc_wwl1();
		break;
		default:
		showBlankAd();
		break;
	}
	document.write('</center>');
}

function showBottom2(){
	document.write('<br><center>');
	switch (bottom2_ad){
		case ad_type_blank:
		showBlankAd();
		break;
		case ad_type_textlinks1:
		showTextLinksTop();
		break;
		case ad_type_addotcom728x90:
		showAdDotCom728x90();
		break;
		case ad_type_cpx728x90:
		showCPX(3);
		break;
		case ad_type_cpxint728x90:
		showCPXInt(3);
		break;
		case ad_type_wwl760x60:
		showWWL760x60();
		break;
		case ad_type_pch600x100:
		pubch_600x100(1);
		break;
		case ad_type_pch2600x100:
		pubch_600x100(2);
		break;
		case ad_type_wwl1:
		adfunc_wwl1();
		break;
		default:
		showBlankAd();
		break;
	}
	document.write('</center>');
}

function LeftSideAds(){
	document.write('<div id="stlleftad1">');
		showLeft(1);
	document.write('</div><div id="stlleftad3">');
		showLeft(2);
	document.write('</div><div id="stlleftad2">');
		showLeft(3);
	document.write('</div>');
}

function RightSideAds(){
	document.write('<div id="stlrightad1">');
		showRight(1)
	document.write('</div><div id="stlrightad2">');
		showRight(2)
	document.write('</div><div id="stlrightad3">');
		showRight(3)
	document.write('</div>');
}
//WWL Freelotto 760x60
function showWWL760x60(){
		document.write('<a href="http://www.worldwidelotto.com/free_lottery/" target="_blank"><img src="http://www.worldwidelotto.com/images/freelotto_blue.gif"></a>');
}
// direct sale banner
function showDirectSaleBanner() {
	document.write('<a target="_blank" href="http://tinyurl.com/lotto-win-syst">');
	document.write('<img border="0" src="http://www.lottoaffiliatecenter.com/banner-could_you-468x60.JPG" alt="Silver Lotto System" /></a>');
}
// LottoLove 120x90 Banner
function ShowLottoLove120x90() {
	// block texas lottery live
	if ((typeof(lotteryStateShortup)!='undefined') && (lotteryStateShortup != 'TX')) {
		document.write('<a href="http://www.lovelotto.com/aid=6&promo=TinBu" target="_blank"><img src="http://www.tinbuserver.com/ads/lottolove/120x90.gif" border="0" alt="Play Lotteries at LoveLotto!"></a>');
	}
}
function showlovelotto728() {
	// block texas lottery live
	if ((typeof(lotteryStateShortup)!='undefined') && (lotteryStateShortup != 'TX')) {
		document.write('<a href="http://www.lovelotto.com/aid=6&promo=TinBu" target="_blank"><img src="http://www.tinbuserver.com/ads/lottolove/728x90.gif" border="0" alt="Play Lotteries at LoveLotto!"></a>');
	}
	else {
		showAdDotCom728x90();
	}
}
// various wwlads (new)
function adfunc_wwl1() {
	document.write('<a href="http://www.worldwidelotto.com/free_lottery/index.php?subid=statelotlive&subid2='+document.domain+'" target="_blank"><img src="http://www.tinbuserver.com/ads/wwlads/fl_468x60.gif" border="0" alt="Play Today!"></a>');
}
function adfunc_wwl2() {
	document.write('<a href="http://www.worldwidelotto.com/free_lottery/index.php?subid=statelotlive&subid2='+document.domain+'" target="_blank"><img src="http://www.tinbuserver.com/ads/wwlads/fl_728x90.gif" border="0" alt="Play Today!"></a>');
}
function adfunc_wwl3() {
	document.write('<a href="http://www.worldwidelotto.com/free_lottery/index.php?subid=statelotlive&subid2='+document.domain+'" target="_blank"><img src="http://www.tinbuserver.com/ads/wwlads/wwl-text-ss.gif" border="0" alt="Play Today!"></a>');
}
function adfunc_wwl4() {
	document.write('<a href="http://www.worldwidelotto.com/free_lottery/index.php?subid=statelotlive&subid2='+document.domain+'" target="_blank"><img src="http://www.tinbuserver.com/ads/wwlads/fl_160x600.gif" border="0" alt="Play Today!"></a>');
}
// 720x90
//Ad.com
function showAdDotCom728x90(){
	document.write('<!-- -------------- Advertising.com ------ Tinbu, LLC - LotteryLive 728x90 - 784127 - (728x90) ------------ -->');
	document.write("<script type='text/javascript'>");
	document.write("var ACE_AR = {site: '784127', size: '728090'};");
	document.write("</script>");
	document.write("<script type='text/javascript' SRC='http://uac.advertising.com/wrapper/aceUAC.js'></script>");
	document.write("<!-- ---------- Copyright 2009, Advertising.com ---------- -->");
}
function showCPX(which){
	if(which == 2){
		document.write('<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=468 HEIGHT=60 SRC="http://adserving.cpxinteractive.com/st?ad_type=iframe&ad_size=468x60&section=660320"></IFRAME>');
	}
	else if(which == 3){
		document.write('<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=728 HEIGHT=90 SRC="http://adserving.cpxinteractive.com/st?ad_type=iframe&ad_size=728x90&section=660320"></IFRAME>');
	}
	else if(which == 4){
		document.write('<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=160 HEIGHT=600 SRC="http://adserving.cpxinteractive.com/st?ad_type=iframe&ad_size=160x600&section=660320"></IFRAME>');
	}
	else{
		document.write('<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=300 HEIGHT=250 SRC="http://adserving.cpxinteractive.com/st?ad_type=iframe&ad_size=300x250&section=660320"></IFRAME>');
	}
}
function showCPXInt(which){
	if(which == 2){
		document.write('<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=468 HEIGHT=60 SRC="http://adserving.cpxinteractive.com/st?ad_type=iframe&ad_size=468x60&section=1350156"></IFRAME>');
	}
	else if(which == 3){
		document.write('<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=728 HEIGHT=90 SRC="http://adserving.cpxinteractive.com/st?ad_type=iframe&ad_size=728x90&section=1350156"></IFRAME>');
	}
	else if(which == 4){
		document.write('<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=160 HEIGHT=600 SRC="http://adserving.cpxinteractive.com/st?ad_type=iframe&ad_size=160x600&section=1350156"></IFRAME>');
	}
	else{
		document.write('<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=300 HEIGHT=250 SRC="http://adserving.cpxinteractive.com/st?ad_type=iframe&ad_size=300x250&section=1350156"></IFRAME>');
	}
}

//468
//Ad.com
function showAdDotCom468x60(){
	document.write("<!-- -------------- Advertising.com ------ Tinbu, LLC - LotteryLive 468x60 - 784128 - (468x60) ------------ -->");
	document.write("<script type='text/javascript'>");
	document.write("var ACE_AR = {site: '784128', size: '468060'};");
	document.write("</script>");
	document.write("<script type='text/javascript' SRC='http://uac.advertising.com/wrapper/aceUAC.js'></script>");
	document.write("<!-- ---------- Copyright 2009, Advertising.com ---------- -->");
}
//MC
function showMC468x60(){
	document.write('<a href="http://mikecaruana.com/lottostrategies/" target="_blank"><img src="http://www.tinbuserver.com/ads/mc/mc_468x60.gif"></a>');
}

//160x600
//Pulse
function showPulse160x600(){
	document.write('<iframe src="http://content.pulse360.com/D12A19D0-98B0-11DE-B794-106AEDADD848" width="160" height="600" frameborder="0" scrolling="no" allowtransparency="true"></iframe>');
}
//Google
function google_160x600(){
google_ad_client = "ca-pub-2939340252455583";
/* State Lottery sites 160x600 */
google_ad_slot = "2781799813";
google_ad_width = 160;
google_ad_height = 600;
document.write('<script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
}

//Publisher's Clearing House
function pubch_600x100(adType){
var stlcachebuster = Math.round(new Date().getTime() / 1000);
if(adType == 1){
	document.write('<SCRIPT language="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/N5685.289928.TINBU.COM/B5090193.4;sz=600x100;ord='+stlcachebuster+'"></SCRIPT>');
}
else{
	document.write('<SCRIPT language="JavaScript1.1" SRC="http://ad.doubleclick.net/adj/N5685.289928.TINBU.COM/B5090193.5;sz=600x400;ord='+stlcachebuster+'?"></SCRIPT>');
}

}

//MC
function showMC120x600(){
	document.write('<a href="http://mikecaruana.com/lottostrategies/" target="_blank"><img src="http://www.tinbuserver.com/ads/mc/mc_120x600.gif"></a>');
}

//120x240
//Google
function showGoogle120x240(){
google_ad_client = "ca-pub-2939340252455583";
/* State Lottery Sites 120x240 */
google_ad_slot = "6850601529";
google_ad_width = 120;
google_ad_height = 240;
document.write('<script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
}

//125x125
//Google
function showGoogle125x125(){
	google_ad_client = "ca-pub-2939340252455583";
	/* State Lottery Sites 125x125 */
	google_ad_slot = "1478475029";
	google_ad_width = 125;
	google_ad_height = 125;
	//-->
	document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
}
//MC
function showMC125x125(){
	document.write('<a href="http://mikecaruana.com/lottostrategies/" target="_blank"><img src="http://www.tinbuserver.com/ads/mc/mc_125x125.gif"></a>');
}
//120x90
function showErdrct120x90(){
	// new free lotto banners
	// choose random banner
	var erdrctreplace = [
		"http://www.tinbuserver.com/ads/freelotto/new/certificateTV_english_120x60.gif",
		"http://www.tinbuserver.com/ads/freelotto/new/MarqueTV_English_120x60.gif",
		"http://www.tinbuserver.com/ads/freelotto/new/MarqueTV_English_120x90.gif",
		"http://www.tinbuserver.com/ads/freelotto/new/mh_seal_English_120x60.gif",
		"http://www.tinbuserver.com/ads/freelotto/new/mh_teletype_English_120x60.gif",
		"http://www.tinbuserver.com/ads/freelotto/new/mh_tvs_English_120x60.gif"];
	var adtoshow = erdrctreplace[Math.floor(Math.random() * erdrctreplace.length)];
	// display it
	document.write('<a href="http://www.freelotto.com/offer.asp?offer=1061637&affiliateid=" target="_blank"><img src="'+adtoshow+'" width= "120" height= "90" border= "0" alt="Win Today!"></a>');
	// old cash advance ad
	// document.write('<a href="http://www.erdrct.com/?azq=100&bid=762&aid=CD1904&dp=59607&cid=167&land=0&opt" target="_top"><img src="http://www.tinbu.com/wwl_creative/cap120x90.gif" width= "120" height= "90" border= "0" alt="" onMouseOver="window.status=\'\'; return true;" onMouseOut="window.status=\'\'; return true;"></a>');
}
//FreeLotto
function showFreeLotto120x90(){
	document.write('<a href="http://worldwidelotto.com/free_lottery/" target="_blank"><img src="http://www.tinbuserver.com/ads/ls/freelotto120.gif"></a>');
}

//Text Links
function showTextLinksTop(){
	document.write('<span style="padding-left:20px; width:33%;color:#000000; display:inline;">');
	document.write('<strong><a style="color:#000000;" href="http://worldwidelotto.com/free_lottery/" target="_blank" title="World Wide Lotto - Play Free Lottery">Free $100,000 Lottery</a></strong> - Play now online and win every day');
	document.write('</span>');
}
function showTextLinks4(){	
	document.write('<br>');
	document.write('<div><strong><a style="color:#000000;" href="http://worldwidelotto.com/free_lottery/" title="World Wide Lotto - Play Free Lottery" target="_blank">Free $100,000 Lottery</a></strong><br />Play now online and win every day</div>');
	document.write('<br>');
}

//Blank Ad
function showBlankAd(){
}

var TinbuSiteURL = "http://www.tinbuadserv.com/nav/notext/size2";
if(navigator.appName == "Microsoft Internet Explorer"){
	var ModuleArray = [
	["Lottery", "/modules/lottery.html", "-7", "-2", "stlnavicon0", "lottery"], //0
	["Horoscope", "/modules/horoscope.html", "-16", "12", "stlnavicon1", "horoscope"], //1
	["Weather", "/modules/weather.html", "-10", "-2", "stlnavicon2", "weather"], //2
	["Mortgages", "/modules/mortgage.html", "-16", "12", "stlnavicon3", "mortgage"], //3
	["Sudoku", "/modules/sudoku.html", "-6", "-2", "stlnavicon4", "sudoku"], //4
	["Models", "/modules/models.html", "-4", "12", "stlnavicon5", "model"], //5
	["Soccer", "/modules/soccer.html", "-4", "-2", "stlnavicon6", "soccer"], //6
	["Radio", "/modules/music.html", "0", "12", "stlnavicon7", "music"], //7
	["Movies", "/modules/boxoffice.html", "-14", "-2", "stlnavicon8", "boxoffice"], //8
	["Recipes", "/modules/recipes.html", "-6", "12", "stlnavicon9", "recipes"], //9
	["Stocks", "/modules/stocks.html", "-3", "-2", "stlnavicon10", "stocks"], //10
	["Jobs", "/modules/jobs.html", "4", "-2", "stlnavicon20", "jobs"], //11
	["Gas", "/modules/gasprice.html", "6", "-2", "stlnavicon12", "gas"], //12
	["MPG", "/modules/mpg.html", "4", "12", "stlnavicon13", "mpg"], //13
	["Flight", "/modules/flight.html", "0", "-2", "stlnavicon14", "flight"], //14
	["News", "/modules/news.html", "3", "12", "stlnavicon15", "news"], //15
	["Fitness", "/modules/fitness.html", "-6", "-2", "stlnavicon16", "fitness"], //16
	["Quotes", "/modules/quotes.html", "-4", "12", "stlnavicon17", "quotes"], //17
	["Sports", "/modules/sports.html", "-3", "-2", "stlnavicon18", "sports"], //18
	["Games", "/modules/games.html", "-2", "12", "stlnavicon19", "games"], //19
	["Entertainment", "/modules/entertainment.html", "-25", "12", "stlnavicon11", "entertainment"], //20
	["Schools", "/modules/schools.html", "-6", "12", "stlnavicon21", "schools"], //21
	["Shopping", "/modules/shopping.html", "-10", "-2", "stlnavicon22", "shopping"], //22
	//["Autos", "/modules/autos.html", "-2", "12", "stlnavicon23", "aolautos"], //23
	["Safety Mom", "/modules/safetymom.html", "-20", "-2", "stlnavicon24", "safetymom"], //24
	["Crosswords", "/modules/crosswords.html", "-19", "12", "stlnavicon25", "crosswords"] //25
	];
}
else{
	var ModuleArray = [
	["Lottery", "/modules/lottery.html", "-7", "-2", "stlnavicon0", "lottery"], //0
	["Horoscope", "/modules/horoscope.html", "-16", "12", "stlnavicon1", "horoscope"], //1
	["Weather", "/modules/weather.html", "-10", "-2", "stlnavicon2", "weather"], //2
	["Mortgages", "/modules/mortgage.html", "-16", "12", "stlnavicon3", "mortgage"], //3
	["Sudoku", "/modules/sudoku.html", "-6", "-2", "stlnavicon4", "sudoku"], //4
	["Models", "/modules/models.html", "-4", "12", "stlnavicon5", "model"], //5
	["Soccer", "/modules/soccer.html", "-4", "-2", "stlnavicon6", "soccer"], //6
	["Radio", "/modules/music.html", "0", "12", "stlnavicon7", "music"], //7
	["Movies", "/modules/boxoffice.html", "-14", "-2", "stlnavicon8", "boxoffice"], //8
	["Recipes", "/modules/recipes.html", "-6", "12", "stlnavicon9", "recipes"], //9
	["Stocks", "/modules/stocks.html", "-3", "-2", "stlnavicon10", "stocks"], //10
	["Entertainment", "/modules/entertainment.html", "-25", "12", "stlnavicon11", "entertainment"], //11
	["Gas", "/modules/gasprice.html", "6", "-2", "stlnavicon12", "gas"], //12
	["MPG", "/modules/mpg.html", "4", "12", "stlnavicon13", "mpg"], //13
	["Flight", "/modules/flight.html", "0", "-2", "stlnavicon14", "flight"], //14
	["News", "/modules/news.html", "3", "12", "stlnavicon15", "news"], //15
	["Fitness", "/modules/fitness.html", "-6", "-2", "stlnavicon16", "fitness"], //16
	["Quotes", "/modules/quotes.html", "-4", "12", "stlnavicon17", "quotes"], //17
	["Sports", "/modules/sports.html", "-3", "-2", "stlnavicon18", "sports"], //18
	["Games", "/modules/games.html", "-2", "12", "stlnavicon19", "games"], //19
	["Jobs", "/modules/jobs.html", "4", "-2", "stlnavicon20", "jobs"], //20
	["Schools", "/modules/schools.html", "-6", "12", "stlnavicon21", "schools"], //21
	["Shopping", "/modules/shopping.html", "-10", "-2", "stlnavicon22", "shopping"], //22
	//["Autos", "/modules/autos.html", "-2", "12", "stlnavicon23", "aolautos"], //23
	["Safety Mom", "/modules/safetymom.html", "-20", "-2", "stlnavicon24", "safetymom"], //24
	["Crosswords", "/modules/crosswords.html", "-19", "12", "stlnavicon25", "crosswords"] //25
	];
}


//Page Functions
headingInto();
function headingInto(){ 
	document.write('<link rel="stylesheet" href="http://www.newyorklotterylive.com/all/css/stlstyle.php" type="text/css" media="screen" />');

	document.write('<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />');
}
function displCopy(){
	var currYear = new Date();
	document.write(currYear.getFullYear());
}

function rez(){
	var frcsize = document.getElementById('stlcentercolumn'); 
	if(frcsize.offsetWidth < 542){
		frcsize.style.width="542px";
	}
	var flsize1 = document.getElementById('stlleftcolumn').offsetWidth+2;
	var flsize2 = document.getElementById('stlrightcolumn').offsetWidth+30; 
	var fhsize = document.getElementById('stlrightcolumn').offsetHeight;
	var fhsize1 = document.getElementById('stlleftsidebar').offsetHeight;
	var fhsize2 = document.getElementById('stlrightsidebar').offsetHeight;
	fhsize1 = ((fhsize1 > fhsize2)?fhsize1:fhsize2);
	fhsize = ((fhsize > fhsize1)?fhsize : fhsize1);
	document.getElementById("stlleftcolumn").style.height=fhsize+"px";
	document.getElementById("stlbody").style.width=(flsize1+flsize2)+"px";
}

function getViewport(){
	var frcsize = document.getElementById('stlcentercolumn'); 
	if(frcsize.offsetWidth < 542){
		frcsize.style.width="542px";
	}
	var flsize1 = document.getElementById('stlleftcolumn').offsetWidth+2;
	var flsize2 = document.getElementById('stlrightcolumn').offsetWidth+24;
	var fhsize = document.getElementById('stlrightcolumn').offsetHeight;
	var fhsize1 = document.getElementById('stlleftsidebar').offsetHeight;
	var fhsize2 = document.getElementById('stlrightsidebar').offsetHeight;
	fhsize1 = ((fhsize1 > fhsize2)?fhsize1:fhsize2);
	fhsize = ((fhsize > fhsize1)?fhsize : fhsize1);
	
	var smw,smh;
	// standards browsers
	if (typeof window.innerWidth != 'undefined') {
		smw = window.innerWidth;
		smh = window.innerHeight;
	}
	// ie6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		smw = document.documentElement.clientWidth;
		smh = document.documentElement.clientHeight;
	}
	// older versions of ie
	else {
		smw = document.getElementsByTagName('body')[0].clientWidth;
		smh = document.getElementsByTagName('body')[0].clientHeight;
	}
	// return smw;
	if (smw > (flsize1+flsize2+380)) {
		document.getElementById('socialmedia').style.display = 'block';
		document.getElementById('lottoclub').style.display = 'block';
	}
	else {
		document.getElementById('socialmedia').style.display = 'none';
		document.getElementById('lottoclub').style.display = 'none';
	}
}
function mainLinks(){
	document.write('<a href="/" title="'+lotteryStateup+' Lottery Live Home"><ul><li>Home</li></ul></a>');
	document.write('<a href="/drawingschedule.html" title="'+lotteryStateup+' Lottery Live Drawing Schedule"><ul><li>Drawing Schedule</li></ul></a>');
	document.write('<a href="/quickpick.html" title="'+lotteryStateup+' Lottery Live Quick Picks"><ul><li>Quick Picks</li></ul></a>');
	document.write('<a href="/smartpick.html" title="'+lotteryStateup+' Lottery Live Smart Picks"><ul><li>Smart Picks</li></ul></a>');
	document.write('<a href="/frequencychart.html" title="'+lotteryStateup+' Lottery Live Frequency Chart"><ul><li>Frequency Chart</li></ul></a>');
	if(lotteryStateShortup == "AR" || lotteryStateShortup == "CR" || lotteryStateup == "Panama Lottery"){
	}
	else{
		document.write('<a href="/oddcalculator.html" title="'+lotteryStateup+' Lottery Live Odds Calculator"><ul><li>Odds Calculator</li></ul></a>');
	}
	document.write('<a href="/jackpot.html" title="'+lotteryStateup+' Lottery Live Jackpot Information"><ul><li>Jackpot Information</li></ul></a>');
	if(lotteryStateShortup != "AR" || lotteryStateup == "Panama Lottery"){
		document.write('<a href="/howto.html" title="'+lotteryStateup+' Lottery Live How To Play"><ul><li>How To Play</li></ul></a>');
	}
	document.write('<a href="/winningnumbers.html" title="'+lotteryStateup+' Lottery Live Numbers Archive"><ul><li>Numbers Archive</li></ul></a>');
	document.write('<a href="/premiumlinks.html" title="'+lotteryStateup+' Lottery Live Premium Links"><ul><li>Premium Links</li></ul></a>');
	if(hasLotto == "yes"){
		document.write('<a href="/lotteryvendors.html" title="'+lotteryStateup+' Lottery Live Lottery Vendor"><ul><li>Lottery Vendor</li></ul></a>');
	}
	if(hasQuest == "yes"){
		document.write('<a href="/faq.html" title="'+lotteryStateup+' Lottery Live Frequently Asked Questions"><ul><li>F.A.Q</li></ul></a>');
	}
	document.write('<a href="/contact.html" title="'+lotteryStateup+' Lottery Live Contact Us"><ul><li>Advertise with Us</li></ul></a>');
	if(altAds == '1' || lotteryStateShortup == 'GM'){
	}
	else{
		document.write('<a href="/modules/lottery.html" title="'+lotteryStateup+' Lottery Live US Lottery Results"><ul><li> ')
		if(lotteryStateShortup == 'AC' ||lotteryStateShortup == 'WC' ||lotteryStateShortup == 'ON' ||lotteryStateShortup == 'BC' ||lotteryStateShortup == 'QC'){
			document.write('Canada');
		}
		else{
			document.write('US');
		}
		document.write(' Lottery Results</li></ul></a>');
	}
	document.write('</ul></div>');
}
function stlFooter(){
	document.write('<div class="stlcopyright">&copy; Copyright TinBu 2007- ');
	displCopy();
	document.write(' a <a target="_blank" title="World Wide Lotto - Play Free Lottery" href="http://worldwidelotto.com">WorldWideLotto.com</a> Network Site</div>');
	document.write('<div class="stlfooter-right"><a title="'+lotteryStateup+' Lottery Live - Privacy Information" href="/privacy.html">Privacy</a> | <a title="'+lotteryStateup+' Lottery Live - About"  href="/about.html">About Us</a> | <a title="'+lotteryStateup+' Lottery Live - Contact Us"  href="/contact.html">Contact Us</a>');
	if(hasHist == "yes"){
		document.write(' | <a title="'+lotteryStateup+' Lottery Live - '+lotteryStateup+' Lottery History"  href="/history.html">History</a>');
	}
	document.write('</div><br /><br />');
	lottoLinks(lotteryStateShortup);
	document.write('<div class="stlfooterinfo"><br><br> This web site is not the official '+lotteryStateup.replace(' Lottery', '')+' Lottery web site, and is for informational purposes only. This web site is not affiliated with the official '+lotteryStateup.replace(' Lottery', '')+' Lottery organization web site. Every effort is made to ensure the accuracy of the winning numbers, prize pay outs and other information posted on the '+lotteryStateup.replace(' Lottery', '')+' Lottery Live Web site, but we are not responsible for errors or ommissions. In the event of a discrepancy between the information displayed on this Web site concerning winning numbers and pay outs and the information contained in the official records and drawing results, the official drawing results and records shall prevail.</div>');
}
function lottoLinks(lottoStart){
	var arrStart = 0;
	var listEnd = 9;
	var linkCount = 0;
	var spanCount = 0;
	var linklist = "";
	var sampList1 = "";
	var sampList2 = "";
	if(lotteryStateup == "Columbia Lottery"){
		lottoStart = "CO2";
	}
	if(lotteryStateup == "Panama Lottery"){
		lottoStart = "PM";
	}
	if(lotteryStateup == "Argentina Lottery"){
		lottoStart = "AR2";
	}
	var lottolist_arr = [
		["NY", "New York"], //1
		["FL", "Florida"], //2
		["TX", "Texas"], //3
		["IL", "Illinois"], //4
		["OH", "Ohio"], //5
		["PA", "Pennsylvania"], //6
		["AZ", "Arizona"], //7
		["AR", "Arkansas"], //63
		["CA", "California"], //8
		["CO", "Colorado"], //9
		["CT", "Connecticut"], //10
		["DE", "Delaware"], //11		
		["GA", "Georgia"], //12
		["ID", "Idaho"], //13
		["IN", "Indiana"], //14
		["IA", "Iowa"], //15
		["KS", "Kansas"], //16
		["KY", "Kentucky"], //17
		["LA", "Louisiana"], //18
		["ME", "Maine"], //19
		["MD", "Maryland"], //20
		["MA", "Massachusetts"], //21
		["MI", "Michigan"], //22
		["MN", "Minnesota"], //23
		["MO", "Missouri"], //24
		["MT", "Montana"], //25
		["NE", "Nebraska"], //26
		["NH", "New Hampshire"], //27
		["NJ", "New Jersey"], //28
		["NM", "New Mexico"], //29
		["NC", "North Carolina"], //30
		["ND", "North Dakota"], //31
		["OK", "Oklahoma"], //32
		["OR", "Oregon"], //33
		["PR", "Puerto Rico"], //34
		["RI", "Rhode Island"], //35
		["SC", "South Carolina"], //36
		["SD", "South Dakota"], //37
		["TN", "Tennessee"], //38
		["VT", "Vermont"], //39
		["VA", "Virginia"], //40
		["WA", "Washington"], //41
		["DC", "Dist. of Columbia"], //42
		["WV", "West Virginia"], //43
		["WI", "Wisconsin"], //44
		["AC", "Atlantic Canada"], //45
		["ON", "Ontario"], //46
		["BC", "British Columbia"], //47
		["QC", "Quebec"], //48
		["WC", "Western Canada"], //49
		["FR", "France"], //50
		["AU", "Australia"], //51
		["ES", "Spain"], //52
		["IT", "Italy"], //53
		["UK", "Britain"], //54
		["IE", "Ireland"], //55
		["GM", "Germany"], //56
		["AR2", "Argentina"], //57
		["BR", "Brazil"], //58
		["CL", "Chile"], //59
		["CO2", "Columbia"], //60
		["CR", "Costa Rica"], //61
		["PM", "Panama"], //62
		["UY", "Uruguay"], //63
		["XM", "Mexico"] //64
	];
	var endCount = lottolist_arr.length;
	for(var i=0; i < endCount; i++){
		if(lottolist_arr[i][0]== lottoStart){
			arrStart = i;
			break;
		}
	}
	var len = lottolist_arr.length;
	var spanCount = 0;
	var linkCount = 0;
	var linklist = "";
	for(var i = arrStart+1; i < endCount; i++){
		if(linkCount == listEnd){
			break;
		}
		if(spanCount == 0){
			linklist+= "<div class='stlfooterlink'><ul>";
		}
		sampList2 = lottolist_arr[i][1].replace(" ", "");
		sampList1 = lottolist_arr[i][1]+"&nbsp;("+lottolist_arr[i][0]+") Lottery Results";
		var shortst = lottolist_arr[i][0];
		if(shortst == "DC"){
			sampList2 = "dc"
			sampList1 = "Dist. Of Columbia (DC) Lottery Results";
		}
		else if(shortst == "CO2"){
			sampList2 = "columbia";
			sampList1 = "Columbia (CO) Lottery Results";
		}
		else if(shortst == "AR2"){
			sampList2 = "argentina";
			sampList1 = "Argentina (AR) Lottery Results";
		}
		else if(shortst == "XM"){
			sampList2 = "mexico";
			sampList1 = "Mexico (MX) Lottery Results";
		}
		if(shortst == "FR" || shortst == "IE" || shortst == "IT" || shortst == "UK" || shortst == "GM" || shortst == "AR2" || shortst == "BR" || shortst == "CO2" || shortst == "UY" || shortst == "XM"){
			linklist += "<li><a href='http://www.lotto"+sampList2+".com'>"+sampList1+"</a></li>";
		}
		else if(shortst == "AU" ||shortst == "ES"){
			linklist += "<li><a href='http://www.lottoof"+sampList2+".com'>"+sampList1+"</a></li>";
		}
		else if(shortst == "CL"|| shortst == "CR"|| shortst == "PM"){
			linklist += "<li><a href='http://www.lotto"+sampList2+".net'>"+sampList1+"</a></li>";
		}
		else{
			linklist += "<li><a href='http://www."+sampList2+"lotterylive.com'>"+sampList1+"</a></li>";
		}
		linkCount++;
		spanCount++;
		if(spanCount == 3){
			linklist+= "</ul></div>";
			spanCount = 0;
		}
	}
	sampList1 = "";
	sampList2 = "";
	for(var i = 0; i < arrStart; i++){
		if(linkCount == listEnd){
			break;
		}
		if(spanCount == 0){
			linklist+= "<div class='stlfooterlink'><ul>";
		}
		sampList2 = lottolist_arr[i][1].replace(" ", "");
		sampList1 = lottolist_arr[i][1]+"&nbsp;("+lottolist_arr[i][0]+") Lottery Results";
		var shortst = lottolist_arr[i][0];
		if(shortst == "DC"){
			sampList2 = "dc"
			sampList1 = "Dist. Of Columbia (DC) Lottery Results";
		}
		else if(shortst == "CO2"){
			sampList2 = "columbia";
			sampList1 = "Columbia (CO) Lottery Results";
		}
		else if(shortst == "AR2"){
			sampList2 = "argentina";
			sampList1 = "Argentina (AR) Lottery Results";
		}
		else if(shortst == "XM"){
			sampList2 = "mexico";
			sampList1 = "Mexico (MX) Lottery Results";
		}
		if(shortst == "FR" || shortst == "IE" || shortst == "IT" || shortst == "UK" || shortst == "GM" || shortst == "AR2" || shortst == "BR" || shortst == "CO2" || shortst == "UY" || shortst == "XM"){
			linklist += "<li><a href='http://www.lotto"+sampList2+".com'>"+sampList1+"</a></li>";
		}
		else if(shortst == "AU" ||shortst == "ES"){
			linklist += "<li><a href='http://www.lottoof"+sampList2+".com'>"+sampList1+"</a></li>";
		}
		else if(shortst == "CL"){
			linklist += "<li><a href='http://www.lotto"+sampList2+".net'>"+sampList1+"</a></li>";
		}
		else{
			linklist += "<li><a href='http://www."+sampList2+"lotterylive.com'>"+sampList1+"</a></li>";
		}
		linkCount++;
		spanCount++;
		if(spanCount == 3){
			linklist+= "</ul></div>";
			spanCount = 0;
		}
	}

	document.write('<div class="stlfooterlinks"><br>');
	document.write(linklist);
	document.write('<br><br></div>');
}

//Navigation Icons
function ShowTinbuModuleIcons(){
	document.write('<div id="stlnavicons" style="width:542px; font-size:9px;"><ul class=navbartbhead" style="padding-bottom:15px; padding-top:10px; width:512px; height:60px; margin:auto;">');
	document.write("<script type=\"text/javascript\" src=\"http://www.tinbuserver.com/clients/sys/js/wz_tooltip.js\"></script>");
	var modCount =0;
	var modbrCount = 0;
	for (var i=1; i < ModuleArray.length; i++){
		var extraStyle ="";
		if(navigator.appName == "Microsoft Internet Explorer"){
			switch(i){
				case 11:
					extraStyle ="style='position:relative; left: 0px;' ";
					break;
				case 3:
					extraStyle ="style='position:relative; left:-10px;' ";
					break;
				case 24:
					extraStyle ="style='width: 70px;' ";
					break;
				case 25:
					extraStyle ="style='position:relative; left:10px;' ";
					break;
				case 1:
					extraStyle ="style='position:relative; left:4px;' ";
					break;
				default:
					extraStyle = "";
					break;
			}
		}
		else{
			switch(i){
				case 11:
					extraStyle ="style='position:relative; left:-17px;' ";
					break;
				case 3:
					extraStyle ="style='position:relative; left:-10px;' ";
					break;
				case 24:
					extraStyle ="style='width: 70px; position:relative; left:-10px;' ";
					break;
				case 25:
					extraStyle ="style='position:relative; left:-10px;' ";
					break;
				case 1:
					extraStyle ="style='position:relative; left:-10px;' ";
					break;
				default:
					extraStyle = "";
					break;
			}
		}
		if(modbrCount ==1){
			if(lotteryStateShortup == "GM"){
				document.write("<div style='float:left; width: 40px; height:60px;'><div><li class='navlihead' style='float:none;' onclick=\"window.location='?p=modules&f="+ModuleArray[i][5]+"'\" onmouseover=\"Tip('<span class=tb_toolbar_textOptions>"+ModuleArray[i][0]+"</span>',SHADOW,false,BGCOLOR,'',BORDERWIDTH,0,FIX, [this,"+ModuleArray[i][2]+","+ModuleArray[i][3]+"]);this.style.backgroundColor='#"+TinbuNavCol+"';changeDisplayP('"+ModuleArray[i][4]+"');\" onmouseout=\"UnTip();this.style.backgroundColor='#FFFFFF';changeDisplayM('"+ModuleArray[i][4]+"', '"+ModuleArray[i][0]+"');\"><center><img class=navbarimghead src=\""+TinbuSiteURL+"/"+ModuleArray[i][5]+".png\" border=0 alt='"+ModuleArray[i][0]+"' height=24 width=24></center></li></div><div id='"+ModuleArray[i][4]+"' "+extraStyle+">"+ModuleArray[i][0]+"</div></div>");
			}
			else{			
				document.write("<div style='float:left; width: 40px; height:60px;'><div><li class='navlihead' style='float:none;' onclick=\"window.location='"+ModuleArray[i][1]+"'\" onmouseover=\"Tip('<span class=tb_toolbar_textOptions>"+ModuleArray[i][0]+"</span>',SHADOW,false,BGCOLOR,'',BORDERWIDTH,0,FIX, [this,"+ModuleArray[i][2]+","+ModuleArray[i][3]+"]);this.style.backgroundColor='#"+TinbuNavCol+"';changeDisplayP('"+ModuleArray[i][4]+"');\" onmouseout=\"UnTip();this.style.backgroundColor='#FFFFFF';changeDisplayM('"+ModuleArray[i][4]+"', '"+ModuleArray[i][0]+"');\"><center><img class=navbarimghead src=\""+TinbuSiteURL+"/"+ModuleArray[i][5]+".png\" border=0 alt='"+ModuleArray[i][0]+"' height=24 width=24></center></li></div><div id='"+ModuleArray[i][4]+"' "+extraStyle+">"+ModuleArray[i][0]+"</div></div>");
			}
			modbrCount = 0;
		}
		else{
			modbrCount = 1;
			if(lotteryStateShortup == "GM"){
				document.write("<div style='float:left; width: 40px; height:60px;'><div><li class='navlihead' style='float:none;' onclick=\"window.location='?p=modules&f="+ModuleArray[i][5]+"'\" onmouseover=\"Tip('<span class=tb_toolbar_textOptions>"+ModuleArray[i][0]+"</span>',SHADOW,false,BGCOLOR,'',BORDERWIDTH,0,FIX, [this,"+ModuleArray[i][2]+","+ModuleArray[i][3]+"]);this.style.backgroundColor='#"+TinbuNavCol+"';changeDisplayP('"+ModuleArray[i][4]+"');\" onmouseout=\"UnTip();this.style.backgroundColor='#FFFFFF';changeDisplayM('"+ModuleArray[i][4]+"', '<br>"+ModuleArray[i][0]+"');\"><center><img class=navbarimghead src=\""+TinbuSiteURL+"/"+ModuleArray[i][5]+".png\" border=0 alt='"+ModuleArray[i][0]+"' height=24 width=24></center></li></div><div id='"+ModuleArray[i][4]+"' "+extraStyle+"><br>"+ModuleArray[i][0]+"</div></div>");
			}
			else{
				document.write("<div style='float:left; width: 40px; height:60px;'><div><li class='navlihead' style='float:none;' onclick=\"window.location='"+ModuleArray[i][1]+"'\" onmouseover=\"Tip('<span class=tb_toolbar_textOptions>"+ModuleArray[i][0]+"</span>',SHADOW,false,BGCOLOR,'',BORDERWIDTH,0,FIX, [this,"+ModuleArray[i][2]+","+ModuleArray[i][3]+"]);this.style.backgroundColor='#"+TinbuNavCol+"';changeDisplayP('"+ModuleArray[i][4]+"');\" onmouseout=\"UnTip();this.style.backgroundColor='#FFFFFF';changeDisplayM('"+ModuleArray[i][4]+"', '<br>"+ModuleArray[i][0]+"');\"><center><img class=navbarimghead src=\""+TinbuSiteURL+"/"+ModuleArray[i][5]+".png\" border=0 alt='"+ModuleArray[i][0]+"' height=24 width=24></center></li></div><div id='"+ModuleArray[i][4]+"' "+extraStyle+"><br>"+ModuleArray[i][0]+"</div></div>");
			}
		}
		if(navigator.appName == "Microsoft Internet Explorer"){
			if(modCount == 8){
				document.write('</ul><ul class=navbartbhead style="padding-bottom:15px; width:512px; height:60px; margin:auto;">');
			}
			else if(modCount == 17){
				document.write('</ul><ul class=navbartbhead style="padding-bottom:15px; width:448px; height:60px; margin:auto;">');
			}
			else if(modCount == 26){
				document.write('</ul><ul class=navbartbhead style="padding-bottom:15px; width:320px; height:60px; margin:auto;">');
			}
		}
		else{
			if(modCount == 11){
				document.write('</ul><ul class=navbartbhead style="padding-bottom:25px; width:512px; height:60px; margin:auto;">');
			}
			else if(modCount == 23){
				document.write('</ul><ul class=navbartbhead style="padding-bottom:15px; width:512px; height:60px; margin:auto;">');
			}
		}
		modCount++;
	}
	document.write("</ul><br></div>");
}

function ShowTinbuModuleIcons1(){
	if(typeof(p) != "undefined"){
		if(p=="modules"){
			return;
		}
	}
	var totalCount = 14;
	var numMod = 0;
	var dousemod_Arr = new Array();
	var randomnumber=Math.floor(Math.random()*ModuleArray.length);
	for (index in ModuleArray){
		dousemod_Arr[index] = new Array( ModuleArray[index][0], ModuleArray[index][1], ModuleArray[index][2], ModuleArray[index][3], ModuleArray[index][4], ModuleArray[index][5]);
	}
	dousemod_Arr.splice(0, 1);
	dousemod_Arr.splice(2, 1);
	dousemod_Arr.splice(18, 1);
	dousemod_Arr.splice(18, 1);
	numMod++;
	document.write('<div id="stlnavicons">');
	while (numMod != totalCount){		
		var normWidth = '70px';
		if(dousemod_Arr[0][0] == 'Entertainment'){
			normWidth = '95px';
		}
		if(lotteryStateShortup == "GM"){
			document.write('<div style="float:left; text-align:center; width:'+normWidth+';"><a target="_self" href=?p=modules&f='+dousemod_Arr[0][5]+'  style="padding: 0px;"><img class=navbarimghead src='+TinbuSiteURL+'/'+dousemod_Arr[0][5]+'.png border=0 alt='+dousemod_Arr[0][0]+' height=24 width=24><br><span style="text-align:center;">'+dousemod_Arr[0][0]+'</span></a></div>');
		}
		else{
			document.write('<div style="float:left; text-align:center; width:'+normWidth+';"><a target="_self" href='+dousemod_Arr[0][1]+' style="padding: 0px;"><img class=navbarimghead src='+TinbuSiteURL+'/'+dousemod_Arr[0][5]+'.png border=0 alt='+dousemod_Arr[0][0]+' height=24 width=24><br><span style="text-align:center;">'+dousemod_Arr[0][0]+'</span></a></div>');
		}
		dousemod_Arr.shift();
		dousemod_Arr.sort(function() {return 0.5 - Math.random()});	
		numMod++;
	}
	document.write('</div><br><br><br>');
}

function changeDisplayP(whereTo){
	if(typeof(document.getElementById(whereTo)) != "null" && typeof(document.getElementById(whereTo)) != "undefined"){
		if(document.getElementById(whereTo).innerHTML !=""){
			document.getElementById(whereTo).innerHTML = "";
		}
	}
}
function changeDisplayM(whereTo, addMe){
	if(typeof(document.getElementById(whereTo)) != "null" && typeof(document.getElementById(whereTo)) != "undefined"){
		if(document.getElementById(whereTo).innerHTML ==""){
			document.getElementById(whereTo).innerHTML = addMe;
		}
	}
}


//Cookie Information
var stll_crcookieArray = new Array(null);
 //Set Cookie
function stllcr_sc00k1e(cookie_name,cookie_value){ 
	document.cookie = cookie_name + '=' + escape(cookie_value);
}

//Get Cookie
function stll_gc00k1e(cookie_name) {
	var stlcrdcookie = document.cookie;
	var stlcrcname = cookie_name + "=";
	var stlcrclen = stlcrdcookie.length;
	var stlcrcbegin = 0;
		while (stlcrcbegin < stlcrclen)
		{
			var stlcrvbegin = stlcrcbegin + stlcrcname.length;
			if (stlcrdcookie.substring(stlcrcbegin, stlcrvbegin) == stlcrcname) {
				var stlcrvend = stlcrdcookie.indexOf (";", stlcrvbegin);
			if (stlcrvend == -1) stlcrvend = stlcrclen;
				return unescape(stlcrdcookie.substring(stlcrvbegin, stlcrvend));
		}
			stlcrcbegin = stlcrdcookie.indexOf(" ", stlcrcbegin) + 1;
			if (stlcrcbegin == 0) break;
		}
	return null;
} 

//Delete Cookie
function stlcr_dc00k1e(cookie_name){
	document.cookie = cookie_name + '=' + '; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';
}

//Get Array
function stlcr_g8rr8y(cookie_name){
	var stlcrentry = stll_gc00k1e(cookie_name);
	if (stlcrentry) {
		arr_idx = 1;
		while (stlcrentry.indexOf('¬') != '-1')
		{    
			stll_crcookieArray[arr_idx] = stlcrentry.substring(0,stlcrentry.indexOf('¬'));
			arr_idx++;
			stlcrentry = stlcrentry.substring(stlcrentry.indexOf('¬')+1, stlcrentry.length);
		}
	}
}

//Set array
function stlcr_s8rr8y(cookie_name, cookie_expires)
{
	var cookie_value = '';
	for (var arr_idx = 1; stll_crcookieArray[arr_idx]; arr_idx++){
		cookie_value += stll_crcookieArray[arr_idx] + '¬';
	}
	stllcr_sc00k1e(cookie_name, cookie_value);
}

//Delete Entry  
function stlcrdentry(cookie_name, cookie_pos, cookie_expires)
{
	var cookie_value = '';
		stlcr_g8rr8y(cookie_name);
	for (var arr_idx = 1; arr_idx < cookie_pos; arr_idx++){
		cookie_value += stll_crcookieArray[arr_idx] + '¬';
	}
	for (var array_idx = cookie_pos + 1; stll_crcookieArray[array_idx]; array_idx++){
		cookie_value += stll_crcookieArray[array_idx] + '¬';
	}
		stlcr_dc00k1e(cookie_name);
}

//Next Entry
function stlcrnentry() 
{
	var arr_idx = 0;
	for (var array_idx = 1; stll_crcookieArray[array_idx]; array_idx++)
	{
		arr_idx = array_idx
	}
	return arr_idx + 1;
}

//Winning Numbers
function checkFormAction(theForm){
	var checkVal = "";
	var error = "";
	checkVal = makecheckBoxed();
	if(checkVal == ""){
		error = "No Game has been selected. \n";
	}
	else{
		document.getElementById('whatschecked').value=checkVal;
	}
	error += ((document.getElementById('sdate').value=="")?"Start Date has not been selected.\n":"");
	error += ((document.getElementById('edate').value=="")?"End Date has not been selected.\n":"");
	if(error ==""){
		return true;
	}
	else{
		//alert(error);
		return false;
	}
}
function removeAllO(){
	if(document.getElementById('all_games').checked==true){
		for(var i = 1; i< idArr.length; i++){
			((document.getElementById('winnum_'+idArr[i]).checked==true)?document.getElementById('winnum_'+idArr[i]).checked=false:"");
		}
	}
}
function removeAllC(aId){
	if(document.getElementById(aId).checked==true){
			((document.getElementById("all_games").checked==true)?document.getElementById("all_games").checked=false:"");
	}
}
function makecheckBoxed(){
	var whatischecked = "";
	if(document.getElementById('all_games').checked==true){
		whatischecked = "0";
	}
	else{
		for(var i = 1; i< idArr.length; i++){
			if(document.getElementById('winnum_'+idArr[i]).checked==true){
				whatischecked +=((whatischecked=="")?"":",");
				whatischecked +=document.getElementById('winnum_'+idArr[i]).value;
			}
		}
	}
	return whatischecked;
}

function correctDate(dateType){
	var oldYear = "";
	var oldMonth = "";
	var oldDay = "";
	var newYear = "";
	var newMonth = "";
	var newDay = "";

	var achangeDate = "";
	var newdate = "";
	if(dateType == "0"){
		achangeDate = ((dateType=="0")?document.getElementById('sdate').value:document.getElementById('edate').value);
		achangeDate = achangeDate.split("-");
		oldYear = achangeDate[0];
		var isten = "no";
		oldMonth = achangeDate[1];
		oldDay = achangeDate[2];			
		if(oldMonth=="12"){
			oldMonth ="0";
			oldYear++;
		}
		else if(oldMonth=="11"){
		}
		else if(oldMonth=="10"){
			isten = "yes";
			oldMonth--;
		}
		else{
			oldMonth = ((oldMonth.charAt(0) == "0")?oldMonth = oldMonth.substr(1,1):oldMonth);
			oldMonth++;
		}
		oldDay = ((oldDay.charAt(0) == "0")?oldDay = oldDay.substr(1,1):oldDay);
		var dateMade = new Date(oldYear, oldMonth, oldDay);
		newYear = dateMade.getFullYear();
		newMonth = dateMade.getMonth();
		newMonth = newMonth.toString();
		newDay = dateMade.getDate();
		newDay = newDay.toString();
		if(newMonth=="12"){
			newYear++;
			newMonth = "01";
		}
		else if(newMonth=="11"){
			newMonth = "12";
		}
		if(isten=="yes"){
			newMonth = "11";
		}
		if(newMonth == "0"){
			newMonth = "1";
		}
		else{
			newMonth = ((newMonth.charAt(0) == "0")?newMonth = newMonth.substr(1,1):newMonth);
		}		
		newMonth = ((newMonth < 10)?"0"+newMonth:newMonth);
		newDay = ((newDay.charAt(0)!= "0" && newDay < 10)?newDay = "0"+newDay:newDay);
		newdate = newYear+"-"+newMonth+"-"+newDay;
	}
	else{
		achangeDate = ((dateType=="0")?document.getElementById('sdate').value:document.getElementById('edate').value);
		achangeDate = achangeDate.split("-");
		oldYear = achangeDate[0];
		var isten = "no";
		oldMonth = achangeDate[1];
		oldDay = achangeDate[2];
		if(oldMonth=="12" || oldMonth=="11" || oldMonth=="10"){
			oldMonth--;
		}
		else if(oldMonth == "01"){
			oldYear--;
			isten = "yes";
			oldMonth = "11";
		}
		else{
			oldMonth = ((oldMonth.charAt(0) == "0")?oldMonth = oldMonth.substr(1,1):oldMonth);
		}
		oldDay = ((oldDay.charAt(0) == "0")?oldDay = oldDay.substr(1,1):oldDay);
		var dateMade = new Date(oldYear, oldMonth, oldDay);
		newYear = dateMade.getFullYear();
		newMonth = dateMade.getMonth();
		newMonth = newMonth.toString();
		newDay = dateMade.getDate();
		newDay = newDay.toString();
		if(isten == "yes"){
			newMonth = "12";
		}
		else if(newMonth == "11"){
			newMonth = "11";
		}
		else if(newMonth =="10"){
			newMonth ="10";
		}
		else if(newMonth =="9"){
			newMonth ="08";
		}
		else{
			newMonth = ((newMonth.charAt(0) == "0")?newMonth = newMonth.substr(1,1):newMonth);
			newMonth--;
			newMonth = ((newMonth < 10)?"0"+newMonth:newMonth);
		}		
		newDay = ((newDay.charAt(0)!= "0" && newDay < 10)?newDay = "0"+newDay:newDay);
		newdate = newYear+"-"+newMonth+"-"+newDay;
	}
	if(dateType == "0"){
		document.getElementById('edate').value = newdate;
	}
	else{
		document.getElementById('sdate').value = newdate;
	}
}

function toggleExpando(object){
	//alert( "toggleExpando" );
	if ( object && object.parentNode && object.parentNode.className )
	{
		//alert( "toggleExpando" + object.parentNode.className);
		if ( object.parentNode.className == "closed" )
		{
			object.parentNode.className = "open";
			object.className = "open";
		}
		else
		{
			object.parentNode.className = "closed";
			object.className = "closed";
		}
	}
}

function stlgtkck(cookie_name) {
	var search = cookie_name + "=";
	var returnvalue = "";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) {
				end = document.cookie.length;
			}
			returnvalue = unescape(document.cookie.substring(offset, end));
		}
	}
	return returnvalue;
}
function stldopu(){
	if (stlgtkck('stltpu')=='') {
		var win2 = window.open("http://www.worldwidelotto.com/free_lottery/index.php?subid=lotlivepop","","scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1");
		win2.blur();
		window.focus();
		document.cookie = "stltpu=yes";
	}
}
stldopu();
