<!--
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit){
field.value = field.value.substring(0, maxlimit);
}
else 
countfield.value = maxlimit - field.value.length;
}

function putFocus(formInst, elementInst) {
  if (document.forms.length > 0) {
   document.forms[formInst].elements[elementInst].focus();
  }
 }

function validateContacta(){
var err;
err=0;{

if (document.FB.nombre.value=="") {
document.FB.unvalid.value = '* Por favor introduzca su Nombre';err=1;
putFocus('FB', 'nombre');
return false
}else document.FB.unvalid.value = '';

if  (document.FB.email.value.search("@") == -1 || document.FB.email.value.search("[.*]") == -1){
document.FB.unvalid.value = '* Por favor, introduzca su email';err=1;
putFocus('FB', 'email');
return false
}else document.FB.unvalid.value = '';

if (document.FB.comentario.value=="") {
document.FB.unvalid.value = '* Por favor introduzca su Comentario';err=1;
putFocus('FB', 'comentario');
return false
}else document.FB.unvalid.value = '';
}
}

function validateRegistro(){
var err;
err=0;{

if (document.FB.nombre.value=="") {
document.FB.unvalid.value = '* Por favor introduzca su Nombre';err=1;
putFocus('FB', 'nombre');
return false
}else document.FB.unvalid.value = '';

if (document.FB.empresa.value=="") {
document.FB.unvalid.value = '* Por favor introduzca su Empresa';err=1;
putFocus('FB', 'empresa');
return false
}else document.FB.unvalid.value = '';

if (document.FB.telefono.value=="") {
document.FB.unvalid.value = '* Por favor introduzca su Telefono';err=1;
putFocus('FB', 'telefono');
return false
}else document.FB.unvalid.value = '';

if  (document.FB.email.value.search("@") == -1 || document.FB.email.value.search("[.*]") == -1){
document.FB.unvalid.value = '* Por favor, introduzca su email';err=1;
putFocus('FB', 'email');
return false
}else document.FB.unvalid.value = '';

if (document.FB.contrasena.value=="") {
document.FB.unvalid.value = '* Por favor elija una contraseña';err=1;
putFocus('FB', 'contrasena');
return false
}else document.FB.unvalid.value = '';

if (document.FB.contrasena.value.length < 5) {
document.FB.unvalid.value = '* Su contraseña debe tener más de 5 caracteres';err=1;
putFocus('FB', 'contrasena');
return false
}else document.FB.unvalid.value = '';
}
}

function validateLogin(){

var err;
err=0;{
if  (document.FB.usuario.value.search("@") == -1 || document.FB.usuario.value.search("[.*]") == -1){
document.FB.unvalid.value = '* Por favor, introduzca su email';err=1;
putFocus('FB', 'usuario');
return false
}else document.FB.unvalid.value = '';

if (document.FB.contrasena.value=="") {
document.FB.unvalid.value = '* Por favor, introduzca CONTRASEÑA';err=1;
putFocus('FB', 'contrasena');
return false
}else document.FB.unvalid.value = '';

if (document.FB.contrasena.value.length < 5) {
document.FB.unvalid.value = '* Su PASSWORD debe tener más de 5 caracteres';err=1;
putFocus('FB', 'contrasena');
return false
}else document.FB.unvalid.value = '';
}
}

function validateOlvidocontrasena(){

var err;
err=0;{
if  (document.FB.usuario.value.search("@") == -1 || document.FB.usuario.value.search("[.*]") == -1){
document.FB.unvalid.value = '* Por favor, introduzca su email';err=1;
putFocus('FB', 'usuario');
return false
}else document.FB.unvalid.value = '';

}
}

//-->
