function how_learned_fill() {
var otIndex = document.getElementById('ot_learned').selectedIndex;
var otValue = document.getElementById('ot_learned')[otIndex].text;
document.ot_ol_add.how_hear.value = otValue;
}
function employer_fill() {
var empIndex = document.getElementById('employer_select').selectedIndex;
var empValue = document.getElementById('employer_select')[empIndex].text;
document.ot_ol_add.employer_name.value = empValue;
}

function hide_table(checkObj,objID) {
	document.paypal.on0.value = "";
	var textObj = document.getElementById(objID);
	//textObj.style.visibility = checkObj.checked?'hidden':'visable';
	textObj.style.display = checkObj.checked?'none':'block';
	document.getElementById('ghmText').firstChild.data = "";
	}
function show_table(checkObj,objID,ghm_label) {
	var textObj = document.getElementById(objID);
	//textObj.style.visibility = checkObj.checked?'visible':'hidden';
	textObj.style.display = checkObj.checked?'block':'none';
	document.getElementById('ghmText').firstChild.data = ghm_label;
	}

function hwi_add_percent() {
if (document.getElementById("hwi_gift_percent").checked) {
var hwiper = document.getElementById('hwi_percent')[document.getElementById('hwi_percent').selectedIndex].value;
	document.paypal.item_name.value = document.paypal.item_name.value+"  "+hwiper;
}
}
function sb_add_percent() {
if (document.getElementById("sb_gift_percent").checked) {
var hwiper = document.getElementById('sb_percent')[document.getElementById('sb_percent').selectedIndex].value;
	document.paypal.item_name.value = document.paypal.item_name.value+"  "+hwiper;
}
}
function fr_add_percent() {
if (document.getElementById("fr_gift_percent").checked) {
var hwiper = document.getElementById('fr_percent')[document.getElementById('fr_percent').selectedIndex].value;
	document.paypal.item_name.value = document.paypal.item_name.value+"  "+hwiper;
}
}
function owt_add_percent() {
if (document.getElementById("owt_gift_percent").checked) {
var hwiper = document.getElementById('owt_percent')[document.getElementById('owt_percent').selectedIndex].value;
	document.paypal.item_name.value = document.paypal.item_name.value+"  "+hwiper;
}
}
function hwi_add_amount() {
document.paypal_add.amount.value = "333.00";
}
function add_hwi_gift() {
if (document.getElementById("hwi_gift_percent").checked)
{
	document.paypal_add.item_name.value = "Addition gift for Healthywaters Institute";
}

}
function prepare_paypal_submit() {

	if (document.ot_ol.other_amount.value != '') {
	var oth_amnt = document.ot_ol.other_amount.value;
	document.paypal.amount.value = oth_amnt;
	if (oth_amnt >= 50 && oth_amnt < 100) {
		document.paypal.item_name.value = "(Gift = Freshwater Trust Cap/Tote)";
	}
	if (oth_amnt >= 100 && oth_amnt < 250) {
		document.paypal.item_name.value = "(Gift = Freshwater Trust Klean Kanteen)";
	}
	if (oth_amnt >= 250 && oth_amnt < 500) {
		document.paypal.item_name.value = "(Gift = Freshwater Trust fishing shirt)";
	}
	if (oth_amnt >= 500 && oth_amnt < 1000) {
		document.paypal.item_name.value = "(Gift = Original Freshwater Trust Photograph)";
	}
	}

for (var i=0; i < document.ot_ol_add.gift_type.length; i++) {
	if (document.ot_ol_add.gift_type[i].checked) {
		if (document.ot_ol_add.gift_type[i].value == "Gift Membership" || document.ot_ol_add.gift_type[i].value == "Gift in Honor" || document.ot_ol_add.gift_type[i].value == "Memorial Gift") {
		document.paypal.on0.value = document.ot_ol_add.gift_type[i].value+" for"
		document.paypal.os0.value = document.ot_ol_add.ghm_firstname.value+" "+document.ot_ol_add.ghm_middle.value+" "+document.ot_ol_add.ghm_lastname.value+" "+document.ot_ol_add.ghm_address.value+" "+document.ot_ol_add.ghm_city.value+" "+document.ot_ol_add.ghm_state.value+" "+document.ot_ol_add.ghm_zip.value;
		}
	}
}

	var details1Index = document.getElementById('item_details').selectedIndex;
	var details1Value = document.getElementById('item_details')[details1Index].text;
	if (details1Value != "N/A") {
	document.paypal.item_name.value = document.paypal.item_name.value+": "+details1Value;
	}
	var details2Index = document.getElementById('item_details2').selectedIndex;
	var details2Value = document.getElementById('item_details2')[details2Index].text;
	if (details2Value != "N/A") {
	document.paypal.item_name.value = document.paypal.item_name.value+": "+details2Value;
	}
	if (document.paypal.item_name.value != "$35 Donation (Gift = Newsletter)") {
	document.paypal.item_name.value = document.paypal.item_name.value+")";
	}

	if (document.getElementById("employer_match").checked) {
//	var dropdownIndex = document.getElementById('employer_select').selectedIndex;
//	var dropdownValue = document.getElementById('employer_select')[dropdownIndex].text;
	document.paypal.item_name.value = document.paypal.item_name.value+"     Employer Match: "+ document.ot_ol_add.employer_name.value;
	}
	else {
	document.paypal.item_name.value = document.paypal.item_name.value+"     Employer Match: No";
	}
	
	if (document.getElementById("shipping_billing").checked) {
	//alert("use shipping address");
	document.paypal.address1.value=document.ot_ol_add.ship_address.value;
	document.paypal.last_name.value=document.ot_ol_add.ship_lastname.value;
	document.paypal.first_name.value=document.ot_ol_add.ship_firstname.value;
	document.paypal.city.value=document.ot_ol_add.ship_city.value;
	document.paypal.zip.value=document.ot_ol_add.ship_zipcode.value;
	document.paypal.state.value=document.ot_ol_add.ship_state.value;
	document.paypal.night_phone_a.value=document.ot_ol_add.ship_phone_a.value;
	document.paypal.night_phone_b.value=document.ot_ol_add.ship_phone_b.value;
	document.paypal.night_phone_c.value=document.ot_ol_add.ship_phone_c.value;
	document.paypal.email.value=document.ot_ol_add.ship_email.value;
	}
	if (document.getElementById("skip_gift").checked) {
		document.paypal.on1.value = "No gift please";
		document.paypal.os1.value = "";
	}
	document.paypal.os1.value = document.paypal.os1.value+" How learned: "+ document.ot_ol_add.how_hear.value;

}
function other_amount_check(checkObj,objID) {

var textObj = document.getElementById(objID);
textObj.style.visibility = checkObj.checked?'visible':'hidden';
if (!checkObj.checked) {
        document.getElementById('myText').firstChild.data = "None";
        textObj.value = "";
}
else {
document.getElementById('myText').firstChild.data = "Other Amount ";
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = "";
document.paypal.a3.value = '';
document.paypal.p3.value = '';
document.paypal.t3.value = '';
document.paypal.src.value = '';
document.paypal.sra.value = '';
document.paypal.srt.value = '';
window.location.hash="donor_details";
}
document.ot_ol.item_details.options[0].text = "N/A";
document.ot_ol.item_details.options[1].text = "N/A";
document.ot_ol.item_details.options[2].text = "";
document.ot_ol.item_details.options[3].text = "";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
}

function ShowPic(sImage,gift,gift_type)
{
if (gift_type == "O") {
	document.ShowGift.src = sImage;
}
if (gift_type == "R") {
	document.ShowGift2.src = sImage;
}
}


function change_text(gift) {

// uncheck the other amount checkbox and hide the amount field

document.ot_ol.other_amt.checked = false;
var textObj = document.getElementById('other_amount');
textObj.style.visibility = document.ot_ol.other_amt.checked?'visible':'hidden';

if (gift != "Upstream Society") {
if (gift != "$35 Donation (Gift = Newsletter)") {
	document.getElementById('myText').firstChild.data = gift+")";
}
}

if (gift == "Foo Upstream Society") {
//document.getElementById('myText').firstChild.data = gift;
document.ot_ol.item_details.options[0].text = "N/A";
document.ot_ol.item_details.options[1].text = "N/A";
document.ot_ol.item_details.options[2].text = "";
document.ot_ol.item_details.options[3].text = "";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "0.00";
document.paypal.a3.value = '';
document.paypal.p3.value = '';
document.paypal.t3.value = '';
document.paypal.src.value = '';
document.paypal.sra.value = '';
document.paypal.srt.value = '';
}
if (gift == "$35 Donation (Gift = Newsletter)") {
document.getElementById('myText').firstChild.data = gift;
document.ot_ol.item_details.options[0].text = "N/A";
document.ot_ol.item_details.options[1].text = "N/A";
document.ot_ol.item_details.options[2].text = "";
document.ot_ol.item_details.options[3].text = "";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "35.00";
document.paypal.a3.value = '';
document.paypal.p3.value = '';
document.paypal.t3.value = '';
document.paypal.src.value = '';
document.paypal.sra.value = '';
document.paypal.srt.value = '';
}
if (gift == "$50 Donation (Gift = Cap/Tote") {
document.ot_ol.item_details.options[0].text = "Cap";
document.ot_ol.item_details.options[1].text = "Tote";
document.ot_ol.item_details.options[0].value = "Cap";
document.ot_ol.item_details.options[1].value = "Tote";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
//document.ot_ol.item_details.options[2].text = "";
//document.ot_ol.item_details.options[3].text = "";
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "50.00";
document.paypal.a3.value = '';
document.paypal.p3.value = '';
document.paypal.t3.value = '';
document.paypal.src.value = '';
document.paypal.sra.value = '';
document.paypal.srt.value = '';
}
if (gift == "$100 Donation (Gift = Klean Kanteen") {
document.ot_ol.item_details.options[0].text = "N/A";
document.ot_ol.item_details.options[1].text = "N/A";
document.ot_ol.item_details.options[2].text = "";
document.ot_ol.item_details.options[3].text = "";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "100.00";
document.paypal.a3.value = '';
document.paypal.p3.value = '';
document.paypal.t3.value = '';
document.paypal.src.value = '';
document.paypal.sra.value = '';
document.paypal.srt.value = '';
}
if (gift == "$250 Donation (Gift = Fishing Shirt") {
document.ot_ol.item_details2.options[0].text = "Small";
document.ot_ol.item_details2.options[1].text = "Medium";
document.ot_ol.item_details2.options[2].text = "Large";
document.ot_ol.item_details2.options[3].text = "Extra Large";
document.ot_ol.item_details.options[0].text = "Men's";
document.ot_ol.item_details.options[1].text = "Women's";
document.ot_ol.item_details.options[2].text = "";
document.ot_ol.item_details.options[3].text = "";
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "250.00";
document.paypal.a3.value = '';
document.paypal.p3.value = '';
document.paypal.t3.value = '';
document.paypal.src.value = '';
document.paypal.sra.value = '';
document.paypal.srt.value = '';
}
if (gift == "$500 Donation (Gift = Photograph") {
document.ot_ol.item_details.options[0].text = "Wood River";
document.ot_ol.item_details.options[1].text = "Eagle Creek";
//document.ot_ol.item_details.options[2].text = "Salmon Side Channel";
//document.ot_ol.item_details.options[3].text = "Elk River";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "500.00";
document.paypal.a3.value = '';
document.paypal.p3.value = '';
document.paypal.t3.value = '';
document.paypal.src.value = '';
document.paypal.sra.value = '';
document.paypal.srt.value = '';
}
if (gift == "$700 Donation (Gift = Photograph") {
document.ot_ol.item_details.options[0].text = "Wood River";
document.ot_ol.item_details.options[1].text = "Eagle Creek";
//document.ot_ol.item_details.options[2].text = "Salmon Side Channel";
//document.ot_ol.item_details.options[3].text = "Elk River";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "700.00";
document.paypal.a3.value = '';
document.paypal.p3.value = '';
document.paypal.t3.value = '';
document.paypal.src.value = '';
document.paypal.sra.value = '';
document.paypal.srt.value = '';
}
if (gift == "$5 a month (Gift = Cap/Tote") {
document.ot_ol.item_details.options[0].text = "Cap";
document.ot_ol.item_details.options[1].text = "Tote";
document.ot_ol.item_details.options[0].value = "Cap";
document.ot_ol.item_details.options[1].value = "Tote";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.item_name.value = gift;
document.paypal.cmd.value = "_xclick-subscriptions";
document.paypal.amount.value = "";
document.paypal.a3.value = 5.00;
document.paypal.p3.value = '1';
document.paypal.t3.value = 'M';
document.paypal.src.value = '1';
document.paypal.sra.value = '1';
document.paypal.srt.value = '12';
}
if (gift == "$10 a month (Gift = Klean Kanteen") {
document.ot_ol.item_details.options[0].text = "N/A";
document.ot_ol.item_details.options[1].text = "N/A";
document.ot_ol.item_details.options[2].text = "";
document.ot_ol.item_details.options[3].text = "";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.item_name.value = gift;
document.paypal.cmd.value = "_xclick-subscriptions";
document.paypal.amount.value = "";
document.paypal.a3.value = 10.00;
document.paypal.p3.value = '1';
document.paypal.t3.value = 'M';
document.paypal.src.value = '1';
document.paypal.sra.value = '1';
document.paypal.srt.value = '12';
}
if (gift == "$15 a month (Gift = Klean Kanteen") {
document.ot_ol.item_details.options[0].text = "N/A";
document.ot_ol.item_details.options[1].text = "N/A";
document.ot_ol.item_details.options[2].text = "";
document.ot_ol.item_details.options[3].text = "";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.item_name.value = gift;
document.paypal.cmd.value = "_xclick-subscriptions";
document.paypal.amount.value = "";
document.paypal.a3.value = 15.00;
document.paypal.p3.value = '1';
document.paypal.t3.value = 'M';
document.paypal.src.value = '1';
document.paypal.sra.value = '1';
document.paypal.srt.value = '12';
}
if (gift == "$20 a month (Gift = Klean Kanteen") {
document.ot_ol.item_details.options[0].text = "N/A";
document.ot_ol.item_details.options[1].text = "N/A";
document.ot_ol.item_details.options[2].text = "";
document.ot_ol.item_details.options[3].text = "";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.item_name.value = gift;
document.paypal.cmd.value = "_xclick-subscriptions";
document.paypal.amount.value = "";
document.paypal.a3.value = 20.00;
document.paypal.p3.value = '1';
document.paypal.t3.value = 'M';
document.paypal.src.value = '1';
document.paypal.sra.value = '1';
document.paypal.srt.value = '12';
}
if (gift == "$25 a month (Gift = Fishing Shirt") {
document.ot_ol.item_details2.options[0].text = "Small";
document.ot_ol.item_details2.options[1].text = "Medium";
document.ot_ol.item_details2.options[2].text = "Large";
document.ot_ol.item_details2.options[3].text = "Extra Large";
document.ot_ol.item_details.options[0].text = "Men's";
document.ot_ol.item_details.options[1].text = "Women's";
document.ot_ol.item_details.options[2].text = "";
document.ot_ol.item_details.options[3].text = "";
document.paypal.item_name.value = gift;
document.paypal.cmd.value = "_xclick-subscriptions";
document.paypal.amount.value = "";
document.paypal.a3.value = 25.00;
document.paypal.p3.value = '1';
document.paypal.t3.value = 'M';
document.paypal.src.value = '1';
document.paypal.sra.value = '1';
document.paypal.srt.value = '12';
}
if (gift == "$50 a month (Gift = Photograph") {
document.ot_ol.item_details.options[0].text = "Elk River";
document.ot_ol.item_details.options[1].text = "Wood River";
document.ot_ol.item_details.options[2].text = "Eagle Creek";
document.ot_ol.item_details.options[3].text = "Salmon Side Channel";
document.ot_ol.item_details2.options[0].text = "N/A";
document.ot_ol.item_details2.options[1].text = "N/A";
document.ot_ol.item_details2.options[2].text = "";
document.ot_ol.item_details2.options[3].text = "";
document.paypal.item_name.value = gift;
document.paypal.cmd.value = "_xclick-subscriptions";
document.paypal.amount.value = "";
document.paypal.a3.value = 50.00;
document.paypal.p3.value = '1';
document.paypal.t3.value = 'M';
document.paypal.src.value = '1';
document.paypal.sra.value = '1';
document.paypal.srt.value = '12';
}
//hwi_add_percent();
//sb_add_percent();
//fr_add_percent();
//owt_add_percent();
}


