var W;

function closePopup() {
if(W != null && !W.closed) W.close();
}


function displayPopup(figura, height,width, indice,evnt) {

var properties = "toolbar = 0, location = 0, height = " + height;
properties = properties + ", width=" + width;
var leftprop, topprop, screenX, screenY;


if(navigator.appName == "Microsoft Internet Explorer") {
   screenY = document.body.offsetHeight;
   screenX = window.screen.availWidth;
   }
else 
   {
   screenY = window.outerHeight
   screenX = window.outerWidth
   }


leftvar = (screenX - width) / 2;
rightvar = (screenY - height) / 2;
if(navigator.appName == "Microsoft Internet Explorer") {
   leftprop = leftvar;
   topprop = rightvar;
   }
else {
   leftprop = (leftvar - pageXOffset);
   topprop = (rightvar - pageYOffset);
   }

if(evnt != null) {
   properties = properties + ", left = " + leftprop;
   properties = properties + ", top = " + topprop;
   }
closePopup();
W = window.open("", "Preview", properties);
W.document.open();


W.document.write("<HTML><HEAD><TITLE>Fotos do 1o. colóquio da Pós-Graduação</TITLE>");
W.document.write("<link rel='stylesheet' type='text/css'  href='stuff/apgf.css' title='apgf'>");
W.document.write("<SCRIPT LANGUAGE='JavaScript'>");


W.document.write("NewImg = new Array ('fotos/f01.jpg','fotos/f02.jpg',");
W.document.write("'fotos/f03.jpg','fotos/f04.jpg',");
W.document.write("'fotos/f05.jpg','fotos/f06.jpg',");
W.document.write("'fotos/f07.jpg','fotos/f08.jpg',");
W.document.write("'fotos/f09.jpg','fotos/f10.jpg',");
W.document.write("'fotos/f11.jpg','fotos/f12.jpg',");
W.document.write("'fotos/f13.jpg','fotos/f14.jpg',");
W.document.write("'fotos/f15.jpg','fotos/f16.jpg',");
W.document.write("'fotos/f17.jpg','fotos/f18.jpg',");
W.document.write("'fotos/f19.jpg','fotos/f20.jpg',");
W.document.write("'fotos/f21.jpg','fotos/f22.jpg',");
W.document.write("'fotos/f23.jpg','fotos/f24.jpg');");
W.document.write("var ImgNum = ");
W.document.write(indice);
W.document.write(";");
W.document.write("var ImgLength = NewImg.length - 1;");
W.document.write("function chgImg(direction) {");
W.document.write("   if (document.images) {");
W.document.write("      ImgNum = ImgNum + direction;");
W.document.write("      if (ImgNum > ImgLength) {");
W.document.write("         ImgNum = 0;");
W.document.write("         }");
W.document.write("      if (ImgNum < 0) {");
W.document.write("         ImgNum = ImgLength;");
W.document.write("         }");
W.document.write("      document.slideshow.src = NewImg[ImgNum];");
W.document.write("      }");
W.document.write("   }");
W.document.write("</script></HEAD><BODY margin-left: 0px; margin-right: 0px;>");
W.document.write("<img src='");
W.document.write(figura);
W.document.write("' name='slideshow'>");
W.document.write("<CENTER>");
W.document.write("<table><tr>");
W.document.write("<td align='right'><a href='javascript:chgImg(-1)'>Anterior</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>");
W.document.write("<td align='center'><a href='JavaScript:close()'>Fechar</a></td>");
W.document.write("<td align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:chgImg(1)'>Próxima</a></td>");
W.document.write("</tr></table>");
W.document.write("</CENTER></BODY></HTML>");
W.document.close();
}


