/***********************************************
* Advanced Gallery script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var tickspeed2=5000 //ticker speed in miliseconds (2000=2 seconds)
var displaymode2="auto" //displaymode2 ("auto" or "manual"). No need to modify as form at the bottom will control it, unless you wish to remove form.

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.gallerycontent2{display:none;}\n')
document.write('</style>\n')
}

var selectedDiv2=0
var totalDivs2=0

function getElementbyClass2(classname){
partscollect2=new Array()
var inc2=0
var alltags2=document.all? document.all.tags("DIV") : document.getElementsByTagName("*")
for (i=0; i<alltags2.length; i++){
if (alltags2[i].className==classname)
partscollect2[inc2++]=alltags2[i]
}
}

function contractall2(){
var inc2=0
while (partscollect2[inc2]){
partscollect2[inc2].style.display="none"
inc2++
}
}

function expandone2(){
var selectedDivObj2=partscollect2[selectedDiv2]
contractall2()
selectedDivObj2.style.display="block"
if (document.gallerycontrol2)
temp2.options[selectedDiv2].selected=true
selectedDiv2=(selectedDiv2<totalDivs2-1)? selectedDiv2+1 : 0
if (displaymode2=="auto")
autocontrolvar2=setTimeout("expandone2()",tickspeed2)
}

function populatemenu2(){
temp2=document.gallerycontrol2.menu
for (m=temp2.options.length-1;m>0;m--)
temp2.options[m]=null
for (i=0;i<totalDivs2;i++){
var thesubject2=partscollect2[i].getAttribute("subject")
thesubject2=(thesubject2=="" || thesubject2==null)? "HTML Content "+(i+1) : thesubject2
temp2.options[i]=new Option(thesubject2,"")
}
temp2.options[0].selected=true
}

function manualcontrol2(menuobj){
if (displaymode2=="manual"){
selectedDiv2=menuobj
expandone2()
}
}

function preparemode2(themode){
displaymode2=themode
if (typeof autocontrolvar2!="undefined")
clearTimeout(autocontrolvar2)
if (themode=="auto"){
document.gallerycontrol2.menu.disabled=true
autocontrolvar2=setTimeout("expandone2()",tickspeed2)
}
else
document.gallerycontrol2.menu.disabled=false
}


function startgallery2(){
if (document.getElementById("controldiv")) //if it exists
document.getElementById("controldiv").style.display="block"
getElementbyClass2("gallerycontent2")
totalDivs2=partscollect2.length
if (document.gallerycontrol2){
populatemenu2()
if (document.gallerycontrol2.mode){
for (i=0; i<document.gallerycontrol2.mode.length; i++){
if (document.gallerycontrol2.mode[i].checked)
displaymode2=document.gallerycontrol2.mode[i].value
}
}
}
if (displaymode2=="auto" && document.gallerycontrol2)
document.gallerycontrol2.menu.disabled=true
expandone2()
}

if (window.addEventListener)
window.addEventListener("load", startgallery2, false)
else if (window.attachEvent)
window.attachEvent("onload", startgallery2)
else if (document.getElementById)
window.onload=startgallery2