
var photoWin = '' ;

function popupThumb(link, width, height)
{
    var text = null ;
    var image = link.getElementsByTagName("img")[0] ;

    if (!photoWin.closed && photoWin.document)
    {
        currentImage = photoWin.document.getElementsByTagName("img")[0] ;
        currentImage.setAttribute("src", link.getAttribute("href")) ;
        currentImage.setAttribute("width", width) ;
        currentImage.setAttribute("height", height) ;
        currentImage.setAttribute("title", image.getAttribute("title")) ;
        currentImage.setAttribute("alt", image.getAttribute("alt")) ;
        photoWin.document.title = image.getAttribute("title") ;
  
        if (photoWin.sizeToContent)
            photoWin.sizeToContent() ;
        else
            photoWin.resizeTo(width, height) ;
    }
    else
    {
        text = '<?xml version="1.0" encoding="windows-1252"?>\n' ;
		text += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'; 
        text += '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-FR">\n' ;
        text += '<head>\n' ;

        text += '<title>' + image.getAttribute("title") + '<\/title>\n' ;

        text += '<meta http-equiv="content-script-type" content="text/javascript">\n' ;
        text += '<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">\n' ;
        text += '<meta http-equiv="content-style-type" content="text/css">\n' ;

        text += '<style type="text/css">\n<!--\n' ;
        text += 'body { margin: 0 ; padding: 0 ; }\n' ;
        text += 'img { display: block ; }' ;
        text += '-->\n<\/style>' ;
  
        text += '<\/head>\n' ;

        text += '<body onkeypress="self.close();">' ;

        text += '<div>\n' ;
        text += '<img src="' + link.getAttribute("href") + '" width="' + width + '" height="' + height + '" title="' + image.getAttribute("title") + '" alt="' + image.getAttribute("alt") + '" onclick="self.close();"\/>\n' ;
        text += '<\/div>\n' ;

        text += '<\/body>\n' ;
        text += '<\/html>' ;

        photoWin = window.open('', 'fullsize', 'width=' + width + ', height=' + height + ', resizable=0, scrollbars=0, toolbar=0') ;
        photoWin.document.write(text) ;
        photoWin.document.close() ;
    }
    photoWin.focus() ;
  
    return false ;
}
