var newwindow;
var wheight = 0, wwidth = 0;

function popitup5(url, title, iwidth, iheight) {
var pwidth, pheight;

if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+30;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
wheight=iheight;
wwidth=iwidth;
}

if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+90;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}

newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"');
newwindow.document.writeln('"http://www.w3.org/TR/html4/loose.dtd">');
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title><link href="js/imgcontrol.css" rel="stylesheet" type="text/css"><\/head><body><center>');
newwindow.document.writeln('<a href="javascript:window.close()"><img border=0 src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" ><\/a>');
newwindow.document.writeln('<a href="javascript:window.close()">Close<\/a>');
newwindow.document.writeln('<\/center> <\/body> <\/html>');
newwindow.document.close();
newwindow.focus();
}

function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}