// JavaScript Document
function isMail(texto)
	{ 
	var mailres = true;             
	var cadena = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ1234567890@._-"; 
	 
	var arroba = texto.indexOf("@",0); 
	if ((texto.lastIndexOf("@")) != arroba) arroba = -1; 
	 
	var punto = texto.lastIndexOf("."); 
				 
	for (var contador = 0 ; contador < texto.length ; contador++)
		{ 
		if (cadena.indexOf(texto.substr(contador, 1),0) == -1)
			{ 
			mailres = false; 
			break; 
		 	} 
		} 	
	if ((arroba > 1) && (arroba + 1 < punto) && (punto + 2 < (texto.length)) && (mailres == true) && (texto.indexOf("..",0) == -1)) 
		 mailres = true; 
	else 
		 mailres = false; 
	return mailres; 
	} 
function validateContent()
	{	
	var email = document.frmCustom.email.value;
	var name = document.frmCustom.name.value;
	var phone = document.frmCustom.phone.value;
	var sw=true;
	document.getElementById('divname').innerHTML = '';
	document.getElementById('divemail').innerHTML = '';
	document.getElementById('divphone').innerHTML = '';

	if (name=="")
		{
		document.getElementById('divname').innerHTML='Name required!';
		sw=false;
		}
	if (email=="")
		{
		document.getElementById('divemail').innerHTML = 'Email required!';
		sw=false;
		}
	else
		{
		if (!isMail(email))
			{
			document.getElementById('divemail').innerHTML = 'Incorrect Email!';
			sw=false;
			}
		}
		/*
	if (phone=="")
		{
		document.getElementById('divphone').innerHTML ='Phone required!';
		sw=false;
		}
		*/
	return sw;
	}