//The progressive textboxes must be like make sure that the stylesheet is included and has a class tbvsmall
//<input id="tbBB" name="tbBB" class="tbvsmall" type="text" size="9">
//The id's must be:
//BingoBonanza = id="tbBB"
//FruitFrenzee = id="tbFF"
//SuperSeven = id="tbSS"
//Slots of Bingo = id="tbSoB"
//Pyramids of Cash = id="tbPoC"
//onload=load_progressive();

var BB1 = 0;
var FF1 = 0;
var SS1 = 0;
var SoB1 = 0;
var POC1 = 0;
		

function load_progressive()
{
		BB1 = BB;
		FF1 = FF;
		SS1 = S7;
		SoB1 = SOB;
		POC1 = COF;
		
		Set_ProgressiveSOB();
		Set_ProgressiveBB();
		Set_ProgressiveFF();
		Set_ProgressiveSS();
		Set_ProgressivePOC();	
}

function Set_ProgressiveSOB()
{		

	SoB1 = SoB1 + 1;
	
	thisDefIP4 = document.getElementById("tbSoB");
	thisDefIP4.value = DollarAmount(SoB1);
		
	setTimeout("Set_ProgressiveSOB()",1500);
}


function Set_ProgressiveBB()
{		
	BB1 = BB1 + 1;
	
	thisDefIP1 = document.getElementById("tbBB");
	thisDefIP1.value = DollarAmount(BB1);

	setTimeout("Set_ProgressiveBB()",2020);
}

function Set_ProgressiveFF()
{		

	FF1 = FF1 + 1;
		
	thisDefIP2 = document.getElementById("tbFF");
	thisDefIP2.value = DollarAmount(FF1);

	setTimeout("Set_ProgressiveFF()",2000);
}

function Set_ProgressiveSS()
{		

	SS1 = SS1 + 1;
		
	thisDefIP3 = document.getElementById("tbSS");
	thisDefIP3.value = DollarAmount(SS1);
		
	setTimeout("Set_ProgressiveSS()",1750);
}

function Set_ProgressivePOC()
{		

	POC1 = POC1 + 1;
		
	thisDefPOC = document.getElementById("tbPoC");
	thisDefPOC.value = DollarAmount(POC1);
		
	setTimeout("Set_ProgressivePOC()",1800);
}

function DollarAmount(amount) 
{ 


	var i = parseFloat(amount/100);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }


	Num = s;

	dec = Num.indexOf(".");
	end = ((dec > -1) ? "" + Num.substring(dec,Num.length) : ".00");
	Num = "" + parseInt(Num);

	var temp1 = "";
	var temp2 = "";

	if (end.length == 2) end += "0";
	if (end.length == 1) end += "00";
	if (end == "") end += ".00";



	var count = 0;
	for (var k = Num.length-1; k >= 0; k--) 
	{

		var oneChar = Num.charAt(k);
		if (count == 3) 
		{
			temp1 += ",";
			temp1 += oneChar;
			count = 1;
			continue;
		}
		else {
			temp1 += oneChar;
			count ++;
		}
	}


	for (var k = temp1.length-1; k >= 0; k--) 
	{
		var oneChar = temp1.charAt(k);
		temp2 += oneChar;
	}

	temp2 = "$" + temp2 + end;
	return temp2;

}


