/*	function popup_detalles(objeto, id)
	{
		window.open("popup_detalles.php?objeto=" + objeto + "&id=" + id, "Detalles", "width=700, height=800, scrollbars=YES, resizable=NO, directories=NO, location=NO, menubar=NO, status=YES, titlebar=YES, toolbar=NO");
	}*/
	function popup(url_destino, id_objeto, tipo_objeto)
	{
		dia = new Date();
		nombre = dia.getTime();
		nombre = "Detalles";
		window.open(url_destino + "?id=" + id_objeto + "&tipo=" + tipo_objeto, nombre, "width=700, height=800, scrollbars=YES, resizable=NO, directories=NO, location=NO, menubar=NO, status=YES, titlebar=YES, toolbar=NO");
	}

	function selecciones(destino, opcion_var, opcion_val, nombre)
	{
		destino += "?" + opcion_var + "=" + opcion_val;
		window.open(destino, nombre, "width=700, height=500, scrollbars=YES, resizable=NO, directories=NO, location=NO, menubar=NO, status=YES, titlebar=YES, toolbar=NO");
	}
	
/*	function popup(opt, acc, subacc, estado, id, nombre)
	{
		dia = new Date();
		nombre = dia.getTime();
		if (opt == "empresa")
		{
			window.open("popup.php?opt=" + opt + "&acc=" + acc + "&subacc=" + subacc + "&id=" + id + "&estado=" + estado, nombre, "width=850, height=1000, scrollbars=YES, resizable=NO, directories=NO, location=NO, menubar=NO, status=YES, titlebar=YES, toolbar=NO");
		}
		else
		{
			window.open("popup.php?opt=" + opt + "&acc=" + acc + "&subacc=" + subacc + "&id=" + id + "&estado=" + estado, nombre, "width=800, height=500, scrollbars=YES, resizable=NO, directories=NO, location=NO, menubar=NO, status=YES, titlebar=YES, toolbar=NO");
		}
	}
*//*	
	function Mover_Combo_a_Combo(origen, destino)
	{
		select_origen = document.getElementById(origen);
		indice = select_origen.selectedIndex;
		valor = select_origen.options[indice].value;
		texto = select_origen.options[indice].text;
		select_origen.options[indice] = null;
		select_destino = document.getElementById(destino);
		nueva_opcion = new Option(texto, valor);
		select_destino.options[select_destino.options.length] = nueva_opcion;
	}*/
	
	function Elminar_Opcion_Combo(origen)
	{
		select_origen = document.getElementById(origen);
		indice = select_origen.selectedIndex;
		select_origen.options[indice] = null;
	}
	
	function Agregar_Opcion_Combo(origen, destino)
	{
		valor = document.getElementById(origen).value;
		select_destino = document.getElementById(destino);
		nueva_opcion = new Option(valor, valor);
		select_destino.options[select_destino.options.length] = nueva_opcion;
		document.getElementById(origen).value = "";
	}
	
	function Aleatorio(destino)
	{
		dia = new Date();
		nombre = dia.getTime();
		document.getElementById(destino).value = nombre;
	}
	
	function ValidarForm(formulario)
	{
		var indice;
		if (formulario.name != "datosAcceso")
		{
			for (indice = 0; indice <= formulario.elements.length - 1; indice++)
			{
				formulario.elements[indice].style.backgroundColor = '#FFFFFF';
				if ((formulario.elements[indice].type === "text") || (formulario.elements[indice].type === "textarea"))
				{
					if ((formulario.elements[indice].className.indexOf('obligatorio') >= 0) && (formulario.elements[indice].value.length == 0))
					{
						alert("El campo marcado es obligatorio.\nRecuerde que los campos con borde rojo son obligatorios.");
						formulario.elements[indice].style.backgroundColor = '#FF9966';
						formulario.elements[indice].focus();
						return false;
					}
				}
			}
		}
		return true;
	}
	
	/* Validacion de Email */
	function validarEmail(valor)
	{
		var expresion = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
		if (expresion.test(valor))
		{
			return  true;
		}
		else
		{
			return false;
		}
	}
	
	/* Validacion de Telefono */
	function validarTelefono(valor)
	{
		var expresion = /(^[9|6]{1}[0-9]{8}$)/;
		if (expresion.test(valor))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	/* Validacion de numero entero */
	function validarEntero(valor)
	{
		//Compruebo si es un valor numérico 
		if (isNaN(valor))
		{
			return false;
		}
		else
		{
			return true;
		}
	}
