// JavaScript Document

	function borrarNombre(){ 
		if(document.form1.nombre.value=='Tu Nombre'){
			document.form1.nombre.value="";//aqui
			}
			window.document.getElementById('lname').style.display ="";
//			lname.style.display="";
		}
	function resetNombre(){
//		lname.style.display="none";
		window.document.getElementById('lname').style.display ="none";
		if (document.form1.nombre.value.length==0){
			document.form1.nombre.value="Tu Nombre"; 
			status0=false;
			} 
		else{status0=true;}
		}
	
	function borrarMail(){ 
		if(document.form1.remitente.value=='Tu e-mail'){
			document.form1.remitente.value=""; 
			}
		window.document.getElementById('lmail').style.display ="";
		window.document.getElementById('lmail1').style.display ="none";
//		lmail.style.display="";
//		lmail1.style.display="none";
		}
	function resetMail(){
//		lmail.style.display="none";
		window.document.getElementById('lmail').style.display ="none";
		if (document.form1.remitente.value.length==0){document.form1.remitente.value="Tu e-mail"; } 
		else{ validarEmail(document.form1.remitente.value);}
		}

	function validarEmail(valor) {aroba=false;punto=false;
		if(valor.length>=6){
			for(i=0; i<=valor.length-1 && !aroba; i++){
				aroba = (valor.charAt(i)=='@') ? true : false;
				punto = (valor.charAt(i)=='.') ? true : false;
				}
			for(i=0; i<=valor.length-1 && !punto; i++){
				punto = (valor.charAt(i)=='.') ? true : false;
				}
			if(aroba && punto){status1=true;}
			else{ 
				window.document.getElementById('lmail1').style.display ="";
				//lmail1.style.display=""; 
				status1=false;}
			}//end if
		else{
			//lmail1.style.display="";
			window.document.getElementById('lmail1').style.display ="";
			status1=false;}
		return status1;
			}
	
	function validar(){
		revisar0 = (document.form1.nombre.value!="Tu Nombre") ? true : false;
		revisar1 = validarEmail(document.form1.remitente.value) ? true : false;
		window.document.getElementById('lmail1').style.display ="none";
//		lmail1.style.display="none";
		if(revisar0 && revisar1){document.form1.submit(); }
		else if(!revisar0){
			alert("Debes ingresar un nombre");
			document.form1.nombre.focus();
			}
		else if(!revisar1){
			alert("Debes ingresar una e-mail válido");
			document.form1.remitente.focus();
			}
		}
