//here you place the ids of every element you want.
var ids=new Array('a1','a2','a3','a4');
var sub_ids = new Array('Div1','Div2','Div3','Div4','Div5','Div6');

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 hidediv(id) {
	//safe function to hide an element with a specified id
	document.getElementById(id).style.display = 'none';
}

function showdiv(id) {
	//safe function to show an element with a specified id
	document.getElementById(id).style.display = 'block';
	showsubdiv('Div_Dummy');
}

function showsubdiv(did) {
	for (var j=0; j<sub_ids.length; j++) {
		document.getElementById(sub_ids[j]).style.left = "-600px";
	}
	document.getElementById(did).style.left = "0px";
}

