// homePage.js

function init(){
	setSearchFocus();
	randomBannerImg();		
}

function setSearchFocus() {
document.getElementById("search_string").focus()
}

function homeslide() {
	window.open("/home/audioslideshow/", "popup", "width=650,height=800");
}

function openWindow(url, windowname, width, height, toolbar){
        var sizestring = 'width=' + width + ',height=' + height;
	SmallWin = window.open(url,windowname,'scrollbars,resizable,' + sizestring +',toolbar='+toolbar+',location=0,status=0,directories=0,menubar='+toolbar);
	SmallWin.focus();	
}

// Used to display a random banner image on the homepage

function randomBannerImg() {
	var i = Math.round(6*Math.random());
	var i = i+ 1;
		
	var bannerDiv = document.getElementById("bannerDiv");
	
	var bannerImg = document.createElement("img");
	bannerImg.setAttribute("src", "/home/pics/banner_760_" + i + ".jpg");
	bannerImg.setAttribute("alt","Stanford scenes");
	bannerImg.setAttribute("border","0");

	bannerDiv.appendChild(bannerImg);
}

window.onload = init;

