/* BEGIN: Donate Tracking
/*-----------------------------*/

function trackDonation() {
	if(!document.getElementById('DonateForm')) {return false;}
	var oneTime = document.getElementById('OneTimeContents');
	var oneTimeArray = oneTime.getElementsByTagName('input');
	var recurring = document.getElementById('RecurringContents');
	var recurringArray = recurring.getElementsByTagName('input');
	var type;
	var donate;
	var other;
	for(i=0; i<oneTimeArray.length; i++) {
		if(oneTimeArray[i].type == 'radio' && oneTime.style.display != 'none') {
			if(oneTimeArray[i].checked) {
				var type = 'OneTime';
				var donate = oneTimeArray[i].value;
			}
		}
	}
	for(i=0; i<recurringArray.length; i++) {
		if(recurringArray[i].type == 'radio' && recurring.style.display != 'none') {
			if(recurringArray[i].checked) {
				var type = 'TriRecurring';
				var donate = recurringArray[i].value;
			}
		}
	}
	if(donate == 'Other') {
		if(type == 'TriRecurring') {
			other = document.getElementById('TriOther').value;
			_digiTrack('/conversion/IC Donation/' + type + '/' + 'Other' + '/' + other);
			
		} else {
			other = document.getElementById('OTOther').value;
			_digiTrack('/conversion/IC Donation/' + type + '/' + 'Other' + '/' + other);
			
		}
	} else {
		_digiTrack('/conversion/IC Donation/' + type + '/' + donate);
	}
}

function trackTriDonation() {
	if(!document.getElementById('DonateForm')) {return false;}
	var tri = document.getElementById('TriDonation');
	var triArray = tri.getElementsByTagName('input');
	
	for(i=0; i<triArray.length; i++) {
		if(triArray[i].type == 'radio') {
			if(triArray[i].checked) {
				var type = 'TriRecurring';
				var donate = triArray[i].value;
			}
		}
	}
	if(donate == 'Other') {
		other = document.getElementById('TriOther').value;
		_digiTrack('/conversion/IC Donation/' + type + '/' + 'Other' + '/' + other);
	} else {
		_digiTrack('/conversion/IC Donation/' + type + '/' + donate);
	}
}