// definiciones basicas
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' debe ser numérico.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es un dato requerido.\n'; }
  } if (errors) alert('Corrija los siguientes errores para enviar los datos:\n'+errors);
  document.MM_returnValue = (errors == '');
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_ve_Con(una,otra){
	
	if (document.MM_returnValue) {
		if(una.value == otra.value)
			document.MM_returnValue =  true;
		else {
			alert("Las contraseñas deben ser iguales.");
			document.MM_returnValue =  false;
		}
	}
	
}

function submitir(){
	document.MM_returnValue = true;
	alert("Hola "+document.MM_returnValue);
	if (document.MM_returnValue) {
		document.fHtmlEditor.submit();
	}
}
function verificar(selec){
	//alert("Hola "+selec.options[selec.selectedIndex].value);
	if(selec.options[selec.selectedIndex].value == "Si"){
		accion = document.getElementById('MM_insert');
		if (!accion){
			alert("El elemento selecionado no existe");
		} else {
			padre = accion.parentNode;
			padre.removeChild(accion);
		}
	} else {
		accion = document.getElementById('MM_insert');
		if (!accion){
			padre = document.getElementById('form1');
  		    ele = document.createElement('input'); // 5
			  ele.type = 'hidden'; 
			  ele.name = 'MM_insert'; 
			  ele.value= 'form1';
			  padre.appendChild(ele); 
						
		}
	}
}
function destaca()
{
   if (document.form1.secundario.checked)
   { 
       ver(1);
       ver(2);
       ver(3);
       ver(4);

   } else {
       nover(1);
       nover(2);
       nover(3);
       nover(4);
   }         
}
function nover(cual) {
	elem=document.getElementById('secundarios');
	fila=elem.getElementsByTagName('tr');
	fila[cual].style.display='none';
}
function ver(cual) {
	elem=document.getElementById('secundarios');
	fila=elem.getElementsByTagName('tr');
	fila[cual].style.display='block';
}

function agregar(){
	   if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
	      var url= (location.href);
	      var titulo="Oficina Provincial de Recursos Humanos ::: Gobierno de la Provincia del Neuqu&eacute;n";
	      window.external.AddFavorite(url,titulo);
	   }
	   else {
	      if(navigator.appName == "Netscape")
	         alert ("Presione Crtl+D para agregar este sitio en sus Favoritos");
	   }
	}

function confirmDelete(delUrl) { 
	if (confirm("Está Seguro que desea Eliminar este Registro?")) { 
	document.location = delUrl; 
	}
	}

