function setup() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("mainmenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function search() {
	var searchStr = document.getElementById("searchText").value;
	if(searchStr.length == 0) {
		return;
	}
	searchStr = searchStr.replace(/ /gi, "+");
	window.location="http://www.google.com/search?q=" + searchStr + " +site:www.harshalom.org&l=en";
}

//media player
var UniqueID = 314 // Make each link open in a new window 

function PlayerOpen(soundfiledesc,soundfilepath) { 
	PlayWin = window.open('',UniqueID,'width=320,height=190,top=0left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
	PlayWin.focus(); 
	
	var winContent = "<HTML><HEAD><TITLE>" + soundfiledesc + "</TITLE></HEAD><BODY bgcolor='#714964'>"; 
	winContent += "<B style='font-size:18px;font-family:Verdana,sans-serif;line-height:1.5'>" + soundfiledesc + "</B>";
	
	winContent += "<OBJECT width='300' height='42'>"; 
	winContent += "<param name='SRC' value='" + soundfilepath + "'>";
	winContent += "<param name='AUTOPLAY' VALUE='true'>"; 
	winContent += "<param name='CONTROLLER' VALUE='true'>";
	winContent += "<param name='BGCOLOR' VALUE='#714964'>"; 
	winContent += "<EMBED SRC='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#714964'></EMBED>";
	winContent += "</OBJECT>"; 
	winContent += "<FORM><DIV align='center'><a href='#' style='color:white;' onclick='javascript:window.close();'>Close Window</a></DIV></FORM>"; 
	winContent += "</BODY></HTML>"; 
	
	PlayWin.document.write(winContent); 
	PlayWin.document.close(); // "Finalizes" new window 
	UniqueID = UniqueID + 1 
} 

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000

// Duration of crossfade (seconds)
var crossFadeDuration = 20

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = 'images/home/chocolate seder.gif'
Pic[1] = 'images/home/syn7fin.jpg'
Pic[2] = 'images/home/kids in sukkah.jpg'
Pic[3] = 'images/home/World Wide Wrap 2-8-09.jpg'
Pic[4] = 'images/home/teens with flyers.gif'
Pic[5] = 'images/home/sanctuary dedication.jpg'
Pic[6] = 'images/home/Purim Carnival Clown and others.gif'


// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      //document.images.SlideShow.style.filter="blendTrans(duration=7)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}