<!--
// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}
//-->


function ChangeTextbox(_v)
{document.donation.amount.value=_v;}


//Remove the $ sign if you wish the parse number to NOT include it
var prefix=""
var wd
function parseelement(thisone){
if (thisone.value.charAt(0)=="")
return
wd="w"
var tempnum=thisone.value
for (i=0;i<tempnum.length;i++){
if (tempnum.charAt(i)=="."){
wd="d"
break
}
}
if (wd=="w")
thisone.value=prefix+tempnum+".00"
else{
if (tempnum.charAt(tempnum.length-2)=="."){
thisone.value=prefix+tempnum+"0"
}
else{
tempnum=Math.round(tempnum*100)/100
thisone.value=prefix+tempnum
}
}
}


<!--
function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}
//-->


<!-- Begin disable submit button--- called from CC validator
function disableForm(form) {
if (document.all || document.getElementById) {
for (i = 0; i < form.length; i++) {
var tempobj = form.elements[i];
if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
tempobj.disabled = true;
}
}
}
//  End -->



var testresults

function checkemail(){
 var str=document.form.email.value
 var filter=/^.+@.+\..{2,3}$/

 if (filter.test(str))
    testresults=true
 else {
    alert("Please input a valid email address!")
    testresults=false
}
 return (testresults)
}



function checkbae(){
if (document.layers||document.all)
return checkemail()
else
return true
}



<!--
function clear_radio_buttons() {
     for (var i = 0; i < document.donation.r1.length; i++) {
          document.donation.r1[i].checked = false;
     }
}

//-->



function selectRadio()
{
  var a_box = window.document.donation.amount;
  if ((a_box.value == "25.00")) {
    window.document.donation.r1[0].checked = true;
  }
    if ((a_box.value == "50.00")) {
    window.document.donation.r1[1].checked = true;
  }
      if ((a_box.value == "75.00")) {
    window.document.donation.r1[2].checked = true;
  }
      if ((a_box.value == "100.00")) {
    window.document.donation.r1[3].checked = true;
  }
}



function enableme() 
{ 
 (document.donation.special_occasion_name.disabled = false ); 
 (document.donation.special_occasion_street1.disabled = false ); 
 (document.donation.special_occasion_street2.disabled = false ); 
 (document.donation.special_occasion_city.disabled = false ); 
 (document.donation.special_occasion_state.disabled = false ); 
 (document.donation.special_occasion_zip.disabled = false ); 
 } 
 

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=1,resizable=1,width=550,height=400,left = 520,top = 250');");
}
// End -->

    function deleteconfirm(nameOfNewURL,targ) {
 
  if 
      (confirm('Are you sure you want to cancel?'))

	if(targ=='0')  {
   window.open(nameOfNewURL); 
   
   }
   
   else  {
   
   this.document.location=nameOfNewURL; 
	
	}

 }
 


var isIE=document.all?true:false;
var isDOM=document.getElementById?true:false;
var isNS4=document.layers?true:false;

/* _w : which ID (1) or (2) */
/* _h : (h)ide or (s)how */
function toggleT(_w,_h) {
  if (isDOM)
  {
    if (_h=='s') document.getElementById(_w).style.visibility='visible';
    if (_h=='h') document.getElementById(_w).style.visibility='hidden';
  }
  else if (isIE) {
    if (_h=='s') eval("document.all."+_w+".style.visibility='visible';");
    if (_h=='h') eval("document.all."+_w+".style.visibility='hidden';");
  }
  else if(isNS4)
  {
    if (_h=='s') eval("document.layers['"+_w+"'].visibility='show';");
    if (_h=='h') eval("document.layers['"+_w+"'].visibility='hide';");
  }
}



function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,titlebar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=620,height=450');");
}

function clearButtons(buttonGroup){ 

   for (i=0; i < buttonGroup.length; i++) { 

    if (buttonGroup[i].checked == true) { 
    buttonGroup[i].checked = false 
    }

   } 

}
