/* Function to make menus work in IE */

startList = function() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("dmenu");
		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", "");
				}
			}
		}
	}
}

window.onload=startList;

/* Function to open a window */
function OpenWind(url, width, height, scroll) {
	var Win = window.open(url,"displayPhoto",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,location=no,menubar=no,status=no' );
}

/* Function to Print content */
function PrintContent() {
	window.print();
}

/* Function to automatically go to next text enter field */
function selNext(field, next_field, max_chr) {

	var cf = document.getElementById(field).value;
	var nf = document.getElementById(next_field);
	
	if (cf.length > 3) {
		nf.focus();
	}
}

/* Function to automatically select Donation type */
function paymentSelect(field) {
	document.getElementById(field).checked = true;
	
	if (document.getElementById('monthly').checked == true) {
		document.getElementById('$25').checked = false;
		document.getElementById('$50').checked = false;
		document.getElementById('$75').checked = false;
		document.getElementById('other_value').checked = false;
		document.getElementById('other_amount').value = '';
	
	} else if (document.getElementById('single_gift').checked == true) {
		document.getElementById('monthly_amount').value = '';
		document.getElementById('start_month').value = "-";
		document.getElementById('start_year').value = "-";
	}
	
}

/* Function to select Other checkbox */
function otherSelect(field) {
	document.getElementById(field).checked = true;
}