
function hide_table(checkObj,objID) {
	document.paypal.on0.value = "";
	var textObj = document.getElementById(objID);
	//textObj.style.visibility = checkObj.checked?'hidden':'visible';
	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 prepare_paypal_submit() {

if (document.getElementById("other_amount").value != "") {
if (document.getElementById("other_amount").value < 1000.00) {
alert("A minimum gift of $1000 per year is required for Upstream Society membership. Please increase your gift or visit http://www.ortrout.org/joinOnline.html to give a regular membership gift");
return(false);
}
var oth_amount = document.getElementById("other_amount").value;
	document.paypal.amount.value = oth_amount;
	document.paypal.item_name.value = oth_amount+" Donation, amount specified by donor";
}
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;
                }
        }
}


        if (document.getElementById("shipping_billing").checked) {
        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.H_PhoneNumber.value=document.ot_ol_add.ship_phone.value;
        }
return(true);
}

function ShowPic(sImage,gift,gift_type)
{
document.ShowGift.src = sImage;
document.getElementById('myText').firstChild.data = gift;

if (gift == "$1,000 Donation (Gift = Event Invitations)") {
document.paypal.item_name.value = gift;
document.paypal.amount.value = "1000.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 == "$1,500 Donation (Gift = Event Invitations)") {
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "1500.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 == "$2,500 Donation (Gift = case of OT private label wine)") {
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "2500.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,000 Donation (Gift = OT wine, objet d'art)") {
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "5000.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 == "$10,000 Donation (Gift = OT wine, objet d'art, invitations )") {
document.paypal.cmd.value = "_xclick";
document.paypal.item_name.value = gift;
document.paypal.amount.value = "10000.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 = '';
}
}
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 = "";
}
document.getElementById('myText').firstChild.data = "Other Amount (minimum $1000): ";
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";
}
function monthly_gift(gift) {
document.getElementById("other_amount").value = "";
var dropdownIndex = document.getElementById('monthly_amount').selectedIndex;
var dropdownValue = document.getElementById('monthly_amount')[dropdownIndex].text;
document.getElementById('myText').firstChild.data = gift+dropdownValue+")";
document.paypal.item_name.value = gift+dropdownValue+")";
document.paypal.cmd.value = "_xclick-subscriptions";
document.paypal.amount.value = "";
document.paypal.a3.value = dropdownValue;
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';
window.location.hash="donor_details";
}


