function checkMail (texto) {
	patron = /^[a-zA-Z0-9\._]+@([a-zA-Z0-9])+([\.a-zA-Z])+$/;
	valida = patron.test(texto);
	if (valida) {
		return true;
	} else {
	 	return false;
	}
}

function checkLength(texto, min, max) {
	if(texto.length >= min && texto.length <= max) {
		return true;
	} else {
		return false;
	}
}
	
function checkString (texto) {
	patron = /^[a-zA-Záéíóúàèìòùñ:\s\\]+$/;
	valida = patron.test(texto);
	if (valida) {
		return true;
	} else {
	 	return false;
	}
}

function checkNumero (texto) {
	patron = /^[\-0-9]+$/;
	valida = patron.test(texto);
	if (valida) {
		return true;
	} else {
	 	return false;
	}
}

function checkTelefono(texto) {
	patron = /^[\-0-9\s\.()\-*]+$/;
	valida = patron.test(texto);
	if (valida) {
		return true;
	} else {
	 	return false;
	}
}

function checkHora (texto) {
	patron = /^[0-9]{4}/;
	valida = patron.test(texto);

	if (valida) {
		return true;
	} else {
	 	return false;
	}
}

function checkCompleto (texto) {
	patron = /^[0-9a-zA-Zº\-:áéíóúàèìòùñ\s\,\.\(\)\?\¿\\\/!]+$/;
	valida = patron.test(texto);
	if (valida) {
		return true;
	} else {
	 	return false;
	}
}

function writeYouTubeObject(destElement, videoID, width, height) {
	document.getElementById(destElement).innerHTML = "<object width=\"" + width + "\" height=\"" + height + "\"><param name=\"movie\" value=\"http://www.youtube.com/v/" + videoID + "&hl=es&fs=1&\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/" + videoID + "&hl=es&fs=1&\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"" + width + "\" height=\"" + height + "\"></embed></object>";
}

function popUp (pagina,ancho,alto ) {
    window.open(pagina,"detalle","toolbar=no,status=no,directories=no,menubar=no,scrollbars=no,resizable=yes,width="+ancho+",height="+alto);    
}


