// JavaScript Document

var linkOn = '';

linkOn = function() {
	var curr = location.href;
	var setLink = '';
	//var setLink = 'home';
	try {
		var Toplinks = document.getElementById("topNav").getElementsByTagName("LI");
		for (var j=0; j<Toplinks.length; j++){
			var thisLink = Toplinks[j];
			var thisId = thisLink.id;
			if (curr.search(thisId) > 0){
				setLink = thisId;
				} 
			}
			document.getElementById(setLink).className = "on";
		}
	catch (err) {
		
		}
	try {
		var links = document.getElementById("sideNav").getElementsByTagName("A");
		for (var i=0; i<links.length; i++) {
			var href = links[i].href;
			if (curr == href){
				links[i].className = "on"	
				}
			}
		} 
	catch (err){
			
		}
	}

window.onload = linkOn;


function confirmDonate(URL){
	var msg;
	msg = '\n**** NEW ****\n\nYou are about to leave the Family Van web site for a secure web server where you may donate online through our fiscal agent Harvard Medical School using a credit card. \n\nPlease enter your personal information on the first page.\n\nOn page 2, be sure to select "Other" under "Gift Designation" and type the text "Family Van" in the "Comments/Other designation" text field.\n\nDo you wish to proceed to Harvard Medical School to donate to Family Van? ';
	var answer = confirm(msg);
	if (answer){
		window.open(URL, 'Donate', 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=550');
		//document.location.href = URL;
		}
	
}
