var AgntUsr=navigator.userAgent.toLowerCase();
var DomYes=document.getElementById?1:0,NavYes=AgntUsr.indexOf("mozilla")!=-1&&AgntUsr.indexOf("compatible")==-1?1:0,ExpYes=AgntUsr.indexOf("msie")!=-1?1:0,Opr=AgntUsr.indexOf("opera")!=-1?1:0;
var Nav4=NavYes&&!DomYes&&document.layers?1:0,Exp4=ExpYes&&!DomYes&&document.all?1:0;
var cursor1=ExpYes?"hand":"pointer",hide1=Nav4?"hide":"hidden",show1=Nav4?"show":"visible";

if (/Mozilla\/5\.0/.test(navigator.userAgent))
	document.write('<script type="text/javascript" src="mozInnerHTML.js"></script>');
  
function getElem(obj) {
  return Nav4?document.layers[obj]:DomYes?document.getElementById(obj):document.all[obj]
}

function getElem2(obj) {
  obj2 = Nav4?document.layers[obj]:DomYes?document.getElementById(obj):document.all[obj];
  return Nav4?obj2:obj2.style
}

function x() {
  return
}

function mm(id) {
  eval('document.form1.mm' + id + '.value = 1')
}

function setCheckboxes() {
  var cb=document.getElementsByTagName('input');
  var cb_cnt=(typeof(cb.length)!='undefined')?cb.length:0;
  var valor1=cb[0].checked?true:false;
  if (cb_cnt) {
    for (var ii=0; ii<cb_cnt; ii++) {
      if (cb[ii].name.substr(0,2)=='cb') cb[ii].checked=valor1
    }
  } else {
    if (cb.name.substr(0,2)=='cb') cb.checked=valor1
  }
  return true
}

// menu
function ov1(obj) {
  obj.style.backgroundColor='#DC2828';
  obj.style.cursor=cursor1
}

function ou1(obj) {
  obj.style.backgroundColor='transparent'
}

function ov2(obj, txt) {
  obj.style.backgroundColor='#DC2828';
  obj.style.cursor=cursor1;
  tip2=getElem('tip');
  tip2.innerHTML=txt;
  tip2.style.display = "block"
}

function ou2(obj) {
  obj.style.backgroundColor='transparent';
  tip2=getElem('tip');
  tip2.innerHTML=' ';
	tip2.style.display = 'none'
}


// contactos
function showhide(id) {
  obj=getElem2(id);
  obj2=getElem2('a'+id);

  if (obj.display=='none') {
    obj.display='';
    obj2.color='#FF0000'
  } else {
    obj.display='none';
    obj2.color='#000099'
  }
}

// login
function vUC(form1) {
  if (form1.usuario1.value.length==0) {
    alert('Debe introducir el Usuario.');
    form1.usuario1.focus();
    return false
  }
  if (form1.codigo1.value.length==0) {
    alert('Debe introducir la Contraseña.');
    form1.codigo1.focus();
    return false
  }
  return true
}

// usuarios
function eUsuario(clave, usuario) {
  if (confirm('¿Desea Eliminar el Usuario: '+usuario+'?')) location='usuarios.php?idD='+clave
}

function vUCN(form1) {
  if (form1.usuario.value.length==0) {
    alert('Debe introducir el Usuario.');
    form1.usuario.focus();
    return false
  }
  if (form1.codigo.value.length==0) {
    alert('Debe introducir la Contraseña.');
    form1.codigo.focus();
    return false
  }
  if (form1.nombre.value.length==0) {
    alert('Debe introducir el Nombre.');
    form1.nombre.focus();
    return false
  }
  return true
}

// evalua
function ve(form1) {
  if (form1.dato1.value.length==0) {
    alert('Debe introducir el Evaluador.');
    form1.dato1.focus();
    return false
  }
  if (form1.dato2.value.length==0) {
    alert('Debe introducir el Evaluado.');
    form1.dato2.focus();
    return false
  }
  return true
}

function vcurp(form1) {
  if (form1.curp1.value.length == 0) {
    alert ('Error. Debe introducir el CURP.');
    form1.curp1.focus();
    return false;
  }
  return true;
}
  
// filer
function del() {
  if (confirm('¿Desea eliminar lo seleccionado?')) 
    return true
  else
    return false
}

function ren(form1) {
  if (form1.rname.value.length==0) {
    alert('Debe escribir el nombre nuevo del archivo/carpeta.'); 
    return false
  }
  var cb=document.getElementsByTagName('input');
  var cb_cnt=(typeof(cb.length)!='undefined')?cb.length:0;
  var cc=0;
  var clave='';
  if (cb_cnt) {
    for (var ii=0; ii<cb_cnt; ii++)
      if (cb[ii].name.substr(0,2)=='cb') 
        if (cb[ii].checked) cc++;
    if (cc!=1) {
      alert('Debe seleccionar solo un archivo/carpeta.');
      return false
    }
  }
  return true
}

function mov(form1,ruta) {
  var cb=document.getElementsByTagName('input');
  var cb_cnt=(typeof(cb.length)!='undefined')?cb.length:0;
  var cc=0;
  if (cb_cnt) {
    for (var ii=0; ii<cb_cnt; ii++)
      if (cb[ii].name.substr(0,2)=='cb') 
        if (cb[ii].checked) cc++;
    if (cc==0) {
      alert('Debe seleccionar al menos un archivo/carpeta.');
      return false
    }
  }

  if ((form1.mname.value.length==0)||(form1.mname.value==ruta)) {
    alert('Debe escribir el nombre del archivo/carpeta a mover.'); 
    return false
  }
  if (confirm('¿Desea mover lo seleccionado?')) 
    return true
  else
    return false
}

function mkd(form1) {
  if (form1.dname.value.length==0) {
    alert('Debe escribir el nombre de la carpeta nueva.'); 
    return false
  }
  return true
}

function upf(form1) {
  if (form1.userfile.value.length==0) {
    alert('Debe seleccionar el archivo a subir.'); 
    return false
  }
  return true
}

// forum

function ov3(obj,txt) {
  obj.bgColor="#FFCC00"; 
  obj.style.cursor=cursor1;
  tip2=getElem("tip");
  tip2.innerHTML=txt;
  tip2.style.display = "block"
}

function ou3(obj) {
  obj.bgColor="#DDDDDD";
  tip2=getElem("tip");
  tip2.innerHTML="";
  tip2.style.display = "none"
}

function cl1(id) {
  location.href='forum2.php?id='+id
}
  
function ov4(obj) {
  obj.bgColor='#FFCC00'; 
  obj.style.cursor=cursor1
}

function ou4(obj) {
  obj.bgColor='#DDDDDD'
}

function cl2(id) {
  location.href='forum3.php?id='+id
}

function vf1(form1) {
  if (form1.dato1.value.length==0) {
    alert('Debe introducir el Nombre.');
    form1.dato1.focus();
    return false
  }
  if (form1.dato2.value.length==0) {
    alert('Debe introducir el Tema.');
    form1.dato2.focus();
    return false
  }
  if (form1.dato3.value.length==0) {
    alert('Debe introducir el Mensaje.');
    form1.dato3.focus();
    return false
  }
  return true
}

function vf2(form1) {
  if (form1.dato1.value.length==0) {
    alert('Debe introducir el Nombre.');
    form1.dato1.focus();
    return false
  }
  if (form1.dato3.value.length==0) {
    alert('Debe introducir el Mensaje.');
    form1.dato3.focus();
    return false
  }
  return true
}

/*
function goIndex1() {
  if (parent.parent.temporal) 
    parent.parent.temporal.location.href="../index2.htm"
  else
    top.location.href="../index2.htm"
}

function goIndex2() {
  if (parent.parent.temporal) 
    parent.parent.temporal.location.href="index.php"
  else
    top.location.href="index.php"
}
*/
