var c;
var k=0;
var j=0;
var divContainer = document.getElementById('detailTextContainer');
var lnksContainer = document.getElementById('detailListContainer');
var ary=[];
var divs = divContainer.getElementsByTagName('div');
var lnks = lnksContainer.getElementsByTagName('a');
var lstItms = lnksContainer.getElementsByTagName('li');
var splt;

/**************************************************

function init is provided for those who have javascript disabled
and would, otherwise, not be able to view any of the divs at all.
They would also I presume not need the links that control the divs
so that will not show up.

***************************************************/
function init() {
for(c=0;c<divs.length;c++) {
divs[c].id='d'+k++;
}
for (i=0;i<lstItms.length;i++) {
	lstItms[i].id=('item'+i);	
}
for (i=0;i<lnks.length;i++) {
	lnks[i].className=('hide');	
}
divs[0].className=('detailText show');	
for (i=1;i<lstItms.length;i++) {
	divs[i].className=('detailText hide');	
}

for(c=0;c<lnks.length;c++) {
if(lnks[c].className=='hide') {
ary[c]=true;
lnks[c].className='hs';
lnks[c].id='a'+j++;
lnks[c].onclick=function() {
splt=this.id.split('a')[1];
if(ary[splt]==true) {
ary[splt]=false;
showDiv(splt);
for (i=0;i<lstItms.length;i++) {
document.getElementById('item'+i).className='';	
}
document.getElementById('item'+splt).className='current';
return false;
}
else {
ary[splt]=true;

document.getElementById('d'+splt).className='hide';
return false;
}
}
}
}
}

function showDiv(num) {
for(c=0;c<j;c++){
ary[c]=true;
ary[num]=false;
}
for(c=0;c<divs.length;c++) {
if(divs[c].className=='detailText show') {
divs[c].className='hide';
}
}
document.getElementById('d'+num).className='detailText show';
}

if(window.addEventListener){
window.addEventListener('load',init,false);
}
else {
if(window.attachEvent){
window.attachEvent('onload',init);
}
}
