var slidespeed=2000
var slideimages=new Array("../images/script/image 01.jpg","../images/script/image 02.jpg","../images/script/image 03.jpg","../images/script/image 04.jpg","../images/script/image 05.jpg","../images/script/image 06.jpg","../images/script/image 07.jpg","../images/script/image 08.jpg","../images/script/image 09.jpg","../images/script/image 10.jpg","../images/script/image 11.jpg","../images/script/image 12.jpg","../images/script/image 13.jpg","../images/script/image 14.jpg","../images/script/image 15.jpg","../images/script/image 16.jpg","../images/script/image 17.jpg","../images/script/image 18.jpg")
var slidelinks=new Array("http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/","http://starofhopebg.com/gallery/")
var num = 0;

var whichlink=0
var whichimage=0
var imgobj, filtersupport, blenddelay
var imageholder=new Array()
for (i=0;i<slideimages.length;i++){ //preload images
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
window.open(slidelinks[whichlink]);
}

function slideit(){
num = RandomFilter();
if (filtersupport)
imgobj.filters[num].apply()
imgobj.src=imageholder[whichimage].src
if (filtersupport)
imgobj.filters[num].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()", slidespeed+blenddelay)
}
window.onload=function(){

imgobj=document.getElementById("slideshow") //access img obj
filtersupport=imgobj.filters //check for support for filters
blenddelay=(filtersupport)? (imgobj.filters[0].duration+1)*1000 : 0
slideit()
}

function RandomFilter(){
var thenumber = Math.floor(Math.random()*3); 
if (thenumber == 1)
	return 0;
else
	return 1;
}

function toggleMenu(idname)
{
	//var menuItem = document.getElementById(menuitemId);
	var el = document.getElementById(idname);
	if(el.style.display == "block")
	{
		el.style.display = "none";
		//menuItem.style.removeAttribute("backgroundColor");
	}
	else
	{
		//menuItem.style.background = '#ECFBFF';
		el.style.display = "block";
	}
}
