/* Sub box rotation for the home page */


/***********************************************
* 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 tickspeed=5000 //ticker speed in miliseconds (2000=2 seconds)
var displaymode="auto" //displaymode ("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('.contentBx1{display:none;}\n')
document.write('</style>\n')
}

var selectedDiv=0
var totalDivs=0

function getElementbyClass(classname){
partscollect=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)
partscollect[inc++]=alltags[i]
}
}

function contractall(){
var inc=0
while (partscollect[inc]){
partscollect[inc].style.display="none"
inc++
}
}

function expandone(){
var selectedDivObj=partscollect[selectedDiv]
contractall()
selectedDivObj.style.display="block"
if (document.gallerycontrol)
temp.options[selectedDiv].selected=true
selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
if (displaymode=="auto")
autocontrolvar=setTimeout("expandone()",tickspeed)
}

function populatemenu(){
temp=document.gallerycontrol.menu
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<totalDivs;i++){
var thesubject=partscollect[i].getAttribute("subject")
thesubject=(thesubject=="" || thesubject==null)? "HTML Content "+(i+1) : thesubject
temp.options[i]=new Option(thesubject,"")
}
temp.options[0].selected=true
}

function manualcontrol(menuobj){
if (displaymode=="manual"){
selectedDiv=menuobj
expandone()
}
}

function preparemode(themode){
displaymode=themode
if (typeof autocontrolvar!="undefined")
clearTimeout(autocontrolvar)
if (themode=="auto"){
document.gallerycontrol.menu.disabled=true
autocontrolvar=setTimeout("expandone()",tickspeed)
}
else
document.gallerycontrol.menu.disabled=false
}


function startgallery(){
if (document.getElementById("controldiv")) //if it exists
document.getElementById("controldiv").style.display="block"
getElementbyClass("contentBx1")
totalDivs=partscollect.length
if (document.gallerycontrol){
populatemenu()
if (document.gallerycontrol.mode){
for (i=0; i<document.gallerycontrol.mode.length; i++){
if (document.gallerycontrol.mode[i].checked)
displaymode=document.gallerycontrol.mode[i].value
}
}
}
if (displaymode=="auto" && document.gallerycontrol)
document.gallerycontrol.menu.disabled=true
expandone()
}

if (window.addEventListener)
window.addEventListener("load", startgallery, false)
else if (window.attachEvent)
window.attachEvent("onload", startgallery)
else if (document.getElementById)
window.onload=startgallery

///////////////////////////////////////////////////////////// SUB-BOX #2 ///////////////////////////////////////////////////////////////
var tickspeed2=5100 //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('.contentBx2{display:none;}\n')
document.write('</style>\n')
}

var selectedDiv2=0
var totalDivs2=0

function getElementbyClass2(classname2){
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==classname2)
partscollect2[inc2++]=alltags2[i]
}
}

function contractall2(){
var inc2=0
while (partscollect2[inc2]){
partscollect2[inc2].style.display="none"
inc2++
}
}

function expandone2(){
var selectedDiv2Obj=partscollect2[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 populatemenu2(){
temp=document.gallerycontrol.menu
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<totalDivs2;i++){
var thesubject=partscollect2[i].getAttribute("subject")
thesubject=(thesubject=="" || thesubject==null)? "HTML Content "+(i+1) : thesubject
temp.options[i]=new Option(thesubject,"")
}
temp.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.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("contentBx2")
totalDivs2=partscollect2.length
if (document.gallerycontrol){
populatemenu2()
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()
}

if (window.addEventListener)
window.addEventListener("load", startgallery2, false)
else if (window.attachEvent)
window.attachEvent("onload", startgallery2)
else if (document.getElementById)
window.onload=startgallery2

///////////////////////////////////////////////////////////// SUB-BOX #3 ///////////////////////////////////////////////////////////////
var tickspeed3=5200 //ticker speed in miliseconds (3000=3 seconds)
var displaymode3="auto" //displaymode3 ("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('.contentBx3{display:none;}\n')
document.write('</style>\n')
}

var selectedDiv3=0
var totalDivs3=0

function getElementbyClass3(classname3){
partscollect3=new Array()
var inc3=0
var alltags3=document.all? document.all.tags("DIV") : document.getElementsByTagName("*")
for (i=0; i<alltags3.length; i++){
if (alltags3[i].className==classname3)
partscollect3[inc3++]=alltags3[i]
}
}

function contractall3(){
var inc3=0
while (partscollect3[inc3]){
partscollect3[inc3].style.display="none"
inc3++
}
}

function expandone3(){
var selectedDiv3Obj=partscollect3[selectedDiv3]
contractall3()
selectedDiv3Obj.style.display="block"
if (document.gallerycontrol)
temp.options[selectedDiv3].selected=true
selectedDiv3=(selectedDiv3<totalDivs3-1)? selectedDiv3+1 : 0
if (displaymode3=="auto")
autocontrolvar3=setTimeout("expandone3()",tickspeed3)
}

function populatemenu3(){
temp=document.gallerycontrol.menu
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<totalDivs3;i++){
var thesubject=partscollect3[i].getAttribute("subject")
thesubject=(thesubject=="" || thesubject==null)? "HTML Content "+(i+1) : thesubject
temp.options[i]=new Option(thesubject,"")
}
temp.options[0].selected=true
}

function manualcontrol3(menuobj){
if (displaymode3=="manual"){
selectedDiv3=menuobj
expandone3()
}
}

function preparemode3(themode){
displaymode3=themode
if (typeof autocontrolvar3!="undefined")
clearTimeout(autocontrolvar3)
if (themode=="auto"){
document.gallerycontrol.menu.disabled=true
autocontrolvar3=setTimeout("expandone3()",tickspeed3)
}
else
document.gallerycontrol.menu.disabled=false
}


function startgallery3(){
if (document.getElementById("controldiv")) //if it exists
document.getElementById("controldiv").style.display="block"
getElementbyClass3("contentBx3")
totalDivs3=partscollect3.length
if (document.gallerycontrol){
populatemenu3()
if (document.gallerycontrol.mode){
for (i=0; i<document.gallerycontrol.mode.length; i++){
if (document.gallerycontrol.mode[i].checked)
displaymode3=document.gallerycontrol.mode[i].value
}
}
}
if (displaymode3=="auto" && document.gallerycontrol)
document.gallerycontrol.menu.disabled=true
expandone3()
}

if (window.addEventListener)
window.addEventListener("load", startgallery3, false)
else if (window.attachEvent)
window.attachEvent("onload", startgallery3)
else if (document.getElementById)
window.onload=startgallery3
