var showAmount="";
function calcResult(thisamount){
	if(thisamount < 100 ) showAmount = "<b>The amount you entered is too low for a bonus!</b>";
	else if(thisamount < 300){
		freeplay = Math.round(thisamount * 20)/100;
		buddyr = freeplay;
		total = freeplay+buddyr;
		showAmount = "<b>You qualify for 40% BRONZE bonuses!</b><br><br>You qualify for:<br>&middot; a <b>FREE play of $"+freeplay.toFixed(2)+"</b><!--<br>&middot; a Buddy Referral bonus of <b>$"+buddyr.toFixed(2)+"</b><br><br>Total bonus of <b>$"+total.toFixed(2)+"</b>-->";
	}
	else if(thisamount < 500){
		freeplay = Math.round(thisamount * 25)/100;
		buddyr = Math.round(thisamount * 20)/100;
		total = freeplay+buddyr;
		showAmount = "<b>You qualify for 80% SILVER bonuses!</b><br><br>You qualify for:<br>&middot; a <b>FREE play of $"+freeplay.toFixed(2)+"</b><!--<br>&middot; a Buddy Referral bonus of <b>$"+buddyr.toFixed(2)+"</b><br>&middot;  Gambler's Insurance of <b>$"+gambi.toFixed(2)+" twice a year</b><br><br>Total bonus of <b>$"+total.toFixed(2)+"</b>-->";
	}
	else if(thisamount < 1500){
		freeplay = Math.round(thisamount * 35)/100;
		buddyr = Math.round(thisamount * 20)/100;
		gambi = Math.round(thisamount * 15)/100;
		total = freeplay+buddyr+2*gambi;
		showAmount = "<b>You qualify for 85% GOLD bonuses!</b><br><br>You qualify for:<br>&middot; a <b>FREE play of $"+freeplay.toFixed(2)+"</b><!--<br>&middot; a Buddy Referral bonus of <b>$"+buddyr.toFixed(2)+"</b><br>&middot;  Gambler's Insurance of <b>$"+gambi.toFixed(2)+" twice a year</b><br><br>Total bonus of <b>$"+total.toFixed(2)+"</b>-->";
	}
	else{
		maxStr="";
		freeplay = Math.round(thisamount * 35)/100;
		if(freeplay > 700) {
			freeplay= 700;
			maxStr="&nbsp;<i>(Maximum Amount)</i>";
		}
		buddyr = Math.round(thisamount * 20)/100;
		gambi = Math.round(thisamount * 25)/100;
		total = freeplay+buddyr+2*gambi;
		showAmount = "<b>You qualify for 105% PLATINUM bonuses!</b><br><br>You qualify for:<br>&middot; a <b>FREE play of $"+freeplay.toFixed(2)+"</b>"+maxStr+"<!--<br>&middot; a Buddy Referral bonus of <b>$"+buddyr.toFixed(2)+"</b><br>&middot;  Gambler's Insurance of <b>$"+gambi.toFixed(2)+" twice a year</b><br><br>Total bonus of <b>$"+total.toFixed(2)+"</b>-->";
	}
	showResult(showAmount);
}
function showResult(thisstring){
	document.getElementById("result").innerHTML=thisstring;
	document.getElementById("result").innerHTML+="<br><br><a href=\"javascript:hideResult()\">click here to close</a>";
	document.getElementById("result").style.display="block";
}
function hideResult(){
	document.getElementById("result").style.display="none";
}