view_image = 1;

all_images = new Array();

function flipImage( direction ) {
	if( all_images && view_image ) {
		showImage( view_image + direction );
	}
}

function showImage( index ) {

	if( all_images != undefined && view_image != undefined ) {
		var num = all_images.length - 1; 
		if( num > 0 ) {
			dispbigimage = document.getElementById( "bigimage" );
			if( dispbigimage != undefined ) {
				if( index < 1 ) {
					view_image = num + index;
				} else if( index > num ) {
					view_image = index - num;
				} else {
					view_image = index;
				}
				
				newImg = all_images[ view_image ];
				if( newImg != undefined ) {

					dispbigimage.src = newImg[0];

					return true;
				}
			}
		}
	} else {
		return false;
	}
}
