<!--
// arrays for photos
var gallery_photos = new Array();
var photo_names = new Array();
var photo_count;
var current_photo = 0;
//var currentlyLoaded = -1;
var currentlyLoading = 0;

var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;
/* detect Opera */
ua = navigator.userAgent;
if (ua.indexOf("Opera")!=-1)
	{ isOpera = true;	isIE5=false; }

function showPhoto(new_photo) {

	if (new_photo==current_photo)
		return;

	previous_photo = current_photo;
	current_photo=new_photo;

	changeVisibility('foto' + current_photo, "visible");
	changeVisibility('foto' + previous_photo, "hidden");
	
	gallery_photos[current_photo].src = '/images/'+photo_names[current_photo];
	document['picImg'+current_photo].src = gallery_photos[current_photo].src;

}


function changeVisibility(obj_name,state) {
//alert("changeVisibility('" + obj_name +"','" + state + "');");
	if (isIE4==true){
		obj = eval('document.all.'+obj_name);
		if(obj) obj.visibility = state;
		return;
	}
	else if(isIE5==true)
	{
		obj = eval('document.all.'+obj_name);
		if(obj)
			{ 
			obj.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=0.5)";
			obj.filters[0].Apply();
			obj.style.visibility = state;
			obj.filters[0].Play();
			}
	}
	else /* NS6 or Opera */
	{
   	obj = document.getElementById(obj_name);
 		if(obj) obj.style.visibility = state;
	}
}

function initGallery(autoPlay, delay) {
	if (document.images){
		for (i=0;i<photo_names.length;i++){
			gallery_photos[gallery_photos.length] = new Image();
		}
	}
	gallery_photos[0] = document.images['picImg0'];
	gallery_photos[0].src = '/images/'+photo_names[0];
	photo_count = gallery_photos.length;
	loadPics();
}

function loadPics() {
	if(gallery_photos[currentlyLoading].complete) {
		currentlyLoading++;
		gallery_photos[currentlyLoading] = new Image();
		gallery_photos[currentlyLoading].src = '/images/'+photo_names[currentlyLoading];
	}
	if(currentlyLoading < photo_count-1) {
		setTimeout("loadPics()",200);
	}
}

//-->
