	var messages=new Array()

	for(indice=0;indice<titulo_noticia.length;indice++)
	{
		messages[indice] =  '					<table width="565" border="0" cellspacing="0" cellpadding="0">'
		messages[indice] += '                       <tr bgcolor="#FFFFE3"> '
		messages[indice] += '                         <td width="8" valign="top" class="txtgris"><img src="images/spacer.gif" width="8" height="1"></td>'
		messages[indice] += '                         <td valign="top" class="txtgris" align="left">'
		messages[indice] += '                         <a href="#" onClick="ver_detalles(this.id)" class="ttlnoticia" id="not'+indice+'">'
		messages[indice] += 							titulo_noticia[indice]+'<br>';
		messages[indice] += '                         </a>'
		messages[indice] += 							ajustar_texto(resumen_noticia[indice],400);
		messages[indice] += '                         </td>'
		messages[indice] += '                       <td width="92" height="69" align="center" valign="middle"><a href="#" onClick="ver_detalles(this.id)" class="ttlnoticia" id="not'+indice+'"><img src="images/'+imagen_noticia[indice]+'" width="112" height="90" border="0"></a></td>'
		messages[indice] += '                     </tr>'
		messages[indice] += '                   </table>';
	}	
	
	function llenar_Galeria(tipo)
	{
		var retorno = 	'<table height="140" border="0" cellpadding="0" cellspacing="0">';
		retorno += 		'	<tr>';
		for(i=0;i<miniaturas_galeria.length;i++)
		{
			retorno += 		'	 <td align="left">';
			retorno += 		'	 	<table width="96" height="140" border="0" cellpadding="0" cellspacing="3">';
			retorno += 		'	 	 <tr>';
			retorno += 		'	 	  <td height="72" valign="top">';
			retorno += 		'	 	  <a href="#gal" onClick="abrirGaleria(\''+tipo+'\',\''+i+'\')">';
			retorno += 		'	 	   <img src="images/galerias/'+tipo+'/'+miniaturas_galeria[i]+'" width="96" height="72" border="0">';
			retorno += 		'	 	  </a>';
			retorno += 		'	 	  </td>';
			retorno += 		'	 	 </tr>';
			retorno += 		'	 	 <tr>';
			retorno += 		'	 	  <td valign="top">';
			retorno += 		'	 	  <a class="txtgris" href="#gal" onClick="abrirGaleria(\''+tipo+'\',\''+i+'\')">';
			retorno +=		textos_galeria[i][0];		
			retorno += 		'	 	  </a>';
			retorno += 		'	 	  </td>';
			retorno += 		'	 	 </tr>';
			retorno += 		'	 	</table>';
			retorno += 		'	 </td>';
		}
				
		retorno += 		'	</tr>';		
		return retorno;
	}	
	
	function cargar_datos_galeria_servicios(not_sel,num_item)
	{
		if (document.getElementById) {
			ttl = document.getElementById("ttl_galeria");
			imag = document.getElementById("imag_galeria");
		}
		else if (document.all) {
			ttl = document.all["ttl_galeria"];
			imag = document.all["imag_galeria"];
		}
		ttl.innerHTML = textos_galeria[not_sel][num_item];
		imag.innerHTML = '<img border="0" align="center" height="270" width="360" src="images/galerias/servicio/'+imagen_grd_galeria[not_sel][num_item]+'">';
	}
	
	function cargar_datos_galeria_jovenes(not_sel,num_item)
	{
		if (document.getElementById) {
			ttl = document.getElementById("ttl_galeria");
			imag = document.getElementById("imag_galeria");
		}
		else if (document.all) {
			ttl = document.all["ttl_galeria"];
			imag = document.all["imag_galeria"];
		}
		ttl.innerHTML = textos_galeria[not_sel][num_item];
		imag.innerHTML = '<img border="0" align="center" height="270" width="360" src="images/galerias/jovenes/'+imagen_grd_galeria[not_sel][num_item]+'">';
	}	
	
	
	function cargar_datos_galeria_difusion(not_sel,num_item)
	{
		if (document.getElementById) {
			ttl = document.getElementById("ttl_galeria");
			imag = document.getElementById("imag_galeria");
		}
		else if (document.all) {
			ttl = document.all["ttl_galeria"];
			imag = document.all["imag_galeria"];
		}
		ttl.innerHTML = textos_galeria[not_sel][num_item];
		imag.innerHTML = '<img border="0" align="center" height="270" width="360" src="images/galerias/difusion/'+imagen_grd_galeria[not_sel][num_item]+'">';
	}
	
	function cargar_datos(not_sel)
	{
		if (document.getElementById) {
			ttl = document.getElementById("ttl_noticia");
			resu = document.getElementById("resu_noticia");
			cont = document.getElementById("cont_noticia");
			imag = document.getElementById("imag_noticia");
		}
		else if (document.all) {
			ttl = document.all["ttl_noticia"];
			resu = document.all["resu_noticia"];
			cont = document.all["cont_noticia"];
			imag = document.all["imag_noticia"];
		}
		ttl.innerHTML = titulo_noticia[not_sel];
		resu.innerHTML = resumen_noticia[not_sel];
		cont.innerHTML = texto_noticia[not_sel];
		imag.innerHTML = '<img border="0" align="right" height="69" width="92" src="images/'+imagen_noticia[not_sel]+'">';
	}

	function abrirGaleria(tipo,n_id)
	{
		wnd = window.open("popup_"+tipo+".html", "tinyWindow", 'toolbar=no,width=500,height=400') 
		wnd.focus();
		document.forms['form1'].not_sel.value = n_id;
	}
	
	function ver_detalles(n_id)
	{
		wnd = window.open("popup_noticia.html", "tinyWindow", 'toolbar=no,width=500,height=500') 
		document.forms['form1'].not_sel.value = n_id.substring(3,n_id.length);
		wnd.focus();
	}
	
	function anterior(gale,foto)
	{
		if(foto>0)
		{
			return foto-1;
		}
		else
		{
			return imagen_grd_galeria[gale].length-1;
		}
	}
	function setContent(content)
	{
		var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1;
		var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;
		if (ie||dom)
		{
			cntr = document.getElementById("scgal");
			cntr.innerHTML = content;
		}
		else if (document.layers)
		{
			cntr = document.scgal;
			cntr.write(content);
		}
	}
	function siguiente(gale,foto)
	{
		if(foto<imagen_grd_galeria[gale].length-1)
		{
			return foto+1;
		}
		else
		{
			return 0;
		}
	}

	function ajustar_texto(texto,longitud)
	{
		if(texto.length>longitud)
		{
			temp = texto.substr(0,longitud);
			temp2 = temp.split(' ');
			var retorno = new Array();
			for(ind=0;ind<temp2.length-1;ind++)
			{
				retorno[ind] = temp2[ind];
			}
			return retorno.join(' ')+"...";
		}
		else
		{
			return texto;
		}
	}
	
	function move1(whichlayer){
		tlayer=eval(whichlayer);		
		if (tlayer.top>0&&tlayer.top<=5){
			tlayer.top=0;
			setTimeout("move1(tlayer)",scrolldelay1);
			setTimeout("move2(document.main.document.second)",scrolldelay1);
			return;
		}
		if (tlayer.top>=tlayer.document.height*-1){
			tlayer.top-=5;
			setTimeout("move1(tlayer)",scrolldelay2);
		}
		else{
			tlayer.top=scrollerheight;
			tlayer.document.write(messages[i]);
			tlayer.document.close();
		if (i==messages.length-1)
			i=0;
		else
			i++;
		}
	}
	
	function move2(whichlayer){
		tlayer2=eval(whichlayer);
		if (tlayer2.top>0&&tlayer2.top<=5){
			tlayer2.top=0;
			setTimeout("move2(tlayer2)",scrolldelay1);
			setTimeout("move1(document.main.document.first)",scrolldelay1);
			return;
		}
		if (tlayer2.top>=tlayer2.document.height*-1){
			tlayer2.top-=5
			setTimeout("move2(tlayer2)",scrolldelay2)
		}
		else{
			tlayer2.top=scrollerheight
			tlayer2.document.write(messages[i])
			tlayer2.document.close()
			if (i==messages.length-1)
				i=0
			else
				i++
			}
	}
	
	function move3(whichdiv){
		tdiv=eval(whichdiv)
		if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
			tdiv.style.top=0
			setTimeout("move3(tdiv)",scrolldelay1)
			setTimeout("move4(second2_obj)",scrolldelay1)
			return
		}
		if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
			tdiv.style.top=parseInt(tdiv.style.top)-5
			setTimeout("move3(tdiv)",scrolldelay2)
		}
		else{
			tdiv.style.top=scrollerheight
			tdiv.innerHTML=messages[i]
			if (i==messages.length-1)
				i=0
			else
				i++
		}
	}
	
	function move4(whichdiv){
		tdiv2=eval(whichdiv)
		if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
			tdiv2.style.top=0
			setTimeout("move4(tdiv2)",scrolldelay1)
			setTimeout("move3(first2_obj)",scrolldelay1)
			return
		}
		if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
			tdiv2.style.top=parseInt(tdiv2.style.top)-5
			setTimeout("move4(second2_obj)",scrolldelay2)
		}
		else{
			tdiv2.style.top=scrollerheight
			tdiv2.innerHTML=messages[i]
			if (i==messages.length-1)
				i=0
			else
				i++
		}
	}
	
	function startscroll(){
		if (ie||dom){
			first2_obj=ie? first2 : document.getElementById("first2")
			second2_obj=ie? second2 : document.getElementById("second2")
			move3(first2_obj)
			second2_obj.style.top=scrollerheight
			second2_obj.style.visibility='visible'
		}
		else if (document.layers){
			document.main.visibility='show'
			move1(document.main.document.first)
			document.main.document.second.top=scrollerheight+5
			document.main.document.second.visibility='show'
		}
	}
	
	function displaySelected(sel)
	{
		if (ie||dom)
		{
			document.getElementById("first2").innerHTML=messages[sel];
			sel2 = (sel+1>=messages.length) ? 0 : sel+1;
			document.getElementById("second2").innerHTML=messages[sel2];			
		}
		else
		{
			tlayer=eval(document.main.document.first);
			tlayer.document.write(messages[sel]);
			sel2 = (sel+1>=messages.length) ? 0 : sel+1;
			tlayer=eval(document.main.document.second);
			tlayer.document.write(messages[sel2]);
		}
	}
	
	function mostrar(ident) {
		//alert("mostrando "+ident)
		if (document.getElementById) {
				x = document.getElementById(ident);
		}
		else if (document.all) {
				x = document.all[ident];
		}
		x.style.display = "block";
	}
	
	function estilo(ident) {
			if (document.getElementById) {
					x = document.getElementById(ident);
			}
			else if (document.all) {
					x = document.all[ident];
			}
			x.style.display=(x.style.display == "block") ? "none" : "block";
		}