// JavaScript Document
// leadcupturemaster.com (c) 2011
function calcthis()
{ 
var planperc=new Array(0,0,0,0,0,0);

var depo = document.getElementById("deposit").value;
var perc = document.getElementById("percent").value;

if (perc == "perc1") {planperc=Array(105, 106, 107, 108, 118, 128);};
if (perc == "perc2") {planperc=Array(117, 120, 125, 150, 180, 235);};
if (perc == "perc3") {planperc=Array(142, 150, 158, 250, 375, 630);};
if (perc == "perc4") {planperc=Array(200, 215, 238, 300, 750, 1125);};
if (perc == "perc5") {planperc=Array(0, 360, 420, 600, 1001 ,2750);};


if ( depo <10)
  {
	document.getElementById("inpvar1").innerHTML = "n/a";
	document.getElementById("inpvar2").innerHTML = "n/a";						
	alert ("Minimal deposit is $10")	
  }  
else
  {
	if (perc == "perc5")
	  {
		if (depo < 500) 
		  {
			document.getElementById("inpvar1").innerHTML = "n/a";
			document.getElementById("inpvar2").innerHTML = "n/a";						
			alert ("Minimal deposit for this plan is $500");			
		  }
		else 
		  {
			document.getElementById("inpvar1").innerHTML = planperc[1];
			document.getElementById("inpvar2").innerHTML = planperc[1] * depo / 100;
		  }
	  }
	else
	  {
	  document.getElementById("inpvar1").innerHTML = planperc[0];
	  document.getElementById("inpvar2").innerHTML = planperc[0] * depo / 100;
	  }
	
	if ( depo >500)
	  {
		document.getElementById("inpvar1").innerHTML = planperc[1];
		document.getElementById("inpvar2").innerHTML = planperc[1] * depo / 100;
		if ( depo > 1000)
		  {
			document.getElementById("inpvar1").innerHTML = planperc[2];
			document.getElementById("inpvar2").innerHTML = planperc[2] * depo / 100;
			if ( depo > 3000)
			  {
				document.getElementById("inpvar1").innerHTML = planperc[3];
				document.getElementById("inpvar2").innerHTML = planperc[3] * depo / 100;
				if ( depo > 5000)
				  {
					document.getElementById("inpvar1").innerHTML = planperc[4];
					document.getElementById("inpvar2").innerHTML = planperc[4] * depo / 100;
					if ( depo > 10000)
					  {
						document.getElementById("inpvar1").innerHTML = planperc[5];
						document.getElementById("inpvar2").innerHTML = planperc[5] * depo / 100;
						if ( depo > 50000)
						  {
							document.getElementById("inpvar1").innerHTML = "n/a";
							document.getElementById("inpvar2").innerHTML = "n/a";
							alert ("Maximal deposit is $50000")						
						  }						
					  }					
				  }
			  }
		  }
	  }
  }
}