var photoDir;
var photoArray;
var activePhoto;
var photoElem;
var perfElem;
var perfPos = 0;
var photoWidth = 172;

function initPhotos(list, dir)
{
	photoArray = list.split("|");
	activePhoto = 0;
	photoDir = dir;
	
	photoElem = document.getElementById("cPhoto");
	var eiPerf = document.getElementById("iPerf");
	
	// perfElem = document.getElementById("perfor");
	// perfElem = eiPerf.contentDocument;
	
	
	//alert(perfElem.getElementById("perfor"));
	
	// alert(perfElem);
}

function shift(dir)
{
	if (dir == -1 && activePhoto > 0)
	{
		activePhoto--;
		photoElem.src = photoDir + "/" + photoArray[activePhoto];
		
		if (activePhoto < photoArray.length - 2)
		{
			perfPos += photoWidth;
			perfElem.style.left = perfPos + "px";
		}
	}
	else if (dir == 1 && activePhoto < photoArray.length -1)
	{
		activePhoto++;
		photoElem.src = photoDir + "/" + photoArray[activePhoto];		
		
		if (activePhoto > 2)
		{
			perfPos -= photoWidth;
			perfElem.style.left = perfPos + "px";
		}
		
	}
}