$(function(){
	$('a.popup').click(function(evt){
		evt.preventDefault();
		var iWidth = $(this).attr('iwidth');
		var iHeight = $(this).attr('iheight');
		var iLeftOffset = screen.availWidth / 2 - iWidth / 2;
		var iTopOffset = screen.availHeight / 2 - iHeight / 2;
		var sName = $(this).attr('winTitle');
		sUrl = $(this).attr('href');
		oNewWindow = window.open(
			sUrl,
			'',
			'left=' + iLeftOffset + ', ' +
			'top = ' + iTopOffset + ', ' +
			'width=' + iWidth + ', ' +
			'height=' + iHeight + ', ' +
			'menubar=no, ' +
			'toolbar=no, ' +
			'resizable=yes, ' +
			'scrollbars=yes, ' +
			'status=yes'
			);
		if(sUrl.match(/\.(gif|jpe?g|png)$/i)) {

				oNewWindow.document.open();

				oNewWindow.document.write('<html><head>' + (sName != ''? '<title>'+sName+'</title>' : '') + '</head><body style="background: #FFF; margin: 0; padding: 0;">' +
					'<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td align="center">' +
					'<img src="' + sUrl + '" />' +
					'</td></tr></table></body></html>'
					);

				oNewWindow.document.close();

			}
		oNewWindow.focus();

		return false;
	});
});
			
			// Utils : {
			// 
			// 		oPopupDefaults : {
			// 
			// 			iWidth      : 540,
			// 			iHeight     : 600,
			// 			sToolbar    : 'no',
			// 			sMenubar    : 'no',
			// 			sResizeable : 'yes',
			// 			sScrollbars : 'yes',
			// 			sStatus     : 'yes'
			// 
			// 		},
			// 		
			// 		
			// 		popup : function(
			// 			sUrl,
			// 			sName,
			// 			oOptions,
			// 			bReplace
			// 			) {
			// 
			// 			oOptions = Common.Object.extend(
			// 				Common.Utils.oPopupDefaults,
			// 				oOptions,
			// 				true
			// 				);
			// 
			// 			var iLeftOffset = screen.availWidth / 2 - oOptions.iWidth / 2;
			// 			var iTopOffset = screen.availHeight / 2 - oOptions.iHeight / 2;
			// 
			// 			oNewWindow = window.open(
			// 				sUrl,
			// 				'',
			// 				'left=' + iLeftOffset + ', ' +
			// 				'top = ' + iTopOffset + ', ' +
			// 				'width=' + oOptions.iWidth + ', ' +
			// 				'height=' + oOptions.iHeight + ', ' +
			// 				'menubar=' + oOptions.sMenubar + ', ' +
			// 				'toolbar=' + oOptions.sToolbar + ', ' +
			// 				'resizable=' + oOptions.sResizeable + ', ' +
			// 				'scrollbars=' + oOptions.sScrollbars + ', ' +
			// 				'status=' + oOptions.sStatus
			// 				);
			// 
			// 			if(sUrl.match(/\.(gif