﻿myhash=''
function openphoto(){
if (myhash != location.hash){
window.focus();
myhash=location.hash;
myid=myhash.substr(1);
source=window.opener.document.getElementById(myid).src;
mysource="photo/"+source.substr(source.lastIndexOf("/")+1);
mycaption=window.opener.document.getElementById(myid).alt;
document.title=mycaption;
document.getElementById("caption").innerHTML=mycaption;
document.getElementById("pic").src=mysource;
}
t=setTimeout("openphoto()",500);
}

function showphoto(me){
window.open("photo.html#"+me.id,"new","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=600");
}

function ArrangePhotos(){
for (i=1; i<=6; i++){
	thisphoto = document.getElementById('photo'+i);
	k = myphoto.length - pagenumber*6 - i;
	if (myphoto[k]){
		thisphoto.src = "tmbs/" + myphoto[k];
		thisphoto.alt = mydesc[k];
	} else {
		thisphoto.src = "../images/spacer.gif";
	}
}
checknextstate_g();
}

function NextG(){
if (document.getElementById('next').className == "next"){
window.location="photogallery00.html#" + (pagenumber+1);
window.location.reload();
} else {
//window.location="photogallery00.html#" + pagenumber;
}
}

function PreviousG(){
if (document.getElementById('previous').className == "next"){
window.location="photogallery00.html#" + (pagenumber-1);
window.location.reload();
} else {
//window.location="photogallery00.html#" + pagenumber;
}
}

function checknextstate_g(){
nextbtn=document.getElementById("next");
prevbtn=document.getElementById("previous");
if (pagenumber ==0) {
	prevbtn.className = "nextoff"
	} else {
	prevbtn.className = "next"
	}
if (((pagenumber+1) * 6) >= myphoto.length){
	nextbtn.className = "nextoff"
	} else {
	nextbtn.className = "next"
	}
}


