function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;	
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function pickDr() {
	number = Math.floor(Math.random() * 6);
	//alert(number);
	
	if (number == 0) {
		doctor = "G. Rees Cosgrove, MD, FRCSC, Chairman";
		txt = "Professor of Neurosurgery and Chair of the Department of Neurosurgery, The Warren Alpert Medical School of Brown University";
		url = "garth-rees-cosgrove";
	} else if (number == 1) {
		doctor = "Curtis E. Doberstein, MD";
		txt = "Dr. Doberstein is an Associate Professor in the Department of Neurosurgery at Brown and serves as the Brown Neurosurgery Residency Program Director. ";
		url = "curtis-doberstein";
	} else if (number == 2) {
		doctor = "Deus Cielo, MD";
		txt = "Dr. Cielo received his medical degree from the Dartmouth School of Medicine and Brown Medical School in 1996.";
		url = "deus-cielo";
	} else if (number == 3) {
		doctor = "Marc A. Goldman, MD";
		txt = "Dr. Goldman received his undergraduate degree from the University of Illinois and his medical degree from the University of Dublin, Trinity College.";
		url = "marc-goldman";
	} else if (number == 4) {
		doctor = "Petra Klinge, MD, Ph.D";
		txt = "Dr. Klinge is an Associate Professor of Neurosurgery, The Warren Alpert Medical School of Brown University.";
		url = "petra-klinge";
	}  else if (number == 5) {
		doctor = "Adetokunbo A. Oyelese, MD, Ph.D";
		txt = "Dr. Oyelese earned his M.D. and Ph.D. Degrees cum laude from Yale University School of Medicine in 1997.";
		url = "a-toki-oyelese";
	}
	
	document.getElementById("drPic").src = "images/photo-"+url+".jpg";
	document.getElementById("drName").innerHTML = "<a href='our-doctors/"+url+".asp'>"+doctor+"</a>";
	document.getElementById("bio").innerHTML = txt;
	document.getElementById("bioLink").innerHTML = "<a href='our-doctors/"+url+".asp'>Read full bio &raquo;</a>";
};

addLoadEvent(pickDr);
