function getImage(what) {
	var w = 600;
	var h = 750;
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings  ='height='+h+',';
	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	win=window.open('/images/' + what,'',settings);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}


function updateFields(radioObj) {
	//alert(radioObj);
	vShow = "none";
	doToggle("school", vShow);
	doToggle("schlyear", vShow);
	doToggle("pro", vShow);
	doToggle("both", vShow);
	vShow = "block";

	if (radioObj == "student") {
	doToggle("school", vShow);
	doToggle("schlyear", vShow);

	} else if (radioObj != "general"){
	doToggle(radioObj, vShow);
	doToggle("both", vShow);
	}
 }


function displayFields() {
	//alert(radioObj);
	var radioObj = trim( document.getElementById( "affiliationtype" ).value );
	vShow = "none";
	doToggle("school", vShow);
	doToggle("schlyear", vShow);
	doToggle("pro", vShow);
	doToggle("both", vShow);
	vShow = "block";

	if (radioObj == "student") {
	doToggle("school", vShow);
	doToggle("schlyear", vShow);
	} else if (radioObj == "faculty") {
		doToggle("school", vShow);
	} else if (radioObj == "admin") {
		doToggle("school", vShow);
	} else if (radioObj == "professional") {
		doToggle("pro", vShow);
	} else if (radioObj == "independent") {
		doToggle("pro", vShow);
	} else {
		//doToggle(radioObj, vShow);
	}


	if (radioObj != "student") {


		doToggle("both", vShow);
	}
 }


 function doToggle (which, what) {
	if (document.getElementById) {
	// this is the way the standards work
	//var style2 = document.getElementByClass(which).style;
	//style2.display = what;
	var hidden = getElementsByCondition( function(el){if(el.className== which){el.style.display= what;return el;}} );
	} else if (document.all) {
	// this is the way old msie versions work
	var style2 = document.all[which].style;
	style2.display = what;
	} else if (document.layers) {
	// this is the way nn4 works
	var style2 = document.layers[which].style;
	style2.display = what;
	}
 }


function getElementsByCondition(condition,container) {
	container = container||document;
	var all = container.all||container.getElementsByTagName('*');
	var arr = [];
	for(var k=0;k<all.length;k++)
	{
	var elm = all[k];
	if(condition(elm,k));
	arr[arr.length] = elm;
	}
	return arr;
}
