<!-- Javascript imported from JS files -- OLD priv.js -->

var txtCourtesy = "The Make-A-Wish Foundation";

// writes courtesy text to the status line.
function courtesyStatus() {
	window.status = txtCourtesy;
}

// selects the radiobutton related for personalization
function altreq(f) {
  f.Custom16[1].checked = 1;
  }

// selects the radiobutton related for personalization
function addcard(f) {
  f.addacard.value = 'addacard';
  }

// selects the radiobutton related for personalization
function mwish(f) {
  f.monthlywish.value = 'monthlywish';
  }


// selects the radiobutton related to the donor-intent field chosen, and clears fields that don't apply
function SelectRelated(f,i,item) {
  var di = f.elements["DonorIntent_" + item];
  var c4 = f.elements["Custom4_" + item];
  var c5 = f.elements["Custom5_" + item];
  var c6 = f.elements["Custom6_" + item];
  di[i].checked = 1;
  if(i != 1) {c4.options[0].selected = true;}
  if (c5) {
  	if(i != 4) {c5.options[0].selected = true;}
  }
  if(i != 0) c6.value = "";
  if(i == 0) {c6.select();}
  }


// selects the contents of the text field passed, if the contents match the test string
function selectiveSelect(objField, txtTest) {

	if(objField.value==txtTest) objField.select();

}

// selects the related check box when a personalization field is edited
//  useage: SelectRelatedCheckbox(this.form,'CHECKBOX_FIELD_NAME')
// Use this in all Card Personalization field tags (font, Color, and Line fields):
// ONCLICK="SelectRelatedCheckbox(this.form,'Custom8')"
// Use this in all Envelope Personalization field tags (font, Color, and Line fields):
// ONCLICK="SelectRelatedCheckbox(this.form,'Custom9')"

function SelectRelatedCheckbox(form,target) {
  form.elements[target].checked = 1;
}

// launches the special-character pop-up window
function specialchar() {
  var URL = "priv/specialchar.htm";
  var winOpts = "toolbar=0,location=0,status=0,menubar=0,directories=0,resizable=1,scrollbars=1,width=350,height=400";
  sw = window.open (URL, "sessionWin", winOpts);
  sw.focus();
}


// sets the value of the line variable, which must be declared in each page's header
function setline (n) {
  line = n;
}

// launches the help pop-up window
function help(scr) {
  var URL = "http://www.wish.org/home/giving/" + scr + "_help.htm";
  var winOpts = "toolbar=0,location=0,status=0,menubar=0,directories=0,resizable=1,scrollbars=1,width=350,height=300";
  hw = window.open (URL, "sessionWin", winOpts);
  hw.focus();
}

// launches product detail page in pop-up window
function detail(item_no) {
  var URL = "http://www.wish.org/home/giving/" + item_no + "_detail.htm";
  var winOpts = "toolbar=0,location=0,status=0,menubar=0,directories=0,resizable=1,scrollbars=1,width=500,height=400";
  pw = window.open (URL, "sessionWin", winOpts);
  pw.focus();
}


var bident_loaded = true;
//var titlelength = self.document.amount.Title.length;
var titlelength = 4;

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}



<!-- Javascript imported from JS files-->

function mswitch () {
  var monthly = self.document.getElementById("MonthlyFields");
//  if (di) {
//	  if (di[0].checked==true) {
		monthly.style.display='inline';
//	  }
//  }
}

// On Load -----------------------------------------------
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  }
  else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

// Dropdown menu ------------------------------------------
startList = function() {
  if (document.all&&document.getElementById) {
    navRoot = document.getElementById("SiteMenu");
    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {
          this.className+=" over";
        }
        node.onmouseout=function() {
          this.className=this.className.replace(" over", "");
        }
      }
    }
  }
}
addLoadEvent(startList);

// Popup handler ------------------------------------------
var client_win = null;
function popClient(url) {
        client_win = window.open(url, 'clientWin', 'width=388,height=600,toolbar=no,scrollbars=yes,scrolling=yes,statusbar=no,resizable=no');
        if (window.focus) client_win.focus();
}

// attach this to the onfocus of an INPUT or TEXTAREA, passing the 'this'
// object as the argument
function textFieldStoreAndClear(el) {
	el.originalText = (el.originalText == null) ? el.value : el.originalText;
	if (el.value == el.originalText) el.value = '';
}

// attach this to the onblur of an INPUT or TEXTAREA, passing the 'this'
// object as the argument
function textFieldRestore(el) {
	el.value = (el.value == '') ? el.originalText : el.value;
}

// -----------------------------------------------------------------------------
// attach this to the onfocus of an INPUT or TEXTAREA, passing the 'this'
// object as the argument
function textFieldStoreAndClear(el) {
	el.originalText = (el.originalText == null) ? el.value : el.originalText;
	if (el.value == el.originalText) el.value = '';
}

// attach this to the onblur of an INPUT or TEXTAREA, passing the 'this'
// object as the argument
function textFieldRestore(el) {
	el.value = (el.value == '') ? el.originalText : el.value;
}

function limit_textarea(objTextField, intMaxlength) {
 if (objTextField.value.length > intMaxlength) {
  objTextField.value = objTextField.value.substring(0, intMaxlength);
  alert("OOPS...\nYour message is limited to " + intMaxlength + " characters.");
 }
}

function RevealPPFields (f) {
  if ( f.elements['CCType'] ) {
	  var paymenttype = f.elements['paypalredirect'];
	  var pp = self.document.getElementById("PayPalButton");
	  var cc = self.document.getElementById("ccinfo");

	  var curvalue;

	  if ( pp ) {

		  if (paymenttype.type == "select-one") {
		  	curvalue = paymenttype.options[paymenttype.selectedIndex].value;
		  } else {
		  	var j = paymenttype.length;
		  	for (var k=0; k < j; k++) {
			   if (paymenttype[k].checked) {
			     curvalue = paymenttype[k].value;
			   }
			}
		  }

	     if (curvalue > 0) {
		     cc.style.display = 'none';
		     pp.style.display = 'block';

	     } else {
		     cc.style.display = 'block';
		     pp.style.display = 'none';

	     }
	  }
	}
}


<!-- Javascript programs specified in document-->
