//array "ids" must be set as global var prior to calling these functions

var ids=new Array('pane1_background','pane2_background','pane3_background','pane4_background','pane5_background','button1_on','button2_on','button3_on','button4_on','button5_on','arrow1','arrow2','arrow3','arrow4','arrow5','pane1','pane2','pane3','pane4','pane5');



var pane1ids=new Array('pane1_background','button1_on','arrow1','pane1');	  
var pane2ids=new Array('pane2_background','button2_on','arrow2','pane2');			  
var pane3ids=new Array('pane3_background','button3_on','arrow3','pane3');
var pane4ids=new Array('pane4_background','button4_on','arrow4','pane4');
var pane5ids=new Array('pane5_background','button5_on','arrow5','pane5');



function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id

	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function showpane1(){
	//loop through the array and hide each element by id

	for (var i=0;i<pane1ids.length;i++){
		showdiv(pane1ids[i]);
	}		  
}

function showpane2(){
	//loop through the array and hide each element by id

	for (var i=0;i<pane2ids.length;i++){
		showdiv(pane2ids[i]);
	}		  
}


function showpane3(){
	//loop through the array and hide each element by id

	for (var i=0;i<pane3ids.length;i++){
		showdiv(pane3ids[i]);
	}		  
}

function showpane4(){
	//loop through the array and hide each element by id

	for (var i=0;i<pane4ids.length;i++){
		showdiv(pane4ids[i]);
	}		  
}

function showpane5(){
	//loop through the array and hide each element by id

	for (var i=0;i<pane5ids.length;i++){
		showdiv(pane5ids[i]);
	}		  
}


function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
