
//Preload the images into an array (include the sizes!)
var image_array = new Array(13)

image_array[0] = new Image(400,425)
image_array[0].src = "Reg/badge.jpg"
image_array[1] = new Image(400,442)
image_array[1].src = "Reg/ties.jpg"
image_array[2] = new Image(400,441)
image_array[2].src = "Reg/jersey.jpg"
image_array[3] = new Image(400,409)
image_array[3].src = "Reg/keyfob.jpg"
image_array[4] = new Image(400,533)
image_array[4].src = "Reg/fleece.jpg"
image_array[5] = new Image(400,400)
image_array[5].src = "Reg/sticker.jpg"
image_array[6] = new Image(400,491)
image_array[6].src = "Reg/sweatshirt.jpg"
image_array[7] = new Image(400,413)
image_array[7].src = "Reg/lapelbadge.jpg"
image_array[8] = new Image(400,450)
image_array[8].src = "Reg/poloshirt.jpg"
image_array[9] = new Image(400,399)
image_array[9].src = "Reg/umbrella.jpg"
image_array[10] = new Image(400,350)
image_array[10].src = "Reg/mug.jpg"
image_array[11] = new Image(400,533)
image_array[11].src = "Reg/Diary.jpg"
image_array[12] = new Image(400,462)
image_array[12].src = "Reg/mugct.jpg"
image_array[13] = new Image(400,392)
image_array[13].src = "Reg/mugls.jpg"
image_array[14] = new Image(400,392)
image_array[14].src = "Reg/mugrs.jpg"


var new_window

function display_image(image_index) {

if (window_available())  {

	// If the window is open, close it (can't resize it in Netscape!)
	new_window.close()

}

// Use the image dimensions to determine the window dimensions
var window_width = image_array[image_index].width
var window_height = image_array[image_index].height

// create the window to the image's dimensions
var window_dimensions = "width=" + window_width + ",height=" + window_height + ",top=5,left=5"
new_window = window.open("","",window_dimensions)

// Write the HTML tags

new_window.document.writeln('<html>')
new_window.document.writeln('<head>')
new_window.document.writeln('<title>')
new_window.document.writeln('<\/title>')
new_window.document.writeln('<\/head>')

// Make sure there are no unsightly margins
new_window.document.writeln('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">')

// Create an <img> tag for the image
new_window.document.writeln('<img src="' + image_array[image_index].src + '">')

// Finish up
new_window.document.writeln('<\/body>')
new_window.document.writeln('<\/html>')
new_window.document.close()

// Extract just the filename and use it as the title
var image_url = image_array[image_index].src
var image_filename = image_url.substring(image_url.lastIndexOf("/") + 1)
new_window.document.title = image_filename

	}

function window_available()  {
	if (!new_window)  {
	return false
	}
	else if (new_window.closed)  {
	return false
	}
	else  {
		return true
	}
  }


