function dynamicSelect(id1, id2) {
	// Feature test to see if there is enough W3C DOM support
	if (document.getElementById && document.getElementsByTagName) {
		// Obtain references to both select boxes
		var sel1 = document.getElementById(id1);
		var sel2 = document.getElementById(id2);
		// Clone the dynamic select box
		var clone = sel2.cloneNode(true);
		// Obtain references to all cloned options 
		var clonedOptions = clone.getElementsByTagName("option");
		// Onload init: call a generic function to display the related options in the dynamic select box
		refreshDynamicSelectOptions(sel1, sel2, clonedOptions);
		// Onchange of the main select box: call a generic function to display the related options in the dynamic select box
		sel1.onchange = function() {
			refreshDynamicSelectOptions(sel1, sel2, clonedOptions);
		};
	}
}
function refreshDynamicSelectOptions(sel1, sel2, clonedOptions) {
	// Delete all options of the dynamic select box
	while (sel2.options.length) {
		sel2.remove(0);
	}
	// Create regular expression objects for "select" and the value of the selected option of the main select box as class names
	var pattern1 = /( |^)(select)( |$)/;
	var pattern2 = new RegExp("( |^)(" + sel1.options[sel1.selectedIndex].value + ")( |$)");
	// Iterate through all cloned options
	for (var i = 0; i < clonedOptions.length; i++) {
		// If the classname of a cloned option either equals "select" or equals the value of the selected option of the main select box
		if (clonedOptions[i].className.match(pattern1) || clonedOptions[i].className.match(pattern2)) {
			// Clone the option from the hidden option pool and append it to the dynamic select box
			sel2.appendChild(clonedOptions[i].cloneNode(true));
		}
	}
}
function checkifempty(){
if (document.ringGamesform.ringGames.value=='no')
{
document.ringGamesform.gameType.disabled=true;
document.ringGamesform.gameType.value="80";
document.ringGamesform.noGames.disabled=true;
document.ringGamesform.noGames.value=1;
document.ringGamesform.hrsPerWeek.disabled=true;
document.ringGamesform.hrsPerWeek.value="0";
document.ringGamesform.stake.disabled=true;
document.ringGamesform.stake.value="0.15";
document.getElementById('ringDiv').style.display = "block";
}
else
{
document.ringGamesform.gameType.disabled=false;
document.ringGamesform.noGames.disabled=false;
document.ringGamesform.hrsPerWeek.disabled=false;
document.ringGamesform.stake.disabled=false;
document.getElementById('ringDiv').style.display = "block";
}
if (document.ringGamesform.sitGos.value=='no')
{
document.ringGamesform.tableSeats.disabled=true;
document.ringGamesform.tableSeats.value="6";
document.ringGamesform.sitGoSpeed.disabled=true;
document.ringGamesform.sitGoSpeed.value="3";
document.ringGamesform.sitGoNoTables.disabled=true;
document.ringGamesform.sitGoNoTables.value="1";
document.ringGamesform.hrsPerWeekSitGo.disabled=true;
document.ringGamesform.hrsPerWeekSitGo.value="0";
document.ringGamesform.avgBuyIn.disabled=true;
document.ringGamesform.avgBuyIn.value="3";
document.getElementById('sitgoDiv').style.display = "block";
}
else
{
document.ringGamesform.tableSeats.disabled=false;
document.ringGamesform.sitGoSpeed.disabled=false;
document.ringGamesform.sitGoNoTables.disabled=false;
document.ringGamesform.hrsPerWeekSitGo.disabled=false;
document.ringGamesform.avgBuyIn.disabled=false;
document.getElementById('sitgoDiv').style.display = "block";
}
if (document.ringGamesform.sitGoHead.value=='no')
{
document.ringGamesform.sitGoHeadSpeed.disabled=true;
document.ringGamesform.sitGoHeadSpeed.value=6;
document.ringGamesform.sitGoHeadsNoTables.disabled=true;
document.ringGamesform.sitGoHeadsNoTables.value=1;
document.ringGamesform.hrsPerWeekSitGoHead.disabled=true;
document.ringGamesform.hrsPerWeekSitGoHead.value="0";
document.ringGamesform.headAvgBuyIn.disabled=true;
document.ringGamesform.headAvgBuyIn.value=3;
document.getElementById('sitgoheadDiv').style.display = "block";
}
else
{
document.ringGamesform.sitGoHeadSpeed.disabled=false;
document.ringGamesform.sitGoHeadsNoTables.disabled=false;
document.ringGamesform.hrsPerWeekSitGoHead.disabled=false;
document.ringGamesform.headAvgBuyIn.disabled=false;
document.getElementById('sitgoheadDiv').style.display = "block";
}
if (document.ringGamesform.multiTableTourn.value=='no')
{
document.ringGamesform.hrsPerWeekMultiTable.disabled=true;
document.ringGamesform.hrsPerWeekMultiTable.value="";
document.ringGamesform.avgBuyInMulti.disabled=true;
document.ringGamesform.avgBuyInMulti.value=5;
document.getElementById('multiDiv').style.display = "block";
}
else
{
document.ringGamesform.hrsPerWeekMultiTable.disabled=false;
document.ringGamesform.avgBuyInMulti.disabled=false;
document.getElementById('multiDiv').style.display = "block";

}
}
if (document.all || document.getElementById)
setInterval("checkifempty()",100);
function showBlock()
{
document.getElementById('calc').style.display = "none";
document.getElementById('recalc').style.display = "block";
document.getElementById('screen').style.display = "block";
if (document.ringGamesform.vipLevel.value=='bronze')
  {
    document.getElementById('bronze').style.display = "block";
 	document.getElementById('silver').style.display = "none";
	document.getElementById('gold').style.display = "none";
	document.getElementById('platinum').style.display = "none";
	document.getElementById('supernova').style.display = "none";
	document.getElementById('supernovaelite').style.display = "none";
  }
else if (document.ringGamesform.vipLevel.value=='silver')
{
	document.getElementById('bronze').style.display = "none";
 	document.getElementById('silver').style.display = "block";
	document.getElementById('gold').style.display = "none";
	document.getElementById('platinum').style.display = "none";
	document.getElementById('supernova').style.display = "none";
	document.getElementById('supernovaelite').style.display = "none";
	}
else if (document.ringGamesform.vipLevel.value=='gold')
{
	document.getElementById('bronze').style.display = "none";
 	document.getElementById('silver').style.display = "none";
	document.getElementById('gold').style.display = "block";
	document.getElementById('platinum').style.display = "none";
	document.getElementById('supernova').style.display = "none";
	document.getElementById('supernovaelite').style.display = "none";
	}
else if (document.ringGamesform.vipLevel.value=='platinum')
{
	document.getElementById('bronze').style.display = "none";
 	document.getElementById('silver').style.display = "none";
	document.getElementById('gold').style.display = "none";
	document.getElementById('platinum').style.display = "block";
	document.getElementById('supernova').style.display = "none";
	document.getElementById('supernovaelite').style.display = "none";
	}
else if (document.ringGamesform.vipLevel.value=='supernova')
{
	document.getElementById('bronze').style.display = "none";
 	document.getElementById('silver').style.display = "none";
	document.getElementById('gold').style.display = "none";
	document.getElementById('platinum').style.display = "none";
	document.getElementById('supernova').style.display = "block";
	document.getElementById('supernovaelite').style.display = "none";
	}
else if (document.ringGamesform.vipLevel.value=='supernovaelite')
{
	document.getElementById('bronze').style.display = "none";
 	document.getElementById('silver').style.display = "none";
	document.getElementById('gold').style.display = "none";
	document.getElementById('platinum').style.display = "none";
	document.getElementById('supernova').style.display = "none";
	document.getElementById('supernovaelite').style.display = "block";
	}
else
{
	document.getElementById('bronze').style.display = "none";
 	document.getElementById('silver').style.display = "none";
	document.getElementById('gold').style.display = "none";
	document.getElementById('platinum').style.display = "none";
	document.getElementById('supernova').style.display = "none";
	document.getElementById('supernovaelite').style.display = "none";
	}
document.getElementById('bronzecontainer').innerHTML = (monthlyVipLevel);
document.getElementById('silvercontainer').innerHTML = (monthlyVipLevel);
document.getElementById('goldcontainer').innerHTML = (monthlyVipLevel);
document.getElementById('platinumcontainer').innerHTML = (monthlyVipLevel);
document.getElementById('supernovacontainer').innerHTML = (monthlyVipLevel);
document.getElementById('supernovaelitecontainer').innerHTML = (monthlyVipLevel);
document.getElementById('bronzefpp').innerHTML = (document.ringGamesform.monthlyFppLevel.value);
document.getElementById('silverfpp').innerHTML = (document.ringGamesform.monthlyFppLevel.value);
document.getElementById('goldfpp').innerHTML = (document.ringGamesform.monthlyFppLevel.value);
document.getElementById('platinumfpp').innerHTML = (document.ringGamesform.monthlyFppLevel.value);
document.getElementById('supernovafpp').innerHTML = (document.ringGamesform.monthlyFppLevel.value);
document.getElementById('supernovaelitefpp').innerHTML = (document.ringGamesform.monthlyFppLevel.value);
if (monthlyVipLevel > 1300 && monthlyVipLevel <= 1499)
{
document.getElementById('bronzepromote').innerHTML = "<a href=\"http://www.pokerstars.com/vip/silver/\" target=\"_blank\"><img src=\"http://www.pokerstars.com/poker/affiliate/calculator/images/vip_silver2.jpg\" alt=\"SilverStar Poker Rewards\" class=\"imgAlignRight\"/></a><p>Earn " + (1500 - monthlyVipLevel) + " VPPs more, and you’ll become a <span class=\"strong\"><a href=\"http://www.pokerstars.com/vip/silver/\" target=\"_blank\">SilverStar</a></span> VIP. Adjust your play information above to see how much more you need to play to reach <span class=\"strong\">SilverStar</span> status.</p>";
document.getElementById('silverpromote').innerHTML = "";
document.getElementById('goldpromote').innerHTML = "";
}
else if (monthlyVipLevel > 3200 && monthlyVipLevel <= 3999)
{
document.getElementById('bronzepromote').innerHTML = "";
document.getElementById('silverpromote').innerHTML = "<a href=\"http://www.pokerstars.com/vip/gold/\" target=\"_blank\"><img src=\"http://www.pokerstars.com/poker/affiliate/calculator/images/vip_gold2.jpg\" alt=\"GoldStar Bonuses and Rewards\" class=\"imgAlignRight\"/></a><p>Earn " + (4000 - monthlyVipLevel) + " VPPs more, and you’ll become a <span class=\"strong\"><a href=\"http://www.pokerstars.com/vip/gold/\" target=\"_blank\">GoldStar</a></span> VIP. Adjust your play information above to see how much more you need to play to reach <span class=\"strong\">GoldStar</span> status.</p>";
document.getElementById('goldpromote').innerHTML = "";
}
else if (monthlyVipLevel > 8332 && monthlyVipLevel <= 9999)
{
	document.getElementById('bronzepromote').innerHTML = "";
	document.getElementById('silverpromote').innerHTML = "";
document.getElementById('goldpromote').innerHTML = "<a href=\"http://www.pokerstars.com/vip/platinum/\" target=\"_blank\"><img src=\"http://www.pokerstars.com/poker/affiliate/calculator/images/vip_platinum2.jpg\" alt=\"PlatinumStar Poker Promotions\" /></a><p>Earn " + (10000 - monthlyVipLevel) + " VPPs more, and you’ll become a <span class=\"strong\"><a href=\"http://www.pokerstars.com/vip/platinum/\" target=\"_blank\">PlatinumStar</a></span> VIP. Adjust your play information above to see how much more you need to play to reach <span class=\"strong\">PlatinumStar</span> status.</p>"; 
}
else
{
document.getElementById('bronzepromote').innerHTML = "";
document.getElementById('silverpromote').innerHTML = "";
document.getElementById('goldpromote').innerHTML = "";
}
	}

var ringtot
var sittot
var sitheadtot
var multitot
var tot
var monthlyVipLevel
function calc(){
  var ringone = document.ringGamesform.noGames.value;
  var ringtwo = document.ringGamesform.hrsPerWeek.value;
  var ringthree = document.ringGamesform.gameType.value;
  var ringfour = document.ringGamesform.stake.value; 
  ringtot = ((ringone * 1) * (ringtwo * 1) * (ringthree * 1)) * (ringfour * 1);
  
  var sitone = document.ringGamesform.sitGoSpeed.value;
  var sittwo = document.ringGamesform.sitGoNoTables.value;
  var sitthree = document.ringGamesform.avgBuyIn.value;
  var sitfour = document.ringGamesform.hrsPerWeekSitGo.value;
  sittot = ((sitone * 1) * (sittwo * 1) * (sitthree * 1)) * (sitfour * 1);

  var sitheadone = document.ringGamesform.sitGoHeadSpeed.value;
  var sitheadtwo = document.ringGamesform.sitGoHeadsNoTables.value;
  var sitheadthree = document.ringGamesform.hrsPerWeekSitGoHead.value;
  var sitheadfour = document.ringGamesform.headAvgBuyIn.value;
  sitheadtot = ((sitheadone * 1) * (sitheadtwo * 1) * (sitheadthree * 1)) * (sitheadfour * 1);

  var multione = document.ringGamesform.hrsPerWeekMultiTable.value;
  var multitwo = document.ringGamesform.avgBuyInMulti.value;
  multitot = (multione * 1) * (multitwo * 1);
  
  tot = (ringtot * 1) + (sittot * 1) + (sitheadtot * 1) + (multitot * 1);
  
 monthlyVipLevel = Math.round((tot)*4.3);
}
setInterval("calc()",1000);
function calcTotal(){
  
  var total = monthlyVipLevel;
if (total<1500)
{
var bronzetotal=total;
var silvertotal=0;
var goldtotal=0;
var platinumtotal=0;
var supernovatotal=0;
var supernovaelitetotal=0;
}
else if (total>=1500 && total<4000)
{
var bronzetotal=1500;
var silvertotal= (total-1500);
var goldtotal=0
var platinumtotal=0
var supernovatotal=0;
var supernovaelitetotal=0;
}
else if (total>=4000 && total<10000)
{
var bronzetotal=1500;
var silvertotal= (2500);
var goldtotal= (total-4000);
var platinumtotal=0
var supernovatotal=0;
var supernovaelitetotal=0;
}
else if (total>10000 && total<100000)
{
var bronzetotal=1500;
var silvertotal=2500;
var goldtotal=6000;
var platinumtotal=(total-10000);
var supernovatotal=0;
var supernovaelitetotal=0;
}
else if (total>99999 && total<999999)
{
var bronzetotal=1500;
var silvertotal=2500;
var goldtotal=6000;
var platinumtotal=90000;
var supernovatotal=(total-100000);
var supernovaelitetotal=0;
}
else if (total>999999)
{
var bronzetotal=1500;
var silvertotal=2500;
var goldtotal=6000;
var platinumtotal=90000;
var supernovatotal=900000;
var supernovaelitetotal=(total-1000000);
}
else
{
var bronzetotal=0;
var silvertotal=0;
var goldtotal=0;
var platinumtotal=0;
var supernovatotal=0;
var supernovaelitetotal=0;
}
var fppTotal = (bronzetotal * 1) + (silvertotal * 1.5) + (goldtotal * 2) + (platinumtotal * 2.5) + (supernovatotal * 3.5) + (supernovaelitetotal * 5);
document.ringGamesform.monthlyFppLevel.value = Math.round(fppTotal);
}
setInterval("calcTotal()",100);

function viptotal(){
if (monthlyVipLevel > 999999)
{
document.ringGamesform.vipLevel.value ="supernovaelite";
}
else if (monthlyVipLevel > 99999 && monthlyVipLevel <= 999999)
{
document.ringGamesform.vipLevel.value ="supernova";
}
else if (monthlyVipLevel > 9999 && monthlyVipLevel <= 99999)
{
document.ringGamesform.vipLevel.value ="platinum";
}
else if (monthlyVipLevel > 3999 && monthlyVipLevel <= 9999)
{
document.ringGamesform.vipLevel.value ="gold";
}
else if (monthlyVipLevel > 1499 && monthlyVipLevel <= 3999)
{
document.ringGamesform.vipLevel.value ="silver";
}
else
{
document.ringGamesform.vipLevel.value ="bronze";
}
}
setInterval("viptotal()",100);