function desplegar (obj) {
	var nodoPadre = obj.parentNode;
	var pId = nodoPadre.getAttribute ("id").split ("_");
	var id = pId[pId.length - 1];
	var subObj = $('#mIn_' + id);
	var h = subObj.height ();

	var disp = (subObj.css ("display") == 'block') ? 'none' : 'block';
	var hi = (subObj.css ("display") == 'block') ? h : 0;

	subObj.css ({ height: hi, display: disp });
	if (disp == 'block') {
		subObj.animate (
			{ height: h }
		);
	}
}

function fFocus (obj, cadena) {
	if (obj.value == cadena) obj.value = '';
}

function fBlur (obj, cadena) {
	if (obj.value == '') obj.value = cadena;
}

var archivos = new Array ();
var contArchivos = 1;

$(document).ready (function () {
	$('#slideDiv').cycle ({
		fx:			'scrollHorz',
		speed:		500,
		timeout: 	5000,
		next:		'#lnkSig',
		prev:		'#lnkAnt'
	});
	$('#lnkCerrar').click (function () {
		$('#contNotHeader').html ('');
		$('#contNotHeader').animate ({ opacity: 0, height: 0, width: 0 }, 200);
	});
	// Activo el fade del header
	//archivos = $('#archivos_header').val ().split (",");
	$('#imgContainer').cycle ({
		fx:			'fade',
		speed:		1500,
		timeout: 	5000
	});

	// Feedback
	$('#lnkEtiqueta').click (function () { switchFeed (); });
});

var fContraido = true;
var wTotal = 0;
var feedHtml = "";

function switchFeed () {
	var wFinal = fContraido ? $('#feedContenido').width () : 0;
	if (wTotal > 0) wFinal = wTotal;
	else {
		wTotal = wFinal;
		feedHtml = $('#feedContenido').html ();
	}
	$('#feedContenido').html ('');
	if (!fContraido) wFinal = 0;
	if (fContraido) {
		crearFondo ();
		$('#feedContenido').css ({ overflow: 'hidden', width: '0px', display: 'block' });
	}
	else {
		borrarFondo ();
		$('#feedContenido').css ({ overflow: 'hidden' });
	}
	fContraido = !fContraido;
	$('#feedContenido').animate ({ width: wFinal }, 500, "easeInCubic", function () {
		$('#feedContenido').html (feedHtml);
		if (fContraido) {
			$('#feedContenido').css ({ display: 'none' });
		}
		else {
			$('#feedContenido').css ({ display: 'block' });
		}
	});
}
