forms_l_2 = new Image()
forms_l_3 = new Image()
forms_l_2.src ="../Forms/forms_l_2.gif"
forms_l_3.src ="../Forms/forms_l_3.gif"
slide_j="sld_1"
document.images[slide_j].src = forms_l_2.src
function slide(slide_i) {
	sldn="sld_"+slide_i
	document.images[slide_j].src = forms_l_3.src
	document.images[sldn].src = forms_l_2.src
	swapin()
	tp=parseInt((slide_i-1)*(nrd-lin)/(lin-3)+.5)
	//alert ("slj=" + slide_j +"  sli=" + slide_i +"  tp=" + tp)
	swapout()
	slide_j = sldn
}
function slide1(inc) { return }
function scroll(tpc)
{
nrd*ncd+rrow*(ncd+1)
        swapin()
        tp =tpc
        if (tp < 0) tp=0
        if (tp >nrd-lin) tp=nrd-lin
        swapout()
        exswap()
}

document.formsform.elements[0].focus()
function chng(x) {
if(x==0) valact()
}
function exswap()
{
	slide_i=parseInt(tp*(lin-3)/(nrd-lin)+1)
	sldn="sld_"+slide_i
	//alert("slide_i="+slide_i+"  tp="+tp + "  sldn="+sldn)
	document.images[slide_j].src = forms_l_3.src
	document.images[sldn].src = forms_l_2.src
	slide_j = sldn
	return
}
function cons(xx) { botonpres=xx.value }
function closeform()
{
	swapin()
        fld=0
        if(botonpres=="Consultar")
        {
                for(i=0;i<nhd+ncd;i++) if( document.formsform.elements[i].value!="") fld=1
                if(fld==0) document.formsform.elements[0].value="*"
                return true
        }
	return true
}
function insert(rrow)
{
row=nhd+nrd*ncd+rrow*(ncd+1)
rw=(document.formsform.elements[row].value)-1
if(document.formsform.elements[row+1].value !="")
if(document.formsform.elements[nhd+(nrd-1)*ncd].value=="")
{
	swapin()
	for(i=nrd-1;i>rw;i--) for (j=0;j<ncd;j++)
	document.formsform.elements[nhd+i*ncd+j].value=document.formsform.elements[nhd+i*ncd+j-ncd].value
	for (j=0;j<ncd;j++) document.formsform.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.formsform.elements[nhd+i*ncd+j].value=document.formsform.elements[nhd+i*ncd+j+ncd].value
	for (j=0;j<ncd;j++)
	document.formsform.elements[nhd+i*ncd+j].value=""
	swapout()
}
}
function clearform()
{
lreg=nhd+nrd*ncd+lin*(ncd+1)
for (i=0;i<lreg;i++)
{
	document.formsform.elements[i].value=""
	if(document.formsform.elements[i].type=="checkbox")
		document.formsform.elements[i].checked=false
}
document.formsform.elements[i++].disabled=false
document.formsform.elements[i++].disabled=true
document.formsform.elements[0].readOnly=false
tp=0
swapout()
}
