/**
 * cadeinfos.js: several utilities to show general infos about the Valley,
 *               etc. for the CadeMET project, using the YUI library.
 *
 * by Eduardo Hernando Izcara. Copyright 2009 agroGEX.
 */
// ------------------------------------------------------------------------

// Make sure we haven't already been loaded
var CadeInfos;
if (CadeInfos && (typeof CadeInfos != "object" || CadeInfos.NAME))
{
	throw new Error("Namespace 'CadeInfos' already exists");
}

// Create our namespace, and specify some meta-information
CadeInfos = {};
CadeInfos.NAME = "CadeInfos";    // The name of this namespace
CadeInfos.VERSION = 1.0;         // The version of this namespace

// Algunas variables globales del namespace:

// ------------------------------------------------------------------------

CadeInfos.render_about = function()
{
	YAHOO.util.Dom.setStyle(document.body, 'cursor', 'progress');

	var url = Rutinas.baseUrl() + "/infos/showabout/format/html/";
	var callback =
	{ 
		success: CadeInfos.render_exito,
		failure: CadeInfos.render_fracaso
	}; 
	YAHOO.util.Connect.initHeader('X_REQUESTED_WITH', 'XMLHttpRequest');
    YAHOO.util.Connect.asyncRequest('GET', url, callback);
}
// ------------------------------------------------------------------------

CadeInfos.render_fruit = function()
{
	YAHOO.util.Dom.setStyle(document.body, 'cursor', 'progress');

	var url = Rutinas.baseUrl() + "/infos/showfruit/format/html/";
	var callback =
	{ 
		success: CadeInfos.render_exito,
		failure: CadeInfos.render_fracaso
	}; 
	YAHOO.util.Connect.initHeader('X_REQUESTED_WITH', 'XMLHttpRequest');
    YAHOO.util.Connect.asyncRequest('GET', url, callback);
}
// ------------------------------------------------------------------------

CadeInfos.render_exito = function(o)
{
	document.getElementById('contenido').innerHTML = o.responseText;
	YAHOO.util.Dom.setStyle(document.body, 'cursor', 'auto');
}
// ------------------------------------------------------------------------

CadeInfos.render_fracaso = function(o)
{
	document.getElementById('contenido').innerHTML = "";
	YAHOO.util.Dom.setStyle(document.body, 'cursor', 'auto');
}
// ------------------------------------------------------------------------

