// JavaScript Document


var tickspeed2=9500 
var displaymode2="auto" 

var selectedDiv2=0
var totalDivs2=0

function getElementbyClass2(classname){
partscollectb=new Array()
var inc=0
var alltags=document.all? document.all.tags("DIV") : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
partscollectb[inc++]=alltags[i]
}
}

function contractall2(){
var inc=0
while (partscollectb[inc]){
partscollectb[inc].style.display="none"
inc++
}
}

function expandone2(){
var selectedDiv2Obj=partscollectb[selectedDiv2]
contractall2()
selectedDiv2Obj.style.display="block"
if (document.gallerycontrol)
temp.options[selectedDiv2].selected=true
selectedDiv2=(selectedDiv2<totalDivs2-1)? selectedDiv2+1 : 0
if (displaymode2=="auto")
autocontrolvar2=setTimeout("expandone2()",tickspeed2)
}


function preparemode2(themode2){
displaymode2=themode2
if (typeof autocontrolvar2!="undefined")
clearTimeout(autocontrolvar2)
if (themode2=="auto"){
document.gallerycontrol.menu.disabled=true
autocontrolvar2=setTimeout("expandone2()",tickspeed2)
}
else
document.gallerycontrol.menu.disabled=false
}


function startgallery2(){
if (document.getElementById("controldiv")) //if it exists
document.getElementById("controldiv").style.display="block"
getElementbyClass2("gallerycontent2")
totalDivs2=partscollectb.length
if (document.gallerycontrol){
populatemenu()
if (document.gallerycontrol.mode){
for (i=0; i<document.gallerycontrol.mode.length; i++){
if (document.gallerycontrol.mode[i].checked)
displaymode2=document.gallerycontrol.mode[i].value
}
}
}
if (displaymode2=="auto" && document.gallerycontrol)
document.gallerycontrol.menu.disabled=true
expandone2()
}

