function cancel()
{
	document.location = '/index.php?back';
	return;
}
$(document).ready(function() {
	$.preloadCssImages();
	/*var myriad_pro = {src: '/scripts/myriad_pro.swf'};
	sIFR.activate(myriad_pro);
	sIFR.replace(myriad_pro, {
		selector: 'h1.sifr',
		wmode: 'transparent',
		css: {
			'.sIFR-root': {'color': '#3366cc', 'font-weight': 'bold', 'text-align': 'center'}
		}
	});*/
	if ( $.browser.msie ) {
		var iVersion = parseInt($.browser.version.substr(0, 1), 10);
		if ( iVersion < 7 ) {
			window.location = '/upgrade.html';
			return;
		}
	}
	$('blockquote.collapsible').each(function(i) {
		var sTitle = $(this).attr('title');
		$(this).removeAttr('title');
		$(this).wrap('<fieldset class="collapsible collapsed" title="Click to Expand" />');
		var sLegend = ( sTitle.length > 0 ) ? sTitle + ' - Click to Expand' : 'Click to Expand';
		$(this).parent().prepend('<legend>' + sLegend + '</legend>');
		$(this).parent().click(function() {
			var iScrollHeight = $(this).find('blockquote').get(0).scrollHeight;
			var sText = $(this).find('legend').text();
			if ( $(this).hasClass('collapsed') ) {
				$(this).find('blockquote').animate({'height': iScrollHeight + 'px', 'opacity': 1, 'scrollTop': 0}, 'slow');
				$(this).find('legend').text(sText.replace('Click to Expand', 'Click to Collapse'));
				$(this).attr('title', 'Click to Collapse');
				$(this).removeClass('collapsed');
			} else {
				$(this).find('blockquote').animate({'height': '60px', 'opacity': 0.5, 'scrollTop': Math.round(iScrollHeight / 3)}, 'slow');
				$(this).find('legend').text(sText.replace('Click to Collapse', 'Click to Expand'));
				$(this).attr('title', 'Click to Expand');
				$(this).addClass('collapsed');
			}
		});
		$(this).animate({'height': '60px', 'opacity': 0.5, 'scrollTop': Math.round(this.scrollHeight / 3)}, 'slow');
	});
});
function checkDonationAmount()
{
	var oAmount = document.getElementById('amount');
	var oInputs = document.getElementsByTagName('input');
	
	if ( oAmount && oInputs ) {
		
		if ( oAmount.value == "" ) {
			
			oAmount.removeAttribute('name');
			for (var i = 0; i < oInputs.length; i++) {
				try {
					var sType = oInputs[i].getAttribute('type');
				} catch (e) {
					continue;
				}
				if ( sType.toUpperCase() == 'RADIO' ) {
					if ( oInputs[i].checked ) {
						return true;
					}
				}
			}
			
			window.alert('Please select a donation amount.');
			return false;
			
		} else {
			
			oAmount.setAttribute('name', 'amount');
			oAmount.name = 'amount';
			
			for (var i = 0; i < oInputs.length; i++) {
				try {
					var sType = oInputs[i].getAttribute('type');
				} catch (e) {
					continue;
				}
				if ( sType.toUpperCase() == 'RADIO' ) {
					oInputs[i].checked = false;
				}
			}
			
		}
		
	}
	
	return true;
}
function clearDonation(oInput)
{
	if ( oInput && oInput.value && oInput.value.length > 0 ) {
		var oInputs = document.getElementsByTagName('input');
		for (var i = 0; i < oInputs.length; i++) {
			try {
				var sType = oInputs[i].getAttribute('type');
			} catch (e) {
				continue;
			}
			if ( sType.toUpperCase() == 'RADIO' ) {
				oInputs[i].checked = false;
			}
		}
	} else {
		var oInput = document.getElementById('amount');
		if ( oInput ) {
			oInput.value = "";
		}
	}
	return;
}
function replaceWithIFrame(sSelector, iWidth, iHeight, sURL)
{
	var sHTML = '\u003Ciframe width="' + iWidth + '" height="' + iHeight + '" ';
	sHTML += 'frameborder="0" scrolling="no" src="' + sURL + '"\u003E\u003C/iframe\u003E';
	$(sSelector).replaceWith(sHTML);
	return;
}
var RecaptchaOptions = {'custom_theme_widget': 'recaptcha_widget', 'lang': 'en', 'theme': 'custom'};
