<!--

var playing = 0;
var index = 0;
var timeoutID;

var SlideShowMenu = new Array();
var MenuImg = 0;
var MenuTxt = 1;

function Galeria(titulo) {
	playing = 0;
	param = "";
	items = SlideShowMenu.length;
	GetParam();
	if (idioma == "esp") {
		alt1 = "Anterior";
		alt2 = "Siguiente";
		alt3 = "Iniciar Presentación";
		alt4 = "Detener Presentación";
	} else {
		alt1 = "Previous";
		alt2 = "Next";
		alt3 = "Start SlideShow";
		alt4 = "Stop SlideShow";
	}

	// Start or stop the slideshow
	playing = (playing == 0) ? 1 : 0;
	StopStartSlideShow(1)

	document.writeln("<table class='gMenu'>");
	document.writeln("<tr align='center'>");
	document.writeln("<td width='18'><img src='../../images/btn_dots.gif' width='18' height='32'></td>");
	document.writeln("<td width='120'><B>"+titulo+"</B></td>");
	document.writeln("<td width='18'><img src='../../images/btn_dots.gif' width='18' height='32'></td>");
	document.writeln("<td>"+SlideShowMenu[index][MenuTxt]+"</td>");
	document.writeln("<td width='18'><img src='../../images/btn_dots.gif' width='18' height='32'></td>");
	document.writeln("<td width='172'>");
	document.writeln("<a href='javascript:StopStartSlideShow()'><img src='../../images/btn_start.jpg' width='172' height='32' border='0' alt='"+alt3+"' name='startSlideShow' id='startSlideShow'></a>");
	document.writeln("<a href='javascript:StopStartSlideShow()'><img src='../../images/btn_stop.gif' width='172' height='32' border='0' alt='"+alt4+"' name='stopSlideShow' id='stopSlideShow'></a>");
	document.writeln("</td>");
	document.writeln("<td width='18'><img src='../../images/btn_dots.gif' width='18' height='32'></td>");
	document.writeln("<td width='32'>");
	document.writeln("<a href='javascript:prevSlide()'><img src='../../images/btn_prev.jpg' width='32' height='32' border='0' alt='"+alt1+"' name='prevSlide' id='prevSlide'></a>");
	document.writeln("</td>");
	document.writeln("<td width='60'><B>"+(index*1+1)+" de "+items+"</B></td>");
	document.writeln("<td width='32'>");
	document.writeln("<a href='javascript:nextSlide()'><img src='../../images/btn_next.jpg' width='32' height='32' border='0' alt='"+alt2+"' name='nextSlide' id='nextSlide'></a>");
	document.writeln("</td>");
	document.writeln("<td width='18'><img src='../../images/btn_dots.gif' width='18' height='32'></td>");
	document.writeln("</tr>");
	document.writeln("</table>");

	document.writeln("<table class='gFoto'>");
	document.writeln("<tr align='center'>");
	document.writeln("<td><img src='"+SlideShowMenu[index][MenuImg]+"' class='gImagen'</td>");
	document.writeln("</tr>");
	document.writeln("</table>");

	if (playing)
		document.startSlideShow.style.display="none";
	else
		document.stopSlideShow.style.display="none";
}

// ------------------------------------------------------------------------------

function StopStartSlideShow(first) {
	if (playing == 1) {
		playing = 0
		clearTimeout(timeoutID)
		if (first != 1) {
			document.stopSlideShow.style.display="none";
			document.startSlideShow.style.display="";
		}
	} else {
		playing = 1
		timeoutID = setInterval("slideShow()", 4000)
		if (first != 1) {
			document.startSlideShow.style.display="none";
			document.stopSlideShow.style.display="";
		}
	}
}

function slideShow() {
	nextSlide();
}

function nextSlide() {
	index = index + 1
	if (index >= items) index = 0;
	window.location.href="index.htm?"+index+","+playing;
}

function prevSlide() {
	index = index - 1
	if (index < 0) index = items-1;
	window.location.href="index.htm?"+index+","+playing;
}

function gotoSlide(index) {
	window.location.href="index.htm?"+index+","+playing;
}

// ------------------------------------------------------------------------------

function GetParam() {
	url = location.href;
	idioma = (url.indexOf("eng") == -1) ? "esp" : "eng";
	if (url.indexOf("?") != -1) {
		url = location.href.split("?");
		param = url[1].split(",");
	}
	if (param[0] != null) index = parseInt(param[0]);
	if (param[1] != null) playing = parseInt(param[1]);
}

// ------------------------------------------------------------------------------

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//-->