function render_contacto(){

	$0('c1'); $0('c2'); $1('c3'); 

        if (http_request.readyState== 4) {		

            if (http_request.status == 200) {

		$0('c1'); $1('c2'); $0('c3');

		setTimeout("$1('c1'); $0('c2');  $0('c3'); $('nombrec').value=''; $('apellidoc').value=''; $('emailc').value='';$('telefonoc').value=''; $('celularc').value='';$('paisc').value=''; $('comentariosc').value=''; $('paisc').selectedIndex='0';$('distritoc').selectedIndex='0';$('nompaisc').value='';$('tipcontc').selectedIndex='0';$('conocerc').selectedIndex='0';",2000);

		  } else {

                alert('Hubo problemas con el envio de la informaci\xf3n por favor vuelva a intentarlo.');

				setTimeout("$1('c1'); $0('c2');  $0('c3');",1000);

          }

       }

}

function validar_contacto()
{	
	if($(nombrec).value=="")
	{alert("Debe ingresar su nombre");	$(nombrec).focus(); return false;}
	else if($(apellidoc).value=="")
	{alert("Debe ingresar su apellido");	$(apellidoc).focus(); return false;}
	else if($(emailc).value=="")
	{alert("Debe ingresar su email");	$(emailc).focus(); return false;}
	else if($(paisc).value=="0")
	{alert("Debe marcar su pa\xeds");	$(paisc).focus(); return false;}
	else if($(paisc).value=="2" && $(nompaisc).value=="")
	{alert("Debe ingresar su pa\xeds");	$(nompaisc).focus(); return false;}
	else if($(tipcontc).value=="")
	{alert("Debe indicar el tipo de contacto");	$(tipcontc).focus(); return false;}
	else if($(conocerc).value=="")
	{alert("Debe indicar c\xf3mo nos conici\xf3");	$(conocerc).focus(); return false;}
	else if($(comentariosc).value=="")
	{alert("Debe ingresar un comentario");	$(comentariosc).focus(); return false;}
	else
	{return true;}
}


function press_contacto(tecla){

if (tecla == 13)  { enviar_contacto(); }

}

function dis()
{
	document.getElementById("dis").style.display="block";
	document.getElementById("dis").style.visibility = "visible";

}



function enviar_contacto(){

if(validar_contacto()){

pedir(remoto+'formularios/contacto_envio.php?email='+$(emailc).value+

'&nombre='+$(nombrec).value+

'&apellido='+$(apellidoc).value+

//'&ocupacion='+$(ocupacionc).value+

'&telefono='+$(telefonoc).value+

'&celular='+$(celularc).value+

'&pais='+$(paisc).value+

'&distrito='+$(distritoc).value+

'&nompais='+$(nompaisc).value+

'&tipcont='+$(tipcontc).value+

'&conocer='+$(conocerc).value+

'&mensaje='+$(comentariosc).value.split('\n').join('<br>')+

'&ajax=ran','render_contacto');

document.getElementById("dis").style.display='none';

document.getElementById("nompais").style.display='none';

} 

}