function openNewWindow(URLtoOpen, windowName, windowFeatures)
 { newWindow=window.open(URLtoOpen, windowName, windowFeatures);
   newWindow.focus(); }
 
function openPictureWindow(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
    x=imageWidth; xi=x;
	y=imageHeight; yi=y;
	xs=screen.availWidth-10;
	ys=screen.availHeight-30;
	if ((x>xs)||(y>ys)){
		x=xs;
		y =xs*(yi/xi);
		if (y>ys) {
			y=ys;
			x=ys*(xi/yi);
		}
	}
	newWindow = window.open("","popup_picture","width="+x+",height="+y+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+imageName+' width='+x+' height='+y+' alt='+imageName+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function openswf5Window(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
    x=imageWidth; 
	y=imageHeight; 
	newWindow = window.open("","popup_picture","width="+x+",height="+y+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<div align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width='+x+' height='+y+'>');
    newWindow.document.write('<param name=movie value='+imageName+'>');
    newWindow.document.write('<param name=quality value=high>');
    newWindow.document.write('<embed src='+imageName+' quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width='+x+' height='+y+'>');
    newWindow.document.write('</embed>'); 
    newWindow.document.write('</object></div>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

				  


