function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject(); 

var spons = "0";

function getNumber() {

for (i=0;i < document.form1.sponsorship.length; i++)
{
	if (document.form1.sponsorship[i].checked)
	{
		spons = document.form1.sponsorship[i].value;
	}
}


if (spons == "Contribution") {
		var spons = parseInt(document.form1.contribution.value);
			
		} else if (spons == "10000") {
			var no = 8;
		} else if (spons == "7500") {
			var no = 4;
		} else if (spons == "5000") {
			var no = 4; 
		} else if (spons == "3500") {
			var no = 4; 
		} else if (spons == "1000a") {
			var no = 4;
			var spons = "1000";
		} else if (spons == "225") {
			var no = parseInt(document.form1.gno.value);
			var spons = parseInt(no * spons);
		} else if (isNaN(spons)){
			var spons = "0";
		}
		
			var dinner = parseInt(document.form1.dinspons.value);
			var dinners = parseInt(document.form1.dno.value);
			var dine = parseInt(dinners * dinner);
			var spon = parseInt(spons);
			var spons = parseInt(dine + spon);
			

if(no != " "){
	var inserttable = ' ';
	for (i=1; i < no + 1; i++) {
  		inserttable += '<table width="550" border="0" cellpadding="4" align="center" cellspacing="0" class="bodycopy" bgcolor="#FFFFFF" ><tr>';
 		inserttable += '<td bgcolor="#003300"><font color="#ffffff"><b>Player Registration ' + i + '</b></font></td>';
  		inserttable += '</tr><tr><td>Name: <input name="golfer' + i + '" type="text" id="golfer" size="50"></td>';
 		inserttable += '</tr><tr><td>Address:<input name="g_address' + i + '" type="text" id="g_address" size="47"></td></tr>';
		inserttable += '<tr><td>City:<input name="g_city' + i + '" type="text" id="g_city" size="35"> State:<input name="g_state' + i + '" type="text" id="g_state" size="5"> Zip:<input name="g_zip' + i + '" type="text" id="g_zip" size="10"></td></tr>';
  		inserttable += '<tr> <td>Phone:<input name="g_phone' + i + '" type="text" id="g_phone" size="10">';
   		inserttable += '&nbsp;E-mail:<input name="g_email' + i + '" type="text" id="g_email"></td></tr></table>';
 		 }
		document.getElementById('golfers').innerHTML = inserttable;
	 } /*else {
		var inserttable = '<table><tr><td>No Players</td></tr></table>';
  		document.getElementById('golfers').innerHTML = inserttable;
	 } */
		document.form1.totalSpons.value = spons;
}

function getad(ad) {

for (i=0;i < document.form1.ad.length; i++)
{
	if (document.form1.ad[i].checked)
	{
		spons = document.form1.ad[i].value;
	}
}

document.form1.totalSpons.value = spons;
document.form1.adsize.value = ad;
}

function getSponsor(n) {

	document.form1.totalSpons.value = n;
	document.form1.att.focus();

}

function getTickets(tix){
	var no = parseInt(document.form1.att.value);
	
	var tix = parseInt(no * tix);
	document.form1.totatt.value = tix;
	if(tix == ''){
		var tix = 0;
	}
	var spons = parseInt(document.form1.totalSpons.value);
	if(spons = ''){
		var spons = 0;
	}
	var tot = parseInt(tix + spons);
	document.form1.total.value = tot;
	}
	
	
function getTennis() {
var spons = 0;	
for (i=0;i < document.form1.sponsorship.length; i++)
{
	if (document.form1.sponsorship[i].checked) {
		spons = document.form1.sponsorship[i].value;
	} 
}

dinner = parseInt(document.form1.dinspons.value);
	
	if(dinner = '') {
		var dinner = 0;
	}

	
	var spons = parseInt(spons);
			var dinners = parseInt(document.form1.dno.value);
				if(dinners = '') {
					var dinners = 0;
				}
			var dine = parseInt(dinners * dinner);
			var spon = parseInt(dine + spons);
	
	document.form1.totalSpons.value = spon;
		

	
}
	
	
function getDiners(){
	
	dinner = parseInt(document.form1.dinspons.value);
	
			var dinners = parseInt(document.form1.dno.value);
			var dine = parseInt(dinners * dinner);
			var spon = parseInt(dine * spons);
	
	document.form1.totalSpons.value = spon;
		
		 
}