// JavaScript Document
//============================================================
// scripts de los formularios (Visual)
//============================================================
	// no incluye validaciones
		
		var nsc6=document.getElementById && !document.all
		var previous=''
		var eventobj
		
		//Regular expression to highlight only form elements
		var intended=/INPUT|TEXTAREA|SELECT|OPTION/
		
		//Function to check whether element clicked is form element
		function checkel(which){
		if (which.style && intended.test(which.tagName)){
		if (nsc6 && eventobj.nodeType==3)
		eventobj=eventobj.parentNode.parentNode
		return true
		}
		else
		return false
		}
		
//---------------------------------------------
// funcion para mostrar y ocultar otro
//---------------------------------------------

function campo_otro_opcion_check(idc, valorc){
	
	//	alert(idc + "-"+  valorc);

	// VALIDAMOS SI EL VALOR ES OTRO
	if(valorc == 'Otro'){
 		document.getElementById('otro_' + idc).style.height = "";
 		document.getElementById('otro_' + idc).style.width = "";
 		document.getElementById('otro_' + idc).style.overflow = "";
 		document.getElementById('otro_' + idc).style.display = "table-cell";
	}else{
 		document.getElementById('otro_' + idc).style.height = "1px";
 		document.getElementById('otro_' + idc).style.width = "1px";
 		document.getElementById('otro_' + idc).style.overflow = "hidden";
 		document.getElementById('otro_' + idc).style.display = "none";
	}
	
}


		
//---------------------------------------------
// funcion para mostrar y ocultar otro
//---------------------------------------------

function campo_otro_opcion_check_box(form, idc, valorc){

	// alert(form + "-" + idc + "-" + valorc);

	
	var check_seleccion = false;
	var total = eval("document." + form + "." + idc + "." + "length");
	var valor_campo;
	
	for (c = 0; c < total ; c++){

		valor_campo = eval("document." + form + "." + idc + "[c].value");
		valor_campo_checked = eval("document." + form + "." + idc + "[c].checked");
		
		if(valor_campo == 'Otro' && valor_campo_checked){
			check_seleccion = true;
		}
	}
	
	//	alert(idc + "-"+  valorc);

	// VALIDAMOS SI EL VALOR ES OTRO
	if(check_seleccion){
 		document.getElementById('otro_' + idc).style.height = "";
 		document.getElementById('otro_' + idc).style.width = "";
 		document.getElementById('otro_' + idc).style.overflow = "";
 		document.getElementById('otro_' + idc).style.display = "table-cell";
	}else{
 		document.getElementById('otro_' + idc).style.height = "1px";
 		document.getElementById('otro_' + idc).style.width = "1px";
 		document.getElementById('otro_' + idc).style.overflow = "hidden";
 		document.getElementById('otro_' + idc).style.display = "none";
	}
	
}

