function swap_background(section,new_url){
	if (document.getElementById('l_section_text').innerHTML != document.getElementById(section.concat('_lib')).innerHTML)  
		document.getElementById(section.concat('_id')).style.backgroundImage=new_url;
}

function select_tab(section){
// switch the descriptive text //
	document.getElementById('l_section_text').innerHTML=document.getElementById(section.concat('_lib')).innerHTML;

	swap_background('l_section0','url(art/tab.png)');
	swap_background('l_section1','url(art/tab.png)');
	swap_background('l_section2','url(art/tab.png)');
	swap_background('l_section3','url(art/tab.png)');
	swap_background('l_section4','url(art/tab.png)');
	swap_background('l_section5','url(art/tab.png)');
	
	if (section == 'l_section0') document.getElementById(section.concat('_id')).style.backgroundImage='url(art/tab_selected.png)';
		else document.getElementById(section.concat('_id')).style.backgroundImage='url(art/tab_selected.png)';
}

function tab_setup(){
// All sections are initially loaded to ensure that all text in crawled by the search engine.
	document.getElementById('l_section0_lib').innerHTML=document.getElementById('l_section0_text').innerHTML;
	document.getElementById('l_section1_lib').innerHTML=document.getElementById('l_section1_text').innerHTML;
	document.getElementById('l_section2_lib').innerHTML=document.getElementById('l_section2_text').innerHTML;
	document.getElementById('l_section3_lib').innerHTML=document.getElementById('l_section3_text').innerHTML;
	document.getElementById('l_section4_lib').innerHTML=document.getElementById('l_section4_text').innerHTML;
	document.getElementById('l_section5_lib').innerHTML=document.getElementById('l_section5_text').innerHTML; 
// initially load just section0
	document.getElementById('l_section_text').innerHTML=document.getElementById('l_section0_lib').innerHTML;
}
