prevup=new Image()
prevup.src="photogallery/prevup.gif"
prevdown=new Image()
prevdown.src="photogallery/prevdown.gif"
nextup=new Image()
nextup.src="photogallery/nextup.gif"
nextdown=new Image()
nextdown.src="photogallery/nextdown.gif"
stopview=new Image()
stopview.src="photogallery/stopview.gif"

function ie() {
	var nav = navigator.appVersion.indexOf("MSIE");
	return (nav>0) && (parseInt(navigator.appVersion.substring(nav+5, nav+6)) >= 4);
}

function ns() {
	return ((navigator.appName == "Netscape") &&
				(parseInt(navigator.appVersion.substring(0, 1)) >= 5))
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function InitGallery() {
	var el = document.all["GalleryListCell"];
	var coll = el.children.tags("A");
	var collength = coll.length-1;
	for (i=0;i<4;i++) coll(i).style.display = "inline";
	for (i=4;i<=collength;i++) coll(i).style.display = "none";
}

function ScrollRight() {
	var el = document.all["GalleryListCell"];
	var coll = el.children.tags("A");
	var collength = coll.length-1;
	var stato = "";
	var esci = false;
	var j,i = 0;
	while (i<=collength && !esci) {
	stato = String(coll(i).style.display);
	if (stato == "inline" )	esci = true;
	j = i;
	i++;
	}
	if (!(j+3 == collength)) {
	scrol = j + 4;
	if (scrol < collength) {
		for (i=j;i<scrol;i++) {
		coll(i).style.display = "none";
		coll(i+4).style.display = "inline";} 
		var btn = document.all("RightBtn");
		btn.src = nextup.src;
	 }
	} else {
		var btnr = document.all("RightBtn");
		var btnl = document.all("LeftBtn");
		btnr.src = stopview.src;
		btnl.src = prevup.src;
		}
		
	}		

function ScrollLeft() {
	var el = document.all["GalleryListCell"];
	var coll = el.children.tags("A");
	var collength = coll.length-1;
	var stato = "";
	var esci = false;
	var j,i = 0;
	while (i<=collength && !esci) {
	stato = String(coll(i).style.display);
	if (stato == "inline" )	esci = true;
	j = i;
	i++;
	}
	scrol = j;
	j = j - 4;
	if (j>=0) {
		for (i=j;i<scrol;i++) {
			coll(i).style.display = "inline";
			coll(i+4).style.display = "none";}
			var btn = document.all("LeftBtn");
		    btn.src = prevup.src;
	} else {
		var btnr = document.all("RightBtn");
		var btnl = document.all("LeftBtn");
		btnr.src = nextup.src;
		btnl.src = stopview.src;
		}
}