// JavaScript Document



function registrationmath (frommeareg)
{
var howmanygoing = document.getElementById('howmanygoing').value;
var registrationprice = "25";
var totalregistrationcost = (howmanygoing * registrationprice);

var fellowshipluncheon = document.getElementById('fellowshipluncheon').value;
var fellowshipluncheonprice = "19";
var fellowshipluncheoncost = (fellowshipluncheon * fellowshipluncheonprice);

var installationdinnerbroil = document.getElementById('broil').value;
var installationchicken = document.getElementById('chicken').value;
var totaldinner = parseInt(installationchicken) + parseInt(installationdinnerbroil);
var installationdinnercost = "29"
var totaldinnercost = (totaldinner * installationdinnercost);

var brunch = document.getElementById('brunch2').value;
var brunchcost = "20";
var brunchtotal = (brunch * brunchcost);

var totalevent = (totalregistrationcost+fellowshipluncheoncost+totaldinnercost+brunchtotal);

document.registrationform.regtotaldue.value = totalevent;


if (frommeareg == 'howmanygoing')
		{
			document.registrationform.regnum.value = howmanygoing;
			document.registrationform.regtotal.value = totalregistrationcost;
		}
if (frommeareg == 'luncheon')
		{
			
			document.registrationform.lunchmeal.value = fellowshipluncheon;	
			document.registrationform.lunchtotal.value = fellowshipluncheoncost;
		}

if (frommeareg == 'dinner1')
		{
			

			document.registrationform.dinnermeal.value = totaldinner;	
			document.registrationform.dinnertotal.value = totaldinnercost;
		}


if (frommeareg == 'brunch')
	{
			document.registrationform.brunchmeal.value = brunch;
			document.registrationform.brunchtotal.value = brunchtotal;
	}
	
	
	
	
	
}





function totalmath(fromwhere)
{
var maintainingaddedmembers = document.getElementById('maintainingclubgrowth').value;
var maintainingmemberpoints = "250";
var maintainingmemberstotal = (maintainingaddedmembers * maintainingmemberpoints);

var replacemembers = document.getElementById('replaceclubgrowth').value;
var replacememberpoints = "200";
var replacememberstotal = (replacemembers * replacememberpoints);

var netgainmembers = document.getElementById('membernetgain').value;
var netgainmemberpoints = "250";
var netgainmemberstotal = (netgainmembers * netgainmemberpoints);

var newclubq1 = document.getElementById('newclubq1').value;
var newclubq1points = "4000";
var newclubq1total = (newclubq1 * newclubq1points); 

var newclubq2 = document.getElementById('newclubq2').value;
var newclubq2points = "3500";
var newclubq2total = (newclubq2 * newclubq2points); 

var newclubq3 = document.getElementById('newclubq3').value;
var newclubq3points = "3000";
var newclubq3total = (newclubq3 * newclubq3points); 

var newclubq4 = document.getElementById('newclubq4').value;
var newclubq4points = "2500";
var newclubq4total = (newclubq4 * newclubq4points); 

var newclub35 = document.getElementById('newclub35').value;
var newclub35points = "500";
var newclub35total = (newclub35 * newclub35points); 

var newjooiclub = document.getElementById('newjooiclub').value;
var newjooiclubpoints = "1500";
var newjooiclubtotal = (newjooiclub * newjooiclubpoints);

var sponsorjooiclubq1 = document.getElementById('sponsorjooiclubq1').value;
var sponsorjooiclubq1points = "250";
var sponsorjooiclubq1total = (sponsorjooiclubq1 * sponsorjooiclubq1points);

var sponsorjooiclubq2 = document.getElementById('sponsorjooiclubq2').value;
var sponsorjooiclubq2points = "250";
var sponsorjooiclubq2total = (sponsorjooiclubq2 * sponsorjooiclubq2points);

var sponsorjooiclubq3 = document.getElementById('sponsorjooiclubq3').value;
var sponsorjooiclubq3points = "250";
var sponsorjooiclubq3total = (sponsorjooiclubq3 * sponsorjooiclubq3points);

var sponsorjooiclubq4 = document.getElementById('sponsorjooiclubq4').value;
var sponsorjooiclubq4points = "250";
var sponsorjooiclubq4total = (sponsorjooiclubq4 * sponsorjooiclubq4points);

var otherdistq1 = document.getElementById('otherdistq1').value;
var otherdistq1points = "250";
var otherdistq1total = (otherdistq1 * otherdistq1points);

var otherdistq2 = document.getElementById('otherdistq2').value;
var otherdistq2points = "250";
var otherdistq2total = (otherdistq2 * otherdistq2points);

var otherdistq3 = document.getElementById('otherdistq3').value;
var otherdistq3points = "250";
var otherdistq3total = (otherdistq3 * otherdistq3points);

var otherdistq4 = document.getElementById('otherdistq4').value;
var otherdistq4points = "250";
var otherdistq4total = (otherdistq4 * otherdistq4points);

var otherarea1 = document.getElementById('otherarea1').value;
var otherarea1points = "250";
var otherarea1total = (otherarea1 * otherarea1points);

var otherarea2 = document.getElementById('otherarea2').value;
var otherarea2points = "250";
var otherarea2total = (otherarea2 * otherarea2points);

var otherarea3 = document.getElementById('otherarea3').value;
var otherarea3points = "250";
var otherarea3total = (otherarea3 * otherarea3points);

var otherarea4 = document.getElementById('otherarea4').value;
var otherarea4points = "250";
var otherarea4total = (otherarea4 * otherarea4points);



var netgain5selected = document.getElementById('netgainclub5select');   
var netgain5value = netgain5selected.selectedIndex;       

if (netgain5value == '1')
{
	netgain5points = 0;
}
else
{
	netgain5points = 1500;	
}

var presdistq1 = document.getElementById('presdistq1');   
var presdistq1value = presdistq1.selectedIndex;

if (presdistq1value == '1')
{
	presdistq1points = 0;
}
else
{
	presdistq1points = 500;	
}

var presdistq2 = document.getElementById('presdistq2');   
var presdistq2value = presdistq2.selectedIndex;

if (presdistq2value == '1')
{
	presdistq2points = 0;
}
else
{
	presdistq2points = 500;	
}

var presdistq3 = document.getElementById('presdistq3');   
var presdistq3value = presdistq3.selectedIndex;

if (presdistq3value == '1')
{
	presdistq3points = 0;
}
else
{
	presdistq3points = 500;	
}

var presdistq4 = document.getElementById('presdistq4');   
var presdistq4value = presdistq4.selectedIndex;

if (presdistq4value == '1')
{
	presdistq4points = 0;
}
else
{
	presdistq4points = 500;	
}

var presarea1 = document.getElementById('presarea1');   
var presarea1value = presarea1.selectedIndex;

if (presarea1value == '1')
{
	presarea1points = 0;
}
else
{
	presarea1points = 500;	
}

var presarea2 = document.getElementById('presarea2');   
var presarea2value = presarea2.selectedIndex;

if (presarea2value == '1')
{
	presarea2points = 0;
}
else
{
	presarea2points = 500;	
}

var presarea3 = document.getElementById('presarea3');   
var presarea3value = presarea3.selectedIndex;

if (presarea3value == '1')
{
	presarea3points = 0;
}
else
{
	presarea3points = 500;	
}

var presarea4 = document.getElementById('presarea4');   
var presarea4value = presarea4.selectedIndex;

if (presarea4value == '1')
{
	presarea4points = 0;
}
else
{
	presarea4points = 500;	
}

var duesoiq1 = document.getElementById('duesoiq1');   
var duesoiq1value = duesoiq1.selectedIndex;

if (duesoiq1value == '1')
{
	duesoiq1points = 0;
}
else
{
	duesoiq1points = 250;	
}

var duesoiq2 = document.getElementById('duesoiq2');   
var duesoiq2value = duesoiq2.selectedIndex;

if (duesoiq2value == '1')
{
	duesoiq2points = 0;
}
else
{
	duesoiq2points = 250;	
}


var duesoiq3 = document.getElementById('duesoiq3');   
var duesoiq3value = duesoiq3.selectedIndex;

if (duesoiq3value == '1')
{
	duesoiq3points = 0;
}
else
{
	duesoiq3points = 250;	
}


var duesoiq4 = document.getElementById('duesoiq4');   
var duesoiq4value = duesoiq4.selectedIndex;

if (duesoiq4value == '1')
{
	duesoiq4points = 0;
}
else
{
	duesoiq4points = 250;	
}

var duesdtq1 = document.getElementById('duesdtq1');   
var duesdtq1value = duesdtq1.selectedIndex;

if (duesdtq1value == '1')
{
	duesdtq1points = 0;
}
else
{
	duesdtq1points = 250;	
}

var duesdtq2 = document.getElementById('duesdtq2');   
var duesdtq2value = duesdtq2.selectedIndex;

if (duesdtq2value == '1')
{
	duesdtq2points = 0;
}
else
{
	duesdtq2points = 250;	
}

var duesdtq3 = document.getElementById('duesdtq3');   
var duesdtq3value = duesdtq3.selectedIndex;

if (duesdtq3value == '1')
{
	duesdtq3points = 0;
}
else
{
	duesdtq3points = 250;	
}
var duesdtq4 = document.getElementById('duesdtq4');   
var duesdtq4value = duesdtq4.selectedIndex;

if (duesdtq4value == '1')
{
	duesdtq4points = 0;
}
else
{
	duesdtq4points = 250;	
}
totalpoints = Math.floor(netgainmemberstotal+replacememberstotal+maintainingmemberstotal+netgain5points+newclubq1total+newclubq2total+newclubq3total+newclubq4total+newclub35total+newjooiclubtotal+sponsorjooiclubq1total+sponsorjooiclubq2total+sponsorjooiclubq3total+sponsorjooiclubq4total+presdistq4points+presdistq3points+presdistq2points+presdistq1points+presarea4points+presarea3points+presarea2points+presarea1points+otherdistq1total+otherdistq2total+otherdistq3total+otherdistq4total+otherarea1total+otherarea2total+otherarea3total+otherarea4total+duesoiq1points+duesoiq2points+duesoiq3points+duesoiq4points+duesdtq1points+duesdtq2points+duesdtq3points+duesdtq4points);

document.addedvalues.totalpoints.value = totalpoints;

if (fromwhere == 'duesdtq4')
		{
			document.addedvalues.duesdtq4points.value = duesdtq4points;
		}
if (fromwhere == 'duesdtq3')
		{
			document.addedvalues.duesdtq3points.value = duesdtq3points;
		}
if (fromwhere == 'duesdtq2')
		{
			document.addedvalues.duesdtq2points.value = duesdtq2points;
		}
		
if (fromwhere == 'duesdtq1')
		{
			document.addedvalues.duesdtq1points.value = duesdtq1points;
		}
		
		
if (fromwhere == 'duesoiq4')
		{
			document.addedvalues.duesoiq4points.value = duesoiq4points;
		}
if (fromwhere == 'duesoiq3')
		{
			document.addedvalues.duesoiq3points.value = duesoiq3points;
		}
if (fromwhere == 'duesoiq2')
		{
			document.addedvalues.duesoiq2points.value = duesoiq2points;
		}
if (fromwhere == 'duesoiq1')
		{
			document.addedvalues.duesoiq1points.value = duesoiq1points;
		}
	
	if (fromwhere == 'mmbers')
		{
			document.addedvalues.maintainingtotalclubgrowth.value = maintainingmemberstotal;
		}
	if (fromwhere == 'rmbers')
		{
			document.addedvalues.replacetotalclubgrowth.value = replacememberstotal;
		}
	if (fromwhere == 'ngmbers')
		{
			document.addedvalues.netgainclubgrowth.value = netgainmemberstotal;	
		}
	if (fromwhere == 'netgain5')
		{
			document.addedvalues.netgainclubgrowth5.value = netgain5points;
		}
	if (fromwhere == 'newclubq1')
		{
			document.addedvalues.newclubq1points.value = newclubq1total ;
		}
	if (fromwhere == 'newclubq2')
		{
			document.addedvalues.newclubq2points.value = newclubq2total ;
		}
	if (fromwhere == 'newclubq3')
		{
			document.addedvalues.newclubq3points.value = newclubq3total ;
		}
	if (fromwhere == 'newclubq4')
		{
			document.addedvalues.newclubq4points.value = newclubq4total ;
		}
	if (fromwhere == 'newclub35')
		{
			document.addedvalues.newclub35points.value = newclub35total ;
		}
	if (fromwhere == 'newjooiclub')
		{
			document.addedvalues.newjooiclubpoints.value = newjooiclubtotal;
		}
	if (fromwhere == 'sponsorjooiclubq1')
		{
			document.addedvalues.sponsorjooiclubq1points.value = sponsorjooiclubq1total ;
		}
	if (fromwhere == 'sponsorjooiclubq2')
		{
			document.addedvalues.sponsorjooiclubq2points.value = sponsorjooiclubq2total ;
		}
	if (fromwhere == 'sponsorjooiclubq3')
		{
			document.addedvalues.sponsorjooiclubq3points.value = sponsorjooiclubq3total ;
		}
	if (fromwhere == 'sponsorjooiclubq4')
		{
			document.addedvalues.sponsorjooiclubq4points.value = sponsorjooiclubq4total ;
		}
	if (fromwhere == 'presdistq4')
		{
			document.addedvalues.presdistq4points.value = presdistq4points ;
		}
	if (fromwhere == 'presdistq3')
		{
			document.addedvalues.presdistq3points.value = presdistq3points ;
		}	
	if (fromwhere == 'presdistq2')
		{
			document.addedvalues.presdistq2points.value = presdistq2points ;
		}
	if (fromwhere == 'presdistq1')
		{
			document.addedvalues.presdistq1points.value = presdistq1points ;
		}
	if (fromwhere == 'presarea1')
		{
			document.addedvalues.presarea1points.value = presarea1points ;
		}
	if (fromwhere == 'presarea4')
		{
			document.addedvalues.presarea4points.value = presarea4points ;
		}
	if (fromwhere == 'presarea3')
		{
			document.addedvalues.presarea3points.value = presarea3points ;
		}	
	if (fromwhere == 'presarea2')
		{
			document.addedvalues.presarea2points.value = presarea2points ;
		}
	if (fromwhere == 'presarea1')
		{
			document.addedvalues.presarea1points.value = presarea1points ;
		}
		
	if (fromwhere == 'otherdistq1')
		{
			document.addedvalues.otherdistq1points.value = otherdistq1total ;
		}
	if (fromwhere == 'otherdistq2')
		{
			document.addedvalues.otherdistq2points.value = otherdistq2total ;
		}
	if (fromwhere == 'otherdistq3')
		{
			document.addedvalues.otherdistq3points.value = otherdistq3total ;
		}
	if (fromwhere == 'otherdistq4')
		{
			document.addedvalues.otherdistq4points.value = otherdistq4total ;
		}
	if (fromwhere == 'otherarea1')
		{
			document.addedvalues.otherarea1points.value = otherarea1total ;
		}
	if (fromwhere == 'otherarea2')
		{
			document.addedvalues.otherarea2points.value = otherarea2total ;
		}
	if (fromwhere == 'otherarea3')
		{
			document.addedvalues.otherarea3points.value = otherarea3total ;
		}
	if (fromwhere == 'otherarea4')
		{
			document.addedvalues.otherarea4points.value = otherarea4total ;
		}
	
}
