function validateMinAmt(minAmt) {	var f = document.forms[0];	var giftRadio='';	for (var i = 0; i < f.GiftAmount.length; i++) {		if(f.GiftAmount[i].checked) {			giftRadio = f.GiftAmount[i].value;		}	}	if (giftRadio == "Other") {		var othAmt = parseInt(f.OtherAmount.value);		if (othAmt < minAmt) {			alert("The minimum donation amount we are able to accept on this page is $" + minAmt + ".");			return false;		}	}		return true;}function validEappealfields(radioVal) {	var docFrm = document.forms[0];	fld2 = docFrm.OtherAmount;	fld2 = fld2.value.replace(",","");		if (radioVal == "Other" && fld2 == ""){		alert("Please indicate the amount of your gift.");		return false;	} else if (radioVal != "Other" && fld2 != ""){		alert("Please make your gift by selecting a pre-determined amount or filling in the Other Amount field, but not both.");		return false;	} else if (radioVal == "Other" && isNaN(parseInt(fld2,10))){		alert("Please enter a numeric donation amount.");		return false;	} else if (radioVal == "Other" && parseInt(fld2,10) > 50000){		alert("We are only able to accept gifts up to $50,000 on this Web site. If you would like to donate more than this amount, please call our Donor Service Center at 1-866-730-3919");		return false;	} else if (radioVal == "Other" && parseInt(fld2,10) < 10){		alert("We are only able to accept gifts of $10 or more on this Web site. Your donation will be increased to this minimum amount.");		return true;	} else {		return true;	}	}/*eSub2 is built to use a split betweeen pledge and single gift donations.  */function eSub2(){		for (var i = 0; i < document.forms[0].GiftAmount.length; i++) {		if(document.forms[0].GiftAmount[i].checked) {			giftRadio = document.forms[0].GiftAmount[i].value;		}	}//	alert ('giftRadio = ' + giftRadio);	if (validEappealfields(giftRadio)){//		alert('validEappealfields returned true');		var tmpPath = (location.href.indexOf("/test/") < 0 ? "/worldvision" : "/test") + "/e-Gift.nsf/GiftCC?OpenForm";		//tmpPath +="&num="+document.forms[0].GiftNum.value;		var giftNum = "&num="+document.forms[0].GiftNum.value;		var splitAmt = document.forms[0].splitAmt.value;		var amt = '';		if (giftRadio == 'Other') {			amt = document.forms[0].OtherAmount.value;			giftNum = "&num="+document.forms[0].GiftNum2.value;			}		else if(giftRadio >= splitAmt){			amt = giftRadio;			giftNum = "&num="+document.forms[0].GiftNum2.value;			}		else {			amt = giftRadio; 			}		tmpPath += giftNum + "&amt=" + amt;//		alert (tmpPath);					//tmpPath += "&amt="+amt;		var cmp = document.forms[0].DVcode.value;//		alert(cmp);				if (cmp != '' && cmp != 'undefined') {			tmpPath += '&campaign=' + cmp;			}//		alert(tmpPath); 		window.location.href = tmpPath;	}	else {//		alert('validEappealfields returned false');		document.forms[0].OtherAmount.focus;	}}function eSub(){	var f = document.forms[0];	var giftRadio;	for (var i = 0; i < f.GiftAmount.length; i++) {		if(f.GiftAmount[i].checked) {			giftRadio = f.GiftAmount[i].value;		}	}	if (validEappealfields(giftRadio)){		var tmpPath = (location.href.indexOf("/test/") < 0 ? "/worldvision" : "/test") + "/e-Gift.nsf/GiftCC?OpenForm";		tmpPath +="&num=" + f.GiftNum.value;		var amt = '';		if (giftRadio == 'Other') {			amt = f.OtherAmount.value;		} 		else {			amt = giftRadio;		}		tmpPath += "&amt="+amt;		var cmp = f.DVcode.value;				if (cmp != '' && cmp != 'undefined') {			tmpPath += '&campaign=' + cmp;		}		window.location.href = tmpPath;	}	else {		document.forms[0].OtherAmount.focus;	}}function eSubV8(giftAmt){	var f = document.forms[0];	var giftRadio;	if(giftAmt) {		giftRadio = giftAmt;	} else {		for (var i = 0; i < f.GiftAmount.length; i++) {			if(f.GiftAmount[i].checked) {				giftRadio = f.GiftAmount[i].value;			}		}	}	if (giftAmt || validEappealfields(giftRadio)){		var tmpPath = (location.href.indexOf("/test/") < 0 ? "/worldvision" : "/test") + "/e-Gift.nsf/check-out?OpenForm";		tmpPath +="&num=" + f.GiftNum.value;		var amt = '';		if (giftRadio == 'Other') {			amt = f.OtherAmount.value;				if (amt.indexOf(".") > -1) {					amt = parseInt(amt,10);		 		}		} 		else {			amt = giftRadio;		}		tmpPath += "&amt="+amt;		var cmp = f.DVcode.value;				if (cmp != '' && cmp != 'undefined') {			tmpPath += '&campaign=' + cmp;		}		window.location.href = tmpPath;	}	else {		document.forms[0].OtherAmount.focus;	}}
