
function vfrm_ingreso(){
	if ((document.frm_ingreso.email.value == "") || (document.frm_ingreso.contrasena.value == "")){
		alert("Favor introducir los campos requeridos.");
		return false;
	}
	return true;
}

function vfrm_asociacion(){
	if (document.frm_asociacion.id_asociacion.value == ""){
		alert("Favor seleccione la asociación y luego presionar el botón de agregar.");
		return false;	
	}
	return true;
}

function vfrm_dependientes(){
		if ((document.frm_dependientes.pri_nombre.value == "") || (document.frm_dependientes.pri_apellido.value == "") || (document.frm_dependientes.parentesco.value == "")){
		alert("Field required fields.");
		return false;	
	}
	return true;
}

function vfrm_activar(tsoc){
	var t = tsoc;
	if (tsoc == 'd'){
		document.frm_datosocios.qt_ec_email.disabled = true;
		document.frm_datosocios.ec_email.disabled = true;
	}
	if (tsoc == 'p'){
		document.frm_datosocios.qt_ec_email.disabled = false;
		document.frm_datosocios.ec_email.disabled = false;
	}
}

function vfrm_datosocios(){
	if ((document.frm_datosocios.pri_nombre.value == "") || (document.frm_datosocios.pri_apellido.value == "") || (document.frm_datosocios.id_socio.value == "") || (document.frm_datosocios.fecha_cumpleano.value == "") || (document.frm_datosocios.tel_casa.value == "")){
		alert("Field required fields.");
		return false;	
	}
	return true;
}

function display_col(d) 
	{
	var obj = document.getElementById(d);
		if (obj.style.display == 'none') 
		{
			obj.style.display = '';
		}
		else 
		{
			obj.style.display = 'none';
		}
	}

function display_col2(d) 
	{
	var obj = document.all(d);
	obj.style.display = 'none';
}

function display_col3(d) 
	{
	var obj = document.all(d);
	obj.style.display = 'none';
}
	
function display_fpago() {
	var d = document.mpago.id_fpago.value;
	
	if (d != ""){
		//alert('fpago' + d);
		var obj = document.all('fpago' + d);
		var obj1 = document.all('fpago1');
		var obj2 = document.all('fpago2');
		var obj3 = document.all('fpago3');
		if (d == 0){
			obj1.style.display = 'none'
			obj2.style.display = 'none';
			obj3.style.display = 'none';
		}
		if (d == 1){			
			obj.style.display = ''
			obj2.style.display = 'none';
			obj3.style.display = 'none';
		}
		if (d == 2){
			obj.style.display = ''
			obj1.style.display = 'none';
			obj3.style.display = 'none';
		}
		if (d == 3){
			obj.style.display = ''
			obj1.style.display = 'none';
			obj2.style.display = 'none';
		}
	}
}

	
function vfrm_contrasena(){
	if ((document.frm_contrasena.contrasena.value == "") || (document.frm_contrasena.rcontrasena.value == "")){
		alert('Debe llenar ambos campos para actualizar la contraseña.')
		return false;
	}
	
	if  (document.frm_contrasena.contrasena.value != document.frm_contrasena.rcontrasena.value) {
		alert('Por favor revisar la contraseña, los valores de los campos no son iguales.')
		return false;
	}
	return true;
}

function vfrm_creausuario(){
	if ((document.frm_creausuario.nombre.value == "") || (document.frm_creausuario.apellido.value == "") || (document.frm_creausuario.contrasena.value == "") || (document.frm_creausuario.rcontrasena.value == "") || (document.frm_creausuario.email.value == "") || (document.frm_creausuario.telefono.value == "")){
		alert("Por favor llenar los campos requeridos.");
		return false;
	}
	if  (document.frm_creausuario.contrasena.value != document.frm_creausuario.rcontrasena.value) {
		alert('Por favor revisar la contraseña, los valores de los campos no son iguales.')
		return false;
	}
	return true;
}

function del_usuario(id_user){
	if (confirm("¿ Desea eliminar este usuario ?")) {
		document.location.href = "usuarios.asp?modo=del&id_user=" + id_user
	}
}

function del_project(id_pro){
	if (confirm("¿ It wishes to eliminate the project ?")) {
		document.location.href = "projects.asp?modo=del&id_pro=" + id_pro
	}
}

function del_form(id_scart, id_det_scart, id_ficha, id_dficha, id_reg){
	if (confirm("¿ Desea eliminar el formulario ?")) {
		document.location.href = "formulario_pago.asp?action=del&id_scart=" + id_scart + "&id_det_scart=" + id_det_scart + "&id_ficha=" + id_ficha + "&id_dficha=" + id_dficha + "&id_reg=" + id_reg
	}
}

function del_inform(id_scart, id_det_scart, id_ficha, id_dficha, id_reg){
	if (confirm("¿ Desea eliminar el formulario ?")) {
		document.location.href = "formulario_pago.asp?action=delin&id_scart=" + id_scart + "&id_det_scart=" + id_det_scart + "&id_ficha=" + id_ficha + "&id_dficha=" + id_dficha + "&id_reg=" + id_reg
	}
}

function del_ccform(id_scart, id_det_scart, id_ficha, id_dficha, id_reg){
	if (confirm("¿ Desea eliminar el formulario ?")) {
		document.location.href = "formulario_pago.asp?action=delcc&id_scart=" + id_scart + "&id_det_scart=" + id_det_scart + "&id_ficha=" + id_ficha + "&id_dficha=" + id_dficha + "&id_reg=" + id_reg
	}
}

function del_unit(id_uni, id_pro){
	if (confirm("¿ It wishes to eliminate the section of the unit ?")) {
		document.location.href = "project_details.asp?action=del&id_uni=" + id_uni + "&id_pro=" + id_pro
	}
}

function del_client(id_uni, id_pro, id_cli){
	if (confirm("¿ It wishes to eliminate the client ?")) {
		document.location.href = "project_details.asp?action=delcli&id_uni=" + id_uni + "&id_pro=" + id_pro + "&id_cli=" + id_cli
	}
}

function vfrm_updperfil(){
	if ((document.frm_updperfil.nombre.value == "") || (document.frm_updperfil.apellido.value == "") || (document.frm_updperfil.email.value == "") || (document.frm_updperfil.telefono.value == "")){
		alert("Por favor llenar los campos requeridos.");
		return false;
	}
	return true;
}

		function numeros () {
				var evento_key = window.event.keyCode; 
				//alert(evento_key);
				if ((evento_key != 46) && ((evento_key < 48) || (evento_key > 57))){
						window.event.keyCode = 0; 
                		return false; 
						}
						return true;
		 }

function vfrm_addunit(){
	if ((document.frm_addunit.num_unit.value == "") || (document.frm_addunit.apartment.value == "")){
		alert('Field required fields.');
		return false;
	}
	return true;
}

function vfrm_addclient(){
	if ((document.frm_addclient.id_uni.value == "") || (document.frm_addclient.nombre.value == "") || (document.frm_addclient.apellido.value == "")){
		alert('Field required fields.');
		return false;
	}
	return true;
}

function vadd_project(){
	if ((document.add_project.project_name.value == "") || (document.add_project.locacion.value == "") || (document.add_project.unidades.value == "")){
		alert('Field required fields.');
		return false;
	}
	return true;
}

function vfrm_reports(){
	if ((document.frm_reports.id_pro.value == "") && (document.frm_reports.num_unit.value == "") && (document.frm_reports.sts_unit.value == "")){
		alert('Select a parameter search');
		return false
	}
	if (document.frm_reports.id_pro.value == ""){
		alert('Select a Project');
		return false
	}
	return true;
}

function vfrm_contacto(){
	if ((document.frm_contacto.id_pro.value == "") || (document.frm_contacto.num_unit.value == "") || (document.frm_contacto.precio.value == "") || (document.frm_contacto.snombre.value == "") || (document.frm_contacto.semail.value == "") || (document.frm_contacto.stelefono.value == "") || (document.frm_contacto.cnombre.value == "") || (document.frm_contacto.ctelefono.value == "")){
		alert('Field required fields.');
		return false;
	}
	return true;
}

function vmfpago1(){
	if (document.mfpago1.monto.value == ""){
		alert("Debe llenar los campos requeridos.")
		return false;
	}
	return true;
}

function vmfpago3(){
	if ((document.mfpago3.ncheque.value == "") || (document.mfpago3.monto.value == "") || (document.mfpago3.banco.value == "")){
		alert("Debe llenar los campos requeridos.")
		return false;
	}
	return true;	
}

function vmfpago2(){
	var d = document.mfpago2.tipo_tar.value;
	if (document.mfpago2.tipo_tar.value == ""){
			alert("Debe llenar los campos requeridos")
			return false;	
	}
	
	if (d == 3){
		if ((document.mfpago2.ae1.value == "") || (document.mfpago2.ae2.value == "") || (document.mfpago2.ae3.value == "")){
			alert("Debe llenar los campos requeridos")
			return false;
		}
	}
	else {
		if ((document.mfpago2.vm1.value == "") || (document.mfpago2.vm2.value == "") || (document.mfpago2.vm3.value == "") || (document.mfpago2.vm4.value == "")){
			alert("Debe llenar los campos requeridos")
			return false;
		}		
	}
	
	if (document.mfpago2.codseg.value == ""){
			alert("Debe llenar los campos requeridos")
			return false;	
	}	
	
	if (document.mfpago2.fv_mes.value == ""){
			alert("Debe llenar los campos requeridos")
			return false;	
	}	

	if (document.mfpago2.fv_anno.value == ""){
			alert("Debe llenar los campos requeridos")
			return false;	
	}

	if (document.mfpago2.titular.value == ""){
			alert("Debe llenar los campos requeridos")
			return false;	
	}
	
	if (document.mfpago2.banco.value == ""){
			alert("Debe llenar los campos requeridos")
			return false;	
	}
	
	return true;
}


function vfrm_upload(){
	if ((document.frm_upload.reg_tipo.value == "") || (document.frm_upload.ruta_file.value == "")){
		alert('Debe llenar los campos requeridos.');
		//display_col('upload');
		return false;
	}
	
	return true;
	
}


function vfrm_registro(){
	//alert(document.frm_registro.id_dficha.value);
	if (document.frm_registro.id_dficha.value == ""){
		alert('Debe seleccionar el nombre de la categoria.');
		return false;
	}
	return true;
}

function vfrm_registro_cocktail(){
	//alert(document.frm_registro.id_dficha.value);
	if ((document.frm_registro.id_dficha.value == "") || (document.frm_registro.nombre.value == "") || (document.frm_registro.compania.value == "") || (document.frm_registro.cargo.value == "") || (document.frm_registro.dir_fisica.value == "") || (document.frm_registro.ciudad.value == "") || (document.frm_registro.pais.value == "") || (document.frm_registro.telefono.value == "") || (document.frm_registro.email.value == ""))          {
		alert('Favor llenar los campos requeridos.');
		return false;
	}
	return true;
}

function vfrm_registro_conferencia(){
	//alert(document.frm_registro.id_dficha.value);
	if ((document.frm_registro.id_dficha.value == "") || (document.frm_registro.nombre.value == "") || (document.frm_registro.compania.value == "") || (document.frm_registro.cargo.value == "") || (document.frm_registro.dir_fisica.value == "") || (document.frm_registro.ciudad.value == "") || (document.frm_registro.pais.value == "") || (document.frm_registro.telefono.value == "") || (document.frm_registro.email.value == ""))          {
		alert('Favor llenar los campos requeridos.');
		return false;
	}
	return true;
}

function vfrm_registro_grafica(){
	//alert(document.frm_registro.id_dficha.value);
	if ((document.frm_registro.id_dficha.value == "") || (document.frm_registro.anunciante.value == "") || (document.frm_registro.producto.value == "") || (document.frm_registro.titulo.value == "") || (document.frm_registro.mes.value == "") || (document.frm_registro.anno.value == "") || (document.frm_registro.fec_inscripcion.value == "") || (document.frm_registro.pais_emision.value == "") || (document.frm_registro.idioma_orig.value == "") || (document.frm_registro.agencia.value == "") || (document.frm_registro.pais_agencia.value == "") || (document.frm_registro.dir_creativo.value == ""))          {
		alert('Favor llenar los campos requeridos.');
		return false;
	}
	//alert("");
	if (document.frm_registro.id_dficha.value == "20"){
		if ((document.frm_registro.nombre_pieza1.value == "") && (document.frm_registro.nombre_pieza2.value == "") && (document.frm_registro.nombre_pieza3.value == "")){
			alert('Favor llenar los campos requeridos, por lo menos un nombre de pieza.');
			return false;
		}
	}

				check = frm_registro.tamano;				
				selected = false 
				x=0;
				while (!selected && (x < check.length)) {
				
				if (check[x].checked) {
					selected = true;
				}
				x++;
				}				
				if (!selected) {
					alert ("Favor llenar los campos requeridos.");
					return false;
				}

				check = frm_registro.anuncio;				
				selected = false 
				x=0;
				while (!selected && (x < check.length)) {
				
				if (check[x].checked) {
					selected = true;
				}
				x++;
				}				
				if (!selected) {
					alert ("Favor llenar los campos requeridos.");
					return false;
				}
				
				check = frm_registro.medio;				
				selected = false 
				x=0;
				while (!selected && (x < check.length)) {
				
				if (check[x].checked) {
					selected = true;
				}
				x++;
				}				
				if (!selected) {
					alert ("Favor llenar los campos requeridos.");
					return false;
				}				
	
	return true;
}

function vfrm_registro_internet(){
	//alert(document.frm_registro.id_dficha.value);
	if ((document.frm_registro.id_dficha.value == "") || (document.frm_registro.nombre_empresa.value == "") || (document.frm_registro.tipo_empresa.value == "") || (document.frm_registro.direccion_empresa.value == "") || (document.frm_registro.ciudad_empresa.value == "") || (document.frm_registro.pais_empresa.value == "") || (document.frm_registro.telefono_empresa.value == "") || (document.frm_registro.email_empresa.value == ""))          {
		alert('Favor llenar los campos requeridos.');
		return false;
	}
	return true;
}

function vfrm_registro_medios(){
	//alert(document.frm_registro.id_dficha.value);
	if ((document.frm_registro.id_dficha.value == "") || (document.frm_registro.anunciante.value == "") || (document.frm_registro.producto.value == "") || (document.frm_registro.titulo.value == "") || (document.frm_registro.tamano.value == "") || (document.frm_registro.mes.value == "") || (document.frm_registro.anno.value == "") || (document.frm_registro.fec_inscripcion.value == "") || (document.frm_registro.pais_emision.value == "") || (document.frm_registro.agencia.value == "") || (document.frm_registro.pais_agencia.value == "") || (document.frm_registro.dir_creativo.value == ""))          {
		alert('Favor llenar los campos requeridos.');
		return false;
	}
	
	if (document.frm_registro.id_dficha.value == "1"){
		if ((document.frm_registro.nombre_pieza1.value == "") && (document.frm_registro.nombre_pieza2.value == "") && (document.frm_registro.nombre_pieza3.value == "")){
			alert('Favor llenar los campos requeridos, por lo menos un nombre de pieza.');
			return false;
		}
	}
	
	return true;
}

function vfrm_registro_publicidad_exterior(){
	//alert(document.frm_registro.id_dficha.value);
	if ((document.frm_registro.id_dficha.value == "") || (document.frm_registro.anunciante.value == "") || (document.frm_registro.producto.value == "") || (document.frm_registro.titulo.value == "") || (document.frm_registro.tamano.value == "") || (document.frm_registro.especificaciones.value == "") || (document.frm_registro.mes.value == "") || (document.frm_registro.anno.value == "") || (document.frm_registro.fec_inscripcion.value == "") || (document.frm_registro.pais_emision.value == "") || (document.frm_registro.agencia.value == "") || (document.frm_registro.pais_agencia.value == "") || (document.frm_registro.dir_creativo.value == "") || (document.frm_registro.redactor.value == "") || (document.frm_registro.productor.value == "") || (document.frm_registro.dir_arte.value == "") || (document.frm_registro.casa_prod.value == "") || (document.frm_registro.otros_cred.value == ""))          {
		alert('Favor llenar los campos requeridos.');
		return false;
	}
	
	if (document.frm_registro.id_dficha.value == "1"){
		if ((document.frm_registro.nombre_pieza1.value == "") && (document.frm_registro.nombre_pieza2.value == "") && (document.frm_registro.nombre_pieza3.value == "")){
			alert('Favor llenar los campos requeridos, por lo menos un nombre de pieza.');
			return false;
		}
	}
	
	return true;
}

function vfrm_registro_radio(){
	//alert(document.frm_registro.id_dficha.value);
	if ((document.frm_registro.id_dficha.value == "") || (document.frm_registro.anunciante.value == "") || (document.frm_registro.producto.value == "") || (document.frm_registro.titulo.value == "") || (document.frm_registro.duracion.value == "") || (document.frm_registro.mes.value == "") || (document.frm_registro.anno.value == "") || (document.frm_registro.fec_inscripcion.value == "") || (document.frm_registro.pais_emision.value == "") || (document.frm_registro.idioma_orig.value == "") || (document.frm_registro.agencia.value == "") || (document.frm_registro.pais_agencia.value == "") || (document.frm_registro.dir_creativo.value == ""))          {
		alert('Favor llenar los campos requeridos.');
		return false;
	}
	
	if (document.frm_registro.id_dficha.value == "20"){
		if ((document.frm_registro.nombre_pieza1.value == "") && (document.frm_registro.nombre_pieza2.value == "") && (document.frm_registro.nombre_pieza3.value == "")){
			alert('Favor llenar los campos requeridos, por lo menos un nombre de pieza.');
			return false;
		}
	}
	
	return true;
}

function vfrm_registro_television(){
	//alert(document.frm_registro.id_dficha.value);
	if ((document.frm_registro.id_dficha.value == "") || (document.frm_registro.anunciante.value == "") || (document.frm_registro.producto.value == "") || (document.frm_registro.titulo.value == "") || (document.frm_registro.duracion.value == "") || (document.frm_registro.mes.value == "") || (document.frm_registro.anno.value == "") || (document.frm_registro.fec_inscripcion.value == "") || (document.frm_registro.pais_emision.value == "") || (document.frm_registro.idioma_orig.value == "") || (document.frm_registro.idioma_trad.value == "") || (document.frm_registro.agencia.value == "") || (document.frm_registro.pais_agencia.value == "") || (document.frm_registro.dir_creativo.value == ""))          {
		alert('Favor llenar los campos requeridos.');
		return false;
	}
	
	if (document.frm_registro.id_dficha.value == "20"){
		if ((document.frm_registro.nombre_pieza1.value == "") && (document.frm_registro.nombre_pieza2.value == "") && (document.frm_registro.nombre_pieza3.value == "")){
			alert('Favor llenar los campos requeridos, por lo menos un nombre de pieza.');
			return false;
		}
	}
	return true;
}