function ImageResizer(imgs) {
	var maxheight = 450;
	var maxwidth = 400;	
	url=window.location.href;
	
	var w = parseInt( imgs.width );
	var h = parseInt( imgs.height );
	if ( w > maxwidth ) {
		imgs.style.cursor = "pointer";
		imgs.style.border = "#555 1px solid";
		imgs.style.margin = "5px";
		imgs.style.padding = "3px";
		imgs.title = "Click vào để xem hình với kích thước đầy đủ";
		imgs.onclick = function( ) {
			var iw = window.open ( '/home/p_up.html?'+this.src, 'Image', 'width=200, height=200, toolbar=no, location=no, directories=yes, status=yes, menubar=yes, scrollbars=yes, copyhistory=yes, resizable=yes, left=10, top=10' );
			iw.focus();
		};
		h = ( maxwidth / w ) * h;
		w = maxwidth;
		imgs.height = h;
		imgs.width = w;
	}
	if ( h > maxheight ) {
		imgs.style.cursor = "pointer";
		imgs.style.border = "#555 1px solid";
		imgs.style.margin = "5px";
		imgs.style.padding = "3px";
		imgs.title = "Click vào để xem hình với kích thước đầy đủ";
		imgs.onclick = function( ) {
			var iw = window.open ( '/home/p_up.html?'+this.src, 'Image', 'width=200, height=200, toolbar=no, location=no, directories=yes, status=yes, menubar=yes, scrollbars=yes, copyhistory=yes, resizable=yes, left=10, top=10' );
			iw.focus();
		};
		imgs.width = ( maxheight / h ) * w;
		imgs.height = maxheight;
	}
}
