function fotoslogin(f) { 

	if(f.foto.value == "" ){
	alert("Agrega una foto");
	f.foto.focus(); 
	// if the browser is Netscape 6 or IE
	if(document.all || document.getElementByID){
	// change the color of text field
	f.foto.style.background = "yellow";
	}
	// make sure the form is not submitted
	return false;
	}
	
	var imagen = f.foto.value.split(".");
	var t=imagen.length-1;
	if (imagen[t].toUpperCase() != "JPG"){
	alert("El formato de la foto debe ser JPG");
	f.foto.focus(); 
	// if the browser is Netscape 6 or IE
	if(document.all || document.getElementByID){
	// change the color of text field
	f.foto.style.background = "yellow";
	}
	// make sure the form is not submitted
	return false;
	}
}


function comment(f) { 
var temp = f.text.value;
//document.write(temp + '<br>');
temp =  temp.replace(/[^a-zA-Z 0-9 ?¿,+)(*:;.ÁÉÍÓÚáéíóúñÑ]+/g,'');
f.text.value=temp;
}

function compa(f) { 
var temp = f;
//document.write(temp + '<br>');
temp =  temp.replace(/[^a-zA-Z 0-9 ÁÉÍÓÚáéíóúñÑ]+/g,'');
return temp;
}

function handler()
{
	if (form.text.value.length>120){
		form.text.value=form.text.value.substring(0,(form.text.value.length-1));		
	}
  form.contar.value=form.text.value.length;
}

function valog(f)
{
	if(!check_email(f.email.value)){
	alert("Email Incorrecto.");
	f.email.focus(); 
	// if the browser is Netscape 6 or IE
	if(document.all || document.getElementByID){
	// change the color of text field
	f.email.style.background = "yellow";
	}
	// make sure the form is not submitted
	return false;
	}
	if(f.codigo.value==""){
	alert("Tipea la contraseña");
	f.codigo.focus(); 
	// if the browser is Netscape 6 or IE
	if(document.all || document.getElementByID){
	// change the color of text field
	f.codigo.style.background = "yellow";
	}
	// make sure the form is not submitted
	return false;
	}	
	
}


function contra(f){

	if(f.opass.value == "" ){
		alert("Debes tipear la contrasena actual");
		f.opass.focus(); 
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
		// change the color of text field
			f.opass.style.background = "yellow";
		}
		// make sure the form is not submitted
		return false;
	}
	
	if(f.npass.value == "" ){
		alert("Debes tipear la contrasena nueva");
		f.npass.focus(); 
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
		// change the color of text field
			f.npass.style.background = "yellow";
		}
		// make sure the form is not submitted
		return false;
	}
	
	if(f.npass2.value == "" ){
		alert("Debes volver a tipear la contrasena nueva");
		f.npass2.focus(); 
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
		// change the color of text field
			f.npass2.style.background = "yellow";
		}
		// make sure the form is not submitted
		return false;
	}
	
	if(f.npass2.value != f.npass.value ){
		alert("Las contrasenas no coinciden");
		f.npass.focus(); 
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
		// change the color of text field
			f.npass.style.background = "red";
			f.npass2.style.background = "red";
		}
		// make sure the form is not submitted
		return false;
	}
}	