var photogalleryTimer=null;
var photogalleryTable=null;
var photogalleryOffset=100;
var photogalleryImgNum=0;
var photogalleryImgWidth=200;
var photogalleryCount=0;
function photogalleryInit() {
	photogalleryTable=document.getElementById('photogallery').getElementsByTagName('UL')[0];
	photogalleryImgNum=photogalleryTable.getElementsByTagName('LI').length-1;
	for(i=0;photogalleryTable.getElementsByTagName('DIV')[i];i++) {
		photogalleryTable.getElementsByTagName('DIV')[i].style.display='none';
		}
	photogalleryTable.style.left="300px";
	photogalleryTimer=setInterval(photogalleryStartPos,10);
	}
function photogalleryStartPos() {
	var x=parseInt(photogalleryTable.style.left);
	if(x>photogalleryOffset) photogalleryTable.style.left=(x-5)+'px';
	else clearInterval(photogalleryTimer);
	}
function photogalleryLeft() {
	if(photogalleryCount>0) {
		photogalleryCount--;
		photogalleryTimer=setInterval(photogalleryMove,10);
		}
	}
function photogalleryRight() {
	if(photogalleryCount<photogalleryImgNum) {
		photogalleryCount++;
		photogalleryTimer=setInterval(photogalleryMove,10);
		}
	}
function photogalleryMove() {
	var x=parseInt(photogalleryTable.style.left);
	if(x>-(photogalleryCount*photogalleryImgWidth)+photogalleryOffset) photogalleryTable.style.left=(x-5)+'px';
	else if(x<-(photogalleryCount*photogalleryImgWidth)+photogalleryOffset) photogalleryTable.style.left=(x+5)+'px';
	else clearInterval(photogalleryTimer);
	}
function photogalleryOver(t) {
	t.getElementsByTagName('DIV')[0].style.display='block';
	}
function photogalleryOut(t) {
	t.getElementsByTagName('DIV')[0].style.display='none';
	}
