var root
if (location.protocol == "file:") root = "../"
else if (location.protocol == "http:") root = "http://www.rootsweb.ancestry.com/~miachs/"

var itemnum = 0
function album(name){
	this.name = name
	this.photos = new Array()
	}
function photo(url,width,height,title){
	this.url = url
	this.width = width
	this.height = height
	this.title = title
	}
myalbum = new album("myalbum")

//album page 1
myalbum.photos[0]  = new photo('achsgn-001.jpg',786,1446,'These pictures are from glass negatives that were loaned to the Society to copy for the Museum collections. They were loaned by Bruce VanHorn whose grandfather grew up at Point Lookout. Around 1905, as his grandfather was going through college, he needed money. His solution was to purchase a camera and take pictures at the Point and surrounding areas. We have added captions to a few of the pictures that we had information on and a few are overexposed, but are included also as they are still interesting.')
myalbum.photos[1]  = new photo('achsgn-001.jpg',786,1446,' ')
myalbum.photos[2]  = new photo('achsgn-002.jpg',1470,1139,'Delano School')
myalbum.photos[3]  = new photo('achsgn-003.jpg',1203,1453,' ')
myalbum.photos[4]  = new photo('achsgn-004.jpg',1443,1010,' ')
myalbum.photos[5]  = new photo('achsgn-005.jpg',1162,1419,' ')
myalbum.photos[6]  = new photo('achsgn-006.jpg',413,480,'Edna Davis Brown')
myalbum.photos[7]  = new photo('achsgn-009.jpg',1169,1139,' ')
myalbum.photos[8]  = new photo('achsgn-010.jpg',1101,1433,' ')

//album page 2
myalbum.photos[9]  = new photo('achsgn-011.jpg',485,715,' ')
myalbum.photos[10]  = new photo('achsgn-012.jpg',1450,1146,' ')
myalbum.photos[11]  = new photo('achsgn-014.jpg',1203,1146,' ')
myalbum.photos[12]  = new photo('achsgn-015.jpg',1456,1146,' ')
myalbum.photos[13]  = new photo('achsgn-016.jpg',1477,1146,' ')
myalbum.photos[14]  = new photo('achsgn-017.jpg',1128,1419,' ')
myalbum.photos[15]  = new photo('achsgn-018.jpg',1436,1153,' ')
myalbum.photos[16]  = new photo('achsgn-020.jpg',1436,1132,' ')

//album page 3
myalbum.photos[17]  = new photo('achsgn-022.jpg',1470,1160,' ')
myalbum.photos[18]  = new photo('achsgn-023.jpg',1470,941,' ')
myalbum.photos[19]  = new photo('achsgn-024.jpg',1443,1132,' ')
myalbum.photos[20]  = new photo('achsgn-025.jpg',1491,1167,' ')
myalbum.photos[21]  = new photo('achsgn-026.jpg',1422,1167,' ')
myalbum.photos[22]  = new photo('achsgn-027.jpg',1497,1167,' ')
myalbum.photos[23]  = new photo('achsgn-028.jpg',1409,1167,' ')
myalbum.photos[24]  = new photo('achsgn-029.jpg',1409,1167,' ')

//album page 4
myalbum.photos[25]  = new photo('achsgn-030.jpg',1429,1139,' ')
myalbum.photos[26]  = new photo('achsgn-031.jpg',1374,1139,' ')
myalbum.photos[27]  = new photo('achsgn-032.jpg',1176,1446,' ')
myalbum.photos[28]  = new photo('achsgn-033.jpg',1436,1126,' ')
myalbum.photos[29]  = new photo('achsgn-034.jpg',1443,1167,' ')
myalbum.photos[30]  = new photo('achsgn-035.jpg',1395,1064,' ')
myalbum.photos[31]  = new photo('achsgn-036.jpg',1135,1371,' ')
myalbum.photos[32]  = new photo('achsgn-037.jpg',1135,1419,' ')

//album page 5
myalbum.photos[33]  = new photo('achsgn-038.jpg',1436,1153,' ')
myalbum.photos[34]  = new photo('achsgn-039.jpg',1429,1153,' ')
myalbum.photos[35]  = new photo('achsgn-040.jpg',1142,1412,' ')
myalbum.photos[36]  = new photo('achsgn-041.jpg',1142,1412,' ')
myalbum.photos[37]  = new photo('achsgn-042.jpg',1101,1392,' ')
myalbum.photos[38]  = new photo('achsgn-045.jpg',1443,1160,' ')
myalbum.photos[39]  = new photo('achsgn-046.jpg',1374,1139,' ')
myalbum.photos[40]  = new photo('achsgn-047.jpg',1415,1126,' ')

//album page 6
myalbum.photos[41]  = new photo('achsgn-048.jpg',1169,1392,' ')
myalbum.photos[42]  = new photo('achsgn-049.jpg',1108,1371,' ')
myalbum.photos[43]  = new photo('achsgn-051.jpg',1409,1119,' ')
myalbum.photos[44]  = new photo('achsgn-052b.jpg',705,559,'The Whitman Sisters:  Zella, Irma, Vera, Meda')
myalbum.photos[45]  = new photo('achsgn-053.jpg',1155,1405,' ')
myalbum.photos[46]  = new photo('achsgn-054.jpg',1415,1105,' ')
myalbum.photos[47]  = new photo('achsgn-055.jpg',1402,1105,' ')
myalbum.photos[48]  = new photo('achsgn-056.jpg',1121,1351,' ')

//album page 7
myalbum.photos[49]  = new photo('achsgn-057.jpg',1121,1392,' ')
myalbum.photos[50]  = new photo('achsgn-058.jpg',1114,1392,' ')
myalbum.photos[51]  = new photo('achsgn-059.jpg',1135,1460,' ')
myalbum.photos[52]  = new photo('achsgn-060.jpg',1135,1460,' ')
myalbum.photos[53]  = new photo('achsgn-061e.jpg',1125,899,'This is a picture of the neighborhood picnic taken out on Saginaw Bay in 1906.  The only people I can identify to the left of the tree are Mr. and Mrs. Van Horn.  Standing between the trees is Mate W. Davis. In front of here is Edna Davis, Helen Olmstead (The Minister\'s daughter) and Genevieve Courtright.  In back of her is Zella Griffith and Bess Davis and in fron of her is my father, William Davis.  In back of him is Dell Griffith and John David.')
myalbum.photos[54]  = new photo('achsgn-063.jpg',1114,1433,' ')
myalbum.photos[55]  = new photo('achsgn-064c.jpg',727,577,'Charlie Griffith at Point Lookout')
myalbum.photos[56]  = new photo('achsgn-065.jpg',480,373,'Boney the Mailman.  Thomas Draggart.')

//album page 8
myalbum.photos[57]  = new photo('achsgn-067.jpg',390,480,'Genevieve Griffith')
myalbum.photos[58]  = new photo('achsgn-068.jpg',1162,1474,' ')
myalbum.photos[59]  = new photo('achsgn-070.jpg',1456,1180,' ')
myalbum.photos[60]  = new photo('achsgn-071.jpg',1169,1453,' ')
myalbum.photos[61]  = new photo('achsgn-072.jpg',690,1453,' ')
myalbum.photos[62]  = new photo('achsgn-073.jpg',1142,1453,' ')
myalbum.photos[63]  = new photo('achsgn-074.jpg',1162,1453,' ')
myalbum.photos[64]  = new photo('achsgn-075.jpg',1162,1453,' ')

//album page 9
myalbum.photos[65]  = new photo('achsgn-076.jpg',1354,1153,' ')
myalbum.photos[66]  = new photo('achsgn-077.jpg',1155,1453,' ')
myalbum.photos[67]  = new photo('achsgn-078.jpg',1183,1453,' ')
myalbum.photos[68]  = new photo('achsgn-079.jpg',1456,1139,' ')
myalbum.photos[69]  = new photo('achsgn-080.jpg',1456,1139,' ')
myalbum.photos[70]  = new photo('achsgn-081b.jpg',737,591,'Rhoda Webster and her cart of veggies, eggs and meat to deliver to the Point three times a week.  Standing:  Ellen Doan.')
myalbum.photos[71]  = new photo('achsgn-082.jpg',1361,1180,' ')
myalbum.photos[72]  = new photo('achsgn-084.jpg',1135,1378,' ')


// end of albums
var margin_horiz = 40
var margin_vert = 135

// strip html
function stripHTML(myString) {
	var re = /<\S[^><]*>/g
	myString = myString.replace(/<br>/g,"\n")
	return myString.replace(re, "")
	}

// initiate single picture display
function display_window(photonum) {
	var url = root + "glass/" + myalbum.photos[photonum].url
	var width = myalbum.photos[photonum].width
	var height = myalbum.photos[photonum].height
	var title = stripHTML(myalbum.photos[photonum].title)
	display_pic_window(url,width,height,title)
	}

// initiate single picture display
function display_window_home(photonum) {
	var url = root + "glass/" + myalbum.photos[photonum].url
	var width = myalbum.photos[photonum].width
	var height = myalbum.photos[photonum].height
	var title = stripHTML(myalbum.photos[photonum].title)
	display_pic_window(url,width,height,title)
	}

// display a single picture window
function display_pic_window(image_file,image_width,image_height,description) {

	var margin_h = margin_horiz
	var margin_v = margin_vert
	var form_width_default = 85
	var window_width = Math.round(screen.width * 0.7)
	var window_height = Math.round(screen.height * 0.7)
	var photo_width = image_width
	var photo_height = image_height

	if (image_width > (window_width - margin_h)) {       
		image_height = Math.round(image_height * (window_width - margin_h) / image_width)
		image_width = (window_width - margin_h)
		}

	if (image_height > (window_height - margin_v)) {       
		image_width = Math.round(image_width * (window_height - margin_v) / image_height)
		image_height = (window_height - margin_v)
		}

	var form_width = Math.round(window_width * 60 / 300 - 25)
	if (navigator.appName.indexOf("Microsoft")!=-1) {form_width = form_width - 15}

	window_properties = 'resizable=yes,width=' + window_width + ',height=' + window_height + ',scrollbars=yes'

	var x = Math.floor(Math.random() * 10000)
	var address = x.toString()
	window3=window.open('about:blank',address,window_properties)
	window3.document.writeln('<html>')
	window3.document.writeln('<head>')
	window3.document.writeln('<title>Arenac County Historical Society Photo</title>')
	window3.document.writeln('<style TYPE="text/css">')
	window3.document.writeln('<!--')
	window3.document.writeln('body {background-color: #A68C7C; margin: 0px; font-size: 10px;')
	window3.document.writeln('color: #000000; font-style: normal;')
	window3.document.writeln('font-family: arial, verdana, helvetica, sans-serif}')
	window3.document.writeln('-->')
	window3.document.writeln('</style>')
	window3.document.writeln('<script type="text/javascript" language="JavaScript1.2">')
	window3.document.writeln('<!-- ')
	window3.document.writeln('function resize() {')
	window3.document.writeln('x = document.getElementById("myDesc")')
	window3.document.writeln('myImageTag = document.getElementById("myimg")')
	window3.document.writeln('var margin_h = ' + margin_h)
	window3.document.writeln('var margin_v = ' + margin_v)
	window3.document.writeln('var photo_width = ' + photo_width)
	window3.document.writeln('var photo_height = ' + photo_height)
	window3.document.writeln('var image_width = myImageTag.width')
	window3.document.writeln('var image_height = myImageTag.height')
	window3.document.writeln('if (navigator.appName.indexOf("Microsoft")!=-1) {')
	window3.document.writeln('var window_width = document.body.offsetWidth')
	window3.document.writeln('var window_height = document.body.offsetHeight')
	window3.document.writeln('}')
	window3.document.writeln('else {')
	window3.document.writeln('var window_width = window.innerWidth')
	window3.document.writeln('var window_height = window.innerHeight')
	window3.document.writeln('}')
	window3.document.writeln('window_width = window_width - 4')
	window3.document.writeln('window_height = window_height - 4')
	window3.document.writeln('image_width = screen.width')
	window3.document.writeln('image_height = Math.round(image_width * photo_height / photo_width)')
	window3.document.writeln('if (image_width > (window_width - margin_h)) {')
	window3.document.writeln('image_height = Math.round(image_height * (window_width - margin_h) / image_width)')
	window3.document.writeln('image_width = (window_width - margin_h)')
	window3.document.writeln('}')
	window3.document.writeln('if (image_height > (window_height - margin_v)) {')
	window3.document.writeln('image_width = Math.round(image_width * (window_height - margin_v) / image_height)')
	window3.document.writeln('image_height = (window_height - margin_v)')
	window3.document.writeln('}')
	window3.document.writeln('myImageTag.width = image_width')
	window3.document.writeln('myImageTag.height = image_height')
	window3.document.writeln('x.cols = Math.round(window_width * 60 / 300 - 25)')
	window3.document.writeln('if (navigator.appName.indexOf("Microsoft")!=-1) {x.cols = x.cols - 15}')
	window3.document.writeln('}')
	window3.document.writeln('function fullsize() {')
	window3.document.writeln('if (navigator.appName.indexOf("Microsoft")!=-1) {')
	window3.document.writeln('var window_width = document.body.offsetWidth')
	window3.document.writeln('var window_height = document.body.offsetHeight')
	window3.document.writeln('}')
	window3.document.writeln('else {')
	window3.document.writeln('var window_width = window.innerWidth')
	window3.document.writeln('var window_height = window.innerHeight')
	window3.document.writeln('}')
	window3.document.writeln('window_width = window_width - 4')
	window3.document.writeln('window_height = window_height - 4')
	window3.document.writeln('var image_width = ' + photo_width)
	window3.document.writeln('var image_height = ' + photo_height)
	window3.document.writeln('x = document.getElementById("myDesc")')
	window3.document.writeln('myImageTag = document.getElementById("myimg")')
	window3.document.writeln('myImageTag.width = image_width')
	window3.document.writeln('myImageTag.height = image_height')
	window3.document.writeln('x.cols = Math.round(window_width * 60 / 300 - 25)')
	window3.document.writeln('if (navigator.appName.indexOf("Microsoft")!=-1) {x.cols = x.cols - 15}')
	window3.document.writeln('}')
	window3.document.writeln('// -->')
	window3.document.writeln('</script>')
	window3.document.writeln('</head>')
	window3.document.writeln('<body>')
	window3.document.writeln('<form ID="actionForm" name="actionForm"><input type="button" value="Close Window" title="Close window" name="B1" onClick="self.close()">&nbsp;<input type="button" value="Fit to Window" title="Fit image to window" name="B2" onClick="resize()">&nbsp;<input type="button" value="Full Size" title="Display image full size" name="B3" onClick="fullsize()">')
	window3.document.writeln('<p align="center"><a title="Click to open in a new window" style="color: #000000; border-color: #000000" href="' + image_file + '" target="_blank"><img ID="myimg" src="' + image_file + '" width="' + image_width + '" height="' + image_height + '" border="1" style="border-color: #000000"></a></p>')
	window3.document.writeln('<p align="center"><textarea ID="myDesc" rows="2" cols="' + form_width + '" style="text-align: center; font-size: 10px; font-family: verdana, arial, helvetica, sans-serif; background-color: #C8B7AC" onFocus="blur()">' + description + '</textarea></p></form>')
	window3.document.writeln('<p align="center" class="smalltext">Content &copy; 2005-2009 by the Arenac County Historical Society</p>')
	window3.document.writeln('</body>')
	window3.document.writeln('</html>')
	window3.document.close()
	}