/***********************************************
* Switch Content script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated Mar 23rd, 2004.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

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

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit, omit2){
var inc=0
while (ccollect[inc]){
	if (ccollect[inc].id!=omit) {
		ccollect[inc].style.display="none"
	}
inc++
}
//document['ExConImg'+omit2].src = "/skin/default/img/categories/plus.gif";
}

function expandcontent(cid, cid2, type){
if (typeof ccollect!="undefined"){
	if (collapseprevious=="yes") {
		contractcontent(cid, cid2);
	} else {
		document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"

		if(type == "arrow") {
			if(document.getElementById(cid).style.display=="none") {
				document['Arrow'+cid2].src = "/skin/default/img/shell/arrow_closed.gif";
			} else {
				document['Arrow'+cid2].src = "/skin/default/img/shell/arrow_open.gif";
			}
		} else {
			if(document.getElementById(cid).style.display=="none") {
				document['ExConImg'+cid2].src = "/skin/default/img/categories/plus.gif";
			} else {
				document['ExConImg'+cid2].src = "/skin/default/img/categories/minus.gif";
			}
		}
		
		
	}
}
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

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

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
}


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