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.estadform.elements[i].value!="") fld=1
                if(fld==0) document.estadform.elements[0].value="*"
                return true
        }
	return true
}
function insert(rrow)
{
row=nhd+nrd*ncd+rrow*(ncd+1)
rw=(document.estadform.elements[row].value)-1
if(document.estadform.elements[row+1].value !="")
if(document.estadform.elements[nhd+(nrd-1)*ncd].value=="")
{
	swapin()
	for(i=nrd-1;i>rw;i--) for (j=0;j<ncd;j++)
	document.estadform.elements[nhd+i*ncd+j].value=document.estadform.elements[nhd+i*ncd+j-ncd].value
	for (j=0;j<ncd;j++) document.estadform.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.estadform.elements[nhd+i*ncd+j].value=document.estadform.elements[nhd+i*ncd+j+ncd].value
	for (j=0;j<ncd;j++)
	document.estadform.elements[nhd+i*ncd+j].value=""
	swapout()
}
}
function clearform()
{
lreg=nhd+nrd*ncd+lin*(ncd+1)
for (i=0;i<lreg;i++)
{
	document.estadform.elements[i].value=""
	if(document.estadform.elements[i].type=="checkbox")
		document.estadform.elements[i].checked=false
}
document.estadform.elements[i++].disabled=false
document.estadform.elements[i++].disabled=true
document.estadform.elements[0].readOnly=false
tp=0
for (j=i;j< document.estadform.elements.length;j++)
if(document.estadform.elements[j].type=="text") document.estadform.elements[j].value=""
swapout()
}
