
var side_images = new Array();

side_images[0] = "side.panopticon.jpg";
side_images[1] = "side.oppenheimer.jpg";
side_images[2] = "side.dolly.jpg";
side_images[3] = "side.butterfly.jpg";
side_images[4] = "side.einstein.jpg";
side_images[5] = "side.hanford.jpg";
side_images[6] = "side.taskforce.jpg";
side_images[7] = "side.sandia.jpg";

var image_directory = "sdnimages/";
var top_image_location = 10;
var skip_distance_pixels = 110;
var image_class_name = "sidepic";
var image_info_page = "sdnimages/";
var image_height = 95;

var pathToRoot=""; //create but leave empty

function load_side_images(rootpath) {
	var index = 0;
	var count = 0;
	var image_top = 0;
	var max_height = 5000;
	var rp = ""; if(rootpath) rp = rootpath;
	pathToRoot = rp; //set rootpath 
	if(document.body.scrollHeight<max_height) max_height = document.body.scrollHeight;
	while(image_top+image_height<max_height) {
		image_top = (count*skip_distance_pixels) + top_image_location;
		if(image_top < max_height) {
			var newdiv = document.createElement('div');
			newdiv.className = image_class_name;
			newdiv.style.backgroundImage = "url('"+rp+image_directory + side_images[index]+"')";
			newdiv.style.position = "absolute";
			newdiv.style.top = image_top+"px";
			newdiv.setAttribute('title',"SDN Images: Click to learn about this image");
			newdiv.setAttribute("onclick","javascript:image_info('"+side_images[index]+"');");
			document.body.appendChild(newdiv);
		}
		index++;
		if(index>=side_images.length) index=0;
		count++;
	}
}

function image_info(filename) {
	var keyword = filename.substring(filename.indexOf(".")+1,filename.indexOf(".",filename.indexOf(".")+1));
	window.location = pathToRoot+image_info_page+"#"+keyword;
}
