A tu función le falta declarar las variables varCliente y varCodProducto como me suponía. Debería ser así:
    
Código Javascript
:
Ver original- function validacion () { 
-   
- var varCliente     = document.getElementById("varCliente"); 
- var varCodProducto = document.getElementById("varCodProducto"); 
-   
- if (varCliente.value == "") { 
- // Si no se cumple la condicion... 
- alert('El campo Cliente no puede estar vacio'); 
- varCliente.style.backgroundColor = "#FFFFCC"; 
- varCliente.focus(); 
- return false; 
-   
- } 
- else if (varCodProducto.value == "") { 
- // Si no se cumple la condicion... 
- varCliente.style.backgroundColor = "#CCFFCC"; 
- alert('El campo Cod Producto no puede estar vacio'); 
- varCodProducto.style.backgroundColor = "#FFFFCC"; 
- varCodProducto.focus(); 
- return false; 
-   
- } else { 
- return true; 
- }; 
Saludos :)