// JavaScript SlideShow
var adfadeadimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
adfadeadimages[0]=["images/slideshow2/ad_01.jpg", "certified-dealer.htm", "_self", "Certified Dealer"]
adfadeadimages[1]=["images/slideshow2/ad_03.jpg", "http://www.trackerboats.com/promotions/promotion.cfm?promotionschildID=85", "_blank", "Bass Pro"]
adfadeadimages[2]=["images/slideshow2/ad_04.jpg", "no-haggle-no-hassle.htm", "_self", "No Haggle, No Hassle"]
adfadeadimages[3]=["images/slideshow2/ad_06.jpg", "https://www.tournament-rewards.com/", "_blank", "Tournament Rewards"]
adfadeadimages[4]=["images/slideshow2/ad_05.jpg", "bass-pro-group.htm", "_self", "Bass Pro Group"]

var adfadebgcolor="#FFFFFF"
 
////NO need to edit beyond here/////////////
 
var adfadearray=new Array() //array to cache adfadeshow instances
var adfadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function adfadeshow(theadimages, adfadewidth, adfadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=0
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curadimageindex=0
this.nextadimageindex=1
adfadearray[adfadearray.length]=this
this.slideshowid=adfadearray.length-1
this.adcanvasbase="adcanvas"+this.slideshowid
this.curadcanvas=this.adcanvasbase+"_0"
if (typeof displayorder!="undefined")
theadimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theadimages=theadimages
this.adimageborder=parseInt(borderwidth)
this.postadimages=new Array() //preload adimages
for (p=0;p<theadimages.length;p++){
this.postadimages[p]=new Image()
this.postadimages[p].src=theadimages[p][0]
}
 
var adfadewidth=adfadewidth+this.adimageborder*0
var adfadeheight=adfadeheight+this.adimageborder*0
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+adfadewidth+'px;height:'+adfadeheight+'px;overflow:hidden;"><div id="'+this.adcanvasbase+'_0" style="position:absolute;width:'+adfadewidth+'px;height:'+adfadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+adfadebgcolor+'"></div><div id="'+this.adcanvasbase+'_1" style="position:absolute;width:'+adfadewidth+'px;height:'+adfadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+adfadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postadimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curadimageindex++
setInterval("adfadearray["+this.slideshowid+"].rotateadimage()", this.delay)
}
}

function adfadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(adfadeclear[obj.slideshowid])
obj.nextadcanvas=(obj.curadcanvas==obj.adcanvasbase+"_0")? obj.adcanvasbase+"_0" : obj.adcanvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextadcanvas] : document.getElementById(obj.nextadcanvas)
obj.populateslide(obj.tempobj, obj.nextadimageindex)
obj.nextadimageindex=(obj.nextadimageindex<obj.postadimages.length-1)? obj.nextadimageindex+1 : 0
setTimeout("adfadearray["+obj.slideshowid+"].rotateadimage()", obj.delay)
}
}
 
adfadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theadimages[picindex][1]!="") //if associated link exists for adimage
slideHTML='<a href="'+this.theadimages[picindex][1]+'" target="'+this.theadimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postadimages[picindex].src+'" alt="'+this.theadimages[picindex][3]+'" border="'+this.adimageborder+'px">'
if (this.theadimages[picindex][1]!="") //if associated link exists for adimage
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
adfadeshow.prototype.rotateadimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateadimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curadcanvas] : document.getElementById(this.curadcanvas)
crossobj.style.zIndex++
adfadeclear[this.slideshowid]=setInterval("adfadepic(adfadearray["+this.slideshowid+"])",50)
this.curadcanvas=(this.curadcanvas==this.adcanvasbase+"_0")? this.adcanvasbase+"_1" : this.adcanvasbase+"_0"
}
else{
var ns4imgobj=document.adimages['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postadimages[this.curadimageindex].src
}
this.curadimageindex=(this.curadimageindex<this.postadimages.length-1)? this.curadimageindex+1 : 0
}
 
adfadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curadcanvas] : document.getElementById(this.curadcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
adfadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curadcanvas] : document.getElementById(this.curadcanvas)
this.populateslide(crossobj, this.curadimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateadimage()
}
