/* javascript to popup an image */

function popupImageUrl(el, title)
{
	imageurl = el;
	wintitle = title;
	
	imgPic = new Image();
	imgPic.src = imageurl;
	setDims();
}

/*  popupImage

    This function will open a new window (minus a toolbar, menubar, and statusbar) and display the -->
    image specified by the 'imageurl' parameter. The window is automatically resized to fit the -->
    image's dimensions. The 'wintitle' parameter allows you to specify text for the window's titlebar; -->
    if this parameter is left empty, it will automatically be assigned the string value "Image Window"  -->
*/

var imgPic;
var imageurl;
var wintitle;
var imgPic2;
var imageurl2;
var wintitle2;
var idTMP2 ;

function setDims()
{
  if(!imgPic.complete)
  	setTimeout("setDims()",100);
  else {
	var winPic;
  	winPic = window.open("", "ShowImage", "width=" + screen.availWidth + ", height=" + screen.availHeight  + ", scrollbars=yes, menubar=no, status=no, toolbar=no");
	
	winPic.document.open();
	winPic.document.writeln("<html><head><title>" + wintitle + "</title></head><body>");
	winPic.document.writeln('<div style="position:absolute;width:' + imgPic.width + 'px; height:' + imgPic.height + 'px; left:0px; top:0px">');
	winPic.document.writeln("<img src=" + imageurl + "></div></body></html>");
	winPic.document.close();
	winPic.resizeTo(screen.availWidth,screen.availHeight);
	w = screen.availWidth;
	h = screen.availHeight;
	
	if(w >= imgPic.width+26)
	  w = imgPic.width+6;
	if(h >= imgPic.height+24+20)
	  h = imgPic.height+34;
	
	winPic.resizeTo(w,h);
	winPic.moveTo((screen.availWidth-w)/2,(screen.availHeight-h)/2);
	winPic.focus();
  }
}
