var Last="";
function swaplayer(current){
if(current==Last){return} 
//document.getElementById(current).style.visibility="visible" 
SlideShow.innerHTML = "<img src='spotlightPics/"+current+" 'width=300 height=200'>"
//document.images.SlideShow.src = "images/"+current+".jpg";

if(Last==""){
Last=current 
return
}
else{
//document.getElementById(Last).style.visibility="hidden"
}
Last=current 
}

function rolllayer(ctl) {
	if (Last==ctl)
	eval(ctl+'.filters.alpha.opacity=100');
	//else eval(ctl+'.filters.alpha.opacity=30');
}


var ns=document.getElementById&&!document.all
var ns4=document.layers&&!document.getElementById&&!document.all

Display=new Array()
<?php if ($rs_page->getCurrentValueByName("pic1") == ""){ echo ""; } else {	echo "Display[Display.length]=new Array('spotlightPics/";echo $rs_page->getCurrentValueByName("pic1");echo "', '', '')";}?>;
<?php if ($rs_page->getCurrentValueByName("pic2") == ""){ echo ""; } else {	echo "Display[Display.length]=new Array('spotlightPics/";echo $rs_page->getCurrentValueByName("pic2");echo "', '', '')";}?>;
<?php if ($rs_page->getCurrentValueByName("pic3") == ""){ echo ""; } else {	echo "Display[Display.length]=new Array('spotlightPics/";echo $rs_page->getCurrentValueByName("pic3");echo "', '', '')";}?>;
<?php if ($rs_page->getCurrentValueByName("pic4") == ""){ echo ""; } else {	echo "Display[Display.length]=new Array('spotlightPics/";echo $rs_page->getCurrentValueByName("pic4");echo "', '', '')";}?>;
<?php if ($rs_page->getCurrentValueByName("pic5") == ""){ echo ""; } else {	echo "Display[Display.length]=new Array('spotlightPics/";echo $rs_page->getCurrentValueByName("pic5");echo "', '', '')";}?>;
<?php if ($rs_page->getCurrentValueByName("pic6") == ""){ echo ""; } else {	echo "Display[Display.length]=new Array('spotlightPics/";echo $rs_page->getCurrentValueByName("pic6");echo "', '', '')";}?>;
<?php if ($rs_page->getCurrentValueByName("pic7") == ""){ echo ""; } else {	echo "Display[Display.length]=new Array('spotlightPics/";echo $rs_page->getCurrentValueByName("pic7");echo "', '', '')";}?>;
<?php if ($rs_page->getCurrentValueByName("pic8") == ""){ echo ""; } else {	echo "Display[Display.length]=new Array('spotlightPics/";echo $rs_page->getCurrentValueByName("pic8");echo "', '', '')";}?>;
<?php if ($rs_page->getCurrentValueByName("pic9") == ""){ echo ""; } else {	echo "Display[Display.length]=new Array('spotlightPics/";echo $rs_page->getCurrentValueByName("pic9");echo "', '', '')";}?>;

// Display[Display.length]=new Array("spotlightPics/<?php echo $rs_page->getCurrentValueByName("pic2");?>","","")

var preloadpics=new Array() // preloads images
for (i=0;i<=Display.length-1;i++) {
preloadpics[i]=new Image()
preloadpics[i].src=Display[i][0]
}

newTrans=new Array()
newTrans[newTrans.length] = "progid:DXImageTransform.Microsoft.fade(duration=3, overlap=0.5)";
//newTrans[newTrans.length] = "progid:DXImageTransform.Microsoft.Checkerboard(Direction='left')";
//newTrans[newTrans.length] = "progid:DXImageTransform.Microsoft.Slide(bands = 1, slideStyle = 'push')";
//newTrans[newTrans.length] = "progid:DXImageTransform.Microsoft.RadialWipe(wipeStyle='clock') ";

var tranSpeed = 2.0; // how long transition takes in seconds
var pause = 5000 // in milliseconds
var advance = (tranSpeed*1000)+pause //
var loop=true // false to run once
var i=0
var picnum=0


function WinOpen(page) {
w=825; h=600;
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',menubar=yes,toolbar=no,scrollbars=yes,resizable=no'
win = window.open(page, 'brochure', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}





function Run_Show(){

if(!ns4) {
	Width=document.getElementById("SlideShow").style.width;
	Height=document.getElementById("SlideShow").style.height;
	
	if(picnum>Display.length-1){ picnum=0 }
	
	if(!ns){
		SlideShow.style.filter = newTrans[i];
		SlideShow.filters[0].apply();
	}

	document.getElementById("SlideShow").innerHTML = "<img src='"+Display[picnum][0]+"'width='"+Width+"'height='"+Height+"'>"

	if(!ns){ SlideShow.filters[0].play(tranSpeed); }

	/*if(Display[picnum][2]==""){
		document.getElementById("text").innerHTML=""
	}
	else{
		setTimeout("document.getElementById('text').innerHTML=Display[picnum][2]",250) // speed text is revealed
	}*/

	if(i==newTrans.length-1){ i=-1 }
	i++

	if(loop==true){
		setTimeout("picnum++;Run_Show()",advance)
	}
	else{
		if(loop==false&&picnum<Display.length-1){
			setTimeout("picnum++;Run_Show()",advance)
		}
	}
}
else { 
	// For NS4 browsers
	runNS4SlideShowPics();
}
} 

function runNS4SlideShowPics(){
	// Set SlideShowPicsSpeed (milliseconds)
	var SlideShowPicsSpeed = 2000;
	var t;

   	document.images.SlideShowPics.src = preloadpics[picnum].src;

   	picnum = picnum + 1;
   	if(picnum>Display.length-1){ picnum=0 };
   	t = setTimeout('runNS4SlideShowPics()', SlideShowPicsSpeed);
} 


function where(){
if(Display[picnum][1]==""){return}
doc=Display[picnum][1]
window.open(doc) // comment out if using the line below
//window.open(doc,'','left=200,top=200,width=200,height=200') // use for specific size and positioned window
}


