function fnGetDomain(url) {
return url.match(/:\/\/(.[^/]+)/)[1];
}
var hostDomain=window.location.host;
var scriptIdTag=document.getElementById("dScript");
var scriptIdSrc=scriptIdTag.src;
var scriptDomain=fnGetDomain(scriptIdSrc);
// SD:egive-usa.com
// RS:35
// RD:crosstrailscowboychurch.org
// MT:UID
// CD:20284
// AE:99
var dxmlhttp;
if (window.XMLHttpRequest) {dxmlhttp=new XMLHttpRequest();} // code for IE7+, Firefox, Chrome, Opera, Safari
else {dxmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } // code for IE6, IE5
function popCardCode() {
codeWin=window.open("http://"+scriptDomain+"/images/cardcode.gif","win2",'toolbar=0,location=0,top=50,left=100,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=320,height=435')
self.name = "codeWin";
}
function process() {
var row1 = document.getElementById('trSubmit');
var row2 = document.getElementById('trStatus');
goodForm=true;
var objTotal=document.getElementById("total");
objTotalValue=parseFloat(objTotal.value);
if (objTotalValue < 1){
goodForm=false;
objTotal.style.borderColor='#cc0000';
}
var runAchCheck=false;
if (runAchCheck==true){
if (document.getElementById("useach").checked==true){
runAchCheck=true;
} else {
runAchCheck=false;
}
}
if (runAchCheck==true){
if (document.getElementById("bankname").value==''){goodForm=false;}
if (document.getElementById("abarouting").value==''){goodForm=false;}
if (document.getElementById("achaccount").value==''){goodForm=false;}
} else {
if (document.getElementById("cardnumber").value==''){goodForm=false;}
if (document.getElementById("bname").value==''){goodForm=false;}
if (document.getElementById("baddr1").value==''){goodForm=false;}
if (document.getElementById("bzip").value==''){goodForm=false;}
}
if (document.getElementById("quickEmail").value==''){goodForm=false;}
var regEx = /^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$/
if (! regEx.test(document.getElementById("quickEmail").value)) { goodForm=false; }
if (goodForm==false) {
alert("Please complete required fields.");
} else {
row1.style.visibility = 'hidden';
row1.style.display = 'none';
row2.style.visibility = 'visible';
row2.style.display = 'table-row';
document.dForm.submit();
}
}
preAmountVal=0;
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
var rowVisKey='table-row';
if ((browser=="Microsoft Internet Explorer") && (version <= 7)) {rowVisKey='inline';}
function validateNumber(field) {
var val = field.value;
var val2 = val;
val2 = parseFloat(val2);
if (val2 < 1){alert("Please enter numbers greater than zero.");}
val=val.replace(".","0");
// if (val != '' && val != '0') {
// if(!/^\d*$/.test(val)){
// alert("Please enter numbers greater than zero.");
// field.value='0';
// field.focus();
// field.select();
// }
// }
if (val2 >= 0) {
} else {
alert("Please enter numbers greater than zero.");
field.value='0';
field.focus();
field.select();
}
if (field.name=="total"){
var objTotal=document.getElementById("total");
objTotalValue=parseFloat(objTotal.value);
if (objTotalValue < 1){objTotal.style.borderColor='#cc0000';}
if (objTotalValue > 0){objTotal.style.borderColor='#cccccc';}
}
}
function addEmUp(){
var totalAmount=0;
var amount1=document.getElementById("total").value;
var amount2=document.getElementById("total2").value;
var amount3=document.getElementById("total3").value;
if (amount1=='') {
amount1=0;} else {amount1=parseFloat(amount1);}
totalAmount=totalAmount+amount1;
if (amount2=='') {amount2=0;} else {amount2=parseFloat(amount2);}
totalAmount=totalAmount+amount2;
if (amount3=='') {amount3=0;} else {amount3=parseFloat(amount3);}
totalAmount=totalAmount+amount3;
if (totalAmount.toFixed){totalAmount=totalAmount.toFixed(2);}
if (document.getElementById("recur").checked==false){
document.getElementById("subButton").value='Submit $'+totalAmount;
}
}
function checkCard(felem){
tCardNum=felem.value;
tCardNum=tCardNum.replace(/-/g, "");
tCardNum=tCardNum.replace(/ /g, "");
felem.value=tCardNum;
}
function addFund(zid) {
thisZid=zid;
prevZid=zid-1;
var row1 = document.getElementById('addRow'+prevZid);
var row2 = document.getElementById('dRow'+thisZid);
var row3 = document.getElementById('addRow'+thisZid);
var row4 = document.getElementById('spac'+thisZid);
row1.style.visibility = 'hidden';
row1.style.display = 'none';
row2.style.visibility = 'visible';
row2.style.display = rowVisKey;
row3.style.visibility = 'visible';
row3.style.display = rowVisKey;
row4.style.visibility = 'visible';
row4.style.display = rowVisKey;
if (thisZid == 1){
var lastIndexObj = document.getElementById('comments');
var lastIndex = lastIndexObj.selectedIndex;
if (lastIndex==0){
nextIndex=1;
} else {
nextIndex=0;
}
var nextIndexObj = document.getElementById('comments2');
nextIndexObj.selectedIndex=nextIndex;
}
if (thisZid == 2){
var lastIndexObj = document.getElementById('comments2');
var lastIndex = lastIndexObj.selectedIndex;
if (lastIndex==0){
nextIndex=1;
} else {
nextIndex=0;
}
var nextIndexObj = document.getElementById('comments3');
nextIndexObj.selectedIndex=nextIndex;
}
}
function checkOtherAdd(){
var showAddOtherRow = 0;
var selComObj1 = document.getElementById('comments').options[document.getElementById('comments').selectedIndex].text;
var selComObj2 = document.getElementById('comments2').options[document.getElementById('comments2').selectedIndex].text;;
var selComObj3 = document.getElementById('comments3').options[document.getElementById('comments3').selectedIndex].text;;
selComObj1=selComObj1.toLowerCase();
selComObj2=selComObj2.toLowerCase();
selComObj3=selComObj3.toLowerCase();
if (selComObj1.search("other")==0){showAddOtherRow=1}
if (selComObj2.search("other")==0){showAddOtherRow=1}
if (selComObj3.search("other")==0){showAddOtherRow=1}
var saRow1 = document.getElementById('otherAdd1');
var saRow2 = document.getElementById('otherAdd2');
if (showAddOtherRow > 0) {
saRow1.style.visibility = 'visible';saRow1.style.display = rowVisKey;
saRow2.style.visibility = 'visible';saRow2.style.display = rowVisKey;
} else {
saRow1.style.visibility = 'hidden';saRow1.style.display = 'none';
saRow2.style.visibility = 'hidden';saRow2.style.display = 'none';
document.getElementById("extracomments").value='';
}
}
function backUpAutoStart(bsd){
if (document.getElementById("backupdate")){
document.getElementById("backupdate").value=bsd;
}
}
function fixStartDate(tstd){
var autoStartSpan=document.getElementById("autoFreqOption");
var selOptions='8/19/2016 ';
if (tstd=='1'){selOptions='9/1/2016 - Thu 10/1/2016 - Sat 11/1/2016 - Tue 12/1/2016 - Thu 1/1/2017 - Sun 2/1/2017 - Wed ';}
if (tstd=='2'){selOptions='9/16/2016 10/16/2016 11/16/2016 12/16/2016 1/16/2017 2/16/2017 ';}
if (tstd=='3'){selOptions='9/1/2016 9/16/2016 10/1/2016 10/16/2016 11/1/2016 11/16/2016 ';}
if (tstd=='4'){selOptions='8/20/2016 9/5/2016 9/20/2016 10/5/2016 10/20/2016 ';}
if (tstd=='5' || tstd=='6'){selOptions='8/21/2016 8/28/2016 9/4/2016 9/11/2016 9/18/2016 9/25/2016 10/2/2016 10/9/2016 10/16/2016 10/23/2016 10/30/2016 11/6/2016 11/13/2016 11/20/2016 11/27/2016 ';}
if (tstd=='8'){selOptions='8/19/2016 8/20/2016 8/21/2016 8/22/2016 8/23/2016 8/24/2016 8/25/2016 8/26/2016 8/27/2016 8/28/2016 8/29/2016 8/30/2016 8/31/2016 9/1/2016 9/2/2016 9/3/2016 9/4/2016 9/5/2016 9/6/2016 9/7/2016 9/8/2016 9/9/2016 9/10/2016 9/11/2016 9/12/2016 9/13/2016 9/14/2016 9/15/2016 9/16/2016 9/17/2016 9/18/2016 ';}
if (tstd=='9'){selOptions='8/19/2016 - Fri 8/20/2016 - Sat 8/21/2016 - Sun 8/22/2016 - Mon 8/23/2016 - Tue 8/24/2016 - Wed 8/25/2016 - Thu ';}
if (tstd=='10'){selOptions='8/19/2016 - Fri 8/20/2016 - Sat 8/21/2016 - Sun 8/22/2016 - Mon 8/23/2016 - Tue 8/24/2016 - Wed 8/25/2016 - Thu 8/26/2016 - Fri 8/27/2016 - Sat 8/28/2016 - Sun 8/29/2016 - Mon 8/30/2016 - Tue 8/31/2016 - Wed 9/1/2016 - Thu ';}
autoStartSpan.innerHTML=''+selOptions+' ';
}
function swapRecur(){
if (document.getElementById("recur").checked==true){
for (var iauto=1;iauto < 4;iauto++){
document.getElementById("trRecur"+iauto).style.display = rowVisKey;
document.getElementById("trRecur"+iauto).style.visibility = "visible";
}
fixStartDate(8);
document.getElementById("subButton").value="Activate Schedule";
} else {
//alert('recur false');
for (var iauto=1;iauto < 4;iauto++){
document.getElementById("trRecur"+iauto).style.display = "none";
document.getElementById("trRecur"+iauto).style.visibility = "hidden";
}
document.getElementById("subButton").value="Submit Donation";
addEmUp();
}
}
var postingUrl='https://'+scriptDomain+'/inline/proc-fdc';
var postingUrlAch='https://'+scriptDomain+'/inline/proc-fdc';
function masterMethod(){
if (document.getElementById("useach").checked==true){
for (var iauto=1;iauto < 5;iauto++){
document.getElementById("trAch"+iauto).style.display = rowVisKey;
document.getElementById("trAch"+iauto).style.visibility = "visible";
}
for (var iauto=1;iauto < 5;iauto++){
document.getElementById("trCard"+iauto).style.display = "none";
document.getElementById("trCard"+iauto).style.visibility = "hidden";
}
document.getElementById("hMethod").innerHTML="Checking Account";
document.getElementById("hInfo").innerHTML="Account Holder Information";
document.getElementById("nameOn").innerHTML="Full Name";
document.getElementById("dForm").action=postingUrlAch;
document.getElementById("cardnumber").value="";
} else {
for (var iauto=1;iauto < 5;iauto++){
document.getElementById("trAch"+iauto).style.display = "none";
document.getElementById("trAch"+iauto).style.visibility = "hidden";
}
for (var iauto=1;iauto < 5;iauto++){
document.getElementById("trCard"+iauto).style.display = rowVisKey;
document.getElementById("trCard"+iauto).style.visibility = "visible";
}
document.getElementById("hMethod").innerHTML="Card Information";
document.getElementById("hInfo").innerHTML="Card Holder Information";
document.getElementById("nameOn").innerHTML="Name on Card";
document.getElementById("dForm").action=postingUrl;
}
}
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regex = new RegExp("[\\?&]" + name + "=([^]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var checkThankYou=getParameterByName('ids');
var checkError=getParameterByName('ide');
if (checkThankYou != ""){
var dCont=document.getElementById("donorContainer");
dCont.innerHTML='
'+checkThankYou+'
Close Window Make a Donation » ';
}
if (checkError != ""){
var dCont=document.getElementById("donorContainer");
dCont.innerHTML=''+checkError+'
Make a Donation » ';
}
var origInner="";
function dCancel(){
if (preAmountVal > 0){window.close();}
else if (hostDomain==scriptDomain){window.close();}
else {document.getElementById("donorContainer").innerHTML=origInner;}
}
function setOrig(){
if (origInner=="") {origInner=document.getElementById("donorContainer").innerHTML;}
}
function initDonor(){
setOrig();
var dCont=document.getElementById("donorContainer");
var postingUrl='https://'+scriptDomain+'/inline/proc-fdc';
document.getElementById("dForm").action=postingUrl;
ibs='';
ibs=ibs+'';
dCont.innerHTML=ibs;
document.getElementById("total").value=preAmountVal;
addEmUp();
}
var plImages = new Array()
function preloadi() {for (i = 0; i < preloadi.arguments.length; i++) {plImages[i] = new Image();plImages[i].src = preloadi.arguments[i];}}
preloadi("//give.egive-usa.com/inline/images/loading.gif");
function loadDonor(){
setOrig();
document.getElementById("donorContainer").innerHTML=' ';
var tLoad=setTimeout(function(){initDonor();},1000);
}
function initPreAmount(){
var pamounttxt=document.getElementById("preAmount");
if (pamounttxt.value=="Enter Amount"){
pamounttxt.value="";
pamounttxt.style.color="#333333";
}
}
function preDonorSubmit(){
document.getElementById("donorContainer").innerHTML=' ';
document.getElementById("dForm").submit();
writeDonorBox();
}
function goPreDonor(){
var objPtot=document.getElementById("preAmount");
objPtotValue=parseFloat(objPtot.value);
preAmountVal=objPtotValue;
var postingUrl='https://'+scriptDomain+'/inline/dedicated/?uid=crospob115&amt='+objPtotValue;
document.getElementById("dForm").action=postingUrl;
document.getElementById("dForm").target="_blank";
setOrig();
document.getElementById("donorContainer").innerHTML=' ';
var tLoad=setTimeout(function(){preDonorSubmit();},1000);
}
function cPreAmt(){
var pamounttxt=document.getElementById("preAmount");
if (pamounttxt.value==""){pamounttxt.style.color="#999999";pamounttxt.value="Enter Amount";}
}
function writeDonorBox(){
var wdb='';
wdb=wdb+'
';
wdb=wdb+'
My Online Donation
';
wdb=wdb+'
No Registration Required
';
wdb=wdb+'
';
wdb=wdb+'
';
wdb=wdb+'
';
wdb=wdb+'
';
wdb=wdb+'
';
wdb=wdb+'
';
wdb=wdb+'
';
var dConti=document.getElementById("donorContainer");
dConti.innerHTML=wdb;
}
if (checkThankYou=="" && checkError==""){writeDonorBox();}