// in Script -------
function ShowWin(imgsrc, imgid, pagename) {
	var availHeight;
	var availWidth;
	if(typeof(window.innerWidth) == 'number'){
	    availHeight = window.innerHeight;
	    availWidth = window.innerWidth;
	}else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
	    availHeight = document.documentElement.clientHeight;
	    availWidth = document.documentElement.clientWidth;
	}else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
	    availHeight = document.body.clientHeight;
	    availWidth = document.body.clientWidth;
	}
	var yOffset;
	var indicatorHeight = 450;
	
	if (pagename == 'photo') {
		var indicatorWidth = 500;
	}
	else
	{
		var indicatorWidth = 299;
	}
	
	if (self.pageYOffset){// all except Explorer
	    yOffset = self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop){// Explorer 6 Strict{
	    yOffset = document.documentElement.scrollTop;
	}
	else if (document.body){ // all other Explorers
	    yOffset = document.body.scrollTop;
	}
	
	var top = ((availHeight/2)+yOffset) - (indicatorHeight/2);
	var left = (availWidth/2) - (indicatorWidth/2);
		
	if (pagename == 'photo') {
		document.getElementById('popDiv').innerHTML = "<img src='" + imgsrc + "' /><a href='javascript:HideWin()'>Close Window</a> | <a href='photos.php?id=" + imgid + "' />Print Image</a>";
		document.getElementById('popDiv').style.visibility = 'visible';
		document.getElementById('popDiv').style.left = left + 'px';
		document.getElementById('popDiv').style.top = top + 'px';
	}
	else if (pagename == 'option') {
		document.getElementById('optDiv').innerHTML = "<img src='" + imgsrc + "' /><a href='javascript:HideOptWin()'>Close Window</a> | <a href='candleoptions.php?filename=" + imgsrc + "' />Print Image</a>";
		document.getElementById('optDiv').style.visibility = 'visible';
		document.getElementById('optDiv').style.left = left + 'px';
		document.getElementById('optDiv').style.top = top + 'px';
	}

}

function HideWin() {
document.getElementById('popDiv').style.visibility = 'hidden';
}

function HideOptWin() {
document.getElementById('optDiv').style.visibility = 'hidden';
}