 
 
function Validar_calendario_reg(theForm)
<!-- Validacion de Formulario INGRESO NOTICIAS -->
{var checkStr = theForm.tituloregion_agenda.value;
  if (checkStr.length==0  )
	{
    alert("Ingrese su Titulo, por favor.");
    theForm.tituloregion_agenda.focus();
    return (false);
	}	
		if (checkStr.length!=0) {
	if (checkStr.replace(/ /g, '') == '')
	{
		alert("No se aceptan espacios en blanco");
		theForm.tituloregion_agenda.focus();
		theForm.tituloregion_agenda.select();
		return (false);
		}
	}
	
 
	//*****************  validacion de textarea
theForm.descripcionregion_agenda.required = "true"; 
for (i = 0; i <theForm.elements.length; i++){
if ((theForm.elements[i].type == "textarea") &&  theForm.elements[i].required=="true" && theForm.elements[i].value=='')
{
  alert('Por favor, complete el campo de descripcion'); 
		 return (false);
		break;
	}
}
 
if (Trim(theForm.descripcionregion_agenda.value)=='<P>&nbsp;</P>')
	{
    alert("No dejar en blanco la descripcion, por favor.");
 
    return (false);
	}
//************************************ 
//************************************ 

var checkStr2 = theForm.codregion;
 
 
  if (checkStr2[0].selected == true )
	{
    alert("Selecciones una Región, por favor.");
    theForm.codregion.focus();
    return (false);
	}	
 
 
 return (true);
}

/*************************/
 
/************************  OPCIONES DE USUARIO **************/ 
/*************************/

function EDITAR_CALENDARIO_REG(VER,CODIGO,ENVIAR)
{
//if (Validar_noticia(window.document.formulario))
//{

 window.document.formulario.enviar.value=ENVIAR;
	window.document.formulario.ver_opt.value=VER;
 	window.document.formulario.id_pre.value=CODIGO;
 	/// alert(VER);
 //alert(CODIGO);
 window.document.formulario.submit();
//}
} 
 /*************************/
function pregunta_elimina_calendario_reg(CODIGO,ENVIAR,VER){ 
   if (confirm('¿Estas seguro de ELIMINAR este CALENDARIO DE REGION?')){ 
 
	 document.formulario.enviar.value=ENVIAR;   
 document.formulario.id_pre.value=CODIGO;
  window.document.formulario.ver_opt.value=VER;
// alert(ENVIAR);
 //alert(CODIGO);
 document.formulario.submit();
    } 
} 
/*************************/
function GUARDAR_MODI_CALENDARIO_REG(VER,CODIGO,ENVIAR)
{
 
if (Validar_calendario_reg(window.document.formulario))
{
	window.document.formulario.enviar.value=ENVIAR;
	window.document.formulario.ver_opt.value=VER;
 	window.document.formulario.id_pre.value=CODIGO;
 window.document.formulario.submit();

}

}

 /*************************/
function DETALLE_CALENDARIO_REG(VER,CODIGO,ENVIAR)
{

 window.document.formulario.enviar.value=ENVIAR;
	window.document.formulario.ver_opt.value=VER;
 	window.document.formulario.id_pre.value=CODIGO;
 window.document.formulario.submit();

}

 
/*************************/
/*************************/
function GUARDAR_CALENDARIO_REG(VER,ENVIAR)
{
if (Validar_calendario_reg(window.document.formulario))
{

	window.document.formulario.enviar.value=ENVIAR;
	window.document.formulario.ver_opt.value=VER;
 window.document.formulario.submit();

}
}

 
 /************************   **************/ 
/*************************/
 function Ir_tipo_region_calen_reg(VER,DERECHO,TIPO_EMP)
{
    window.document.formulario.ver_opt.value=VER;
 	window.document.formulario.t_region_info_reg.value=TIPO_EMP; 
	window.document.formulario.derecho.value=DERECHO;

	window.document.formulario.submit();

} 
