function checkForm(f) {
	
	
	if(f.pmethod.selectedIndex == 0) {
		alert('Please select a payment method!');
		return false;
	} else if(!trim(f.amount.value)) {
		alert('Amount is empty!');
		return false;
	} else if(!f.amount.value.match(/^[0-9]+(\.[0-9]{1,2})?$/) ) {
		alert('Amount only accept numbers!');
		return false;
	} else {
		return true;
	}
}

function trim(jstr) { 
	var p1 = /^\s+/gi; 
	var p2 = /\s+$/gi 
	
	jstr = jstr.replace(p1,''); 
	jstr = jstr.replace(p2,''); 
	return jstr; 
}