//here you place the ids of every element you want.
var ids=new Array('tab1','tab2','tab3');
var menus=new Array('menu1','menu2','menu3');
var links=new Array('navigation_links_1','navigation_links_2','navigation_links_3');


function switchid(id,buttons,links){	
	hideallids();
	showdiv(id);
	disable_buttons(buttons,links);
	enable_button(buttons,links);

	}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}
	for (var i=0;i<menus.length;i++){
		disable_buttons(menus[i],links[i]);
	}
}

function disable_buttons(id,links) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.background = '#CCCCCC';
		document.getElementById(links).style.color = '#595959';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.background = 'url("http://img.perfumedeal.com/top_perfumes_main.gif")';
		}
		else { // IE 4
			document.all.id.style.background = 'url("http://img.perfumedeal.com/top_perfumes_main.gif")';
		}
	}
}

function enable_button(id,links) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.background = '#AB0000';
		document.getElementById(links).style.color = '#FFFFFF';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.backgroundColor = '#FFFFFF';
		}
		else { // IE 4
			document.all.id.style.backgroundColor = '#FFFFFF';
		}
	}
}

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';
		}
	}
}