function initpopup() {
	if(document.getElementById && document.createTextNode)
	{
	  if(document.getElementById('printinfo'))
	  {
	    document.getElementById('printinfo').style.display ='none';
	  }
	}
}

function initmenu() {
var expandLink, expandText;
	if(document.getElementById && document.createTextNode) {
		if(document.getElementById('menu')) {
			// create an expand link 
			expandLink=document.createElement('a');
			expandText=document.createTextNode('Expand All');

			// add the text as a child of the link
			expandLink.appendChild(expandText);

			// set the href to # and call expand all when clicked or tabbed to		
			expandLink.setAttribute('href','#'); 
			expandLink.onclick=function(){expandCollapseAll('menu',true)};
			expandLink.onfocus=function(){return false;}
			expandLink.onkeypress=function(){expandCollapseAll('menu',true)};
			expandLink.className = 'expcol';

			// add the new link directly before the menu
			var menu = document.getElementById('menu');
			menu.parentNode.insertBefore(expandLink,menu);

			// create a separator link 
			separateLink=document.createElement('span');
			separateText=document.createTextNode(' / ');

			// add the text as a child of the link
			separateLink.appendChild(separateText);
			separateLink.className = 'expcol';

			menu.parentNode.insertBefore(separateLink,menu);

			// create a collapse link 
			collapseLink=document.createElement('a');
			collapseText=document.createTextNode('Collapse All');

			// add the text as a child of the link
			collapseLink.appendChild(collapseText);

			// set the href to # and call collapse all when clicked or tabbed to		
			collapseLink.setAttribute('href','#'); 
			collapseLink.onclick=function(){expandCollapseAll('menu',false)};
			collapseLink.onkeypress=function(){expandCollapseAll('menu',false)};
			collapseLink.className = 'expcol';

			// add the new link directly before the menu
			var menu = document.getElementById('menu');
			menu.parentNode.insertBefore(collapseLink,menu);

		}
	  }
	  
}





function setExpDate() {

	var selMo = document.frmDonation.selExpirationMonth;

	var selYr = document.frmDonation.selExpirationYear;

	var mo = selMo.options[selMo.selectedIndex].value;

	var yr = selYr.options[selYr.selectedIndex].value;

	document.frmDonation.ssl_exp_date.value = mo + yr;

}

function CheckRequiredFields() {
var errormessage = new String();
// Put field checks below this point.

if(WithoutContent(document.frmDonation.ssl_amount.value))
	{ errormessage += "\n\nDonation Amount"; }
num = parseFloat(document.frmDonation.ssl_amount.value)
if (isNaN(num)) 
	{ errormessage += "\n\nDonation Amount must be number"; }
if(WithoutContent(document.frmDonation.ssl_first_name.value))
	{ errormessage += "\n\nFirst Name"; }
if(WithoutContent(document.frmDonation.ssl_last_name.value))
	{ errormessage += "\n\nLast Name"; }		
if(WithoutContent(document.frmDonation.ssl_avs_address.value))
	{ errormessage += "\n\nAddress"; }
if(WithoutContent(document.frmDonation.ssl_city.value))
	{ errormessage += "\n\nCity"; }
if(WithoutContent(document.frmDonation.ssl_avs_zip.value))
	{ errormessage += "\n\nZIP/Postal code"; }
if(WithoutContent(document.frmDonation.ssl_email.value))
	{ errormessage += "\n\nEmail Address"; }
if(WithoutContent(document.frmDonation.ssl_card_number.value))
	{ errormessage += "\n\nCredit Card Number"; }		
if(WithoutContent(document.frmDonation.ssl_cvv2cvc2.value))
	{ errormessage += "\n\nThe 3-digit security code for your credit card"; }
	
if(WithoutSelectionValue(document.frmDonation.ssl_state))
	{ errormessage += "\n\nState (from drop-down menu)"; }


// Put field checks above this point.
if(errormessage.length > 2) {
	alert('Please enter the following field(s):' + errormessage);
	return false;
	}
return true;
} // end of function CheckRequiredFields()


function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function NoneWithContent(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].value.length > 0) { return false; }
	}
return true;
}

function NoneWithCheck(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].checked) { return false; }
	}
return true;
}

function WithoutCheck(ss) {
if(ss.checked) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}
function clear_radio_buttons() {
     for (var i = 0; i < document.frmDonation.ssl_amount2.length; i++) {
          document.frmDonation.ssl_amount2[i].checked = false;
     }
}
