//here you place the ids of every element you want to hide or view.
var ids=new Array('ouragency','rentalunits','onlinesystems','contactus');

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 == 'rentalunits') {			
		}
		else if (id == 'onlinesystems') {
		}
		else if (id == 'contactus') {
		}
		else if (id == 'ouragency') {
		}
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.className = 'open';
			if (id == 'rentalunits') {
				document.ledgerd.className = 'open';
			}
			else if (id == 'onlinesystems') {
			}
			else if (id == 'contactus') {
			}
			else if (id == 'ouragency') {
			}
		}
		else { // IE 4
			document.all.id.className = 'open';
			if (id == 'rentalunits') {
				document.ledgerd.className = 'open';
			}
			else if (id == 'onlinesystems') {
			}
			else if (id == 'contactus') {
			}
			else if (id == 'ouragency') {
			}
		}
	}
}
