function enlargeImage(img, w, h){
	var imgSrc = img.src.replace('thumb', 'large');
	var imgTitle = img.title;
	
	var isScrollbarsVisible = 0;
	
	if( h > screen.availHeight ) {
		h = (document.all) ? screen.availHeight-30 : screen.availHeight;
		isScrollbarsVisible = 1;
	}
	if( w > screen.availWidth ) {
		w = screen.availWidth;
		isScrollbarsVisible = 1;
	}
	
	var winTop = Math.floor((screen.availHeight - h) / 2) - (document.all ? 15 : 0);
	var winLeft = Math.floor((screen.availWidth - w) / 2);
	
	newWin = window.open('', null, 'width='+w+',height='+h+',location=0,menubar=0,scrollbars='+isScrollbarsVisible+',status=0,toolbar=0,top='+winTop+',left='+winLeft);
			
	newWin.document.body.style.margin = '0px';
	newWin.document.body.style.padding = '0px';
	
	newWin.document.open();
	newWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
	newWin.document.write('<html xmlns="http://www.w3.org/1999/xhtml">');
	newWin.document.write('<head>');
	newWin.document.write('<title>'+imgTitle+'</title>');
	newWin.document.write('</head>');
	newWin.document.write('<body style="margin:0px; padding:0px; "><img src="'+imgSrc+'" style="cursor:pointer;" onclick="window.close();"></body>');
	newWin.document.write('</html>');
	newWin.document.close();
}