/**
 * @author Claudio Cesar Sanchez Tejeda
 */

$.extend($.blockUI.defaults.overlayCSS, {opacity: '0.8', backgroundColor: '#E6E6E6' });

var newLightbox = {

	rootPath: root_path,
	content: '',
	
	setContent: function (content)
	{
		newLightbox.content = $(content);
	}, 
	
	setAjaxContent: function (url)
	{
		url = newLightbox.rootPath + url.replace(newLightbox.rootPath, '');
		newLightbox.setContent($.ajax({url: url, method: 'get', async: false}).responseText);
	},
	
	getContent_id: function (id)
	{
		var element = false;
		$().each(function()
		{
		  if (this.id == id)
		  	element = $(this);
		});
		return false;
	},
		
	show: function (parameters)
	{
		if (!parameters) parameters = '';
		$.blockUI($(newLightbox.content), parameters);
		$('.blockUI').css('cursor', 'default');
	},
	
	hide: function ()
	{
		$.unblockUI();
	},
	height: function(param_height, callback_function)
	{
/*		var height = $('.blockMsg').css('height').replace('px', '');
		var i = 15;
		if (param_height >  height)
		{
			var limit = param_height - height;
			for (i=15; i < limit; i+=15) 
				setTimeout("$('.blockMsg').css('height' , '" + (height + i) + "px');", (i * 5)); 
		}
		if (param_height <  height)
		{
			var limit = height - param_height;
			for (i=15; i < limit; i+=15) 
				setTimeout("$('.blockMsg').css('height' , '" + (height - i) + "px');", (i * 5)); 
		}
		setTimeout("$('.blockMsg').css('height' , '" + param_height + "px');", (i * 5)); 
		i += 15;
		setTimeout(callback_function, (i * 5)); */

		$('.blockMsg').css('height', param_height + 'px');
		callback_function();
	}
/*	changeContent: function ()
	{
		
	}*/
};	
		

		
