function MM_swapImgRestore()
{
	var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}

function MM_preloadImages()
{
	var d=document;
	if(d.images)
	{
		if(!d.MM_p)
			d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0)
			{
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
	}
}

function MM_findObj(n, d)
{
	var p,i,x;
	if(!d)
		d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length)
	{
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all)
		x=d.all[n];
	for (i=0;!x&&i<d.forms.length;i++)
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
		x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById)
		x=document.getElementById(n);
	return x;
}

function MM_swapImage()
{
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null)
		{
			document.MM_sr[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];
		}
}

function MM_openBrWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function Right(str, n)
{
	if (n <= 0)
		return "";
	else if (n > String(str).length)
		return str;
	else
	{
		var iLen = String(str).length;
		return String(str).substring(iLen, iLen - n);
	}
}

function fechaValida()
{
	D = new Date(document.Datos.anio.value,document.Datos.mes.value - 1,document.Datos.dia.value);
	if ((D.getDate() == document.Datos.dia.value) && (D.getMonth() == document.Datos.mes.value - 1))
		return true;
	else
		return false;
}

function verMas()
{
	document.getElementById('leerMasLink').innerHTML = "";
	document.getElementById('leerMasText').innerHTML = "<br>Ante la política generalizada de bloqueo de correos electrónicos solicitados dispuesta por la empresa CANTV.NET nos vemos obligados a solicitarle a nuestros usuarios de Venezuela que se registren a nuestro website a través de otras direcciones pertenecientes a otros proveedores.";
}

function enviar()
{
	s = '';
	if (document.Datos.nombre.value == '')
	{
		s += ' - Ingrese su nombre\r\n';
	}
	if (document.Datos.apellido.value == '')
	{
		s += ' - Ingrese su apellido\r\n';
	}
	if (document.Datos.email.value == '')
	{
		s += ' - Ingrese su email\r\n';
	}
	else if (!validarEmail(document.Datos.email.value))
	{
		s += ' - Ingrese un email valido\r\n';
	}
	if (!fechaValida())
	{
		s += ' - La fecha no es correcta\r\n';
	}
	if (document.Datos.pais.value == '')
	{
		s += ' - Ingrese su país\r\n';
	}
	if (document.Datos.provincia.value == '')
	{
		s += ' - Ingrese su Provincia\r\n';
	}
	if (document.Datos.referencia.value == '')
	{
		s += ' - Ingrese como nos conoció\r\n';
	}
	if (document.Datos.EnglishLevel.value == '')
	{
		s += ' - Ingrese su nivel de ingles\r\n';
	}
	if (document.Datos.tel.value == '')
	{
		s += ' - Ingrese su teléfono\r\n';
	}
	if (document.Datos.profesion.value == '')
	{
		s += ' - Ingrese su profesión\r\n';
	}
	/*if (document.Datos.especializacion.value == '')
	{
		s += ' - Ingrese la especialización de su profesión\r\n';
	}*/
	if (document.Datos.consulta.value == '')
	{
		s += ' - Ingrese su consulta\r\n';
	}
	if ("@cantv.net"==Right(document.Datos.email.value,10))
	{
		s += ' - Por favor escoja una dirección de email que no pertenezca al dominio cantv.net.\r\n';
	}
	if (s=='')
	{
		document.Datos.submit();
	}
	else
	{
		alert('No se puede registrar porque:\r\n' + s);
	}
}

function validarEmail(valor)
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor))
	{
		return true;
	}
	else
	{
		return false;
	}
}

var cadena = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-.@";
var cadena2 = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var cadena3 = "1234567890-().+";

function Valido(Caja)
{
	for(var i=0;i<Caja.value.length ; i++ )
	{
		if (cadena.indexOf(Caja.value.charAt(i))==-1)
		{
			alert("Caracter no permitido : " + Caja.value.charAt(i));
			Caja.value = Caja.value.substring(0,i); 
			return false;
		}
	}
	return true;
}

function Valido2(Caja)
{
	for(var i=0;i<Caja.value.length ; i++ )
	{
		if (cadena2.indexOf(Caja.value.charAt(i))==-1)
		{
			alert("Caracter no permitido : " + Caja.value.charAt(i));
			Caja.value = Caja.value.substring(0,i); 
			return false;
		}
	}
	return true;
}

function Valido3(Caja)
{
	for(var i=0;i<Caja.value.length; i++ )
	{
		if (cadena2.indexOf(Caja.value.charAt(i))!=-1)
		{
			alert("Caracter no permitido : " + Caja.value.charAt(i));
			Caja.value = Caja.value.substring(0,i); 
			return false;
		}
	}
	return true;
}

function MM_jumpMenu(targ,selObj,restore)
{
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore)
		selObj.selectedIndex=0;
}


