<html>
<head>
<style type="text/css">
body{background-color:#FFE4E1;}
input{width:150px;background-color:#000000;color:'silver';}
.1{background-color:#FFC0CB;width:200px;color:'black';}
p{font-family:"Times New Roman";font-weight:bold;}
#datos{position:absolute;top:200px;left:300px;}
#menu{position:absolute;top:150px;left:100px;}
</style>
<script language="javascript">
function fsobre(objeto){
objeto.style.color="FUCHSIA";
}
function ffuera(objeto){
objeto.style.color="white";
}
function fcomprueba(){
var ok='s';
var banderanom=0;
var banderaape=0;
var banderatele=0;
var banderaemail=0;
var contarroba=0;
if(document.getElementById('nombre').value==""){
document.getElementById('errornom').style.visibility='visible';
ok='n';
}
else{
document.getElementById('errornom').style.visibility='hidden';
for(var i=0;i<document.getElementById('nombre').length;i++){
if(!letrasV(document.getElementById('nombre').charAt(i))){banderanom=1;}
}
}
if(document.getElementById('apellidos').value==""){
document.getElementById('errorape').style.visibility='visible';
ok='n';
}
else{
document.getElementById('errorape').style.visibility='hidden';
for(var i=0;i<document.getElementById('apellidos').length;i++){
if(!letrasV(document.getElementById('apellidos').charAt(i))){banderaape=1;}
}
}
if(document.getElementById('telefono').value==""){
document.getElementById('errortele').style.visibility='visible';
ok='n';
}
else{
document.getElementById('errortele').style.visibility='hidden';
for(var i=0;i<document.getElementById('telefono').length;i++){
if(!numerosV(document.getElementById('telefono').charAt(i))){banderatele=1;}
}
}
if(document.getElementById('correo').value==""){
document.getElementById('errorcorreo').style.visibility="visible";
ok='n';
}
else{
document.getElementById('errorcorreo').style.visibility="hidden";
for(var i=0;i<document.getElementById('correo').length;i++){
var letra=document.getElementById('correo').charAt(i);
switch(letra){
case '@': contarroba++;if(contarroba>1){ banderaemail=1;} break;
case '.': var cadena2=document.getElementById('correo').substring(i+1,document.getElementById('correo').length);
if(cadena2.length>3){banderaemail=1;}
for(var j=0;j<cadena2.length;j++){
alert(cadena2);
if(!letrasV(cadena2.charAt(j))){banderaemail=1;}}
break;
case ' ':banderaemail=1;break;
}
}
}
if(banderaemail!=0){alert("correo no valido");}
if(banderanom!=0){alert("Nombre escrito erroneamente");}
if(banderaape!=0){alert("Apellido escrito erroneamente");}
if(banderatele!=0){alert("Telefono no valido");}
if((ok=='s'&&banderaemail==0)&&(banderanom==0&&banderaape==0)){
document.f.submit();
}
}
function letrasV(c){
var letras=' abcdefghijklmnopqrstuvwxyzáéíóúABCDEFGHIJKLMNOPQRSTUVWXYZ';
return (letras.indexOf(c)>=0);
}
function numerosV(c){
var numeros='0123456789 -';
return (numeros.indexOf(c)>=0);
}
function emailV(c){
var email='@.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
return (email.indexOf(c)>=0);
}
</script>
</head>
<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="1240px" height="110px">
<param name="movie" value="eslogan2.swf" />
<param name="quality" value="high" />
<embed src="eslogan2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="32px" height="32px"></embed>
</object>
<div id=menu>
<table border=0>
<tr><td><form action='index.html'><input type='submit'value="Inicio" onmouseover="fsobre(this)" onmouseout="ffuera(this)"></form></td></tr><tr><td><form action='registro.html'><input type=submit name=y value=" Registrarse " onmouseover="fsobre(this)" onmouseout="ffuera(this)"></form></td></tr><tr><td><form action="servicios.html"><input type="submit" value="Servicios ofrecidos" onmouseover="fsobre(this)" onmouseout="ffuera(this)"></td></tr></table>
</div>
<div id=datos>
<table border=0 align=center>
<form action="registro2.php" name='f' id='f' method="POST">
<tr><td><p>Nombre:</p></td><td><input type=text class="1" name=nombre id=nombre></td><td><label id=errornom style="visibility=hidden">Por favor ntroduce un nombre</label></td></tr>
<tr><td><p>Apellidos:</p></td><td><input type=text class="1" name=apellidos id=apellidos></td><td><label id=errorape style="visibility=hidden">Por favor ntroduce tus apellidos</label></td></tr>
<tr><td><p>Correo electronico:</p></td><td><input class="1" type=text name=correo id=correo></td><td><label id=errorcorreo style="visibility=hidden">Por favor Introduce direccion de email</label></td></tr>
<tr><td><p>Telefono:</p></td><td><input type=text class="1" name=telefono id=telefono></td><td><label id=errortele style="visibility=hidden">Por favor introduce un telefono de contacto</label></td></tr>
<tr><td><p>Movil:</p></td><td><input type=text class="1" name=movil id=movil></td></tr>
<tr><td align=center><input type="button" name=x value="Enviar" onmouseover="fsobre(this)" onmouseout="ffuera(this)" onclick="fcomprueba()"></td></tr>
</form>
</table>
</div>
</body>
</html>