/**
 * JS DE NOTICIAS
 */

MICARPETA=
{
	// Cambio de solapas -------------------------------------------------------
	gotoLicitaciones 	: function() { document.getElementById('fLic').style.display='block'; document.getElementById('fAdj').style.display='none'; document.getElementById('fNot').style.display='none'; },
	gotoAdjudicaciones	: function() { document.getElementById('fLic').style.display='none'; document.getElementById('fAdj').style.display='block'; document.getElementById('fNot').style.display='none'; },
	gotoNoticias		: function() { document.getElementById('fLic').style.display='none'; document.getElementById('fAdj').style.display='none'; document.getElementById('fNot').style.display='block'; }
}

LICITACIONES=
{
	// Manejo individual de nota -----------------------------------------------
	abrir : function(id) { document.getElementById("short_"+id).style.display="none"; document.getElementById("long_"+id).style.display="block"; },
	cerrar : function(id) { document.getElementById("short_"+id).style.display="block"; document.getElementById("long_"+id).style.display="none"; },
	// Carga de notas ----------------------------------------------------------
	loadLast : function() { this.showCargando(); AJAX.loadApiCallback("LICITACIONES.muestraResultados","licitaciones:op","getLast",""); },
	muestraResultados : function(req) { document.getElementById("buscador_resultados").innerHTML=req.responseText; this.hideCargando(); }, 
	buscar 			: function(nombreForm) { this.showCargando(); AJAX.postApiCallback("LICITACIONES.muestraResultados","licitaciones|principal|principal|licitaciones","getBuscados",nombreForm,"&cr_pag=1"); },
	irPagina 		: function(pagina) { this.showCargando(); AJAX.loadApiCallback("LICITACIONES.muestraResultados","licitaciones|principal|principal|licitaciones","getBuscados","&cr_pag="+pagina); },
	// Manejo del Cargando -----------------------------------------------------
	showCargando 	: function() { document.getElementById("buscador_resultados").style.display="none"; document.getElementById("buscador_resultados_cargando").style.display="block"; },
	hideCargando 	: function() { document.getElementById("buscador_resultados").style.display="block"; document.getElementById("buscador_resultados_cargando").style.display="none"; },
	// Cambio de solapas -------------------------------------------------------
	gotoAvanzada 	: function() { document.getElementById('fAvanzado').style.display='block'; document.getElementById('fBasico').style.display='none'; },
	gotoBasica 		: function() { document.getElementById('fAvanzado').style.display='none'; document.getElementById('fBasico').style.display='block'; }
}

//--[Manejo de noticias enteras ida y vuelta]-----------------------------------
function showBig(ob)
{
	b=document.getElementById('licitaciones_full'); s=document.getElementById('licitaciones_home');
	pu=document.getElementById('paginacionUp'); pd=document.getElementById('paginacionDown');
	b.innerHTML=document.getElementById('b'+ob).innerHTML;
	b.style.display='block'; s.style.display='none'; 
	if(pu!=null) pu.style.display='none'; 
	if(pd!=null) pd.style.display='none';
}
function hideBig() 
{ 
	b=document.getElementById('licitaciones_full'); s=document.getElementById('licitaciones_home');
	pu=document.getElementById('paginacionUp'); pd=document.getElementById('paginacionDown');
	b.style.display='none'; s.style.display='block'; 
	if(pu!=null) pu.style.display='block'; 
	if(pd!=null) pd.style.display='block';
}


APERTURAS=
{
	// Manejo individual de nota -----------------------------------------------
	abrir : function(id) { document.getElementById("short_"+id).style.display="none"; document.getElementById("long_"+id).style.display="block"; },
	cerrar : function(id) { document.getElementById("short_"+id).style.display="block"; document.getElementById("long_"+id).style.display="none"; },
	// Carga de notas ----------------------------------------------------------
	loadLast : function() { this.showCargando(); AJAX.loadApiCallback("APERTURAS.muestraResultados","aperturas:op","getLast",""); },
	muestraResultados : function(req) { document.getElementById("buscador_resultados").innerHTML=req.responseText; this.hideCargando(); },
	buscar : function(nombreForm) { this.showCargando(); AJAX.postApiCallback("APERTURAS.muestraResultados","aperturas|principal|principal|aperturas","getBuscados",nombreForm,"&cr_pag=1"); },
	irPagina : function(pagina) { this.showCargando(); AJAX.loadApiCallback("APERTURAS.muestraResultados","aperturas|principal|principal|aperturas","getBuscados","&cr_pag="+pagina); },
	// Manejo del Cargando -----------------------------------------------------
	showCargando : function() { document.getElementById("buscador_resultados").style.display="none"; document.getElementById("buscador_resultados_cargando").style.display="block"; },
	hideCargando : function() { document.getElementById("buscador_resultados").style.display="block"; document.getElementById("buscador_resultados_cargando").style.display="none"; },
	// Cambio de solapas -------------------------------------------------------
	gotoAvanzada : function() { document.getElementById('fAvanzado').style.display='block'; document.getElementById('fBasico').style.display='none'; },
	gotoBasica : function() { document.getElementById('fAvanzado').style.display='none'; document.getElementById('fBasico').style.display='block'; },
	// Favoritos ---------------------------------------------------------------
	addLicFavorito	: function(ob,user,id) { ob.src=AJAX.loadApi("micarpeta:op","addFavorito","&feuser_id="+user+"&adj_id="+id); },
	delLicFavorito	: function(ob,user,id) { ob.src=AJAX.loadApi("micarpeta:op","delFavorito","&feuser_id="+user+"&adj_id="+id); },
	turnLicFavorito : function(ob,user,id) { if(ob.alt=="favorito") { this.delLicFavorito(ob,user,id); ob.alt=""; } else { this.addLicFavorito(ob,user,id); ob.alt="favorito"; } }
}

//--[Manejo de noticias enteras ida y vuelta]-----------------------------------
function showBigA(ob)
{
	b=document.getElementById('aperturas_full'); s=document.getElementById('aperturas_home');
	pu=document.getElementById('paginacionUp'); pd=document.getElementById('paginacionDown');
	b.innerHTML=document.getElementById('b'+ob).innerHTML;
	b.style.display='block'; s.style.display='none';
	if(pu!=null) pu.style.display='none'; 
	if(pd!=null) pd.style.display='none';
}
function hideBigA() 
{ 
	b=document.getElementById('aperturas_full'); s=document.getElementById('aperturas_home');
	pu=document.getElementById('paginacionUp'); pd=document.getElementById('paginacionDown');
	b.style.display='none'; s.style.display='block'; 
	if(pu!=null) pu.style.display='block'; 
	if(pd!=null) pd.style.display='block';
}

//--[Manejo de noticias enteras ida y vuelta]-----------------------------------
function showBigN(ob)
{
	b=document.getElementById('noticias_full'); s=document.getElementById('noticias_home');
	pu=document.getElementById('paginacionUp'); pd=document.getElementById('paginacionDown');
	b.innerHTML=document.getElementById('b'+ob).innerHTML;
	b.style.display='block'; s.style.display='none'; 
	if(pu!=null) pu.style.display='none'; 
	if(pd!=null) pd.style.display='none';
}
function hideBigN() 
{ 
	b=document.getElementById('noticias_full'); s=document.getElementById('noticias_home');
	pu=document.getElementById('paginacionUp'); pd=document.getElementById('paginacionDown');
	b.style.display='none'; s.style.display='block'; 
	if(pu!=null) pu.style.display='block'; 
	if(pd!=null) pd.style.display='block';
}

//alert("LICITACIONES.Ok!");
