function Validate_Index(){
  with(document.form){
    if (cd_access_code.value == ""){
	  alert("Llenar obligatoriamente!");
	  cd_access_code.focus();
	  return;
    }
    if (isInt(cd_access_code.value) == false){
	  alert("Secuencia de numeros esperada!");
	  cd_access_code.focus();
	  return;
    }
    if (cd_access_code.value.length < 8){
	  alert("Secuencia de 8 numeros esperada!");
	  cd_access_code.focus();
	  return;
    }
    if (cd_detailing_user.value == ""){
	  alert("Llenar obligatoriamente!");
	  cd_detailing_user.focus();
	  return;
    }
    if (isInt(cd_detailing_user.value) == false){
	  alert("Secuencia de numeros esperada!");
	  cd_detailing_user.focus();
	  return;
    }
    if (cd_detailing_user.value.length < 8){
	  alert("Secuencia de 8 numeros esperada!");
	  cd_detailing_user.focus();
	  return;
    }
    submit();
  }
}

/*********************************************************************************
*	FUNCTION	isEmpty checks if the parameter is empty or null
*	PARAMETER	str		AS String
**********************************************************************************/
function isEmpty (str) {
	if ((str==null)||(str.length==0)) return true;
	else return(false);
}

/*********************************************************************************
*	FUNCTION:		isDigit
*	PARAMETER:		Any Chracter
*	CALLS			isEmpty to check the NULL
*	RETURNS:		TRUE if the passed chracter is a digit, otherwise FALSE
**********************************************************************************/
function isDigit(theNum) {
	var theMask = '0123456789';
	
	if (isEmpty(theNum)) return(false);
	else if (theMask.indexOf(theNum) == -1) return(false);
	
	return(true);
}

/*********************************************************************************
*	FUNCTION:		isInt
*	PARAMETER:		theStr	AS String 
*	RETURNS:		TRUE if the passed parameter is an integer, otherwise FALSE
*	CALLS:			isDigit
**********************************************************************************/
function isInt (theStr) {
	var flag = true;

	if (isEmpty(theStr)) { flag=false; }
	else
	{	for (var i=0; i<theStr.length; i++) {
			if (isDigit(theStr.substring(i,i+1)) == false) {
				flag = false; break;
			}
		}
	}
	return(flag);
}