// JavaScript Document

/*CUANDO SE HACE CLICK EN EL CHECKBOX EN EL CUAL SE DECIDE 
 *BORRAR LA IMAGEN PONE EN 'DISABLE' EL <INPUT TYPE="FILE"...*/
function disableBox(ide) {
	
	var chkbox = document.getElementById(ide);
	var idFile = ide.substring(3);
	var fileEntry = document.getElementById(idFile);
	
	if(chkbox.checked) {
		//fileEntry.style.display= 'none';
		fileEntry.disabled= 'disabled';
	
	} else {
		//fileEntry.style.display= '';
		fileEntry.disabled= '';
	}
}
/*LE DA FOCO AL PRIMER CAMPO VISIBLE DEL FORM*/
function focusFirst(form) {
  var bFound = false;

  // for each element in each form
  for(i=0; i < form.length; i++)
  {
      // if it's not a hidden element
      if (form[i].type != "hidden")
      {
        // and it's not disabled
        if (form[i].disabled != true)
        {
            // set the focus to it
            form[i].focus();
            var bFound = true;
        }
      }
      // if found in this element, stop looking
      if (bFound == true)
        break;
  }
}
