////////////////////////////////////
// Enrique Meléndez Estrada
// creado : 02/09/2004
// version : 27/02/2006
////////////////////////////////////

$(document).ready(function() { 
		$('a.feed').gFeed( { target: '#feeds', tabs: true, max: 15 } ); 
	}); 
				
var dss = document.styleSheets;
var sPlantillasAsp ="lib_asp/plantilla.asp?ID=";
var sCSSbutton =	"font-family:verdana; font-size:7.5pt";
var sCSSdiv=		"display:block; position:absolute; z-index:50; top:0;right:0";
var sCSSiframe =	"position:absolute;top:-10px;height:1px;width:1px";

function ITAcms_CambiarCSS(iFicheroCSS)
{
	// sólo cambia el CSS, si no estaba previamente ACTIVADO
	// !!! NO FUNCIONA EN MOZILLA
	// SI iFicheroCSS no es un número y es el ID...
	
	if (dss[iFicheroCSS].disabled !=false)
		{
		ITAcms_desactivarTodosCSS();
		dss[iFicheroCSS].disabled = false;
		}
}

function ITAcms_desactivarTodosCSS()
{
	var iCont = dss.length - 1;//el último CSS (PRINT) no se deshabilita nunca...
	for (var i=0; i<iCont; i++)
		dss[i].disabled = true;
}

function ITAcms_getBotonesCSS()
{
	var iCont = dss.length;
	sHTML =	'<button style="'+sCSSbutton+'" onclick="ITAcms_verHTML()">Ver HTMLs</button>';
	sHTML +=	'<select style="'+sCSSbutton+'" onchange="ITAcms_CambiarCSS(this.value)">';
	for (var i=0; i<iCont; i++)
		sHTML +='<option '+(!i ?'selected':'')+' value="'+i+'">'+ dss[i].title +'</option>';
	document.write('<div style="'+sCSSdiv+'">'+ sHTML + '</select></div>');
}

function ITAcms_getImgPutOnclick(oDiv)
{
	var cImg = oDiv.getElementsByTagName("img");
	for (var i=0;i<cImg.length ;i++)
		cImg[i].onclick = function _openImg(){window.open(this.src)};
}

function ITAcms_verHTML()
{
	/*var oIframe = document.getElementsByTagName("iframe");*/
	var w= window.open("about:blank","_blank");
	var s="";
	for (var i in _aTarget)
		s+='<span style="padding:2px;background-color:#fff;color:#007;font:bold 20px verdana">#'+_aTarget[i]+'</span><pre class="html" style="font:normal 12px \'new courier\'; background-color:#eee; display:block; margin-bottom:10px; border:2px solid #007; padding:5px">'+document.getElementById(_aTarget[i]).innerHTML.split("<").join("&lt;").split(">").join("&gt;")+'</pre>';
	w.document.write(s);
	w.document.close();
}

