// JavaScript Document
  var fundlist = new Array();
  var len;
  //html bullet - " &#8226; "
function toggle(id) {
      var objBranch = 
         document.getElementById(id).style;
      if(objBranch.display=="block")
         objBranch.display="none";
      else
         objBranch.display="block";
}

function addline(id) {
var a=document.getElementById(id).innerHTML;
alert(a);
}

function validate(thisform,which) {
  len=fundlist.length;
  switch (document.getElementById("stepnum").value) {
	case "2":
	  validate2(thisform,which);
	  break;
	case "1":
	  validate1(thisform,which)
  }
}

function validate2(thisform,which) {
  //alert("validate2");	
  switch (which) {
    case "cancel":
	  window.parent.location="http://www.bethelnw.org"
      break;
    case "reset":
	window.location.href="http://www.davidrolle.com/tbe/working.htm"
	/*
	  document.getElementById("stepnum").value="1"
      for (c=0;c<len;c++) {
        var obj0 = document.getElementById(fundlist[c][1]+"0").style;		
	      obj0.display="block";	  
        var obj1 = document.getElementById(fundlist[c][1]+"1").style;		
	      obj1.display="none";
        var obj3 = document.getElementById(fundlist[c][1]+"3").style;			  
  	      obj3.display="none";	  
	    var obj=document.getElementById("amt"+fundlist[c][1])
	      obj.value=""
	  }  
      var obj=document.getElementById("valid1").style;
	    obj.display="none";
	  document.getElementById("valid2").innerHTML="Total Donation $ "
	  var theRules = new Array();
	  if (document.styleSheets[0].cssRules) {
		theRules = document.styleSheets[0].cssRules;
	  } else if (document.styleSheets[0].rules) {
		theRules = document.styleSheets[0].rules;
	  }	
      for (c=0;c<theRules.length;c++) {
        if (theRules[c].selectorText==".header") {
		  theRules[c].style.display = "block";
 	    }
	  }
	  */
      break;
  case "submit":	
    var amt=1*0;
    var ret=true;
    var fieldname;
    var valid;
    var total=0;
    var htmlstring;
    //alert(len);
    //document.getElementById("bader2").innerHTML="teststring";
    for (c=0;c<len;c++) {
	  valid=true;
	  fundlist[c][7]=0;
	  fieldname=fundlist[c][1];
	  document.getElementById(fieldname+"2").innerHTML="";
      //document.getElementById(fieldname+'0').style.color = "#CCCCCC";
      amt=thisform.elements["amt"+fieldname].value;
	  fundlist[c][3]=amt
	  //alert(amt)
      if (!isBlank(amt)) {
 	    if (!isNumeric(amt)) {
          fundlist[c][7]=1;
          document.getElementById(fieldname+"0").style.color = "red";
	      document.getElementById(fieldname+"2").innerHTML="non-numeric amount"+" - ";
		  valid=false
        }
	    else
	    {
          if (amt<0) {
		    fundlist[c][7]=3
            document.getElementById(fieldname+"0").style.color = "red";
	        document.getElementById(fieldname+"2").innerHTML="amount less than 0"+" - ";
		    valid=false		  
	      }
	      else
	      {
	        if (amt<fundlist[c][2]) {
		      //test for minimum donation
		      fundlist[c][7]=2;
              document.getElementById(fieldname+'0').style.color = "red";		
    	      document.getElementById(fieldname+"2").innerHTML="amount less than minumum of " + fundlist[c][2]+" - ";
		      valid=false			
		    }	  
	      }
	    }
	  }
	  if (valid==false) {
	    fundlist[c][3]=0;
	  }
	  else
	  {
	    fundlist[c][3]=amt;
	    total=total+(1*amt);
	  }	
	  //ret will be false at the end if any entries are invalid
	  ret=(ret&&valid)
    }
	//if (ret==true) {
	//  ret=true
      document.getElementById("donorerr").innerHTML="";				
      for (c=0;c<len;c++) {
		if (fundlist[c][3]>0) {
		  valid=true;
	      fundlist[c][7]=0;
	      fieldname=fundlist[c][1];
	      document.getElementById(fieldname+"4").innerHTML="";		
	      document.getElementById(fieldname+"5").innerHTML="";				  
		  if (!(document.getElementById(fieldname+"6").checked || document.getElementById(fieldname+"7").checked)) {
			valid=false;
            document.getElementById(fieldname+'4').style.color = "red";		
    	    document.getElementById(fieldname+"4").innerHTML="Select In Memory Of or In Honor Of ";
		  }
		  if (""==document.getElementById("ded"+fieldname).value) {
			valid=false;			  
            document.getElementById(fieldname+'5').style.color = "red";		
    	    document.getElementById(fieldname+"5").innerHTML="Enter Dedication Name  ";
		  }
		}
		ret=(ret && valid);
	  }
	  if (""==document.getElementById("donor").value) {
        document.getElementById("donorerr").style.color = "red";		
    	document.getElementById("donorerr").innerHTML="Enter Donor Name  ";		
		ret=false;
	  }
	  if (ret==false) {
	    htmlstring='<font size="3" color="black"><BR><BR><p>Please check your entries for errors.</p>';
	    htmlstring=htmlstring+'Check for warnings in <font size="4" color="red">red</font> preceding each field.<BR><BR><BR></font>';
	    htmlstring=htmlstring+'<input type="button" value="Ok" name="B1" onclick=valid1win.hide(); />';
        valid1win=dhtmlmodal.open('winid', 'inline',  htmlstring, 'Entry Warning!', 'width=500px,height=200px,left=25px,top=100px,resize=0,scrolling=1');
        valid1win.onclose=function(){
        //alert("onclose function");
	    //var theform=document.getElementById("validform");
          return true;
		}
	  }
	  else
	  {
	    //call asp page and pass form
		//window.location.href="funds-donations.asp"
		//alert(thisform.getElementById("bader8").value)
	  document.getElementById("stepnum").value="3"
thisform.action="funds-donations.asp";
thisform.method="post";
thisform.submit();		
	  }
	//}
  }
}
//end of validate2

function validate1(thisform,which) {
  switch (which) {
    case "cancel":
	  window.parent.location="http://www.bethelnw.org"
      break;
    case "reset":
	window.location.href="http://www.davidrolle.com/tbe/working.htm"
	/*
	  document.getElementById("stepnum").value="1"
      for (c=0;c<len;c++) {
        var obj0 = document.getElementById(fundlist[c][1]+"0").style;		
	      obj0.display="block";	  
        var obj1 = document.getElementById(fundlist[c][1]+"1").style;		
	      obj1.display="none";
        var obj3 = document.getElementById(fundlist[c][1]+"3").style;			  
  	      obj3.display="none";	  
	    var obj=document.getElementById("amt"+fundlist[c][1])
	      obj.value=""
	  }  
      var obj=document.getElementById("valid1").style;
	    obj.display="none";
	  document.getElementById("valid2").innerHTML="Total Donation $ "
	  var theRules = new Array();
	  if (document.styleSheets[0].cssRules) {
		theRules = document.styleSheets[0].cssRules;
	  } else if (document.styleSheets[0].rules) {
		theRules = document.styleSheets[0].rules;
	  }	
      for (c=0;c<theRules.length;c++) {
        if (theRules[c].selectorText==".header") {
		  theRules[c].style.display = "block";
 	    }
	  }	  
	  */
      break;
  case "submit":
    var amt=1*0;
    var ret=true;
    var fieldname;
    var valid;
    var total=0;
    var htmlstring;
	var isred=false;
    //alert(len);
    //document.getElementById("bader2").innerHTML="teststring";
    for (c=0;c<len;c++) {
	  valid=true;
	  fundlist[c][7]=0;
	  fieldname=fundlist[c][1];
	  document.getElementById(fieldname+"2").innerHTML="";
      //document.getElementById(fieldname+'0').style.color = "#CCCCCC";
      amt=thisform.elements["amt"+fieldname].value;
	  fundlist[c][3]=amt
	  //alert(amt)
      if (!isBlank(amt)) {
 	    if (!isNumeric(amt)) {
	      //if ret is turned to false then we have a non-numeric value
          fundlist[c][7]=1;
          document.getElementById(fieldname+"0").style.color = "red";
	      document.getElementById(fieldname+"2").innerHTML="non-numeric amount"+" - ";
		  isred=true;
		  valid=false;
        }
	    else
	    {
          if (amt<0) {
		    fundlist[c][7]=3
            document.getElementById(fieldname+"0").style.color = "red";
	        document.getElementById(fieldname+"2").innerHTML="amount less than 0"+" - ";
            isred=true;
		    valid=false		  
	      }
	      else
	      {
	        if (amt<fundlist[c][2]) {
		      //test for minimum donation
		      fundlist[c][7]=2;
              document.getElementById(fieldname+'0').style.color = "red";		
    	      document.getElementById(fieldname+"2").innerHTML="amount less than minumum of " + fundlist[c][2]+" - ";
              isred=true;
		      valid=false			
		    }	  
	      }
	    }
	  }
	  if (valid==false) {
	    fundlist[c][3]=0;
	  }
	  else
	  {
	    fundlist[c][3]=amt;
	    total=total+(1*amt);
	  }	
	  ret=(ret&&valid)
    }
    if (ret==true && total!=0) {
	  document.getElementById("stepnum").value="2"
      document.getElementById("heading").innerHTML='<p class="style1">Temple Beth El - Donate to Endowment and Special Funds - Step 2 of 3</p>'
	  
	  htmlstring="<ul><li>For each fund, select In Honor Of or In Memory Of and fill in the dedication name.</li>"
      htmlstring=htmlstring+"<li>Fill in your name as you'd like it to appear on the notification card.</li>"
      htmlstring=htmlstring+"<li>If you feel additional information is required, fill in the comments box.</li>"
      htmlstring=htmlstring+"<li>When you're done filling in everything, click on the Continue button on the top or bottom of the page.</li>"
      htmlstring=htmlstring+"<li>Click on Reset to reset the page and start over.</li>"
      htmlstring=htmlstring+"<li>Click on Cancel to cancel your fund donation.</li>"
      htmlstring=htmlstring+"<li>If you naviagate away from this page, any amounts filled in may be lost.</li></ul>"
      document.getElementById("instructions").innerHTML=htmlstring
	  
	  for (c=0;c<len;c++) {
        var obj0 = document.getElementById(fundlist[c][1]+"0").style;		
        var obj1 = document.getElementById(fundlist[c][1]+"1").style;		
	      obj1.display="none";
        //var obj2 = document.getElementById(fundlist[c][2]+"0").style;		
        var obj3 = document.getElementById(fundlist[c][1]+"3").style;			  
        if (fundlist[c][3]!=0) {
		  obj3.display="block";
	    }
	    else
	    {
          obj0.display="none";
          obj3.display="none";
	    }
	  }
	  var obj=document.getElementById("valid1").style;
	    obj.display="block";
	  document.getElementById("valid2").innerHTML="Total Donation $ "+total
	  var theRules = new Array();
	  if (document.styleSheets[0].cssRules) {
		theRules = document.styleSheets[0].cssRules;
	  } else if (document.styleSheets[0].rules) {
		theRules = document.styleSheets[0].rules;
	  }	
      for (c=0;c<theRules.length;c++) {
        if (theRules[c].selectorText==".header") {
		  theRules[c].style.display = "none";
 	    }
	  }
    }
	else
	{
	/*
		scrollTo(0,0);
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
	alert("netscape");
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
	alert("dom");
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
	alert("ie6");
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  //alert(scrOfY);
  //alert(scrOfX);
  */
	  if (total==0 && isred==false) {
	    htmlstring='<font size="3" color="black"><BR><BR><p>Your total donation amount is 0.</p>';
	    htmlstring=htmlstring+'Please try again...<BR><BR><BR></font>';
	    htmlstring=htmlstring+'<input type="button" value="Ok" name="B1" onclick=valid1win.hide(); />';
        valid1win=dhtmlmodal.open('winid', 'inline',  htmlstring, 'Entry Warning!', 'width=500px,height=200px,left=25px,top=600px,resize=0,scrolling=1');
	
        //alert(valid1win)
        valid1win.onclose=function(){
          //alert("onclose function");
	      //var theform=document.getElementById("validform");
          return true;	
	    }		  
	  }
	  else
	  {
	    htmlstring='<font size="3" color="black"><BR><BR><p>Please check your donation amounts for errors.</p>';
	    htmlstring=htmlstring+'Check for warnings messages in <font size="4" color="red">red</font>.<BR><BR><BR></font>';			
	    htmlstring=htmlstring+'<input type="button" value="Ok" name="B1" onclick=valid1win.hide(); />';
        valid1win=dhtmlmodal.open('winid', 'inline',  htmlstring, 'Entry Warning!', 'width=500px,height=200px,left=25px,top=100px,resize=0,scrolling=1');
	
        //alert(valid1win)
        valid1win.onclose=function(){
        //alert("onclose function");
	    //var theform=document.getElementById("validform");
          return true;	
	    }
	  }
	}
  }
}

function winhide(butt,myform, flag) {
  //alert("2");
  valid1win.hide();
  //alert("3");
  button=butt.value;
  //alert(button);
  switch (flag){
    //case 1: 
      //do nothing extra
    //  break;
    case 2: 
      //do nothing extra
      break;
    case 0:
      var htmlstring="";
      if (button=="Continue") {
        for (c=0;c<len;c++) {
	      if (0!=fundlist[c][3] && ""==fundlist[c][4]) {
	        htmlstring='<BR><table border="1"><tr><td>Donation Amount</td><td>Fund Name</td></tr>';
            htmlstring=htmlstring+'<tr><td align="right">'+fundlist[c][3] + '</td><td>' + fundlist[c][0]+'</td></tr></table>';
		    htmlstring=htmlstring+'<form name="form1"><table width="300"><tr><td>Select Donation Type - Memorial or Honorary</td><td></td>';
		    htmlstring=htmlstring+'</tr><tr><td><input type="radio" id="groupmemory" name="group1" value="memory">In Memory Of</td><tr></tr><td><input type="radio" id="grouphonor" name="group1" value="honor">In Honor Of<br></td></tr>';
		    htmlstring=htmlstring+'<tr><td>Fill in honoree/memorial name</td><tr></tr><td><input type="text" id="donee" name="donee" size="75"></td></tr></table>';
		    htmlstring=htmlstring+'<input type="hidden" name="fundnum" id="fundnum" value="' + c + '">';
            htmlstring=htmlstring + '<input type="button" value="Continue" name="B1" onClick="winhide(this,form1,0)" />';
            htmlstring=htmlstring + '<input type="button" value="Cancel" name="B2" onClick="winhide(this,form1,0)" />';
            htmlstring=htmlstring + '</form>';

            valid1win=dhtmlmodal.open('fundid', 'inline',  htmlstring, 'Donation Detail Entry', 'width=500px,height=400px,left=25px,top=100px,resize=0,scrolling=1');

            valid1win.onclose=function(){
	          var fundnum=document.getElementById("fundnum").value;			
		      //alert(fundnum.value);
              fundlist[fundnum][5]=document.getElementById("donee").value;		
//		      if (document.getElementById("groupmemory").status==true) {
	//
	//
	//as of 2/9/08 - can't access the group to know which box was checked...
              if (document.form1.group1[0].checked) {
		        fundlist[fundnum][4]="memory";			
		      }
		      else
		      {
		        fundlist[fundnum][4]="honor";
		      }
			  alert(fundlist[fundnum][4]);
              //alert("onclose function");
	          //var theform=document.getElementById("validform");
              return true;
            }
          }
	      if (htmlstring!="") {
		    c=9999;
	      }
	    }
	    if (htmlstring=="") {
	      alert("last entry");
	      htmlstring='<p>Enter your name as it will appear on the acknowledgement card?</p>';
	      htmlstring=htmlstring+'<form name="form1"><p><input type="text" id="donor" name="donor"></p><p>Enter any necessary comments?</p>';
	      htmlstring=htmlstring+'<p><textarea name="comments" rows="6" cols="50"></textarea></p>';
          htmlstring=htmlstring + '<input type="button" value="Continue" name="B1" onClick="winhide(this,2)" />';
          htmlstring=htmlstring + '<input type="button" value="Cancel" name="B2" onClick="winhide(this,2)" /></form>';
		  htmlstring=htmlstring+'<script type="text/javascript">donorid.form1.donor.focus();</script>';
alert(htmlstring);
          valid1win=dhtmlmodal.open('donorid', 'inline',  htmlstring, 'Donor Entry', 'width=500px,height=400px,left=25px,top=100px,resize=0,scrolling=1');	
          valid1win.onclose=function(){
	      return true;
	    }
	  }
    }
    break;
  }
}
/*
  //[0] - name of fund
  //[1] - input field name
  //[2] - minumum donation donation amount
  //[3] - actual donation
  //[4] - donation type
  //[5] - donation description
  //[6] - donor name
  //[7] - problem code
*/
//-------------------------------------------------------------------
// isBlank(value)
//   Returns true if value only contains spaces
//-------------------------------------------------------------------
function isBlank(val){
	if((val==null)||(val=="")){return true;}
	for(var i=0;i<val.length;i++) {
		//if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
		if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
		}
	return true;
	}

//-------------------------------------------------------------------
// isNumeric(value)
//   Returns true if value contains a positive float value
//-------------------------------------------------------------------
function isNumeric(val){return(parseFloat(val,10)==(val*1));}

function startsite() {

//alert("startsite"+document.getElementById("stepnum").value);
//alert("startsite");

  //for (c=0;c<33;c=c+1) {
/*
for (c=0;c<3;c=c+1) {
		  //alert(c);
	fundlist[c]=new Array(8);
  }
*/
  //[0] - name of fund
  //[1] - input field name
  //[2] - minumum donation donation amount
  //[3] - actual donation
  //[4] - in honor of description
  //[5] - in memory of description
  //[6] - donor name
  //[7] - problem code

for (c=0;c<36;c=c+1) {
fundlist[c]=new Array(8);
}

fundlist[0][0]="BETTY & JACK BADER ADULT EDUCATION FUND";
fundlist[0][1]="bader";
fundlist[0][2]=0;
fundlist[1][0]="BEGINNING YEARS EARLY CHILDHOOD CENTER FUND";
fundlist[1][1]="begyears";
fundlist[1][2]=10;
fundlist[2][0]="LIFELONG LEARNING SCHOLARSHIP FUND";
fundlist[2][1]="lifelong";
fundlist[2][2]=0;
fundlist[3][0]="RELIGIOUS SCHOOL AND FAMILY EDUCATION FUND";
fundlist[3][1]="school";
fundlist[3][2]=0;
fundlist[4][0]="YOUTH PROGRAM FUND";
fundlist[4][1]="youth";
fundlist[4][2]=0;
fundlist[5][0]="SYLVIA & PERRY NEIDICH EDUCATIONAL SCHOLARSHIP ASSISTANCE FUND";
fundlist[5][1]="neidich";
fundlist[5][2]=0;
fundlist[6][0]="THE LEE S. KREINDLER B’NEI MITZVAH FUND";
fundlist[6][1]="kreindler";
fundlist[6][2]=0;
fundlist[7][0]="TORAT CHAYIM: A YOUTH ENRICHMENT ENDOWMENT FUND";
fundlist[7][1]="torat";
fundlist[7][2]=0;
fundlist[8][0]="AMY & SAM RESNICK FAMILY FUND FOR ADULT JEWISH STUDIES IN LOVING MEMORY OF REBECCA, MAX & AARON RESNICK";
fundlist[8][1]="resnick";
fundlist[8][2]=0;
fundlist[9][0]="BARBARA POLLACK MITZVAH DAY FUND";
fundlist[9][1]="pollack";
fundlist[9][2]=0;
fundlist[10][0]="BARBARA’S FUND FOR SURVIVORS";
fundlist[10][1]="survivors";
fundlist[10][2]=0;
fundlist[11][0]="TIKKUN OLAM (SOCIAL JUSTICE) FUND";
fundlist[11][1]="tikkun";
fundlist[11][2]=0;
fundlist[12][0]="ELLIS & RAE ZIMMER FUND FOR CHILDREN IN NEED";
fundlist[12][1]="zimmer";
fundlist[12][2]=0;
fundlist[13][0]="CLERGY’S CONGREGANTS IN NEED FUND";
fundlist[13][1]="need";
fundlist[13][2]=0;
fundlist[14][0]="CARING COMMUNITY FUND";
fundlist[14][1]="caring";
fundlist[14][2]=0;
fundlist[15][0]="ISRAEL ACTION FUND";
fundlist[15][1]="israel";
fundlist[15][2]=0;
fundlist[16][0]="RICHARD E. LEAVITT MEMORIAL FUND";
fundlist[16][1]="leavitt";
fundlist[16][2]=0;
fundlist[17][0]="RABBI CHAIM STERN CARING COMMUNITY ENDOWMENT FUND";
fundlist[17][1]="stern";
fundlist[17][2]=0;
fundlist[18][0]="DAVE & BUNNY CENTER FAMILY MITZVAH ENDOWMENT FUND";
fundlist[18][1]="bunny";
fundlist[18][2]=0;
fundlist[19][0]="BOOK OF LIFE FUND";
fundlist[19][1]="life";
fundlist[19][2]=120;
fundlist[20][0]="MEMORIAL PLAQUE FUND";
fundlist[20][1]="memorial";
fundlist[20][2]=250;
fundlist[21][0]="PRAYER BOOK FUND – Mishkan T’filah";
fundlist[21][1]="prayera";
fundlist[21][2]=54;
fundlist[22][0]="PRAYER BOOK FUND – Gates of Prayer";
fundlist[22][1]="prayerb";
fundlist[22][2]=54;
fundlist[23][0]="PRAYER BOOK FUND – The Torah: A Modern Commentary";
fundlist[23][1]="prayerc";
fundlist[23][2]=54;
fundlist[24][0]="PRAYER BOOK FUND – Gates of Repentance";
fundlist[24][1]="prayerd";
fundlist[24][2]=54;
fundlist[25][0]="TREE OF LIFE FUND";
fundlist[25][1]="tree";
fundlist[25][2]=500;
fundlist[26][0]="YOM HASHOAH FUND";
fundlist[26][1]="hashoah";
fundlist[26][2]=0;
fundlist[27][0]="GREGORY ALTMAN MUSIC & ARTS FUND";
fundlist[27][1]="altman";
fundlist[27][2]=0;
fundlist[28][0]="LIBRARY FUND";
fundlist[28][1]="library";
fundlist[28][2]=0;
fundlist[29][0]="CHAI FUND";
fundlist[29][1]="chai";
fundlist[29][2]=18;
fundlist[30][0]="FLOWER FUND";
fundlist[30][1]="flower";
fundlist[30][2]=36;
fundlist[31][0]="TEMPLE BETH EL ENDOWMENT FUND";
fundlist[31][1]="endow";
fundlist[31][2]=0;
fundlist[32][0]="THE RICHARD M. BLEIER MAINTENANCE ENDOWMENT FUND";
fundlist[32][1]="bleier";
fundlist[32][2]=0;
fundlist[33][0]="SENIOR RABBI’S DISCRETIONARY FUND";
fundlist[33][1]="senior";
fundlist[33][2]=0;
fundlist[34][0]="ASSISTANT RABBI’S DISCRETIONARY FUND";
fundlist[34][1]="assistant";
fundlist[34][2]=0;
fundlist[35][0]="CANTOR’S DISCRETIONARY FUND";
fundlist[35][1]="cantor";
fundlist[35][2]=0;
/*
for (c=0;c<3;c=c+1) {
fundlist[c]=new Array(8);
}

fundlist[0][0]="BETTY & JACK BADER ADULT EDUCATION FUND";
fundlist[0][1]="bader";
fundlist[0][2]=0;
//fundlist[0][4]="";
fundlist[1][0]="BEGINNING YEARS EARLY CHILDHOOD CENTER FUND";
fundlist[1][1]="begyears";
fundlist[1][2]=0;
//fundlist[1][4]="";
fundlist[2][0]="LIFELONG LEARNING SCHOLARSHIP FUND";
fundlist[2][1]="lifelong";
fundlist[2][2]=0;
//fundlist[2][4]="";

  fundlist[0][0]="BETTY & JACK BADER ADULT EDUCATION FUND";
  fundlist[0][1]="bader";
  fundlist[0][2]=0;
  fundlist[0][4]="";
  fundlist[1][0]="BEGINNING YEARS EARLY CHILDHOOD CENTER FUND";
  fundlist[1][1]="begyears";
  fundlist[1][2]=0;
  fundlist[1][4]="";
  fundlist[2][0]="LIFELONG LEARNING SCHOLARSHIP FUND";
  fundlist[2][1]="lifelong";
  fundlist[2][2]=0;
  fundlist[2][4]="";
  
  fundlist[3][0]="RELIGIOUS SCHOOL FUND";
  fundlist[3][1]="school";
  fundlist[3][2]=0;
  fundlist[3][4]="";
  fundlist[4][0]="YOUTH PROGRAM FUND";
  fundlist[4][1]="youth";
  fundlist[4][2]=0;
  fundlist[4][4]="";
  fundlist[5][0]="SYLVIA & PERRY NEIDICH EDUCATIONAL SCHOLARSHIP ASSISTANCE FUND";
  fundlist[5][1]="neidich";
  fundlist[5][2]=0;
  fundlist[5][4]="";
  fundlist[6][0]="THE LEE S. KREINDLER B’NEI MITZVAH FUND";
  fundlist[6][1]="kreindler";
  fundlist[6][2]=0;
  fundlist[6][4]="";
  fundlist[7][0]="TORAT CHAYIM: A YOUTH ENRICHMENT ENDOWMENT FUND";
  fundlist[7][1]="torat";
  fundlist[7][2]=0;
  fundlist[7][4]="";
  fundlist[8][0]="AMY & SAM RESNICK FAMILY FUND FOR ADULT JEWISH STUDIES IN LOVING MEMORY OF REBECCA, MAX & AARON RESNICK";
  fundlist[8][1]="resnick";
  fundlist[8][2]=0;
  fundlist[8][4]="";
  fundlist[9][0]="BARBARA POLLACK MITZVAH DAY FUND";
  fundlist[9][1]="pollack";
  fundlist[9][2]=0;
  fundlist[9][4]="";
  fundlist[10][0]="BARBARA’S FUND FOR SURVIVORS";
  fundlist[10][1]="survivors";
  fundlist[10][2]=0;
  fundlist[10][4]="";
  fundlist[11][0]="TIKKUN OLAM (SOCIAL JUSTICE) FUND";
  fundlist[11][1]="tikkun";
  fundlist[11][2]=0;
  fundlist[11][4]="";
  fundlist[12][0]="ELLIS & RAE ZIMMER FUND FOR CHILDREN IN NEED";
  fundlist[12][1]="zimmer";
  fundlist[12][2]=0;
  fundlist[12][4]="";
  fundlist[13][0]="CLERGY'S CONGREGANTS IN NEED FUND";
  fundlist[13][1]="need";
  fundlist[13][2]=0;
  fundlist[13][4]="";
  fundlist[14][0]="CARING COMMUNITY FUND";
  fundlist[14][1]="caring";
  fundlist[14][2]=0;
  fundlist[14][4]="";
  fundlist[15][0]="ISRAEL ACTION FUND";
  fundlist[15][1]="israel";
  fundlist[15][2]=0;
  fundlist[15][4]="";
  fundlist[16][0]="RICHARD E. LEAVITT MEMORIAL FUND";
  fundlist[16][1]="leavitt";
  fundlist[16][2]=0;
  fundlist[16][4]="";
  fundlist[17][0]="RABBI CHAIM STERN CARING COMMUNITY ENDOWMENT FUND";
  fundlist[17][1]="stern";
  fundlist[17][2]=0;
  fundlist[17][4]="";
  fundlist[18][0]="DAVE & BUNNY CENTER FAMILY MITZVAH ENDOWMENT FUND";
  fundlist[18][1]="bunny";
  fundlist[18][2]=0;
  fundlist[18][4]="";
  fundlist[19][0]="BOOK OF LIFE FUND";
  fundlist[19][1]="life";
  fundlist[19][2]=120;
  fundlist[19][4]="";
  fundlist[20][0]="MEMORIAL PLAQUE FUND";
  fundlist[20][1]="memorial";
  fundlist[20][2]=250;
  fundlist[20][4]="";
  fundlist[21][0]="PRAYER BOOK FUND";
  fundlist[21][1]="prayer";
  fundlist[21][2]=36;
  fundlist[21][4]="";
  fundlist[22][0]="TREE OF LIFE FUND";
  fundlist[22][1]="tree";
  fundlist[22][2]=500;
  fundlist[22][4]="";
  fundlist[23][0]="YOM HASHOAH FUND";
  fundlist[23][1]="hashoah";
  fundlist[23][2]=0;
  fundlist[23][4]="";
  fundlist[24][0]="GREGORY ALTMAN MUSIC & ARTS FUND";
  fundlist[24][1]="altman";
  fundlist[24][2]=0;
  fundlist[24][4]="";
  fundlist[25][0]="LIBRARY FUND";
  fundlist[25][1]="library";
  fundlist[25][2]=0;
  fundlist[25][4]="";
  fundlist[26][0]="CHAI FUND";
  fundlist[26][1]="chai";
  fundlist[26][2]=18;
  fundlist[26][4]="";
  fundlist[27][0]="FLOWER FUND";
  fundlist[27][1]="flower";
  fundlist[27][2]=36;
  fundlist[27][4]="";
  fundlist[28][0]="TEMPLE BETH EL ENDOWMENT FUND";
  fundlist[28][1]="endow";
  fundlist[28][2]=0;
  fundlist[28][4]="";
  fundlist[29][0]="THE RICHARD M. BLEIER MAINTENANCE ENDOWMENT FUND";
  fundlist[29][1]="bleier";
  fundlist[29][2]=0;
  fundlist[29][4]="";
  fundlist[30][0]="SENIOR RABBI’S DISCRETIONARY FUND";
  fundlist[30][1]="senior";
  fundlist[30][2]=0;
  fundlist[30][4]="";
  fundlist[31][0]="ASSISTANT RABBI’S DISCRETIONARY FUND";
  fundlist[31][1]="assistant";
  fundlist[31][2]=0;
  fundlist[31][4]="";
  fundlist[32][0]="CANTOR’S DISCRETIONARY FUND";
  fundlist[32][1]="cantor";
  fundlist[32][2]=0;
  fundlist[32][4]="";
*/
if (3==document.getElementById("stepnum").value) {
  len=fundlist.length;
  //alert("len"+len);
  var totalamt=0;
		  for (n=0;n<len;n++) {  
		  //alert(n);
			fundlist[n][3]=0  
		  }
		  //alert("fflen"+document.fundsform.length);
  for (c=1;c<document.fundsform.length;c++) {
    //Response.Write(Request.Form.key(c).substr(0,3)+"<BR>");
    //Response.Write("key"+Request.Form.key(c));
  //alert("len"+len);
    switch (document.fundsform.elements[c].name.substr(0,3)) {

	  case "amt" :
		//alert(document.fundsform.elements[c].name);
		//alert(document.fundsform.elements[c].value);	  
	    if (document.fundsform.elements[c].value!="") {
		  for (n=0;n<len;n++) {
			if (fundlist[n][1]==document.fundsform.elements[c].name.substr(3)) {
              fundlist[n][3]=document.fundsform.elements[c].value;
		      totalamt=totalamt+(1*document.fundsform.elements[c].value);
			}
		  }
		}
        break;
    }
  }  
	  for (c=0;c<len;c++) {
        var obj0 = document.getElementById(fundlist[c][1]+"0").style;		
        var obj1 = document.getElementById(fundlist[c][1]+"1").style;		
	      obj1.display="none";
        //var obj2 = document.getElementById(fundlist[c][2]+"0").style;		
        var obj3 = document.getElementById(fundlist[c][1]+"3").style;			  
        if (fundlist[c][3]!=0) {
		  obj3.display="block";
	    }
	    else
	    {
          obj0.display="none";
          obj3.display="none";
	    }
	  }
	  var obj=document.getElementById("valid1").style;
	    obj.display="block";
	  document.getElementById("valid2").innerHTML="Total Donation $ "+totalamt
	  var theRules = new Array();
	  if (document.styleSheets[0].cssRules) {
		theRules = document.styleSheets[0].cssRules;
	  } else if (document.styleSheets[0].rules) {
		theRules = document.styleSheets[0].rules;
	  }	
      for (c=0;c<theRules.length;c++) {
        if (theRules[c].selectorText==".header") {
		  theRules[c].style.display = "none";
 	    }
	  }
	  document.getElementById("stepnum").value=2


  }
  }
