var Ajax;
if (Ajax && (Ajax != null)) {
	Ajax.Responders.register({
	  onCreate: function() {
        if($('spinner') && Ajax.activeRequestCount>0)
          Effect.Appear('spinner',{duration:0.5,queue:'end'});
	  },
	  onComplete: function() {
        if($('spinner') && Ajax.activeRequestCount==0)
          Effect.Fade('spinner',{duration:0.5,queue:'end'});
	  }
	});
}

function popupImage(imageUrl){
	overlib('<img src="' + imageUrl + '">', DELAY, 500, BORDER, 2, SNAPX, 100, FIXY, 100, CAPTION, 'Sample', CLOSECLICK); 
	return true;
}

function popupPageCentered(url, width, height, name) {
	var x = (screen.width - width) / 2;
	var y = (screen.height - height) / 2;
	var popupOptions = 'scrollbars=yes,toolbar=no,menubar=no,resizable=yes,location=no,directories=no'
		+ ',width=' + width + ',height=' + height
		+ ',top=' + y + ',left=' + x;
	window.open(url, name, popupOptions);
}
