

var seqslides=new Array()
//Set Path to Image plus optional URL ("" for no URL):
seqslides[0]=['images/ad_logos/cobham.gif', 'http://www.cobham.com', '_blank']
seqslides[1]=['images/ad_logos/eads.gif', 'http://www.eads.com', '_blank']
seqslides[2]=['images/ad_logos/elbit-systems.gif', 'http://www.elbitsystems.com', '_blank']
seqslides[3]=['images/ad_logos/esterline-racal-acoustics.gif', 'http://www.racalacoustics.com', '_blank']
seqslides[4]=['images/ad_logos/fischer.gif', 'http://www.fischerconnectors.co.uk', '_blank']
seqslides[5]=['images/ad_logos/iqpc.gif', 'http://www.iqpc.co.uk', '_blank']
seqslides[6]=['images/ad_logos/millbrook.gif', 'http://www.millbrook.co.uk', '_blank']
seqslides[7]=['images/ad_logos/nacre.gif', 'http://www.nacre.no', '_blank']
seqslides[8]=['images/ad_logos/odu.gif', 'http://www.odu.de', '_blank']
seqslides[9]=['images/ad_logos/otis.gif', 'http://www.otisgun.com', '_blank']
seqslides[10]=['images/ad_logos/qioptiq.gif', 'http://www.qioptiq.co.uk', '_blank']
seqslides[11]=['images/ad_logos/racal.gif', 'http://www.racalacoustics.com', '_blank']
seqslides[12]=['images/ad_logos/sagem.gif', 'http://www.sagem-ds.com', '_blank']
seqslides[13]=['images/ad_logos/wbr.gif', 'http://www.wbresearch.com', '_blank']
seqslides[13]=['images/ad_logos/spi.gif', 'http://www.sensorprod.com', '_blank']




//Set pause between each image display (2000=2 second):
var slidedelay=2000

//Set how many images to show at once (must be less than total # of images above):
var slidestoreveal=1

//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>"

//Set optional link target to be added to all images with a link:
var optlinktarget="secwindow"

//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=[0.2,1]

// random function
randomize(seqslides)


///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+'">'+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
}
}

// new function added
function randomize(targetarray){
	seqslides=new Array()
	var the_one
	var z=0
	while (z<targetarray.length){
		the_one=Math.floor(Math.random()*targetarray.length)
		if (targetarray[the_one]!="_selected!"){
			seqslides[z]=targetarray[the_one]
			targetarray[the_one]="_selected!"
			z++
		}
	}
}
// end

function changeimage(slideindex){
document.getElementById("seqslide"+slideindex).innerHTML=processimgcode(seqslides[curimgindex])
curimgindex++
if (curimgindex>=seqslides.length)
curimgindex=0
}

if (document.getElementById)
setInterval("displayit()",slidedelay)

