
/***********************************************
* MultiFrame 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 seqslides=new Array()
//Set Path to Image plus optional URL ("" for no URL):
seqslides[0]=["http://www.knight-international.co.uk/images/slideshow/front1.jpg", "http://www.knight-international.co.uk/news2011.htm#beer"] 		// news - july 2011
seqslides[1]=["http://www.knight-international.co.uk/images/slideshow/front16.jpg", "http://www.knight-international.co.uk/newproductsuvbubbles.htm"]	// product
seqslides[2]=["http://www.knight-international.co.uk/images/slideshow/front15.jpg", "http://www.knight-international.co.uk/news2011.htm#eu"]		// news - june 2011
seqslides[3]=["http://www.knight-international.co.uk/images/slideshow/front19.jpg", "http://www.knight-international.co.uk/newproducts.htm"]		// new products
seqslides[4]=["http://www.knight-international.co.uk/images/slideshow/front10.jpg", "http://www.knight-international.co.uk/news2011.htm#polfed"]	// news - may 2011
seqslides[5]=["http://www.knight-international.co.uk/images/slideshow/front9.jpg", "http://www.knight-international.co.uk/newproductsradiomics.htm"]	// product
seqslides[6]=["http://www.knight-international.co.uk/images/slideshow/front14.jpg", "http://www.knight-international.co.uk/news2011.htm#nintendo"]	// news - jan 2011
seqslides[7]=["http://www.knight-international.co.uk/images/slideshow/front8.jpg", "http://www.knight-international.co.uk/hirelights.htm"]		// hire lights
seqslides[8]=["http://www.knight-international.co.uk/images/slideshow/front2.jpg", "http://www.knight-international.co.uk/news2010.htm#jcs"] 		// news - dec 2010
seqslides[9]=["http://www.knight-international.co.uk/images/slideshow/front6.jpg", "http://www.knight-international.co.uk/newproductskabuki.htm"]	// product
seqslides[10]=["http://www.knight-international.co.uk/images/slideshow/front3.jpg", "http://www.knight-international.co.uk/news2010.htm#churchill"] 	// news - oct 2010
seqslides[11]=["http://www.knight-international.co.uk/images/slideshow/front13.jpg", "http://www.knight-international.co.uk/install.htm"]		// install
seqslides[12]=["http://www.knight-international.co.uk/images/slideshow/front5.jpg", "http://www.knight-international.co.uk/news2010.htm#natcole"]	// news - july 2010
seqslides[13]=["http://www.knight-international.co.uk/images/slideshow/front17.jpg", "http://www.knight-international.co.uk/newproductsco2.htm"]	// product
seqslides[14]=["http://www.knight-international.co.uk/images/slideshow/front11.jpg", "http://www.knight-international.co.uk/news2010.htm#euball"]	// news - june 2010
seqslides[15]=["http://www.knight-international.co.uk/images/slideshow/front7.jpg", "http://www.knight-international.co.uk/newproductsbigshot.htm"]	// product
seqslides[16]=["http://www.knight-international.co.uk/images/slideshow/front12.jpg", "http://www.knight-international.co.uk/news2010.htm#lough"]	// news - april 2010
seqslides[17]=["http://www.knight-international.co.uk/images/slideshow/front18.jpg", "http://www.knight-international.co.uk/newproductsviper.htm"]	// product
seqslides[18]=["http://www.knight-international.co.uk/images/slideshow/front4.jpg", "http://www.knight-international.co.uk/exhib.htm"]			// exhib

//Set pause between each image display (2000=2 second):
var slidedelay=1500

//Set how many images to show at once (must be less than total # of images above):
var slidestoreveal=3

//Specify code to insert between each slide (ie: "<br>" to insert a line break and create a vertical layout)
//"" for none (or horizontal):
var slideseparater="<br><br>"

//Set optional link target to be added to all images with a link: "secwindow"
var optlinktarget=""

//Set image border width:
var imgborderwidth=0

//Set opacity value of each image when it's "dimmed", and when it's not, respectively (1=100% opaque/normal).
//Change 0.2 to 0 to completely hide image when it's dimmed:
var opacityvalues=[1,1]

///No need to edit beyond here///////////

function processimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'" style="filter:alpha(opacity='+(opacityvalues[0]*100)+');-moz-opacity:'+opacityvalues[0]+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}

var curslide=1 //var to track current slide (total: slidestoreveal)
var curimgindex=0 //var to track current image (total: seqslides.length)
var isfirstcycle=1 //boolean to indicate whether this is the first cycle

if (document.getElementById){
for (i=0;i<slidestoreveal;i++)
document.write('<span id="seqslide'+i+'" class="seqslidestyle">'+processimgcode(seqslides[i])+'</span>'+slideseparater)
curimgindex=slidestoreveal
illuminateslide(0,opacityvalues[1])
}

function illuminateslide(slideindex, amt){
var slideobj=document.getElementById("seqslide"+slideindex).getElementsByTagName("IMG")[0]
if (slideobj.filters)
slideobj.filters.alpha.opacity=amt*100
else if (slideobj.style.MozOpacity)
slideobj.style.MozOpacity=amt
}

function displayit(){
if (curslide<slidestoreveal){
if (!isfirstcycle)
changeimage(curslide)
illuminateslide(curslide, opacityvalues[1])
curslide++
}
else{
isfirstcycle=0
for (i=0;i<slidestoreveal;i++)
illuminateslide(i, opacityvalues[0])
changeimage(0)
illuminateslide(0, opacityvalues[1])
curslide=1
}
}

function changeimage(slideindex){
document.getElementById("seqslide"+slideindex).innerHTML=processimgcode(seqslides[curimgindex])
curimgindex++
if (curimgindex>=seqslides.length)
curimgindex=0
}

if (document.getElementById)
setInterval("displayit()",slidedelay)
