function parseCurrency(input) {
	var amt = input.value;
	if (amt !="") {
		amt = amt.replace(/^ *\$? */, "");
		amt = amt.replace(",","");
		var number = parseFloat(amt);
		if (isNaN(number)) {
			input.value = '';
			return;
		} else {
			input.value = dispCurrencyN(number);
		}
	}
}

function dispCurrencyN(num){
	if (num == Math.round(num)){
		return (num + ".00");
	}
	else{	
		var sNum = (Math.round(num*100)) + "";	
		if (sNum.length == 1){
			return "0.0" + sNum;
		} else if (sNum.length == 2){
			return "0." + sNum;
		} else {
			return (sNum.substring(0,sNum.length-2)+ "." + sNum.substring(sNum.length-2, sNum.length));
		}
	}
}
function toggleCustomAmt(obj){
	dAmt = obj.value;
	cAmt = document.getElementById("customAmtId");
	if (dAmt!="0") {
		cAmt.disabled=true;
		cAmt.value='';
		cAmt.style.backgroundColor='#cccccc';
		return;
	}
	cAmt.disabled=false;
	cAmt.style.backgroundColor='#ffffff';
}

	function globalPopup(url, anchortag, title, options) {
		if (anchortag!=null) {
			var regHelpWindow=window.open(url+'\#'+anchortag, title, options);
		} else { 
			var regHelpWindow=window.open(url, title, options);
		}
		regHelpWindow.focus();
		return false;
	}
	
	function delayedFuncCall(func, delay) {
		setTimeout(func, delay);
	}
	
function replaceClassName(obj, oldName, newName) {
	obj.className = obj.className.replace(oldName,newName);
}

function selectBoxGo(box)
{
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}
function colorZebraTable(tableId) {
	var table = document.getElementById(tableId);
	var tRows = table.tBodies[0].rows;
	var tRow;
	for (var i=0; i<tRows.length; i++) {
		tRow = tRows[i];
		if (tRow!=null) tRow.className = (i%2==0)?"even":"odd";
	}
}
/*
Ext.namespace('THX');
THX.scroll = function() {
	var showTask;
	var hideTask;
	var template;
	var scrollbar;
	var index=0;
	
	var data = [
		{html:'ThanksUSA is thanking YOU for helping us thank America\'s troops',href:'/main/scholarships.html'},
		{html:'Over 1,750 scholarships awarded, total value almost $5 million',href:'/main/scholarships.html'},
		{html:'Nearly as many scholarship dollars awarded to spouses as to children',href:'/main/scholarships.html'},
		{html:'Our Scholarship recipients come from each of the 50 states and D.C.',href:'/main/scholarships.html'},
		{html:'Recipients represent all military branches including Guard and Reserves',href:'/main/scholarships.html'}
	];
	function init() {
		template = new Ext.Template('<a href="{href}">{html}</a>');
		template.compile();
		scrollbar = Ext.get('scroll-bar');
		showTask = new Ext.util.DelayedTask(show,this);
	 	hideTask = new Ext.util.DelayedTask(hide,this);
	 	show();
	}
	function show() {
		if (index > data.length-1) index = 0;
		template.overwrite(scrollbar,data[index++]);
		scrollbar.fadeIn({duration:1});		
		hideTask.delay(5000);
	}
	function hide() {
		scrollbar.fadeOut({duration:1});
		showTask.delay(1000);
	}
	return {init:init};
}();
*/