/***********************************************
* Fade-in image slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var slideshow_width2='333px' //SET IMAGE WIDTH
var slideshow_height2='319px' //SET IMAGE HEIGHT
var pause2=6000 //SET pause2 BETWEEN SLIDE (3000=3 seconds)

var fadeimages2=new Array()
//SET 1) IMAGE PATHS, 2) optional link, 3), optional link target:
fadeimages2[0]=["images/products/energy_bar_ap_lg.png", "", ""]
fadeimages2[1]=["images/products/energy_gell_y_lg.png", "", ""]
fadeimages2[2]=["images/products/shotz_lg.png", "", ""]



////NO need to edit beyond here/////////////

var preloadedimages2=new Array()
for (p=0;p<fadeimages2.length;p++){
preloadedimages2[p]=new Image()
preloadedimages2[p].src=fadeimages2[p][0]
}

var ie42=document.all
var dom2=document.getElementById

if (ie42||dom2)
document.write('<div style="position:relative;width:'+slideshow_width2+';height:'+slideshow_height2+';overflow:hidden"><div id="canvas02" style="position:absolute;width:'+slideshow_width2+';height:'+slideshow_height2+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div><div id="canvas12" style="position:absolute;width:'+slideshow_width2+';height:'+slideshow_height2+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10;visibility: hidden"></div></div>')
else
document.write('<img name="defaultslide2" src="'+fadeimages2[0][0]+'">')

var curpos2=10
var degree2=10
var curcanvas2="canvas02"
var curimageindex2=0
var nextimageindex2=1

function fadepic2(){
if (curpos2<100){
curpos2+=10
if (tempobj2.filters)
tempobj2.filters.alpha.opacity=curpos2
else if (tempobj2.style.MozOpacity)
tempobj2.style.MozOpacity=curpos2/101
}
else{
clearInterval(dropslide2)
nextcanvas2=(curcanvas2=="canvas02")? "canvas02" : "canvas12"
tempobj2=ie42? eval("document.all."+nextcanvas2) : document.getElementById(nextcanvas2)
tempobj2.innerHTML=insertimage2(nextimageindex2)
nextimageindex2=(nextimageindex2<fadeimages2.length-1)? nextimageindex2+1 : 0
var tempobj22=ie42? eval("document.all."+nextcanvas2) : document.getElementById(nextcanvas2)
tempobj22.style.visibility="hidden"
setTimeout("rotateimage2()",pause2)
}
}

function insertimage2(i){
var tempcontainer2=fadeimages2[i][1]!=""? '<a href="'+fadeimages2[i][1]+'" target="'+fadeimages2[i][2]+'">' : ""
tempcontainer2+='<img src="'+fadeimages2[i][0]+'" border="0">'
tempcontainer2=fadeimages2[i][1]!=""? tempcontainer2+'</a>' : tempcontainer2
return tempcontainer2
}

function rotateimage2(){
if (ie42||dom2){
resetit2(curcanvas2)
var crossobj2=tempobj2=ie42? eval("document.all."+curcanvas2) : document.getElementById(curcanvas2)
crossobj2.style.zIndex++
tempobj2.style.visibility="visible"
var temp2='setInterval("fadepic2()",50)'
dropslide2=eval(temp2)
curcanvas2=(curcanvas2=="canvas02")? "canvas12" : "canvas02"
}
else
document.images.defaultslide2.src=fadeimages2[curimageindex2][0]
curimageindex2=(curimageindex2<fadeimages2.length-1)? curimageindex2+1 : 0
}

function resetit2(what){
curpos2=10
var crossobj2=ie42? eval("document.all."+what) : document.getElementById(what)
if (crossobj2.filters)
crossobj2.filters.alpha.opacity=curpos2
else if (crossobj2.style.MozOpacity)
crossobj2.style.MozOpacity=curpos2/101
}

function startit2(){
var crossobj2=ie42? eval("document.all."+curcanvas2) : document.getElementById(curcanvas2)
crossobj2.innerHTML=insertimage2(curimageindex2)
rotateimage2()
}

function startSlide2(){
	if (ie42||dom2){
	//window.onload=startit2
	startit2()
	}
	else{
	setInterval("rotateimage2()",pause2)
	}	
}
startSlide2();