
  $(document).ready(function(){
    $("#tabs > ul").tabs();
    $('#donationForm').submit(function() {
		if (isNaN(document.forms['_xclick'].elements['useramount'].value)==false) {
			otherAmount = document.forms['_xclick'].elements['useramount'].value;
		} else {
			otherAmount = 50;
		}
    	updateCheckedValue(document.forms['_xclick'].elements['amount'], 'other', otherAmount);
	    return true;
	});
  });

function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}
function updateCheckedValue(radioObj, currentValue, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == currentValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].value == currentValue.toString()) {
			radioObj[i].value = newValue.toString();
		}
	}
}