//here you place the ids of every element you want.
var ids=new Array('personal','business','commercial');


function switchid(id){	
	var isHidden;
	if (document.getElementById(id).className == 'closed'){
		isHidden = true;
	} else {
		isHidden = false;
	}
	
	if (isHidden) {
		hideallids();
		showdiv(id);
	} else {
		hideallids();
	}
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).className = 'closed';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.className = 'closed';
		}
		else { // IE 4
			document.all.id.className = 'closed';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).className = 'open';
		if (id == 'business') {
			document.form_b.USERID.focus();
		}
		else if (id == 'commercial') {
			document.logondropdownc.selectc.focus();
		}
		else {
			document.form_p.j_username.focus();
		}
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.className = 'open';
			if (id == 'business') {
				document.form_b.USERID.focus();
			}
			else if (id == 'commercial') {
				document.logondropdownc.selectc.focus();
			}
			else {
				document.form_p.j_username.focus();
			}
		}
		else { // IE 4
			document.all.id.className = 'open';
			if (id == 'business') {
				document.form_b.USERID.focus();
			}
			else if (id == 'commercial') {
				document.logondropdownc.selectc.focus();
			}
			else {
				document.form_p.j_username.focus();
			}
		}
	}
}