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