spliurl = document.URL.split('/');
var APP_URL = spliurl[0]+"/"+spliurl[1]+"/"+spliurl[2]+"/";

var is_manager = false;
document.observe("dom:loaded", function(){
	//Comprobar si estamos en el gestor
	
	if ($('gestor_portadas'))
	{
		is_manager = true;
	}
});

/* 
 *
 */
function reload_blog(id_module,page,module_type)
{
	if (!module_type)
	{
		module_type = 9;
	}
	
	var url = APP_URL+'module/edit/'+id_module+'/0/0/'+page;
	var myAjax = new Ajax.Request(url, {
		method: 'post',
		onSuccess: function(transport)
		{
			$("module_"+id_module).replace(transport.responseText);
			if (is_manager)
			{
				pon_editable(id_module,module_type);
			}			
		}
	});
}

function reload_gallery(id_module,page,module_type,gallery,picture)
{
	if (!module_type)
	{
		module_type = 14;
	}
	
	var url = APP_URL+'module/edit/'+id_module+'/0/0/'+page+'/'+gallery+'/'+picture;
	var myAjax = new Ajax.Request(url, {
		method: 'post',
		onSuccess: function(transport)
		{
			$("module_"+id_module).replace(transport.responseText);
			if (is_manager)
			{
				pon_editable(id_module,module_type);
			}			
		}
	});
}
