<script type="text/javascript">
function new_reg_docu(e)
{



	document.getElementById('auto_fila').style.display='none';
	document.getElementsByClassName('suco_fila').item(0).style.display='none';
	document.getElementsByClassName('suco_fila').item(1).style.display='none';


	document.getElementsByClassName('vendedor_fila').item(0).style.display='none';
	document.getElementsByClassName('vendedor_fila').item(1).style.display='none';
	document.getElementById('vendedor_descri').innerHTML='';

	document.getElementsByClassName('caja_fila').item(0).style.display='none';
	document.getElementsByClassName('caja_fila').item(1).style.display='none';
	document.getElementById('caja_descri').innerHTML='';

	document.getElementsByClassName('bcos_fila').item(0).style.display='none';
	document.getElementsByClassName('bcos_fila').item(1).style.display='none';

	document.getElementsByClassName('ctab_fila').item(0).style.display='none';
	document.getElementsByClassName('ctab_fila').item(1).style.display='none';

	document.getElementsByClassName('bod1nrtr').item(0).style.display='none';
	document.getElementsByClassName('bod1nrtr').item(1).style.display='none';
	document.getElementById('bode_descri').innerHTML='';

	document.getElementsByClassName('bod2nrtr').item(0).style.display='none';
	document.getElementsByClassName('bod2nrtr').item(1).style.display='none';
	document.getElementById('bode2_descri').innerHTML='';



//vicore OFF
	document.getElementById('deta_cont').style.display='block';

	document.getElementById('ctas_cab').style.display='none';
	document.getElementById('ctas_text').style.display='none';
		
	document.getElementById('item_cab').style.display='none';
	document.getElementById('item_text').style.display='none';
						
	document.getElementById('docu_cab').style.display='none';
	document.getElementById('docu_text').style.display='none';




	var docu=document.getElementById('docunr').value;
	docu=docu.toLowerCase();
	
	var reg=/(fp)/;

	reg=/(fp)|(FP)|(np)|(NP)/;
	if(reg.test(docu))
	{
		document.getElementById('auto_fila').style.display='block';
		
		document.getElementsByClassName('suco_fila').item(0).style.display='block';
		document.getElementsByClassName('suco_fila').item(1).style.display='block';

	}

	reg=/(fc)|(FC)|(nv)|(NV)|(nc)|(NC)/;
	if(reg.test(docu))
	{
		document.getElementsByClassName('vendedor_fila').item(0).style.display='block';
		document.getElementsByClassName('vendedor_fila').item(1).style.display='block';

	}


	reg=/(ie10)|(IE10)|(ic10)|(IC10)|(id10)|(ID10)/;
	
	if(reg.test(docu))
	{
		document.getElementsByClassName('caja_fila').item(0).style.display='block';
		document.getElementsByClassName('caja_fila').item(1).style.display='block';

	}



/*
	reg=/(ic10)|(IC10)/;
	
	if(reg.test(docu))
	{
		document.getElementsByClassName('bcos_fila').item(0).style.display='block';
		document.getElementsByClassName('bcos_fila').item(1).style.display='block';

	}


*/
	reg=/(ch)|(CH)|(db)|(DB)|(dc)|(DC)/;
	
	if(reg.test(docu))
	{
		document.getElementsByClassName('ctab_fila').item(0).style.display='block';
		document.getElementsByClassName('ctab_fila').item(1).style.display='block';

	}
	
	reg=/(ib)|(IB)|(eb)|(EB)/;
	if(reg.test(docu))
	{
		document.getElementsByClassName('bod1nrtr').item(0).style.display='block';
		document.getElementsByClassName('bod1nrtr').item(1).style.display='block';
		if(docu.substring(3,4)=='3')
		{
			document.getElementsByClassName('bod2nrtr').item(0).style.display='block';
			document.getElementsByClassName('bod2nrtr').item(1).style.display='block';
		}
		
	}


	//var tipo_docu_temp=document.getElementById('hdd_docuxreg').value;
		/*			
	var reg=/(cont)/;

	reg=/(cont)/;
	if(reg.test(tipo_docu_temp))
	{
		document.getElementById('ctas_cab').style.display='block';
		document.getElementById('ctas_text').style.display='block';
	}
			
 	reg=/(vtas)|(clie)|(comp)|(inve)|(nomi)/;
	if(reg.test(tipo_docu_temp))
	{
		document.getElementById('item_cab').style.display='block';
		document.getElementById('item_text').style.display='block';
	}

 	reg=/(caja)|(bcos)|(retc)|(retp)/;
	if(reg.test(tipo_docu_temp))
	{
		document.getElementById('docu_cab').style.display='block';
		document.getElementById('docu_text').style.display='block';
	}

*/





	if(docu.length!=0 && docu!='' && docu!=' ' && e.keyCode==13)
	{	
	$.ajax({
		cache:false,
		url:'../lib/vrnewreg2.php',
		datatype: "text",
	    async:false,
		type:'POST',
		data:{docu:docu}, 
    	beforeSend: function(jqXHR, textStatus)
		{
		}, 
		
		success:function(dato, textStatus, jqXHR)
		{
			document.getElementById('docu_carga').innerHTML=dato;
			document.getElementById('numenr').value=document.getElementById('hdd_num').value;
			document.getElementById('docunr_descri').innerHTML=document.getElementById('hdd_descri').value;
			
			console.log(document.getElementById('hdd_descri').value);	
			if(document.getElementById('hdd_tab').value=='clie')
			{
				document.getElementById('cab2_reg').style.display='block';
				document.getElementById('plaz_reg3').style.display='block';
				document.getElementById('zsub_reg3').style.display='block';
				document.getElementById('dcto_reg3').style.display='block';
			}
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              console.log('Not connect: Verify Network.');
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               //console.log('Time out error.');
			   alert('Servidor no Responde');
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
	    complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {
    	    	if(document.getElementById('hdd_error').value!='0')
				{
					alert('El tipo de Documento es Incorrecto');
				}

			}           
		},
		timeout:30000
	});
	
	}




}



function carga_reg_docu()
{
	var docu=document.getElementById('docunr').value;
	var ptoe=document.getElementById('ptoenr').value;
	var numero=document.getElementById('numenr').value;
	

	docu=docu.toLowerCase();
	
	
//if(docu.length!=0 && docu!='' && docu!=' ' && e.keyCode==13 && ptoe!='' && numero!='')
//{	
$.ajax({
		cache:false,
		url:'../lib/vrnewreg4.php',
		datatype: "text",
	    async:false,
		type:'POST',
		data:{docu:docu,ptoe:ptoe,numero:numero}, 
    	beforeSend: function(jqXHR, textStatus)
		{
	
		}, 
		
		success:function(dato, textStatus, jqXHR)
		{
			//console.log(dato);
			document.getElementById('docu_carga2').innerHTML=dato;
			document.getElementById('enti').value=document.getElementById('hdd_enti_cod').value;
			document.getElementById('enti_descri').innerHTML=document.getElementById('hdd_enti_descri').value;
			document.getElementById('conceptonr').value=document.getElementById('hdd_enti_concepto').value;
			document.getElementById('hdd_idxreg').value=document.getElementById('hdd_idxreg2').value;
			document.getElementById('fechanr').value=document.getElementById('hdd_fecha').value;
			document.getElementById('atrz').value=document.getElementById('hdd_atrz').value;
			document.getElementById('fecha_auto').value=document.getElementById('hdd_fecha_auto').value;
			document.getElementById('tiempo_auto').value=document.getElementById('hdd_tiempo_auto').value;
			document.getElementById('ruc_auto').value=document.getElementById('hdd_ruc_auto').value;
			document.getElementById('suco').value=document.getElementById('hdd_suco').value;
			document.getElementById('suco_descri').innerHTML=document.getElementById('hdd_suco_descri').value;
			
			if(document.getElementById('hdd_enti_drtr_cod'))
			{
				document.getElementById('director').value=document.getElementById('hdd_enti_drtr_cod').value;
				document.getElementById('director_descri').innerHTML=document.getElementById('hdd_enti_drtr_descri').value;
			}
			if(document.getElementById('hdd_vendedor'))
			{
				document.getElementById('vendedor').value=document.getElementById('hdd_vendedor').value;
				document.getElementById('vendedor_descri').innerHTML=document.getElementById('hdd_vendedor_descri').value;
				
			}
			
			//if(document.getElementById('hdd_idxreg')!='Error')
			//{
				carga_docu_deta();
				
			//}
			//document.getElementById('docu_carga2').innerHTML='';
			//console.log(dato);
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              console.log('Not connect: Verify Network.');
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               //console.log('Time out error.');
			   alert('Servidor no Responde');
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
	    complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {

			}           
		},
		timeout:30000
	});
	
//}

}







function enti(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('enti',document.getElementById('enti').value,'enti_descri','h','enti');
		var etmp=document.getElementById('enti').value;
		if(etmp.length==10)
		{
			document.getElementById('ruc_auto').value=document.getElementById('enti').value+'001';
		}
		else
		{
			document.getElementById('ruc_auto').value=document.getElementById('enti').value;
		}
		
	}

}

function suco(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('suco',document.getElementById('suco').value,'suco_descri','h','suco');
		
	}

}








function vendedor(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('enti',document.getElementById('vendedor').value,'vendedor_descri','h','vendedor');
		
	}

}







function bode(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('bode',document.getElementById('bod1nr').value,'bode_descri','h','bod1nr');
		
	}

}

function bode2(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('bode',document.getElementById('bod2nr').value,'bode2_descri','h','bod2nr');
		
	}

}

function caja()
{

		busca_maes2('caja',document.getElementById('caja').value,'caja_descri','h','caja');
		
}





function zsub(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('zsub',document.getElementById('zsub').value,'zsub_descri','h','zsub');
		
	}

}

function director(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('enti',document.getElementById('director').value,'director_descri','h','director');
		
	}

}

function cuenta(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('ctas',document.getElementById('cuenta').value,'cuenta_descri','v','cuenta');
		
	}

}

function cuenta2(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('ctas',document.getElementById('docu_cuenta').value,'docu_cuenta_descri','v','docu_cuenta');
		
	}

}


function item_cuenta(e)
{
	if(e.keyCode==13)
	{
		busca_maes2('ctas',document.getElementById('item_cuenta').value,'item_cuenta_descri','v','item_cuenta');
		alert('Decripcion de Cuenta:' + document.getElementById('item_cuenta_descri').value);
	}
}

function item_cair(e)
{
	if(e.keyCode==13)
	{
		busca_maes2('cair',document.getElementById('item_cair').value,'item_cair_descri','v','item_cair');
		alert('Decripcion de CAIR:' + document.getElementById('item_cair_descri').value);
	}
}


function item(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('item',document.getElementById('item').value,'item_descri','v','item');
		
	}

}

function docu(e)
{

	if(e.keyCode==13)
	{
		
		busca_maes2('docu',document.getElementById('docu').value,'docu_descri','v','docu');
		
	}

}



function graba_docu()
{
	var docu=document.getElementById('docunr').value;
	var ptoe=document.getElementById('ptoenr').value;
	var fech=document.getElementById('fechanr').value;
	var enti=document.getElementById('enti').value;
	var dire='';
	var cont='';
	
	if(document.getElementById('director'))
	{dire=document.getElementById('director').value;}

	if(document.getElementById('contrato'))
	{cont=document.getElementById('contrato').value;}
	
	var conc=document.getElementById('conceptonr').value;
	var banc=document.getElementById('caja').value;
	var banc=document.getElementById('bcos').value;
	var cuen=document.getElementById('ctab').value;
	var atrz=document.getElementById('atrz').value;
	var bod1=document.getElementById('bod1nr').value;
	var bod2=document.getElementById('bod2nr').value;
	var plaz=document.getElementById('plaznr').value;
	var csub=document.getElementById('csub').value;
	var zsub=document.getElementById('zsub').value;
	var dcto=document.getElementById('dctonr').value;
	//var unidx=document.getElementById('unidx').value;
	//var subtx=document.getElementById('subtx').value;
	//var icex=document.getElementById('icex').value;
	//var dctox=document.getElementById('dctox').value;
	//var totalx=document.getElementById('ivax').value;
	//var totalx=document.getElementById('totalx').value;
	var numex=document.getElementById('numenr').value;
	var vendedor=document.getElementById('vendedor').value;
	var ruc_auto=document.getElementById('ruc_auto').value;
	
	var fecha_auto=document.getElementById('fecha_auto').value;
	var tiempo_auto=document.getElementById('tiempo_auto').value;
	var suco=document.getElementById('suco').value;
	
	
$.ajax({
		cache:false,
		url:'../lib/vrnewreg3.php',
		datatype: "text",
	    async:false,
		type:'POST',
		//data:{docu:docu,ptoe:ptoe,fech:fech,enti:enti,dire:dire,cont:cont,conc:conc,banc:banc,cuen:cuen,auto:auto,bod1:bod1,bod2:bod2,plaz:plaz,csub:csub,zsub:zsub,dcto:dcto,unidx:unidx,subtx:subtx,icex:icex,dctox:dctox,totalx:totalx,totalx:totalx,numex:numex}, 
		data:{docu:docu,ptoe:ptoe,fech:fech,enti:enti,dire:dire,cont:cont,conc:conc,banc:banc,cuen:cuen,bod1:bod1,bod2:bod2,plaz:plaz,csub:csub,zsub:zsub,dcto:dcto,numex:numex,vendedor:vendedor,fecha_auto:fecha_auto,tiempo_auto:tiempo_auto,atrz:atrz,ruc_auto:ruc_auto,suco:suco}, 
    	beforeSend: function(jqXHR, textStatus)
		{
			document.getElementById('reg_deta').innerHTML='';
		}, 
		
		success:function(dato, textStatus, jqXHR)
		{
			console.log(dato);
			/*
			if(dato=='Error')
			{
				alert('Ocurrion un Error al Registrar');
				return false;
			}
			var datu=parseInt(dato);
			if(isNaN(datu))
			{
				alert('Ocurrion un Error al Registrar');
				return false;
			}
			*/
			//console.log(dato);
			document.getElementById('proce_carg_cab').innerHTML=dato;
			//console.log(document.getElementById("hdd_idxreg").value);
			//console.log(document.getElementById('hdd_docuxreg').value);
			if(document.getElementById("hdd_idxreg3").value=='Error' && document.getElementById("hdd_docuxreg3").value=='Error')
			{
				alert('Ocurrion un Error al Registrar');
			}
			else
			{
				document.getElementById('hdd_docuxreg').value=document.getElementById('hdd_docuxreg3').value;
				carga_reg_docu();
			}
			
			
			//carga_docu_deta();
			
			//console.log(datu);
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              console.log('Not connect: Verify Network.');
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               //console.log('Time out error.');
			   alert('Servidor no Responde');
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
	    complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {
    	    

			}           
		},
		timeout:30000
	});
	

}

function carga_docu_deta()
{


$.ajax({
		cache:false,
		url:'../lib/vrnewreg10.php',
		datatype: "text",
	    async:false,
		type:'POST',
		data:{docu:document.getElementById('docunr').value,idnumx:document.getElementById('hdd_idxreg').value}, 
    	beforeSend: function(jqXHR, textStatus)
		{
	
	
		}, 
		
		success:function(dato, textStatus, jqXHR)
		{
			
			document.getElementById('reg_deta').innerHTML=dato;
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              console.log('Not connect: Verify Network.');
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               //console.log('Time out error.');
			   alert('Servidor no Responde');
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
	    complete:function(jqXHR, textStatus)
    	{
			if(textStatus==='success')
	        {
				//console.log(document.getElementById('hdd_car_det_err').value);
    	
				if(document.getElementById('hdd_car_det_err').value=='')
				{
					
					if(document.getElementById('hdd_docuxreg2'))
					{
						document.getElementById('hdd_docuxreg').value=document.getElementById('hdd_docuxreg2').value;
					}
					if(document.getElementById('hdd_docuxreg3'))
					{
						document.getElementById('hdd_docuxreg').value=document.getElementById('hdd_docuxreg3').value;
					}
					
					document.getElementById('deta_cont').style.display='block';
					
					var tipo_docu_temp=document.getElementById('hdd_docuxreg').value;

					var reg=/(cont)/;
					if(reg.test(tipo_docu_temp))
					{
						document.getElementById('ctas_cab').style.display='block';
						document.getElementById('ctas_text').style.display='block';
				
						document.getElementById('item_cab').style.display='none';
						document.getElementById('item_text').style.display='none';
						
						document.getElementById('docu_cab').style.display='none';
						document.getElementById('docu_text').style.display='none';
				
					}
			
				    reg=/(vtas)|(clie)|(comp)|(inve)|(nomi)/;
					
					if(reg.test(tipo_docu_temp))
					{
						document.getElementById('item_cab').style.display='block';
						document.getElementById('item_text').style.display='block';
						document.getElementById('item_text').style.display='block';
						
						
						if(tipo_docu_temp=="vtas" || tipo_docu_temp=="clie" || tipo_docu_temp=="comp")
						{
							document.getElementById('cab_dcto').style.display='block';
							document.getElementById('cab_ice').style.display='block';
							document.getElementById('cab_iva').style.display='block';
							document.getElementById('cab_irbp').style.display='block';
							
							document.getElementById('item_dcto').style.display='block';
							document.getElementById('item_ice').style.display='block';
							document.getElementById('item_iva').style.display='block';
							document.getElementById('item_irbp').style.display='block';
							
						}
						else
						{

							document.getElementById('cab_dcto').style.display='none';
							document.getElementById('cab_ice').style.display='none';
							document.getElementById('cab_iva').style.display='none';
							document.getElementById('cab_irbp').style.display='none';
							
							document.getElementById('item_dcto').style.display='none';
							document.getElementById('item_ice').style.display='none';
							document.getElementById('item_iva').style.display='none';
							document.getElementById('item_irbp').style.display='none';
						
						}
						
						if(tipo_docu_temp=="inve")
						{
												
							document.getElementById('bod1nr').value=document.getElementById('hdd_bode').value;
							document.getElementById('bode_descri').innerHTML=document.getElementById('hdd_bode_descri').value;
							document.getElementById('bod1nr').style.display='block';

							document.getElementById('bod2nr').value=document.getElementById('hdd_tobode').value;
							document.getElementById('bode2_descri').innerHTML=document.getElementById('hdd_tobode_descri').value;
							document.getElementById('bod2nr').style.display='block';
					

						}
						else
						{
							document.getElementById('bod1nr').style.display='none';
							document.getElementById('bod2nr').style.display='none';
							document.getElementById('bode_descri').innerHTML='';
							document.getElementById('bode2_descri').innerHTML='';
						}
						
						
					
						document.getElementById('ctas_cab').style.display='none';
						document.getElementById('ctas_text').style.display='none';
						
						document.getElementById('docu_cab').style.display='none';
						document.getElementById('docu_text').style.display='none';
				
					}
					
					reg=/(caja)|(bcos)|(retc)|(retp)|(cjte)/;
					if(reg.test(tipo_docu_temp))
					{
						document.getElementById('docu_cab').style.display='block';
						document.getElementById('docu_text').style.display='block';
					
						document.getElementById('ctas_cab').style.display='none';
						document.getElementById('ctas_text').style.display='none';

						document.getElementById('item_cab').style.display='none';
						document.getElementById('item_text').style.display='none';
						
				
					}


				}
				else
				{
// vicore 
//					document.getElementById('item_cab').style.display='none';
//					document.getElementById('item_text').style.display='none';
//					document.getElementById('ctas_cab').style.display='none';
//					document.getElementById('ctas_text').style.display='none';
//					document.getElementById('deta_cont').style.display='none';
				}

		    

			}           
		},
		timeout:60000
	});

//+++++
$.ajax({
		cache:false,
		url:'../lib/vrnewreg12.php',
		datatype: "text",
	    async:false,
		type:'POST',
		data:{docu:document.getElementById('docunr').value,idnumx:document.getElementById('hdd_idxreg').value}, 
    	beforeSend: function(jqXHR, textStatus)
		{
	
	
		}, 
		
		success:function(dato, textStatus, jqXHR)
		{
			
			document.getElementById('total_box').innerHTML=dato;
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              console.log('Not connect: Verify Network.');
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               //console.log('Time out error.');
			   alert('Servidor no Responde');
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
	    complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {
			}
    	
		},
		timeout:30000
	});
//+++++





}

function graba_docu_deta()
{
var cant=0;

if(document.getElementById('debitos').value!='')
{
	cant=parseFloat(document.getElementById('debitos').value);
}

if(document.getElementById('creditos').value!='')
{
	cant=parseFloat(document.getElementById('creditos').value);
	cant=cant * -1;
}


if(document.getElementById('item_cant') &&  document.getElementById('item_cant').value!='')
{
	cant=document.getElementById('item_cant').value;
	
}

var detalle='';

if(document.getElementById('cuenta_detalle') && document.getElementById('cuenta_detalle').value!='')
{detalle=document.getElementById('cuenta_detalle').value;}

if(document.getElementById('item_detalle') && document.getElementById('item_detalle').value!='')
{detalle=document.getElementById('item_detalle').value;}

var cuenta='';
if(document.getElementById('cuenta') && document.getElementById('cuenta').value!='')
{cuenta=document.getElementById('cuenta').value;}

if(document.getElementById('item_cuenta') && document.getElementById('item_cuenta').value)
{cuenta=document.getElementById('item_cuenta').value;}

var cair='';
if(document.getElementById('cair') && document.getElementById('cair').value)
{item=document.getElementById('cair').value;}

if(document.getElementById('item_cair') && document.getElementById('item_cair').value)
{cair=document.getElementById('item_cair').value;}


var item='';
if(document.getElementById('item') && document.getElementById('item').value)
{item=document.getElementById('item').value;}

var puni='';
if(document.getElementById('item_puni') && document.getElementById('item_puni').value)
{puni=document.getElementById('item_puni').value;}

var dcto='';
if(document.getElementById('item_dcto') && document.getElementById('item_dcto').value)
{dcto=document.getElementById('item_dcto').value;}

var ice='';
if(document.getElementById('item_ice') && document.getElementById('item_ice').value)
{ice=document.getElementById('item_ice').value;}

var iva='';
if(document.getElementById('item_iva') && document.getElementById('item_iva').value)
{iva=document.getElementById('item_iva').value;}

var irbp='';
if(document.getElementById('item_irbp') && document.getElementById('item_irbp').value)
{irbp=document.getElementById('item_irbp').value;}

var docum='';
if(document.getElementById('docu') && document.getElementById('docu').value)
{docum=document.getElementById('docu').value;}

var ptoe='';
if(document.getElementById('docu_ptoe') && document.getElementById('docu_ptoe').value)
{ptoe=document.getElementById('docu_ptoe').value;}

var numero='';
if(document.getElementById('docu_numero') && document.getElementById('docu_numero').value)
{numero=document.getElementById('docu_numero').value;}


if(document.getElementById('docu_cant') && document.getElementById('docu_cant').value)
{cant=document.getElementById('docu_cant').value;}

if(document.getElementById('docu_cuenta') && document.getElementById('docu_cuenta').value)
{cuenta=document.getElementById('docu_cuenta').value;}

if(document.getElementById('docu_detalle') && document.getElementById('docu_detalle').value)
{detalle=document.getElementById('docu_detalle').value;}




$.ajax({
		cache:false,
		url:'../lib/vrnewreg11.php',
		datatype: "text",
	    async:false,
		type:'POST',
	data:{docu:document.getElementById('docunr').value,idnumx:document.getElementById('hdd_idxreg').value,cuenta:cuenta,cair:cair,cant:cant,detalle:detalle,item:item,dcto:dcto,ice:ice,iva:iva,irbp:irbp,puni:puni,docum:docum,ptoem:ptoe,numero:numero}, 
    	beforeSend: function(jqXHR, textStatus)
		{
	
		}, 
		
		success:function(dato, textStatus, jqXHR)
		{
			console.log(dato);
			carga_docu_deta();
			//document.getElementById('docunr').value='';
			document.getElementById('cuenta').value='';
			document.getElementById('cuenta_descri').value='';
			document.getElementById('cuenta_detalle').value=''
			document.getElementById('item_detalle').value='';
	
			
			document.getElementById('debitos').value='';
			document.getElementById('creditos').value='';
			
			
			document.getElementById('item').value='';
			document.getElementById('item_descri').value='';
			document.getElementById('item_cant').value='';
			document.getElementById('item_puni').value='';
			document.getElementById('item_dcto').value='';
			document.getElementById('item_ice').value='';
			document.getElementById('item_iva').value='';
			document.getElementById('item_irbp').value='';
			document.getElementById('item_cuenta').value='';
			document.getElementById('item_cair').value='';
			document.getElementById('item_detalle').value='';			




			
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              console.log('Not connect: Verify Network.');
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               //console.log('Time out error.');
			   alert('Servidor no Responde');
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
	    complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {
    	    

			}           
		},
		timeout:30000
	});



}



function sel_codi(maes) 
{
//var fenti=document.getElementById('fenti').value;
alert(maes);

$.ajax({
		cache:false,
		url:'../lib/vrselcodi0.php',
		datatype: "text",
	    async:false,
		type:'POST',
		data:{maes:maes}, 
    	beforeSend: function(jqXHR, textStatus)
		{
	
		}, 
		
		success:function(dato, textStatus, jqXHR)
		{
			//document.getElementById('docu_carga').innerHTML=dato;
			//document.getElementById('numenr').value=document.getElementById('hdd_num').value;
			
				
			//if(document.getElementById('hdd_tab').value=='clie')
			//{
				//document.getElementById('cab2_reg').style.display='block';
				//document.getElementById('plaz_reg3').style.display='block';
				//document.getElementById('zsub_reg3').style.display='block';
				//document.getElementById('dcto_reg3').style.display='block';
			//}
			
		

						
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              console.log('Not connect: Verify Network.');
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               //console.log('Time out error.');
			   alert('Servidor no Responde');
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
	    complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {
    	    	//if(document.getElementById('hdd_error').value!='0')
		//		{
		//			alert('El tipo de Documento es Incorrecto');
		//		}

			}           
		},
		timeout:30000
	});


} 


function status_ox(docux,idnumx,extra,opcionx)
{

$.ajax({
		cache:false,
		url:'../lib/vrnewreg5.php',
		datatype: "text",
	    async:false,
		type:'POST',
		data:{docux:docux,idnumx:idnumx,opcionx:opcionx},
    	beforeSend: function(jqXHR, textStatus)
		{
		}, 
		
		success:function(dato, textStatus, jqXHR)
		{
			console.log(dato);
		},
		error:function(jqXHR,textStatus,errorThrown )
		{
           if (jqXHR.status === 0) {
              console.log('Not connect: Verify Network.');
           } else if (jqXHR.status == 404) {
               console.log('Requested page not found [404]');
           } else if (jqXHR.status == 500) {
               console.log('Internal Server Error [500].');
           } else if (exception === 'parsererror') {
               console.log('Requested JSON parse failed.');
           } else if (exception === 'timeout') {
               //console.log('Time out error.');
			   alert('Servidor no Responde');
           } else if (exception === 'abort') {
               console.log('Ajax request aborted.');
           } else {
               console.log('Uncaught Error: ' + jqXHR.responseText);
           }

		}, 
	    complete:function(jqXHR, textStatus)
    	{
			
			if(textStatus==='success')
	        {
			}           
		},
		timeout:30000
	});


}



<?php include('../../_js/busca_maes2.js');?>
<?php include('../../_js/lista_maes2.js');?>
<?php include('../../_js/deledeta.js');?>
</script>


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Comprobante Electronico</title>

<style type="text/css">
body{font-family: courier new;}
body input {font-family: courier new; font-size:14px}
body button {font-family: courier new; font-size:14px;}
body textarea {font-family: courier new; font-size:14px}
</style>
</head>

<body>



<table border="0" cellspacing="0" cellpadding="0" width="100%" style="font-size:14px; border-collapse:collapse;">
<tr valign="top">
<td width="33%">
	<table cellspacing="0" cellpadding="2" width="100%" style="font-size:14px; border-collapse:collapse;">
    	<tr valign="top">
        	<td width="10%"><input type="button" value="DOCUMENTO" accesskey="D" ondblClick="list_carga('docu','docunr','docunr_descri');" /></td>
		<td><input type="text" id="docunr" style="border: solid 1px #000; width:50px; padding-left:2px; text-transform:uppercase;" onKeyPress="new_reg_docu(event);" ondblClick="list_carga('docu','docunr','docunr_descri');" /><span id="docunr_descri"></span></td>
        </tr>
       
        <tr>
        	<td><button >PTOE/NUMERO</button></td>
           	<td>
           	<input type="text" id="ptoenr" style="border: solid 1px #000; width:50px; padding-left:2px;" value="001001" />
                <input type="text" id="numenr" style="border: solid 1px #000; width:80px; padding-left:2px;" onKeyPress="if(document.getElementById('docunr').value!='' && document.getElementById('docunr').value!=' ' && event.keyCode==13 && document.getElementById('ptoenr').value!='' && document.getElementById('numenr').value!=''){carga_reg_docu();}" />
           	</td>
        </tr>
        
        <tr>
        	<td><button>FECHA</button></td>
            	<td><input type="date" id="fechanr" style="border: solid 1px #000; width:150px; font-size:14px; padding-left:2px;" value="<?php echo date("Y-m-d"); ?>" /></td>
        </tr>
        
        <tr>
        	<td width="10%"><input type="button" value="ENTIDAD" accesskey="E" onClick="list_carga('enti','enti','enti_descri');" /></td>
		<td><input type="text" id="enti" onKeyPress="enti(event);" ondblClick="list_carga('enti','enti','enti_descri');" style="border: solid 1px #000; width:100px; padding-left:2px;" />
            	</td>
        </tr>

        <tr>
        	<td></td>
        	<td><div id="enti_descri" style="font-weight:bold; height:25px;"></div></td>
        </tr>


        
        <?php
		if($_SESSION['user_vcrx_empr']=='gnya'){$empr_aux='director';}
		if($_SESSION['user_vcrx_empr']=='tcor'){$empr_aux='contrato';}
        ?>


        <?php
		//if($_SESSION['user_vcrx_empr']=='gnya' || $_SESSION['user_vcrx_empr']=='tcor')
		if(stristr('gnya.tcor',$_SESSION['user_vcrx_empr']))
		{
	?>
        
        <tr>
        	<td><?php echo strtoupper($empr_aux); ?></td>
		<td>
            	<input id="<?php echo $empr_aux; ?>" type="text" style="border: solid 1px #000; width:100px" onKeyPress="<?php if($_SESSION['user_vcrx_empr']=='gnya'){echo 'director(event);';}?>"    />
           	<?php if($_SESSION['user_vcrx_empr']=='gnya'){?> <input type="image" src="http://vcrxol.com/_img/ico_lupa.png"   value="Lista" onClick="list_carga('enti','director','director_descri');" /><?php }?>
            	</td>
        </tr>

        <?php } ?>
        
        
       <tr>
        	<td colspan="2"><div id="director_descri" style="height:25px;"></div></td>
       </tr>

       <tr>
        	<td><button>CONCEPTO</button></td>
            	<td><textarea id="conceptonr" maxlength="240" style="border: solid 1px #000; resize:none;" ></textarea></td>
       </tr>
       <tr>
       		<td>
       		<input type="button" value="DETALLE" onClick="if(confirm('Registrar Detalle?')){graba_docu();}" />
       		</td>
       </tr>
    </table>
</td>

<td width="33%">
	<table id="cab2_reg" border="0" cellspacing="0" cellpadding="2" width="100%" style="font-size:14px; border-collapse:collapse;">
        


        <tr>
        	<td width="10%">
        	<span class="caja_fila" style="display:none;">
        	<input type="button" value="CAJA" accesskey="C" onClick="list_carga('caja','caja','caja_descri');" />
        	</span>
        	</td>

           	<td>
        	<div class="caja_fila" style="display:none;">
	        <input type="text" id="caja" style="border: solid 1px #000; width:50px; padding-left:2px;" onKeyPress="caja(event);" ondblClick="list_carga('caja','caja','caja_descri');" />
           	</div>
           	</td>
        </tr>
        <tr>
        	<td></td>
        	<td><div id="caja_descri" style="font-weight:bold; height:25px;"></div></td>
        </tr>

        <tr>
        	<td width="10%">
        	<span class="ctab_fila" style="display:none;">
        	<input type="button" value="CTA.BANC." accesskey="T" onClick="list_carga('ctab','ctab','caja_descri');" />
        	</span>
        	</td>

           	<td>
        	<div class="ctab_fila" style="display:none;">
	        <input type="text" id="ctab" style="border: solid 1px #000; width:50px; padding-left:2px;" onKeyPress="ctab(event);" ondblClick="list_carga('ctab','ctab','ctab_descri');" />
           	</div>
           	</td>
        </tr>

        <tr>
        	<td width="10%">
        	<span class="bcos_fila" style="display:none;">
        	<input type="button" value="BANCO" accesskey="B" onClick="list_carga('bcos','bcos','bcos_descri');" />
        	</span>
        	</td>

           	<td>
        	<div class="bcos_fila" style="display:none;">
	        <input type="text" id="bcos" style="border: solid 1px #000; width:50px; padding-left:2px;" onKeyPress="bcos(event);" ondblClick="list_carga('bcos','bcos','bcos_descri');" />
           	</div>
           	</td>
        </tr>

        
        <tr id="auto_fila" style="display:none;">
           	<td colspan="2">
            	<table>
            	<tr>
                <td>FECHA(cad)</td>
                <td>HORA(solo CE)</td>
	        </tr>
        	
        	<tr>
                <td><input type="text" id="fecha_auto" value="<?php echo date('d-m-Y');?>" style="border: solid 1px #000; padding-left:2px; width:80px;" /></td>
                <td><input type="text" id="tiempo_auto" value="00:00:00" style="border: solid 1px #000; padding-left:2px; width:70px;" /></td>
	        </tr>

        	<tr height="20">
                <td>&nbsp;</td>
                <td></td>
        	</tr>

        	<tr>
                <td>RUC</td>
                <td>NUMERO(atrz)</td>
        	</tr>

        	<tr>
                <td><input type="text"  id="ruc_auto" style="border: solid 1px #000; padding-left:2px; width:110px;" disabled="disabled" /></td>
                <td><input type="text"  id="atrz" style="border: solid 1px #000; padding-left:2px; width:100px;" maxlength="10" /></td>
        	</tr>

		<tr><td><br></td></tr>

		<tr>
        	<td><span class="suco_fila"  style="display:none;">
        	<input type="button" value="SUSTENTO DEL" accesskey="S" onClick="list_carga('suco','suco','suco_descri');" width="100px" />
		<br>COMPROBANTE</span>
		</td>
		<td>
            	<span class="suco_fila" style="display:none;">
            	<input type="text" id="suco" onKeyPress="suco(event);" ondblClick="list_carga('suco','suco','suco_descri');" style="border: solid 1px #000; width:100px; padding-left:2px; width: 20px;" maxlength="2"  />
            	</span>
            	</td>
        	</tr>
        	<tr>
        	<td></td>
        	<td><div id="suco_descri" style="font-weight:bold; height:25px;"></div></td>
        	</tr>

        	<tr>
        	<td></td>
        	</tr>
                
            	</table>
           	</td> 
        </tr>


        <tr>
        	<td width="10%">
        	<span class="vendedor_fila" style="display:none;">
        	<input type="button" value="VENDEDOR" accesskey="V" onClick="list_carga('vndd','vendedor','vendedor_descri');" />
        	</span>
        	</td>

		<td>
            	<span class="vendedor_fila" style="display:none;">
            	<input type="text" id="vendedor" onKeyPress="vendedor(event);" ondblClick="list_carga('vndd','vendedor','vendedor_descri');" style="border: solid 1px #000; width:100px; padding-left:2px;" />
            	</span>
            	</td>
	</tr>
        <tr>
        	<td></td>
        	<td><div id="vendedor_descri" style="font-weight:bold; height:25px;"></div></td>
        </tr>

        
        <tr >
        	<td width="10%">
        	<span class="bod1nrtr" style="display:none;">
        	<input type="button" value="BODEGA" accesskey="B" onClick="list_carga('bode','bod1nr','bode_descri');" />
        	</span>
        	</td>

           	<td>
        	<div class="bod1nrtr" style="display:none;">
	        <input type="text" id="bod1nr" style="border: solid 1px #000; width:50px; padding-left:2px;" onKeyPress="bode(event);" ondblClick="list_carga('bode','bod1nr','bode_descri');" />
           	</div>
           	</td>
        </tr>
        <tr>
        	<td></td>
        	<td><div id="bode_descri"></div></td>
	</tr>

        <tr>
        	<td width="10%">
        	<span class="bod2nrtr" style="display:none;">
        	<input type="button" value="BODE.2" accesskey="2" onClick="list_carga('bode','bod2nr','bode2_descri');" />
        	</span>
        	</td>

           	<td>
        	<div class="bod2nrtr" style="display:none;">
           	<input type="text" id="bod2nr" style="border: solid 1px #000; width:50px;padding-left:2px;" onKeyPress="bode2(event);" ondblClick="list_carga('bode','bod2nr','bode2_descri');"/>
           	</div>
           	</td>
        </tr>
        <tr>
        	<td></td>
        	<td><div id="bode2_descri"></div></td>
	</tr>


        
        <tr id="plaz_reg3" style="display:none;">
        	<td>PLAZO</td>
            	<td><input type="text" id="plaznr" style="border: solid 1px #000; width:50px;" /></td>
        </tr>
        
        <tr id="csub_reg3" style="display:none;">
        	<td>CENTRO-SUB</td>
		<td><input type="text" id="csub" style="border: solid 1px #000; width:50px;" /></td>
        </tr>
        
        <tr id="zsub_reg3" style="display:none;">
        	<td>ZONA-SUB</td>
		<td><input type="text" id="zsub" onKeyPress="zsub(event);" style="border: solid 1px #000; width:100px;" /></td>
        </tr>
        <tr id="zsub_reg3">
        	<td></td>
        	<td ><div id="zsub_descri" style="height:25px;"></div></td>
        </tr>
        
        <tr id="dcto_reg3" style="display:none;">
        	<td>DSCTO %</td>
		<td><input type="text" id="dctonr" style="border: solid 1px #000; width:50px;"  placeholder="%"/></td>
        </tr>
    
    </table>

</td>

<td width="33%">
	<div id="total_box"></div>
</tr>
</table>


<hr/>

<div id="docu_carga"></div>
<div id="docu_carga2"></div>

<div id="deta_cont" align="left" style="display:block;">


<div id="ctas_cab" style=" margin:0px; padding:0px;display:none;">
<table width="100%" border="1" cellpadding="0" cellspacing="0"  style="border-collapse:collapse; background:#eee;">
<tr align="center" style="border:solid 1px #000;">
    <th><div style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">CUENTA</div></th>
    <th><div style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">CONTABLE</div></th>
    <th><div style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">DEBITOS</div></th>
    <th><div style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">CREDITOS</div></th>
    <th><div style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">DETALLE</div></th>
    <th><div style="width:40px"></div></th>
</tr>
</table>
</div>


<div id="ctas_text" style=" margin:0px; padding:0px;display:none;">
<table width="100%" border="1" cellpadding="0" cellspacing="0"  style="border-collapse:collapse; background:#eee;">
<tr align="center" style="border:solid 1px #000;">
    <th><input type="text" id="cuenta" onKeyPress="cuenta(event);" style="width:100px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="cuenta_descri" style="width:100px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="debitos" style="width:100px; border:none; margin:0px; padding:0px 2px 0px 0px; text-align:right;" /></th>
    <th><input type="text" id="creditos" style="width:100px; border:none; margin:0px; padding:0px 2px 0px 0px; text-align:right;" /></th>
    <th><input type="text" id="cuenta_detalle" style="width:100px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><div><input width="40"  type="image" src="http://vcrxol.com/_img/ico_plus2.png" onClick="graba_docu_deta();" /></div></th>
</tr>
</table>
</div>




<div id="item_cab" style=" margin:0px; padding:0px;display:none;">
<table width="100%" border="1" cellpadding="0" cellspacing="0"  style="border-collapse:collapse; background:#eee;">
<tr align="center" style="border:solid 1px #000;">
    <th><div style="width:110px; border:none; margin:0px; padding:0px 1px 0px 1px;">ITEM</div></th>
    <th><div style="width:200px; border:none; margin:0px; padding:0px 1px 0px 1px;">DESCRI</div></th>
    <th><div style="width:80px; border:none; margin:0px; padding:0px 1px 0px 1px;">CANT</div></th>
    <th><div style="width:80px; border:none; margin:0px; padding:0px 1px 0px 1px;">P.UNIT</div></th>
    <th><div id="cab_dcto" style="width:40px; border:none; margin:0px; padding:0px 1px 0px 1px;">DCTO</div></th>
    <th><div id="cab_ice" style="width:40px; border:none; margin:0px; padding:0px 1px 0px 1px;">ICE</div></th>
    <th><div id="cab_iva" style="width:40px; border:none; margin:0px; padding:0px 1px 0px 1px;">IVA</div></th>
    <th><div id="cab_irbp" style="width:40px; border:none; margin:0px; padding:0px 1px 0px 1px;">IRBP</div></th>
    <th><div id="cab_cta" style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">CUENTA</div></th>
    <th><div id="cab_cair" style="width:40px; border:none; margin:0px; padding:0px 1px 0px 1px;">CAIR</div></th>
    <th><div style="width:200px; border:none; margin:0px; padding:0px 1px 0px 1px;">DETALLE</div></th>
    <th><div style="width:40px"></div></th>
</tr>
</table>
</div>

<div id="item_text" style=" margin:0px; padding:0px;display:none;">
<table width="100%" border="1" cellpadding="0" cellspacing="0"  style="border-collapse:collapse; background:#eee;">
<tr  align="center" style="border:solid 1px #000;">
    <th><input type="text" id="item" onKeyPress="item(event);" style="width:110px; border:none; margin:0px; padding:0px 0px 0px 2px;" ondblClick="list_carga('item','item','item_descri');"/></th>
    <th><input type="text" id="item_descri" style="width:200px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="item_cant" style="width:80px; border:none; margin:0px; padding:0px 2px 0px 0px; text-align:right;" /></th>
    <th><input type="text" id="item_puni" style="width:80px; border:none; margin:0px; padding:0px 2px 0px 0px; text-align:right;" /></th>
    <th><input type="text" id="item_dcto" style="width:40px; border:none; margin:0px; padding:0px 0px 0px 2px; text-align:right;" /></th>
    <th><input type="text" id="item_ice" style="width:40px; border:none; margin:0px; padding:0px 0px 0px 2px; text-align:right;" /></th>
    <th><input type="text" id="item_iva" style="width:40px; border:none; margin:0px; padding:0px 0px 0px 2px; text-align:right;" /></th>
    <th><input type="text" id="item_irbp" style="width:40px; border:none; margin:0px; padding:0px 0px 0px 2px; text-align:right;" /></th>
    <th><input type="text" id="item_cuenta" onKeyPress="item_cuenta(event);" style="width:100px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="item_cair" onKeyPress="item_cair(event);" style="width:40px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="item_detalle" style="width:200px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><div><input width="40" type="image" src="http://vcrxol.com/_img/ico_plus2.png" onClick="graba_docu_deta();" /></div></th>
</tr>
</table>
</div>





<div id="docu_cab" style=" margin:0px; padding:0px;display:none;">
<table width="100%" border="1" cellpadding="0" cellspacing="0"  style="border-collapse:collapse; background:#eee;">
<tr align="center" style="border:solid 1px #000;">
    <th><div style="width:40px; border:none; margin:0px; padding:0px 1px 0px 1px;">DOCU</div></th>
    <th><div style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">DESCRI</div></th>
    <th><div style="width:50px; border:none; margin:0px; padding:0px 1px 0px 1px;">PTOE</div></th>
    <th><div style="width:80px; border:none; margin:0px; padding:0px 1px 0px 1px;">NUMERO</div></th>
    <th><div style="width:80px; border:none; margin:0px; padding:0px 1px 0px 1px;">CANT</div></th>
    <th><div style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">CUENTA</div></th>
    <th><div style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">C.DESCRI</div></th>
    <th><div style="width:100px; border:none; margin:0px; padding:0px 1px 0px 1px;">DETALLE</div></th>
    <th><div style="width:40px"></div></th>
</tr>
</table>
</div>

<div id="docu_text" style=" margin:0px; padding:0px;display:none;">
<table width="100%" border="1" cellpadding="0" cellspacing="0"  style="border-collapse:collapse; background:#eee;">
<tr align="center" style="border:solid 1px #000;">
    <th><input type="text" id="docu" onKeyPress="docu(event);"  style="width:40px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="docu_descri" style="width:100px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="docu_ptoe" style="width:50px; border:none; margin:0px; padding:0px 2px 0px 0px; text-align:left;" /></th>
    <th><input type="text" id="docu_numero" style="width:80px; border:none; margin:0px; padding:0px 2px 0px 0px; text-align:right;" /></th>
    <th><input type="text" id="docu_cant" style="width:80px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="docu_cuenta" onKeyPress="cuenta2(event);" style="width:100px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="docu_cuenta_descri" onKeyPress="cuenta2(event);" style="width:100px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><input type="text" id="docu_detalle" style="width:100px; border:none; margin:0px; padding:0px 0px 0px 2px;" /></th>
    <th><div><input width="40" type="image" src="http://vcrxol.com/_img/ico_plus2.png" onClick="graba_docu_deta();" /></div></th>
</tr>
</table>
</div>

<hr/>
<div id="reg_deta"></div>


</div>

<div id="proce_carg_cab"></div>
<input type="hidden" id="item_cuenta_descri" />
<input type="hidden" id="item_cair_descri" />
<input type="hidden" id="hdd_idxreg"  />
<input type="hidden" id="hdd_docuxreg"  />
<div id="lista_temporal_contenedor" style=" display:none; padding:0px; margin:0px; background: #666; opacity:0.5; width:100%; min-height: 100%; height:auto !important;position: fixed;top:0;left:0; z-index:1;" ></div>
<div id="lista_cargador" style=" display:none; background:#FFF;position: fixed; top:150px;left:350px; z-index:10;" ><img src="../img/ajax-loader.gif" /></div>    
<div id="lista_temporal" style=" display:none; background:#FFF;position: fixed; top:150px;left:350px; z-index:10; overflow-y:scroll; min-height:50px; max-height:400px;" ><img src="../img/ajax-loader.gif" /></div>    

</html>