function mOvr(src)
{ 
  if (!src.contains(event.fromElement))
  { 
	src.style.cursor = 'hand';
	src.className = 'tdColorOver';
	//src.bgColor = clrOver; 
  } 
} 
		
function mOut(src,Menu)
{ 
  if (!src.contains(event.toElement))
  { 
	src.style.cursor = 'default';
	if (Menu == 1)
	{ 
      src.className = 'tdColorSelect';
    }
    else
    { 
      src.className = 'tdColorNormal';
    }
	//src.bgColor = clrIn; 
  } 
} 

function mClk3(src)
{ 
  if(event.srcElement.tagName=='TD')
	src.children.tags('A')[0].click();
}

function mClk2(src)
{ 
  if(event.srcElement.tagName=='TD')
	src.children.tags('A')[0].click();
}


//VALIDACIÓN DE FORMULARIO DE SUSCRIPCION

function ValidaFormulario(URL_SU)
{ 
  var theForm = document.frmSuscripcion; 

  if (theForm.Apellidos.value=="")
  {
    alert("Debes ingresar tus Apellidos");
    theForm.Apellidos.focus();
    return false;
  }
    
  if (theForm.Nombres.value=="")
  {
    alert("Debes ingresar tus Nombres");
    theForm.Nombres.focus();
    return false;
  }
  if (theForm.Email.value=="")
  {
    alert("Debes ingresar tu e-mail");
    theForm.eMail.focus();
    return false;
  }  
	
  var return_email = EmailCheck(theForm.Email.value);
  if (return_email == false){
	theForm.Email.focus();
	return false;	
  }

  theForm.method = "POST";
  theForm.action = URL_SU;
  theForm.submit();

}


function EmailCheck(emailStr) 
{
    if(emailStr!=""){
	emailPat=/^(.+)@(.+)$/
	specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	validChars="\[^\\s" + specialChars + "\]"
	quotedUser="(\"[^\"]*\")"
	ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	atom=validChars + '+'
	word="(" + atom + "|" + quotedUser + ")"
	userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	matchArray=emailStr.match(emailPat)
	if (matchArray==null) {
		alert("La dirección E-Mail no parece correcta")
		return false
	}
	user=matchArray[1]
	domain=matchArray[2]
	if (user.match(userPat)==null) {
	    alert("Falta Nombre de Usuario")
	    return false
	}
	IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
		  for (i=1;i<=4;i++) {
		    if (IPArray[i]>255) {
		        alert("Dirección IP no parece correcta")
			return false
		    }
	    }
	    return true
	}
	domainArray=domain.match(domainPat)
	if (domainArray==null) {
		alert("El Dominio no parece valido")
	    return false
	}
	atomPat=new RegExp(atom,"g")
	domArr=domain.match(atomPat)
	len=domArr.length
	if (domArr[domArr.length-1].length<2 || 
	    domArr[domArr.length-1].length>3) {
		alert("El Dominio no parece valido")
	   return false
	}
	if (len<2) {
	   errStr="Falta el Dominio"
	   alert(errStr)
	   return false
	}
	return true;
  }
}
