function enviar_contacto(){
	
		if (document.getElementById('contacto').raz_soc.value == "") {
			alert("Por favor ingrese su nombre.");
			document.getElementById('contacto').raz_soc.focus();
			return;
		}
		if (document.getElementById('contacto').mail.value == "" && document.getElementById('contacto').tel.value==""){
			alert("Debe ingresar un teléfono o email de contacto.");
			document.getElementById('contacto').mail.focus();
			return;
		}else{
			if(!(document.getElementById('contacto').mail.value=="")){
				if (!((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('contacto').mail.value)))){
					alert("Ha ingresado una dirección de correo electrónico no válida.");
					document.getElementById('contacto').mail.focus();
					return;
				}
			}
		}

	document.getElementById('contacto').submit();
}




function enviar_tasacion(){
	
		if (document.getElementById('contacto').raz_soc.value == "") {
			alert("Por favor ingrese su nombre.");
			document.getElementById('contacto').raz_soc.focus();
			return;
		}
		if (document.getElementById('contacto').mail.value == "" && document.getElementById('contacto').tel.value==""){
			alert("Debe ingresar un teléfono o email de contacto.");
			document.getElementById('contacto').mail.focus();
			return;
		}else{
			if(!(document.getElementById('contacto').mail.value=="")){
				if (!((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('contacto').mail.value)))){
					alert("Ha ingresado una dirección de correo electrónico no válida.");
					document.getElementById('contacto').mail.focus();
					return;
				}
			}
		}

	document.getElementById('contacto').condicion.value=document.getElementById('contacto').con_id[document.getElementById('contacto').con_id.selectedIndex].text;

	document.getElementById('contacto').tipo.value=document.getElementById('contacto').tip_id[document.getElementById('contacto').tip_id.selectedIndex].text;

		
	document.getElementById('contacto').submit();
}


function enviar_buscar(){
	document.getElementById('buscar').submit()
}


function enviar_buscar2(){
	document.getElementById('buscar2').submit()
}

function enviar_buscar3(){
	document.getElementById('buscar3').submit()
}

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

	function checkEnter(event,form)	{ 	
	var code = 0;
	if (isNS4)
		code = event.which;
	else
		code = event.keyCode;
	if (code==13)
		document.getElementById(form).submit();
		//eval('document.'+form).submit();
	}

	function abrir(prp_id,usr,usuario){
		window.open("imprimir_ficha.php?usr_id="+usr+"&prp_id="+prp_id+"&usuario="+usuario,"vent","toolsbar=0,width=600,height=600,scrollbars=0");
	}
	function ampliar_foto(dir,foto){
		window.open("inc/ampliar.php?dir="+dir+"&foto="+foto+"","Foto_Ampliada","toolsbar=0,width=700,height=500,scrollbars=0");
	}
	function abrir_ventana(url){
		window.open(url,"vent","toolsbar=0,width=600,height=600,scrollbars=1");
	}

function cambiar_foto(nro_foto,fo_desc,src){
	var nro,nro_desc,celda_actual,src;
	ob_foto=document.getElementById('foto_ppal');
	ob_input=document.getElementById('fo_desc_ppal');
	ob_foto.src=src;
	ob_input.value=fo_desc;
}

