/***********************************************
* Ultimate Fade-In Slideshow (v1.5): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var imgPath 
//imgPath = "/koikearonson/" // Path for localhost
imgPath = "/" // Path for live and staging

 
var fadeImagesCutting=new Array()
//SET IMAGE PATHS. file,link url, target
fadeImagesCutting[0]=[ imgPath + "img/rotator/cutting/01.jpg", "", ""] 
fadeImagesCutting[1]=[ imgPath + "img/rotator/cutting/02.jpg", "", ""] 
fadeImagesCutting[2]=[ imgPath + "img/rotator/cutting/03.jpg", "", ""] 
fadeImagesCutting[3]=[ imgPath + "img/rotator/cutting/04.jpg", "", ""] 
fadeImagesCutting[4]=[ imgPath + "img/rotator/cutting/05.jpg", "", ""] 
fadeImagesCutting[5]=[ imgPath + "img/rotator/cutting/06.jpg", "", ""] 
fadeImagesCutting[6]=[ imgPath + "img/rotator/cutting/07.jpg", "", ""] 
fadeImagesCutting[7]=[ imgPath + "img/rotator/cutting/08.jpg", "", ""] 
fadeImagesCutting[8]=[ imgPath + "img/rotator/cutting/09.jpg", "", ""] 
fadeImagesCutting[9]=[ imgPath + "img/rotator/cutting/10.jpg", "", ""] 

var fadeImagesGasApparatus=new Array()
//SET IMAGE PATHS. file,link url, target
fadeImagesGasApparatus[0]=[ imgPath + "img/rotator/gasapparatus/01.jpg", "", ""] 
fadeImagesGasApparatus[1]=[ imgPath + "img/rotator/gasapparatus/02.jpg", "", ""] 
fadeImagesGasApparatus[2]=[ imgPath + "img/rotator/gasapparatus/03.jpg", "", ""] 
fadeImagesGasApparatus[3]=[ imgPath + "img/rotator/gasapparatus/04.jpg", "", ""] 
fadeImagesGasApparatus[4]=[ imgPath + "img/rotator/gasapparatus/05.jpg", "", ""] 
fadeImagesGasApparatus[5]=[ imgPath + "img/rotator/gasapparatus/06.jpg", "", ""] 
fadeImagesGasApparatus[6]=[ imgPath + "img/rotator/gasapparatus/07.jpg", "", ""] 
fadeImagesGasApparatus[7]=[ imgPath + "img/rotator/gasapparatus/08.jpg", "", ""] 
fadeImagesGasApparatus[8]=[ imgPath + "img/rotator/gasapparatus/09.jpg", "", ""] 
fadeImagesGasApparatus[9]=[ imgPath + "img/rotator/gasapparatus/10.jpg", "", ""] 
fadeImagesGasApparatus[10]=[ imgPath + "img/rotator/gasapparatus/11.jpg", "", ""] 
fadeImagesGasApparatus[11]=[ imgPath + "img/rotator/gasapparatus/12.jpg", "", ""] 
fadeImagesGasApparatus[12]=[ imgPath + "img/rotator/gasapparatus/13.jpg", "", ""] 
fadeImagesGasApparatus[13]=[ imgPath + "img/rotator/gasapparatus/14.jpg", "", ""] 
fadeImagesGasApparatus[14]=[ imgPath + "img/rotator/gasapparatus/15.jpg", "", ""] 
fadeImagesGasApparatus[15]=[ imgPath + "img/rotator/gasapparatus/16.jpg", "", ""] 
fadeImagesGasApparatus[16]=[ imgPath + "img/rotator/gasapparatus/17.jpg", "", ""] 
fadeImagesGasApparatus[17]=[ imgPath + "img/rotator/gasapparatus/18.jpg", "", ""] 
fadeImagesGasApparatus[18]=[ imgPath + "img/rotator/gasapparatus/19.jpg", "", ""] 
fadeImagesGasApparatus[19]=[ imgPath + "img/rotator/gasapparatus/20.jpg", "", ""] 
fadeImagesGasApparatus[20]=[ imgPath + "img/rotator/gasapparatus/21.jpg", "", ""] 
fadeImagesGasApparatus[21]=[ imgPath + "img/rotator/gasapparatus/22.jpg", "", ""] 
fadeImagesGasApparatus[22]=[ imgPath + "img/rotator/gasapparatus/23.jpg", "", ""] 
fadeImagesGasApparatus[23]=[ imgPath + "img/rotator/gasapparatus/24.jpg", "", ""] 
fadeImagesGasApparatus[24]=[ imgPath + "img/rotator/gasapparatus/25.jpg", "", ""] 
fadeImagesGasApparatus[25]=[ imgPath + "img/rotator/gasapparatus/26.jpg", "", ""] 
fadeImagesGasApparatus[26]=[ imgPath + "img/rotator/gasapparatus/27.jpg", "", ""] 
fadeImagesGasApparatus[27]=[ imgPath + "img/rotator/gasapparatus/28.jpg", "", ""] 
fadeImagesGasApparatus[28]=[ imgPath + "img/rotator/gasapparatus/29.jpg", "", ""] 
fadeImagesGasApparatus[29]=[ imgPath + "img/rotator/gasapparatus/30.jpg", "", ""] 
fadeImagesGasApparatus[30]=[ imgPath + "img/rotator/gasapparatus/31.jpg", "", ""] 

var fadeImagesPortable=new Array()
//SET IMAGE PATHS. file,link url, target
fadeImagesPortable[0]=[ imgPath + "img/rotator/portable/01.jpg", "", ""] 
fadeImagesPortable[1]=[ imgPath + "img/rotator/portable/02.jpg", "", ""] 
fadeImagesPortable[2]=[ imgPath + "img/rotator/portable/03.jpg", "", ""] 
fadeImagesPortable[3]=[ imgPath + "img/rotator/portable/04.jpg", "", ""] 
fadeImagesPortable[4]=[ imgPath + "img/rotator/portable/05.jpg", "", ""] 
fadeImagesPortable[5]=[ imgPath + "img/rotator/portable/06.jpg", "", ""] 
fadeImagesPortable[6]=[ imgPath + "img/rotator/portable/07.jpg", "", ""] 
fadeImagesPortable[7]=[ imgPath + "img/rotator/portable/08.jpg", "", ""] 
fadeImagesPortable[8]=[ imgPath + "img/rotator/portable/09.jpg", "", ""] 
fadeImagesPortable[9]=[ imgPath + "img/rotator/portable/10.jpg", "", ""] 
fadeImagesPortable[10]=[ imgPath + "img/rotator/portable/11.jpg", "", ""] 
fadeImagesPortable[11]=[ imgPath + "img/rotator/portable/12.jpg", "", ""] 
fadeImagesPortable[12]=[ imgPath + "img/rotator/portable/13.jpg", "", ""] 
fadeImagesPortable[13]=[ imgPath + "img/rotator/portable/14.jpg", "", ""] 
fadeImagesPortable[14]=[ imgPath + "img/rotator/portable/15.jpg", "", ""] 
fadeImagesPortable[15]=[ imgPath + "img/rotator/portable/16.jpg", "", ""] 
fadeImagesPortable[16]=[ imgPath + "img/rotator/portable/17.jpg", "", ""] 
fadeImagesPortable[17]=[ imgPath + "img/rotator/portable/18.jpg", "", ""] 
fadeImagesPortable[18]=[ imgPath + "img/rotator/portable/19.jpg", "", ""] 
fadeImagesPortable[19]=[ imgPath + "img/rotator/portable/20.jpg", "", ""] 
fadeImagesPortable[20]=[ imgPath + "img/rotator/portable/21.jpg", "", ""] 
fadeImagesPortable[21]=[ imgPath + "img/rotator/portable/22.jpg", "", ""] 
fadeImagesPortable[22]=[ imgPath + "img/rotator/portable/23.jpg", "", ""] 
fadeImagesPortable[23]=[ imgPath + "img/rotator/portable/24.jpg", "", ""] 
fadeImagesPortable[24]=[ imgPath + "img/rotator/portable/25.jpg", "", ""] 
fadeImagesPortable[25]=[ imgPath + "img/rotator/portable/26.jpg", "", ""] 
fadeImagesPortable[26]=[ imgPath + "img/rotator/portable/27.jpg", "", ""] 
fadeImagesPortable[27]=[ imgPath + "img/rotator/portable/28.jpg", "", ""] 
fadeImagesPortable[28]=[ imgPath + "img/rotator/portable/29.jpg", "", ""] 
fadeImagesPortable[29]=[ imgPath + "img/rotator/portable/30.jpg", "", ""] 
fadeImagesPortable[30]=[ imgPath + "img/rotator/portable/31.jpg", "", ""] 
fadeImagesPortable[31]=[ imgPath + "img/rotator/portable/32.jpg", "", ""] 
fadeImagesPortable[32]=[ imgPath + "img/rotator/portable/33.jpg", "", ""] 
fadeImagesPortable[33]=[ imgPath + "img/rotator/portable/34.jpg", "", ""] 
fadeImagesPortable[34]=[ imgPath + "img/rotator/portable/35.jpg", "", ""] 
fadeImagesPortable[35]=[ imgPath + "img/rotator/portable/36.jpg", "", ""] 
fadeImagesPortable[36]=[ imgPath + "img/rotator/portable/37.jpg", "", ""] 
fadeImagesPortable[37]=[ imgPath + "img/rotator/portable/38.jpg", "", ""] 
fadeImagesPortable[38]=[ imgPath + "img/rotator/portable/39.jpg", "", ""]  

var fadeImagesPositioning=new Array()
//SET IMAGE PATHS. file,link url, target
fadeImagesPositioning[0]=[ imgPath + "img/rotator/positioning/01.jpg", "", ""] 
fadeImagesPositioning[1]=[ imgPath + "img/rotator/positioning/02.jpg", "", ""] 
fadeImagesPositioning[2]=[ imgPath + "img/rotator/positioning/03.jpg", "", ""] 
fadeImagesPositioning[3]=[ imgPath + "img/rotator/positioning/04.jpg", "", ""] 
//fadeImagesPositioning[4]=[ imgPath + "img/rotator/positioning/05.jpg", "", ""] 
//fadeImagesPositioning[5]=[ imgPath + "img/rotator/positioning/06.jpg", "", ""] 
//fadeImagesPositioning[6]=[ imgPath + "img/rotator/positioning/07.jpg", "", ""] 
//fadeImagesPositioning[7]=[ imgPath + "img/rotator/positioning/08.jpg", "", ""] 
//fadeImagesPositioning[8]=[ imgPath + "img/rotator/positioning/09.jpg", "", ""] 
//fadeImagesPositioning[9]=[ imgPath + "img/rotator/positioning/10.jpg", "", ""] 
//fadeImagesPositioning[10]=[ imgPath + "img/rotator/positioning/11.jpg", "", ""] 
//fadeImagesPositioning[11]=[ imgPath + "img/rotator/positioning/12.jpg", "", ""] 
//fadeImagesPositioning[12]=[ imgPath + "img/rotator/positioning/13.jpg", "", ""] 
//fadeImagesPositioning[13]=[ imgPath + "img/rotator/positioning/14.jpg", "", ""] 
//fadeImagesPositioning[14]=[ imgPath + "img/rotator/positioning/15.jpg", "", ""] 
//fadeImagesPositioning[15]=[ imgPath + "img/rotator/positioning/16.jpg", "", ""] 
//fadeImagesPositioning[16]=[ imgPath + "img/rotator/positioning/17.jpg", "", ""] 
//fadeImagesPositioning[17]=[ imgPath + "img/rotator/positioning/18.jpg", "", ""] 
//fadeImagesPositioning[18]=[ imgPath + "img/rotator/positioning/19.jpg", "", ""] 
//fadeImagesPositioning[19]=[ imgPath + "img/rotator/positioning/20.jpg", "", ""] 
//fadeImagesPositioning[20]=[ imgPath + "img/rotator/positioning/21.jpg", "", ""]

var fadeImagesDefault=new Array()
//SET IMAGE PATHS. file,link url, target
fadeImagesDefault[0]=[ imgPath + "img/rotator/default/01.jpg", "", ""] 
fadeImagesDefault[1]=[ imgPath + "img/rotator/default/02.jpg", "", ""] 
fadeImagesDefault[2]=[ imgPath + "img/rotator/default/03.jpg", "", ""]
fadeImagesDefault[3]=[ imgPath + "img/rotator/default/04.jpg", "", ""]
fadeImagesDefault[4]=[ imgPath + "img/rotator/default/05.jpg", "", ""]
fadeImagesDefault[5]=[ imgPath + "img/rotator/default/06.jpg", "", ""]
fadeImagesDefault[6]=[ imgPath + "img/rotator/default/07.jpg", "", ""]
fadeImagesDefault[7]=[ imgPath + "img/rotator/default/08.jpg", "", ""]
fadeImagesDefault[8]=[ imgPath + "img/rotator/default/09.jpg", "", ""]
fadeImagesDefault[9]=[ imgPath + "img/rotator/default/10.jpg", "", ""]
fadeImagesDefault[10]=[ imgPath + "img/rotator/default/11.jpg", "", ""]
fadeImagesDefault[11]=[ imgPath + "img/rotator/default/12.jpg", "", ""]
fadeImagesDefault[12]=[ imgPath + "img/rotator/default/13.jpg", "", ""]
fadeImagesDefault[13]=[ imgPath + "img/rotator/default/14.jpg", "", ""]
fadeImagesDefault[14]=[ imgPath + "img/rotator/default/15.jpg", "", ""]
fadeImagesDefault[15]=[ imgPath + "img/rotator/default/16.jpg", "", ""]
fadeImagesDefault[16]=[ imgPath + "img/rotator/default/17.jpg", "", ""]
 
//var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
//fadeimages2[0]=["photo1.jpg", "", ""] //plain image syntax
//fadeimages2[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
//fadeimages2[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
 
 
 
var fadebgcolor="white"
 
////NO need to edit beyond here/////////////
/* 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(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{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
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=obj.degree/100
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
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.rotateimage()
}
*/

function fadeshow(arrInput, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
  try
  {
   // alert(arrInput.length);
   if ((arrInput.length > 0) && (arrInput != null)) {
    var randomnumber=Math.floor(Math.random()*arrInput.length)
   //alert(arrInput[randomnumber][0]);
    // pull out the rotator div
    var slideHTML=""
    //slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
    slideHTML='<img src="'+ arrInput[randomnumber][0] +'" border="'+this.imageborder+'px">'
    document.getElementById("rotator").innerHTML = slideHTML;
    // randomize using the arrInput length
    // using the random number generated, show the image in the div from the arrInput[randomNumber];
    }
  }
  catch (e)
  {
    alert("An error was encountered:\n\n" + e.message);
  }  

}