
function initFlashProxy(){
	var imageUrl;
	if (metaObject)
		{
		imageUrl = anchors[0].href;
		}
	else
		{
		imageUrl = transcriptIndex[curIndex].value;
		}
	changeImageUrl(imageUrl);
}//end initFlashProxy

function changeImageUrl(myUrl){
	viewer.loadImage(myUrl);
}//end changeImageUrl

function gotoNextImage(){
    //alert("flash wants you to go to the next image");
	var newIndex = curIndex;
	if (metaObject)
		{
		if(newIndex + 1 < anchors.length)
			{
			do
				{
				newIndex = newIndex + 1;
				} 
			while ((anchors[newIndex].type != "page") && (newIndex + 1 < anchors.length) );
				
			switchToSegment(newIndex);
			}//end if		
		}
	else
		{
		if(newIndex + 1 < transcriptIndex.length)
			{
			newIndex = newIndex + 1;
			switchToSegment(newIndex);
			}//end if
	}
}//end gotoNextImage

function gotoPreviousImage(){
	//alert("flash wants you to go to the previous image");
	var newIndex = curIndex;
	if(newIndex >= 1)
		{
		if (metaObject)
			{
			do
				{
				newIndex = newIndex - 1;
				} 
			while ((anchors[newIndex].type != "page") && (newIndex >= 1) );
							
			}
		else
			{
			newIndex = newIndex - 1;
			}
		switchToSegment(newIndex);
		}
}//end gotoPreviousImage

function gotoLastImage(){
	//alert("flash wants you to go to the last image");
	if (metaObject)
		{
		if (curIndex < anchors.length - 1)
			{
			var newIndex = anchors.length - 1
			switchToSegment(newIndex);
			}		
		}
	else
		{
		if (curIndex < transcriptIndex.length - 1)
			{
			var newIndex = transcriptIndex.length - 1
			switchToSegment(newIndex);
			}
		}
}//end gotoLastImage

function gotoFirstImage(){
	if (curIndex > 0)
		{
		var newIndex = 0; 
		switchToSegment(newIndex);
		}
	//alert("flash wants you to go to the first image");
}//end gotoFirstImage
