//
// validate start form
//
function validateStartForm()
{
	if (validateInst())
	{	return(validateReg());
	}
	return false;
}
//
// validate Registrant
//
function validateReg()
{
	// Registrant email
	//
	var emailID=document.form1.email;
	if ((emailID.value==null)||(emailID.value==""))
	{
		alert("Please enter a valid email address");
		emailID.focus();
		return false;
	}
	if (echeck(emailID.value)==false)
	{
		alert("Please enter a valid email address");
		emailID.focus();
		return false;
	}
	//
	// User name
	//
	var userID=document.form1.userID
	if (userID.value == '')
	{	alert('Please enter a User Name');
		userID.focus();
		return false;
	}
	//
	// Password
	//
	var pswd=document.form1.pwd;
	var pstr = pswd.value;

	if (pswd.value == '' || (pstr.length < 5) || (pstr.length > 12))
	{	alert('Please choose a password between 5 and 12 characters');
		pswd.focus();
		return false;
	}
	
	if (!alphanumeric(pstr))
	{	alert('Please use only characters and numbers in your password');
		pswd.focus();
		return false;
	}
	return true;
}
//
// validate Registrant Admin
//
function validateRegAdmin()
{
	// Registrant email
	//
	var emailID=document.form1.email;
	if ((emailID.value==null)||(emailID.value==""))
	{
		alert("Please enter a valid email address");
		emailID.focus();
		return false;
	}
	if (echeck(emailID.value)==false)
	{
		alert("Please enter a valid email address");
		emailID.focus();
		return false;
	}
	//
	// User name
	//
	var userID=document.form1.userID
	if (userID.value == '')
	{	alert('Please enter a User Name');
		userID.focus();
		return false;
	}
	//
	// Password
	//
	var pswd=document.form1.pwd;
	var pstr = pswd.value;

	if (pswd.value == '' || (pstr.length < 5) || (pstr.length > 12))
	{	alert('Please choose a password between 5 and 12 characters');
		pswd.focus();
		return false;
	}
	
	if (!alphanumeric(pstr))
	{	alert('Please use only characters and numbers in your password');
		pswd.focus();
		return false;
	}
	//
	// Expire Date
	//
	var dateExpireYY=document.form1.dateExpireYY
	if (dateExpireYY.value == '' || dateExpireYY.value > '2029')
	{	alert('Please enter an Expire Year less than 2030');
		userID.focus();
		return false;
	}
	return true;
}
//
// validate add Registrant
//
function validateConfRegAdd(formName)
{
	//
	// First Name
	//
	var input=formName.regFirstName;
	if (input.value == '')
	{	alert('Please enter First Name');
		input.focus();
		return false;
	}
	//
	// Last Name
	//
	var input=formName.regLastName;
	if (input.value == '')
	{	alert('Please enter Last Name');
		input.focus();
		return false;
	}
	// radio button validation
	if (!valRadio(formName.regRole))
	{	alert('Please select your Role (medical professional, patient, etc.)');
		return false;
	}	
	//
	// require check on either conference registration or cme
	//
	var field = formName.reg_conf; 
	if (!validate_box_checked(formName.reg_conf) && !validate_box_checked(formName.reg_cme))
	{	alert('Please select Register for Conference or CME or both ');
		field.focus();
		return false;
	}
	return true;
}

//
// validate Registrant
//
function validateConfReg(formName)
{
	//
	// Admin
	//
	var input=formName.admin_flag;
	if (input.value == '1')
	{
		if (!valRadio(formName.mtype))
		{	alert('Please select Member Type');
			return false;
		}
		if (!valRadio(formName.ptype))
		{	alert('Please select Payment Method');
			return false;
		}
	}
	if (input.value == '2')
	{
		if (!valRadio(formName.ptype))
		{	alert('Please select Payment Method');
			return false;
		}
	}
	//
	// First Name
	//
	var input=formName.regFirstName;
	if (input.value == '')
	{	alert('Please enter First Name');
		input.focus();
		return false;
	}
	//
	// Last Name
	//
	var input=formName.regLastName;
	if (input.value == '')
	{	alert('Please enter Last Name');
		input.focus();
		return false;
	}
	// radio button validation
	if (!valRadio(formName.regRole))
	{	alert('Please select your Role (medical professional, patient, etc.)');
		return false;
	}	
	//
	// require check on either conference registration or cme
	//
	var field = formName.reg_conf; 
	if (!validate_box_checked(formName.reg_conf) && !validate_box_checked(formName.reg_cme))
	{	alert('Please select Register for Conference or CME or both ');
		field.focus();
		return false;
	}
	return true;
}
//
// validate Registrant
//
function validateConfPymt(formName)
{

	//
	// First Name
	//
	var input=formName.recordFirstName;
	if (input.value == '')
	{	alert('Please enter First Name');
		input.focus();
		return false;
	}
	//
	// Last Name
	//
	var input=formName.recordFirstName;
	if (input.value == '')
	{	alert('Please enter Last Name');
		input.focus();
		return false;
	}
	//
	// Email
	//
	var input=formName.recordEmail;
	if (input.value == '')
	{	alert('Please enter your Email');
		input.focus();
		return false;
	}
	//
	// Addr1
	//
	var input=formName.recordAddr1;
	if (input.value == '')
	{	alert('Please enter your Address');
		input.focus();
		return false;
	}
	//
	// City
	//
	var input=formName.recordCity;
	if (input.value == '')
	{	alert('Please enter your City');
		input.focus();
		return false;
	}
	//
	// State
	//
	var input=formName.recordState;
	if (input.value == '')
	{	alert('Please enter your State');
		input.focus();
		return false;
	}
	//
	// Zip
	//
	var input=formName.recordZip;
	if (input.value == '')
	{	alert('Please enter your Zip Code');
		input.focus();
		return false;
	}
	//
	// Phone
	//
	var input=formName.recordPhone;
	if (input.value == '')
	{	alert('Please enter your Phone');
		input.focus();
		return false;
	}
	return true;
}
//
// validate Email
//
function validateEmail()
{
	//
	// Registrant email
	//
		var emailID=document.formEmail.conf_email;
		if ((emailID.value==null)||(emailID.value==""))
		{
			alert("Please enter a valid email address");
			emailID.focus();
			return false;
		}
		if (echeck(emailID.value)==false)
		{
			alert("Please enter a valid email address");
			emailID.focus();
			return false;
		}
	return true;
}
//
// validate Registrant
//
//
// validate Registrant
//
function validateMemReg(loggedIn)
{
	//
	// First Name
	//
	var input=document.form2.firstName;
	if (input.value == '')
	{	alert('Please enter your First Name');
		input.focus();
		return false;
	}
	//
	// Last Name
	//
	var input=document.form2.lastName;
	if (input.value == '')
	{	alert('Please enter your Last Name');
		input.focus();
		return false;
	}
	//
	// Registrant email
	//
	if (!loggedIn)
	{	
		var emailID=document.form2.email;
		if ((emailID.value==null)||(emailID.value==""))
		{
			alert("Please enter a valid email address");
			emailID.focus();
			return false;
		}
		if (echeck(emailID.value)==false)
		{
			alert("Please enter a valid email address");
			emailID.focus();
			return false;
		}

		//
		// User name
		//
		var userID=document.form2.userIDa;
		if (userID.value == '')
		{	alert('Please enter a User Name');
			userID.focus();
			return false;
		}
		//
		// Password
		//
		var pswd=document.form2.pwd;
		var pstr = pswd.value;
		if (pswd.value == '' || (pstr.length < 5) || (pstr.length > 12))
		{	alert('Please choose a password between 5 and 12 characters');
			pswd.focus();
			return false;
		}
	
		if (!alphanumeric(pstr))
		{	alert('Please use only characters and numbers in your password');
			pswd.focus();
			return false;
		}
	}
	//
	// Address 1
	//
	var input=document.form2.addr1;
	if (input.value == '')
	{	alert('Please enter your Address');
		input.focus();
		return false;
	}
	//
	// CIty
	//
	var input=document.form2.city;
	if (input.value == '')
	{	alert('Please enter your City');
		input.focus();
		return false;
	}
	//
	// State
	//
	var input=document.form2.state;
	if (input.value == '')
	{	alert('Please enter your State');
		input.focus();
		return false;
	}
	//
	// Zip
	//
	var input=document.form2.zip;
	if (input.value == '')
	{	alert('Please enter your Zip Code');
		input.focus();
		return false;
	}
	//
	// Phone
	//
	var input1=document.form2.phone1;
	var input2=document.form2.phone2;
	var input3=document.form2.phone3;
	if (input1.value == '' || input2.value == '' || input3.value == '')
	{	alert('Please enter your Phone Number');
		input1.focus();
		return false;
	}
	//
	// Membership type
	//
	/*var box = document.forms['form2'].elements['level'];
	var val = box.options[box.selectedIndex].value;
	if (val == '0')
	{	alert('Please select your Membership level');
		return false;
	}*/
	return true;
}

function alphanumeric(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
		{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
		  if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
		  {
		  }
		else	{
			 return false;
		  }
		}
 return true;
}

//
// validate Login
//
function validateLogin(formName)
{
	//
	// User name
	//
	var field = formName.userID; 
	var val = field.value; 
	if (val == '')
	{	alert('Please enter your User Name');
		field.focus();
		return false;
	}
	//
	// Password
	//
	var field = formName.pwd; 
	var val = field.value; 
	if (val == '')
	{	alert('Please enter your password');
		field.focus();
		return false;
	}
	return true;
}
//
// validate Login
//
function validatePWReq()
{
	//
	// User name
	//
	if (document.pwForm.userID.value != '')
	{	return true;
	}
	if ((document.pwForm.firstName.value != '') && (document.pwForm.lastName.value != ''))
	{	return true;
	}
	alert('Please enter either your User Name or your First and Last Name.');
	document.pwForm.userID.focus();
	return false;
}

function alphanumeric(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
		{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
		  if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
		  {
		  }
		else	{
			 return false;
		  }
		}
 return true;
}

//
// validate Registrant if something is in the name field
//
function validateRegName()
{
	// Registrant first name
	if (document.form1.first_name.value != '')
	{	document.form1.writeReg.value='1';
		return (validateReg());
	}
	document.form1.writeReg.value='';
	return true;
}
//
// validate accept field is checked
//
function validateAccept()
{
	if (!check_boxes(form1))
	{
		alert("Please check that you accept the terms.");
		return false;
	}
	// radio button validation
	if (!valRadio(document.form1.ptype))
	{	alert('Please select a payment type.');
		return false;
	}	
	return true;
}
//
// see if any checkboxes checked
//
function check_boxes(f)
{
var e, i = 0, checked = false;
while (e = f.elements[i++]) {if (e.type == 'checkbox' && e.checked) checked = true};
if (!checked) return false;
return true;
}

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
function echeck(str) {

		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   return false;
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false;
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false;
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    return false;
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false;
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    return false;
		 }
		 if (str.indexOf(" ")!=-1){
		    return false;
		 }
 		 return true;					
}
//  Validate Radio Button
function valRadio(rname)
{
    var cnt = -1;
    for (var ii=rname.length-1; ii > -1; ii--)
	{
        if (rname[ii].checked)
		{	cnt = ii; ii = -1;
		}
    }
    if (cnt > -1)
	{	return rname[cnt].value;
	}
    else 
	{	return false;
	}
}
// Set value of Title
function setTitle(strTitle)
{
alert(strTitle);
	var list = document.getElementById('title');
	var list = document.form1.title;
	for (var intI = 0; intI < 7; intI++) {
	alert(list.options[intI].value);
	  if (list.options[intI].value == strTitle) {
    	list.options[intI].selected = true;
	  }
	}
}
// Set value of RegID
function setEditRegID(regID, ndx)
{
	document.form1.EditRegID.value = regID;
	document.form1.EditRegNdx.value = ndx;
	return true;
}
// validate box checked
function validate_box_checked(chk){
  if (chk.checked == 1)
    return true;
  else
    return false;
}
// cancel 
function confirmCancel()
{
		if (confirm('Are you sure you want to cancel your registration?'))
		{	{ return true;
			}
		}
		else
		{	return false;
		}
};
// delete registrant
function confirmDelete()
{
		if (confirm('Are you sure you want to delete this registrant?'))
		{	{ return true;
			}
		}
		else
		{	return false;
		}
};
//
// validate Donation
//
function validateDonation()
{
	var formName = document.forms["formDonate"];
	// radio button validation
	if (!valRadio(formName.recurring))
	{	alert('Please select Recurring or One-time Donation.');
		return false;
	}	
	//
	// Amount
	//
	var fld=formName.other_amount;
	if ((fld.value==null)||(fld.value==""))
	{	var fld1=formName.amount;
		if ((fld1.value==null)||(fld1.value==""))
		{
			alert("Please enter a donation amount");
			fld.focus();
			return false;
		}
	}
	// radio button validation
	if (!valRadio(formName.gift_type))
	{	alert('Please select a Gift Type.');
		return false;
	}
	// First Name
	//
	/*var fld=formName.donor_firstName;
	if ((fld.value==null)||(fld.value==""))
	{
		alert("Please enter your first name");
		fld.focus();
		return false;
	}
	// Last Name
	//
	var fld=formName.donor_lastName;
	if ((fld.value==null)||(fld.value==""))
	{
		alert("Please enter your last name");
		fld.focus();
		return false;
	}*/
	// email
	//
	var fld=formName.donor_email;
	if ((fld.value==null)||(fld.value==""))
	{
		alert("Please enter a valid email address");
		fld.focus();
		return false;
	}
	if (echeck(fld.value)==false)
	{
		alert("Please enter a valid email address");
		fld.focus();
		return false;
	}
	// donor_addr1
	//
	/*var fld=formName.donor_addr1;
	if ((fld.value==null)||(fld.value==""))
	{
		alert("Please enter your street address");
		fld.focus();
		return false;
	}
	// donor_city
	//
	var fld=formName.donor_city;
	if ((fld.value==null)||(fld.value==""))
	{
		alert("Please enter your city");
		fld.focus();
		return false;
	}
	// donor_state
	//
	var fld=formName.donor_state;
	if ((fld.value==null)||(fld.value==""))
	{
		alert("Please enter your state");
		fld.focus();
		return false;
	}
	// donor_zip
	//
	var fld=formName.donor_zip;
	if ((fld.value==null)||(fld.value==""))
	{
		alert("Please enter your zip code");
		fld.focus();
		return false;
	}*/
	return true;
}
//
// validate e-card Donation
//
function validateEcard()
{
	var formName = document.forms["formDonate"];
	//
	// Amount
	//
	var fld=formName.other_amount;
	if ((fld.value==null)||(fld.value==""))
	{	var fld1=formName.amount;
		if ((fld1.value==null)||(fld1.value==""))
		{
			alert("Please enter a gift amount");
			fld.focus();
			return false;
		}
	}

	//
	// email
	//
	var fld=formName.donor_email;
	if ((fld.value==null)||(fld.value==""))
	{
		alert("Please enter a valid email address");
		fld.focus();
		return false;
	}
	if (echeck(fld.value)==false)
	{
		alert("Please enter a valid email address");
		fld.focus();
		return false;
	}

	return true;
}
//
// functions for paypalprophp
//
function getObj(name)
{
  if (document.getElementById) { return document.getElementById(name); }
  else if (document.all) { return document.all[name]; }
  else if (document.layers) { return document.layers[name]; }
}
function getBrowser(name)
{
  if (document.getElementById) { return "IE5"; }
  else if (document.all) { return "IE4"; }
  else if (document.layers) { return "NS"; }
}
function switchFormAction(pageType){
	if (pageType == "ec") {
		document.form1.action = "<?php echo($root_ssl_url . 'ec_to_paypal.php'); ?>";
	}else{
		document.form1.action = "<?php echo($root_ssl_url . 'dcc_confirm.php'); ?>";
	}
alert('1 '+document.form1.action);
}
function changePage1(pageType)
{
	var visText = "block";
	var novisText = "none";
	if (pageType == "ec")
	{
		document.getElementById("cc_info").style.display = novisText;
		document.getElementById("billing_address").style.display = novisText;
		document.form1.action = "<?php echo($root_ssl_url . 'ec_to_paypal.php'); ?>";
	}
	else
	{
		document.getElementById("cc_info").style.display = visText;
		document.getElementById("billing_address").style.display = visText;
		document.form1.action = "<?php echo($root_ssl_url . 'dcc_confirm.php'); ?>";
	}
}

function changePage(pageType) {
	var browserType = getBrowser("cc_info");
	var visText = "visible";
	var novisText = "hidden";
	if (browserType == "IE5") {
		var visText = "block";
		var novisText = "none";
	}
alert(browserType);
	if (browserType == "IE5") {
		if (pageType == "ec") {
			objName = getObj("cc_info");
			objName.style.display = novisText;
			objName = getObj("billing_address");
			objName.style.display = novisText;
			objName = getObj("shipping_address");
			objName.style.display = novisText;
		} else {
			objName = getObj("cc_info");
			objName.style.display = visText;
			objName = getObj("billing_address");
			objName.style.display = visText;
			objName = getObj("shipping_address");
			objName.style.display = visText;
		}
	}
	else if (browserType == "IE4") {
		if (pageType == "ec") {
			objName = getObj("cc_info");
			objName.style.visibility = novisText;
			objName = getObj("billing_address");
			objName.style.visibility = novisText;
			objName = getObj("shipping_address");
			objName.style.visibility = novisText;
		} else {
			objName = getObj("cc_info");
			objName.style.visibility = visText;
			objName = getObj("billing_address");
			objName.style.visibility = visText;
			objName = getObj("shipping_address");
			objName.style.visibility = visText;
		}
	}
	else {
		if (pageType == "ec") {
			objName = getObj("cc_info");
			objName.style.visibility = novisText;
			objName = getObj("billing_address");
			objName.style.visibility = novisText;
			objName = getObj("shipping_address");
			objName.style.visibility = novisText;
		} else {
			objName = getObj("cc_info");
			objName.style.visibility = visText;
			objName = getObj("billing_address");
			objName.style.visibility = visText;
			objName = getObj("shipping_address");
			objName.style.visibility = visText;
		}
	}
	switchFormAction(pageType);
}

function Require(obForm,szFields)
{
	var input=obForm.elements['payment_method'].value;
	if (input.value == 'check')
	{	return true;
	}
//alert('2 '+document.form1.action);
		if (document.form1.action == "<?php echo($root_ssl_url . 'ec_to_paypal.php'); ?>") {
		    return true; -IE
		} else {
			szFields = "CreditCardNumber,CVV2,FIRSTNAME,LASTNAME,STREET1,CITYNAME,POSTALCODE,PAYER,BillingFirstName,BillingLastName,BillingStreet1,BillingCityName,BillingPostalCode";
		}
	
	 	cardNumber = new String(obForm.elements['CreditCardNumber'].value)
		switch (obForm.elements['CreditCardType'].value) {
		 case "Visa" : 
		 	if (cardNumber.substring(0, 1) != "4") {
				alert("The card number you entered is not a Visa.");
				return false;
			}
			break;
		 case "MasterCard" : 
		 	if (cardNumber.substring(0, 1) != "5") {
				alert("The card number you entered is not a Mastercard.");
				return false;
			}
			break;
		 case "Amex" : 
		 	if ((cardNumber.substring(0, 2) != "34") && (cardNumber.substring(0, 2) != "37")) {
				alert("The card number you entered is not an American Express.");
				return false;
			}
			break;
		 case "Discover" : 
		 	if ((cardNumber.substring(0, 2) != "30")&&(cardNumber.substring(0, 1) != "6")&&(cardNumber.substring(0, 2) != "36")&&(cardNumber.substring(0, 2) != "38")) {
				alert("The card number you entered is not a Discover.");
				return false;
			}
			break;
		 default : break;
		}


      var fields = szFields.split(",");
      var szMissing= new Array();
      for (x=0;x<fields.length;x++) {
        if (obForm.elements[fields[x]].value.length==0) {
			if (fields[x] == "PAYER") {
	           //szMissing[szMissing.length]=new String("Email");
			} else {
	           szMissing[szMissing.length]=new String(fields[x]);
			}
        }
      }
      if (szMissing.length) {
        alert("The field"+((szMissing.length>1)?"s ":" ")+szMissing.join(",")+" is a required field.");
        return false;
      }
      return true; -IE
}
/*function SameAsFill(obForm){
	obForm = document.form1;
	if (obForm.elements['SameAs'].checked){
	  szFields = "FIRSTNAME,LASTNAME,STREET1,STREET2,CITYNAME,PHONE,POSTALCODE";
	  szBillFields = "BillingFirstName,BillingLastName,BillingStreet1,BillingStreet2,BillingCityName,BillingPhone,BillingPostalCode";
      var fields = szFields.split(",");
      var billFields = szBillFields.split(",");
      for (x=0;x<fields.length;x++) {
        if (obForm.elements[fields[x]].value.length) {
			obForm.elements[billFields[x]].value = obForm.elements[fields[x]].value;
        }
      }
	
	thisState = obForm.elements['STATEORPROVINCE'].selectedIndex;
	thisCountry = obForm.elements['COUNTRY'].selectedIndex;
	obForm.elements['BillingStateOrProvince'].selectedIndex = thisState;
	obForm.elements['BillingCountry'].selectedIndex = thisCountry;
	}
}*/
function SameAsFill(obForm){
	obForm = document.form1;
	  szFields = "FIRSTNAME,LASTNAME,STREET1,STREET2,CITYNAME,PHONE,POSTALCODE";
	  szBillFields = "BillingFirstName,BillingLastName,BillingStreet1,BillingStreet2,BillingCityName,BillingPhone,BillingPostalCode";
      var fields = szFields.split(",");
      var billFields = szBillFields.split(",");
      for (x=0;x<fields.length;x++) {
        if (obForm.elements[fields[x]].value.length) {
			obForm.elements[billFields[x]].value = obForm.elements[fields[x]].value;
        }
	
	thisState = obForm.elements['STATEORPROVINCE'].selectedIndex;
	thisCountry = obForm.elements['COUNTRY'].selectedIndex;
	obForm.elements['BillingStateOrProvince'].selectedIndex = thisState;
	obForm.elements['BillingCountry'].selectedIndex = thisCountry;
	}
}
function updateCountry()
{
	//var thisCountry = document.forms['form1'].elements['BillingCountry'].selectedIndex;
	var xx = document.form1.BillingCountry.options[document.form1.BillingCountry.selectedIndex].value
	document.forms['form1'].elements['COUNTRY'].value = xx;
	//alert('country= '+ xx);
};
function updateSFName()
{
	var val = document.forms['form1'].elements['BillingFirstName'].value;
	document.forms['form1'].elements['FIRSTNAME'].value = val;
};
function updateSLName()
{
	var val = document.forms['form1'].elements['BillingLastName'].value;
	document.forms['form1'].elements['LASTNAME'].value = val;
};
function updateSAddr1()
{
	var val = document.forms['form1'].elements['BillingStreet1'].value;
	document.forms['form1'].elements['STREET1'].value = val;
};
function updateSAddr2()
{
	var val = document.forms['form1'].elements['BillingStreet2'].value;
	document.forms['form1'].elements['STREET2'].value = val;
};
function updateSCity()
{
	var val = document.forms['form1'].elements['BillingCityName'].value;
	document.forms['form1'].elements['CITYNAME'].value = val;
};
function updateSState()
{
	var val = document.forms['form1'].elements['BillingStateOrProvince'].value;
	document.forms['form1'].elements['STATEORPROVINCE'].value = val;
};
function updateSZip()
{
	var val = document.forms['form1'].elements['BillingPostalCode'].value;
	document.forms['form1'].elements['POSTALCODE'].value = val;
};
function updateSPhone()
{
	var val = document.forms['form1'].elements['BillingPhone'].value;
	document.forms['form1'].elements['PHONE'].value = val;
};
//
// end functions for paypalprophp
//
//
// functions for donate
//
function updateDType()
{
	document.formDonate.d_type.value='0';
	if (getCheckedValue(document.forms['formDonate'].elements['recurring']) == 'recurring')
	{	document.formDonate.d_type.value='1';
	}
	document.formDonate.submit();
};

function updateGType()
{
	document.formDonate.g_type.value='0';
	if (getCheckedValue(document.forms['formDonate'].elements['gift_type']) == 'Memorial')
	{	document.formDonate.g_type.value='1';
	}
	if (getCheckedValue(document.forms['formDonate'].elements['gift_type']) == 'Honor')
	{	document.formDonate.g_type.value='2';
	}
	document.formDonate.submit();
};
//
// end functions for donate
//

