
function Ir_derecho_n(VER,DERECHO)
{
 //alert(VER);
 //var checkStr1;
//checkStr1= window.document.formulario.enunciadoalternativaencuesta.value;
 //window.document.formulario.enunciadoalternativaencuesta.value=checkStr1;
    window.document.formulario.ver_opt.value="";
    window.document.formulario.ver_opt.value=VER;
//	window.document.formulario.nom_seccion.value=NOM_SECCION;
	window.document.formulario.derecho.value=DERECHO;
	//alert(VER);
	//alert(NOM_SECCION);
	//alert(DERECHO);
	window.document.formulario.submit();

} 

function Validar_bus_encuesta(theForm)
<!-- Validacion de Formulario BUSQUEDA DE NOVEDADES-->
{
var checkStr1 = theForm.txt_titulonovedades.value;
var checkStr2 = theForm.f_dia.value;
var checkStr3 = theForm.f_mes.value;
var checkStr4 = theForm.f_anio.value;
 
  if (checkStr1.length==0 && checkStr2=='dia' && checkStr3=='mes' && checkStr4=='año')
	{
    alert("Ingrese al menos una opcion de Búsqueda, por favor.");
    theForm.txt_titulonovedades.focus();
    return (false);
	}	
	
	if (checkStr2!='dia' && checkStr3=='mes' && checkStr4=='año')
	{
    alert("Ingrese una fecha corresta , por favor.");
    theForm.txt_titulonovedades.focus();
    return (false);
	}
	if (checkStr2!='dia' && checkStr3!='mes' && checkStr4=='año')
	{
    alert("Ingrese una fecha corresta , por favor.");
    theForm.txt_titulonovedades.focus();
    return (false);
	}
	
	if ( checkStr2=='dia' && checkStr3!='mes' && checkStr4=='año')
	{
    alert("Ingrese una fecha corresta , por favor.");
    theForm.txt_titulonovedades.focus();
    return (false);
	}
	if ( checkStr2=='dia' && checkStr3!='mes' && checkStr4!='año')
	{
    alert("Ingrese una fecha corresta , por favor.");
    theForm.txt_titulonovedades.focus();
    return (false);
	}
	if ( checkStr2!='dia' && checkStr3=='mes' && checkStr4!='año')
	{
    alert("Ingrese una fecha corresta , por favor.");
    theForm.txt_titulonovedades.focus();
    return (false);
	}
	
 return (true);
}

function Validar_encuesta(theForm)
<!-- Validacion de Formulario INGRESO NOVEDADES -->
{ 	
	
	var checkStr = theForm.enunciadoencuesta.value.length;
	if (checkStr==0) 
	{
    alert("Ingrese el enunciado de la encuesta, por favor.");
    //theForm.enunciadoencuesta.focus();
    return (false);
	}	
   
//*****************  validacion de textarea
theForm.enunciadoencuesta.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.enunciadoencuesta.value)=='<P>&nbsp;</P>')
	{
    alert("No dejar en blanco la descripcion, por favor.");
 
    return (false);
	}
//************************************ 	
 
		 
 return (true);
}

/*************************/
/************************   OPCIONES VER GENERAL **************/ 
/*************************/

function Ir_derecho(VER,DERECHO)
{
 //alert(VER);
    window.document.formulario.ver_opt.value="";
    window.document.formulario.ver_opt.value=VER;
//	window.document.formulario.nom_seccion.value=NOM_SECCION;
	window.document.formulario.derecho.value=DERECHO;
	//alert(VER);
	//alert(NOM_SECCION);
	//alert(DERECHO);
	window.document.formulario.submit();

} 
/*************************/
/*************************/
/************************  OPCIONES DE NOVEDADES**************/ 
/*************************/

function EDITAR_ENCUESTA(VER,CODIGO,ENVIAR)
{
//if (Validar_novedades(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 VER_RESULTADO_ENCUESTA(VER,CODIGO,DERECHO)
{
//if (Validar_novedades(window.document.formulario))
//{
	window.document.formulario.ver_opt.value=VER;
 	//window.document.formulario.enviar.value=ENVIAR;
 	window.document.formulario.id_pre.value=CODIGO;
	window.document.formulario.derecho.value=DERECHO;
 	/// alert(VER);
 //alert(CODIGO);
 window.document.formulario.submit();
//}
} 
 /*************************/
function pregunta_elimina_encuesta(CODIGO,ENVIAR,VER){ 
   if (confirm('¿Estas seguro de ELIMINAR esta ENCUESTA?')){ 
 
	 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_ENCUESTA(VER,CODIGO,ENVIAR)
{
if (Validar_novedades(window.document.formulario))
{
	window.document.formulario.enviar.value=ENVIAR;
	window.document.formulario.ver_opt.value=VER;
 	window.document.formulario.id_pre.value=CODIGO;
 //	 alert(ENVIAR);
 //alert(VER);
 //alert(CODIGO);
 window.document.formulario.submit();

}

}

 /*************************/
function DETALLE_ENCUESTA(VER,CODIGO,ENVIAR)
{

 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 DETALLE_ENCUESTA_HOME(VER,CODIGO,ENVIAR)
{
// alert(ENVIAR);
//alert(VER);
//alert(CODIGO);
 window.document.frm_home_novedades.enviar.value=ENVIAR;
	window.document.frm_home_novedades.ver_opt.value=VER;
 	window.document.frm_home_novedades.id_pre.value=CODIGO;
 
 
 window.document.frm_home_novedades.submit();

}
/*************************/
/*************************/
function GUARDAR_ENCUESTA(VER,ENVIAR)
{
if (Validar_encuesta(window.document.formulario))
{

	//window.document.formulario.enviar.value=AREGLO;
	window.document.formulario.enviar.value=ENVIAR;
//	window.document.formulario.nom_seccion.value=SECCION;
	window.document.formulario.ver_opt.value=VER;
// 	window.document.formulario.id_pre.value=CODIGO;
 //	 alert(ENVIAR);
 //alert(VER);
 //alert(CODIGO);
 window.document.formulario.submit();

}
}

function BUSCAR_ENCUESTA(VER,ENVIAR)
{
 if (Validar_bus_novedades(window.document.formulario))
 {
  window.document.formulario.enviar.value=ENVIAR;
	window.document.formulario.ver_opt.value=VER;
	//alert(ENVIAR);
// alert(VER);
	window.document.formulario.submit();

 }
}
/************************   **************/ 
/*************************/
 
function focus(){
	window.document.formulario.login.focus();
}
 
 
 


