
/* ############################ FUNCION OCULTA ####################################################*/


			function oculta(id)
			{
				document.getElementById(id).style.display='none';
			}




/* ############################ FUNCION MUESTRA ####################################################*/		



			function muestra(id)
			{
				document.getElementById(id).style.display='block';
			}		


		




/*  ################### FUNCION DESACTIVA CONTROLES ####################################################*/

			function desactivacontroles(id)
	{
		var check  = 'check' + id
		var texto  = 'texto' + id
		var select = 'select' + id
						
						
		if (eval('document.getElementById(\'' + check + '\').checked'))
		{
			eval('document.getElementById(\'' + texto + '\').style.visibility=\'visible\'')
			eval('document.getElementById(\'' + select + '\').style.visibility=\'visible\'')
			// SI ES EL GAS HAY QUE MOSTRAR LA PREGUNTA "PREG3BISBISBIS"
					
			if (id=='3-2')
				{document.getElementById('PREG3BISBISBIS').style.display='block'}
		}
		else
		{
			eval('document.getElementById(\'' + texto + '\').style.visibility=\'hidden\'')
			eval('document.getElementById(\'' + select + '\').style.visibility=\'hidden\'')
			// SI ES EL GAS HAY QUE MOSTRAR LA PREGUNTA "PREG3BISBISBIS"
			if (id=='3-2')
				{document.getElementById('PREG3BISBISBIS').style.display='none'}

		}			
	}	

			



		
/* ################### FUNCION DIALOGO AYUDA ####################################################*/


			function dialogoayuda(url)
			{ 
				var url;
				url = 'AYUDAS/' + url + '.asp';
			    try{
					dlog = window.open(url,'','status=no,width=550px,height=341px');
				}catch(e){
					dlog = window.open(url,'width=550px,height=341px,toolbar=no,location=no,directories=no,status=no, menubar=no, scrollbars=auto, resizable=no');
				}
			}		

/* ################### FUNCION DESACTIVACHECKNA ####################################################*/



			function desactivacheckNA (objcheck,idrespuestas)
			{
				/*
				NOTA: Cuando hay un grupo de check con un N/A, se deben desactivar 
				o activar el resto de check y etiquetas	según convenga.
					- Los check vienen identificados chkpreg#preg-#orden
					- Los label vienen identificados lblpreg#preg-#orden
					- En el argumento 'idrespuesta' vienen la lista de 
					  orden separados por comas	*/
						
				grupo = idrespuestas.split(",")
				// prelabel y precheck obtienen la primera parte del identificador para el bucle.
				prelabel = 'lbl' + objcheck.id.substring(3,objcheck.id.length-1) 
				precheck = objcheck.id.substring(0,objcheck.id.length-1)
						

				if (objcheck.checked)
				{
					for (indice=0;indice<=grupo.length-1;indice++)		
					{
						eval('document.getElementById(\'' + precheck + grupo[indice] + '\').checked=false')
						eval('document.getElementById(\'' + prelabel + grupo[indice] + '\').disabled=true')
						eval('document.getElementById(\'' + precheck + grupo[indice] + '\').disabled=true')					
					}
				}
				else
				{
					for (indice=0;indice<=grupo.length-1;indice++)		
					{

						eval('document.getElementById(\'' + prelabel + grupo[indice] + '\').disabled=false')
						eval('document.getElementById(\'' + precheck + grupo[indice] + '\').disabled=false')					
					}
				}
			}	
	
	
	
/* ################### FUNCIONES PARA MARCAR Y DESMARCAR PREGUNTAS####################################################*/	

		function marcarPregunta(objlabel)
		{
			var objetolabel
			objetolabel = eval('document.getElementById(\'' + objlabel + '\')')
			objetolabel.className='lblformRespondido'
		}
		
		function desmarcarPregunta(objlabel)
		{
			var objetolabel
			objetolabel = eval('document.getElementById(\'' + objlabel + '\')')
			objetolabel.className='lblform'
		}
				
		function desmarcar(obj,idPreg)
		{
			//desmarcamos el radio si está marcado
			if (obj.checked)
			{
				obj.checked=false
				//desmarcamos también la pregunta
				desmarcarPregunta(idPreg)
			}
		}
		
		function controla(objcheck,iddiv)
		{
			if (objcheck.checked)
			{
				muestra(iddiv)
			}
			else
			{
				oculta(iddiv)
			}
		}

		function controlaSelect(obj,preg)
		{
			if (obj.selectedIndex>0)
			{
				marcarPregunta(preg)
			}
			else
			{
				desmarcarPregunta(preg)
			}
		}	
	