﻿function openTour(view)
{
	if (screen.availHeight >= 650) {
		var width = "width=600"
		var height = "height=650"
		var scrolling = "scrollbars=no"
		var toosmall=0
	} else {
		var width = "width=610"
		var height = "height=" + screen.availHeight
		var scrolling = "scrollbars=yes"
		var toosmall=1
	}
	var windowChrome = width + "," + height + "," + scrolling
	var tourURL = "" + view + ".html"
	window.open(tourURL,'_blank',windowChrome)
}

//"direc" sets to or from hover direction. Use 1 to change image from
//normal state to hover state. Use 0 to change from hover state back
//to normal state.
function linkreplace(imgobj,direc) {
	var strImgSrc = imgobj.src
	var dotPos = strImgSrc.indexOf(".png")
	if (direc == 1) {
		var strImgName = strImgSrc.substr(0,dotPos) + "hover"
	} else if (direc == 0) {
		var strImgName = strImgSrc.substr(0,dotPos-5)
	}
	var strImgExt = strImgSrc.substring(dotPos)
	var strImgNewName = "" + strImgName + strImgExt
	imgobj.src = strImgNewName
}

function popupImage(imgobj) {
	var strImgSrc = imgobj.src
	var dirPos = strImgSrc.indexOf("thumbs")
	var strImgPath = strImgSrc.substr(0,dirPos)
	var strImgName = strImgSrc.substring(dirPos+6)
	var strFullImg = strImgPath + "photos" + strImgName
	var windowChrome = "width=516,height=350,scrollbars=no"
	window.open(strFullImg,'_blank',windowChrome)
}
