////////////////////////////////////////////////////////////
//
//	IMAGE_GALLERY.JS
//	6 May 2003
//	Kulisics, Joseph D.
//
////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////
//
//	A script to flip images in a panel. The user must
//	define in their page a captionstore array
//	attribute for each flipping picture gallery if
//	they wish captions to appear. The flipping must also
//	be established by the user. The functions in this
//	file only flip the image and caption once. An
//	initial call to insert the caption is recommended
//	before flipping begins to put a caption in place
//	beneath the picture but to prevent captions from
//	appearing in platforms that don't correctly
//	support changing the text, NS4, for example.
//
////////////////////////////////////////////////////////////

function set_caption(){

	var imageloaded=new Boolean(arguments[0].imagestore[arguments[0].liveimage].complete);
	var special_object;

	if(arguments[0].captionstore){
		if(imageloaded){
			if(document.getElementById){
				special_object=document.getElementById(arguments[0].id);
				special_object.innerHTML=arguments[0].captionstore[arguments[0].liveimage-1];
			}else if(document.all){
				special_object=document.all[arguments[0].id];
				special_object.innerHTML=arguments[0].captionstore[arguments[0].liveimage-1];
			}
/*
			}else if(document.layers){
				special_object=document.layers[arguments[0].id];
				special_object.document.open();
				special_object.document.write(arguments[0].captionstore[arguments[0].liveimage-1]);
				special_object.document.close();
			}
*/
		}
	}

}

function image_cycle(){

	var imageloaded=new Boolean(arguments[0].imagestore[arguments[0].liveimage].complete);
	var special_object;

	if(imageloaded){
		document.images[arguments[1]].src=arguments[0].imagestore[arguments[0].liveimage];
		if(document.getElementById){
			special_object=document.getElementById(arguments[0].id);
			if(arguments[0].captionstore){
				special_object.innerHTML=arguments[0].captionstore[arguments[0].liveimage];
			}
		}else if(document.all){
			special_object=document.all[arguments[0].id];
			if(arguments[0].captionstore){
				special_object.innerHTML=arguments[0].captionstore[arguments[0].liveimage];
			}
		}
/*
		}else if(document.layers){
			special_object=document.layers[arguments[0].id];
			special_object.document.open();
			special_object.document.write(arguments[0].captionstore[arguments[0].liveimage]);
			special_object.document.close();
		}
*/
	}
	arguments[0].liveimage=(arguments[0].liveimage+1)%arguments[0].imagestore.length;

}
