// JavaScript Document
/***********************************************
* DHTML Billboard script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
<!--
//List of transitional effects to be randomly applied to billboard:
var billboardeffects=["GradientWipe(GradientSize=1.0 Duration=0.7)", "Inset", "Iris", "Pixelate(MaxSquare=5 enabled=false)", "RadialWipe", "RandomBars", "Slide(slideStyle='push')", "Spiral", "Stretch", "Strips", "Wheel", "ZigZag"]
var billboardeffects=["GradientWipe(GradientSize=1.0 Duration=0.7)"] //Uncomment this line and input one of the effects above (ie: "Iris") for single effect.
var tickspeed=8000 //ticker speed in miliseconds (2000=2 seconds)
var effectduration=1500 //Transitional effect duration in miliseconds
var hidecontent_from_legacy=1 //Should content be hidden in legacy browsers- IE4/NS4 (0=no, 1=yes).
var filterid=Math.floor(Math.random()*billboardeffects.length)

//Write style sheet for divs
document.write('<style type="text/css">\n')
if (document.getElementById)
document.write('.billcontent{display:none;\n'+'filter:progid:DXImageTransform.Microsoft.'+billboardeffects[filterid]+'}\n')
else if (hidecontent_from_legacy)
document.write('#contentwrapper{display:none;}')
document.write('</style>\n')

var selectedDiv=0
var totalDivs=0
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function contractboard(){
var inc=0
while (document.getElementById("billboard"+inc)){
document.getElementById("billboard"+inc).style.display="none"
inc++
}
}

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function expandboard(){

var selectedDivObj=document.getElementById("billboard"+selectedDiv)
contractboard()
if (selectedDivObj.filters){
if (billboardeffects.length>1){
filterid=Math.floor(Math.random()*billboardeffects.length)
selectedDivObj.style.filter="progid:DXImageTransform.Microsoft."+billboardeffects[filterid]
}
selectedDivObj.style.filter="progid:DXImageTransform.Microsoft."+billboardeffects[0]
selectedDivObj.filters[0].duration=effectduration/1000
selectedDivObj.filters[0].Apply()
}
selectedDivObj.style.display="block"
if (selectedDivObj.filters)
selectedDivObj.filters[0].Play()
selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
timer = setTimeout("expandboard()",tickspeed)
}

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function startTicker(){
while (document.getElementById("billboard"+totalDivs)!=null){
configPicInstance("newsImage"+totalDivs);
totalDivs++
}
if (document.getElementById("billboard0").filters){
tickspeed+=effectduration;
}
expandboard();
}

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
function selectATicker(num){
timer = clearTimeout(timer);

var selectedDivObj=document.getElementById("billboard"+num)
contractboard()
if (selectedDivObj.filters){
if (billboardeffects.length>1){
filterid=Math.floor(Math.random()*billboardeffects.length)
selectedDivObj.style.filter="progid:DXImageTransform.Microsoft."+billboardeffects[filterid]
}
selectedDivObj.style.filter="progid:DXImageTransform.Microsoft."+billboardeffects[0]
selectedDivObj.filters[0].duration=effectduration/1000
selectedDivObj.filters[0].Apply()
}
selectedDivObj.style.display="block"
if (selectedDivObj.filters)
selectedDivObj.filters[0].Play()
selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
timer = setTimeout("expandboard()",tickspeed)

}
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function configPicInstance(obj){
var heightLimit=100;
var per=1;

if(document.getElementById(obj).height >heightLimit){
per =heightLimit/document.getElementById(obj).height;
per = Math.round(per*10)/10;
}

var w =Math.round(document.getElementById(obj).width*per );
var h = Math.round(document.getElementById(obj).height*per);

//alert("width:"+w+"  Height:"+h);
document.getElementById(obj).width =w;
document.getElementById(obj).height =h;

}

//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//Starts operation on loading of document
if (window.addEventListener)
window.addEventListener("load", startTicker, false)
else if (window.attachEvent)
window.attachEvent("onload", startTicker)
else if (document.getElementById)
window.onload=startTicker

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-->