// JavaScript Document

var thetotal = ''
var theproduct = ''
var theneed = ''
var theprice = ''
var thephoto = ''
var thedescription = 'These goals blend sturdiness with portability. Owning our own set of goals will gives us more flexibility in hosting games and in determining where we can play.'
var q1='';var q2='';var q3=''; var q4='';var q5='';var q6='';


var product = new Array
product[0] = "goals"
product[1] = "balls"
product[2] = "cones"
product[3] = "pumps"
product[4] = "anklebraces"
product[5] = "giftcards"

var title = new Array
title[0] = "Futsal Goals"
title[1] = "Futsal Balls"
title[2] = "Training Cones"
title[3] = "Ball Pump"
title[4] = "Ankle Brace"
title[5] = "Gift Card"

var need = new Array
need[0] = "images/need1.gif"
need[1] = "images/need2.gif"
need[2] = "images/need3.gif"
need[3] = "images/need3.gif"
need[4] = "images/need1.gif"
need[5] = "images/need2.gif"

var price = new Array
price[0] = "350.00"
price[1] = "30.00"
price[2] = "26.00"
price[3] = "10.00"
price[4] = "13.00"
price[5] = "50.00"

var photo = new Array
photo[0] = "images/goal_l.jpg"
photo[1] = "images/ball_l.jpg"
photo[2] = "images/cones_l.jpg"
photo[3] = "images/pump_l.jpg"
photo[4] = "images/ankle_l.jpg"
photo[5] = "images/giftcard_l.jpg"

var description = new Array
description[0] = "These goals blend sturdiness with portability. Owning our own set of goals will gives us more flexibility in hosting games and in determining where we can play."
description[1] = "Because futsal balls are smaller and don’t bounce, training with them is a great way to develop controlled touches. Having a ball for each player will allow us to run a larger variety of dribbling and skill-intensive drills."
description[2] = "These cones are highly visible but low-standing, making them great for marking boundaries and setting up training fields."
description[3] = "A ball pump gives us the convenience to have properly inflated balls wherever we go."
description[4] = "Injuries happen. But team-owned ankle supports are a practical and cheap way to help those players get back on the court."
description[5] = "A gift card is a great way to contribute to the club while simultaneously bringing business to the company of a friend, coworker, or relative."

//find which product was clicked on; switch it as the main image; bring up the product info
function showProduct(obj)
{
theproduct = obj.id
theprice = ''
thephoto = ''
thedescription = ''
//the product#
	for(i=0; i<6;i++)
	{if(product[i] == theproduct)
		{
		thetitle = title[i]
		theprice = price[i]
		theneed = need[i]
		thephoto = photo[i]
		thedescription = description[i]
		}
	}
//write them into the header box
document.getElementById('mainimage').src = thephoto
document.getElementById('need').src = theneed
document.getElementById('div-title').innerHTML = '<span class=""><strong>' + thetitle + '</strong></span><br><hr noshade width="100% color="#999999" />'
document.getElementById('div-price').innerHTML = '<span class="">' + theprice + '</span>'
document.getElementById('div-description').innerHTML = '<span class="">' + thedescription + '</span>'
}

function sum()
{
	document.getElementById('total').value = ''
	q1 = parseFloat(document.donate.quantity1.selectedIndex)
	s1 = q1 * parseFloat(price[0])
	q2 = parseFloat(document.donate.quantity2.selectedIndex)
	s2 = q2 * parseFloat(price[1])
	q3 = parseFloat(document.donate.quantity3.selectedIndex)
	s3 = q3 * parseFloat(price[2])
	q4 = parseFloat(document.donate.quantity4.selectedIndex)
	s4 = q4 * parseFloat(price[3])
	q5 = parseFloat(document.donate.quantity5.selectedIndex)
	s5 = q5 * parseFloat(price[4])
	q6 = parseFloat(document.donate.quantity6.selectedIndex)
	s6 = q6 * parseFloat(price[5])
	thetotal = s1+s2+s3+s4+s5+s6
	document.getElementById('total').value = '$' + thetotal + '.00'
}

function gocheckout()
{
	document.getElementById('total').value = '$' + thetotal
	alert(title[0] + ': ' + q1 + '\n' + title[1] + ': ' + q2 + '\n' + title[2] + ': ' + q3 + '\n' + title[3] + ': ' + q4 + '\n' + title[4] + ': ' + q5 + '\n' + title[5] + ': ' + q6 + '\n' +'\nYour total amount is: ' + thetotal)
	document.getElementById('total').value = '$' + thetotal + '.00'
}

function changeborder(obj)
	{
	id = document.getElementById(obj)
	id.style.bgColor = "#990000";
	id.style.border = "2px";
	}
function MM_changeProp(objId,x,theProp,theValue) { //v9.0
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}
