﻿function cufonCallback() {
	if (typeof(window['Cufon']) != "undefined") {
		Ext.ux.Lightbox.on('open', (function(){Cufon.replace('#ux-lightbox .g', '#ux-lightbox .g *')}));
	}
}

function ajaxLightbox(url, w, h) {
	Ext.Ajax.request({
		url: url,
		disableCaching: true,
		success: function(response, opts) {
			var a = document.createElement('div');
			a.innerHTML = response.responseText;
			//Ext.ux.Lightbox.init();
			Ext.ux.Lightbox.openMessage(response.responseText, w, h, a);
		},
		failure: function(response, opts) {
			if ('undefined' != typeof(console))
				console.log('Transfer&ecirc;ncia AJAX falhou com c&oacute;digo de status ' + response.status);
		}
	});
}

Ext.onReady(cufonCallback, Ext.ux.Lightbox);
