function chng(x) {
if(x==0) valact()
}
//function exswap()
//{
	//return
//}
function cons(xx) { botonpres=xx.value }
function closeform()
{
        swapin()
        fld=0
        if(botonpres=="Consultar")
        {
                for(i=0;i<nhd+ncd;i++) if( document.subfaform.elements[i].value!="") fld=1
                if(fld==0) document.subfaform.elements[0].value="*"
                return true
        }
	return true
}
function insert(rrow)
{
row=nhd+nrd*ncd+rrow*(ncd+1)
rw=(document.subfaform.elements[row].value)-1
if(document.subfaform.elements[row+1].value !="")
if(document.subfaform.elements[nhd+(nrd-1)*ncd].value=="")
{
	swapin()
	for(i=nrd-1;i>rw;i--) for (j=0;j<ncd;j++)
	document.subfaform.elements[nhd+i*ncd+j].value=document.subfaform.elements[nhd+i*ncd+j-ncd].value
	for (j=0;j<ncd;j++) document.subfaform.elements[nhd+i*ncd+j].value=""
	swapout()
}
else alert ("NO PERMITE NUEVA INSERCION")
else
{
	swapin()
	for(i=rw; i<nrd-1;i++) for (j=0;j<ncd;j++)
	document.subfaform.elements[nhd+i*ncd+j].value=document.subfaform.elements[nhd+i*ncd+j+ncd].value
	for (j=0;j<ncd;j++)
	document.subfaform.elements[nhd+i*ncd+j].value=""
	swapout()
}
}
function clearform()
{
lreg=nhd+nrd*ncd+lin*(ncd+1)
for (i=0;i<lreg;i++)
{
	document.subfaform.elements[i].value=""
	if(document.subfaform.elements[i].type=="checkbox")
		document.subfaform.elements[i].checked=false
}
document.subfaform.elements[i++].disabled=false
document.subfaform.elements[i++].disabled=true
document.subfaform.elements[0].readOnly=false
tp=0
for (j=i;j< document.subfaform.elements.length;j++)
if(document.subfaform.elements[j].type=="text") document.subfaform.elements[j].value=""
swapout()
}
