// JavaScript Document
function mostrarOcultar(obj) {
  document.getElementById('nopcion').style.visibility = (obj.checked) ? 'visible' : 'hidden';
}
 
 
 //VARIABLE GLOBAL
    var textoAnterior = '';

    //ESTA FUNCIÓN DEFINE LAS REGLAS DEL JUEGO
    function cumpleReglas(simpleTexto)
        {
            //la pasamos por una poderosa expresión regular
            var expresion = new RegExp("^(|([0-9]{1,9}(\\.([0-9]{1,2})?)?))$");

            //si pasa la prueba, es válida
            if(expresion.test(simpleTexto))
                return true;
            return false;
        }//end function checaReglas

    //ESTA FUNCIÓN REVISA QUE TODO LO QUE SE ESCRIBA ESTÉ EN ORDEN
    function revisaCadena(textItem)
        {
            //si comienza con un punto, le agregamos un cero
            if(textItem.value.substring(0,1) == '.')
                textItem.value = '0' + textItem.value;

            //si no cumples las reglas, no te dejo escribir
            if(!cumpleReglas(textItem.value))
                textItem.value = textoAnterior;
            else //todo en orden
                textoAnterior = textItem.value;
        }//end function revisaCadena


/*Funcion que oculta y muestra capas*/
var capas = ["capa1", "capa2"];
function mostrar(capa) {
for (i = 0, total = capas.length; i < total; i ++)
document.getElementById(capas[i]).style.display = (capas[i] == capa) ? "block":"none";
}

<!-- Funcion Ventana POp UP -->
function popUpC(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=no,width=630,height=700,left = 1,top = 1');");
}//End Pop UP-->


<!--Cerrar ventana -->

 function cerrar(){
window.parent.close() 
window.open('','_parent','');
window.opener = top ;
window.close();
   }
   <!-- END Cerrar ventana -->
$(document).ready(function(){
			$(".factura").colorbox({width:"60%", height:"60%", iframe:true});
			}); 
