var enablepersist2="no" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious2="yes" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent2{display:none;}')
document.write('</style>')
}

function getElementbyClass2(classname){
ccollect2=new Array()
var inc2=0
var alltags2=document.all? document.all : document.getElementsByTagName("*")
for (i2=0; i2<alltags2.length; i2++){
if (alltags2[i2].className==classname)
ccollect2[inc2++]=alltags2[i2]
}
}

function closeall2() {
if (typeof ccollect2=="undefined"){
   getElementbyClass2("switchcontent2")
}
var inc2=0
while (ccollect2[inc2]){
ccollect2[inc2].style.display="none"
inc2++
}
}

function contractcontent2(omit){
var inc2=0
while (ccollect2[inc2]){
if (ccollect2[inc2].id!=omit)
ccollect2[inc2].style.display="none"
inc2++
}
}

function expandcontent2(cid){
if (typeof ccollect2=="undefined"){
   getElementbyClass2("switchcontent2")
}
if (collapseprevious2=="yes")
contractcontent2(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}

function revivecontent2(){
contractcontent2("omitnothing")
selectedItem2=getselectedItem2()
selectedComponents2=selectedItem2.split("|")
for (i2=0; i2<selectedComponents2.length-1; i2++)
document.getElementById(selectedComponents2[i]).style.display="block"
}

function get_cookie2(Name) { 
var search2 = Name2 + "="
var returnvalue2 = "";
if (document.cookie.length > 0) {
offset2 = document.cookie.indexOf(search)
if (offset2 != -1) { 
offset2 += search2.length
end2 = document.cookie.indexOf(";", offset2);
if (end2 == -1) end2 = document.cookie.length;
returnvalue2=unescape(document.cookie.substring(offset2, end2))
}
}
return returnvalue;
}

function getselectedItem2(){
if (get_cookie2(window.location.pathname) != ""){
selectedItem2=get_cookie(window.location.pathname)
return selectedItem2
}
else
return ""
}

function saveswitchstate2(){
var inc2=0, selectedItem2=""
while (ccollect2[inc]){
if (ccollect2[inc].style.display=="block")
selectedItem2+=ccollect2[inc].id+"|"
inc2++
}

document.cookie=window.location.pathname+"="+selectedItem2
}

function do_onload2(){
getElementbyClass2("switchcontent2")
if (enablepersist2=="on" && typeof ccollect2!="undefined")
revivecontent2()
}


//if (window.addEventListener)
//window.addEventListener("load", do_onload2, false)
//else if (window.attachEvent)
//window.attachEvent("onload", do_onload2)
//else if (document.getElementById)
//window.onload=do_onload2

//if (enablepersist2=="on" && document.getElementById)
//window.onunload=saveswitchstate2


