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.wrkorform.elements[i].value!="") fld=1
                if(fld==0) document.wrkorform.elements[0].value=""
                return true
        }
	return true
}
function insert(rrow)
{
row=nhd+nrd*ncd+rrow*(ncd+1)
rw=(document.wrkorform.elements[row].value)-1
if(document.wrkorform.elements[row+1].value !="")
if(document.wrkorform.elements[nhd+(nrd-1)*ncd].value=="")
{
	swapin()
	for(i=nrd-1;i>rw;i--) for (j=0;j<ncd;j++)
	document.wrkorform.elements[nhd+i*ncd+j].value=document.wrkorform.elements[nhd+i*ncd+j-ncd].value
	for (j=0;j<ncd;j++) document.wrkorform.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.wrkorform.elements[nhd+i*ncd+j].value=document.wrkorform.elements[nhd+i*ncd+j+ncd].value
	for (j=0;j<ncd;j++)
	document.wrkorform.elements[nhd+i*ncd+j].value=""
	swapout()
}
}
function clearform()
{
lreg=nhd+nrd*ncd+lin*(ncd+1)
for (i=0;i<lreg;i++)
{
	document.wrkorform.elements[i].value=""
	if(document.wrkorform.elements[i].type=="checkbox")
		document.wrkorform.elements[i].checked=false
}
document.wrkorform.elements[i++].disabled=false
document.wrkorform.elements[i++].disabled=true
document.wrkorform.elements[0].readOnly=false
tp=0
for (j=i;j< document.wrkorform.elements.length;j++)
if(document.wrkorform.elements[j].type=="text") document.wrkorform.elements[j].value=""
swapout()
}
function otes(x)
{
	if(x.checked==false) x.value=1
	else x.value=""
	alert(x.checked + x.value)
}
function textad(xxx)
{
        if(xxx <5) ttp=(548+xxx*22)
        else ttp=(248+xxx*22)
        fld=nhd+nrd*ncd+xxx*(ncd+1)+1
        vari="../textb.htm?"+fld
        if(document.wrkorform.elements[fld].value!="")
        {
                param="width=550,height=195,top="+ttp+",left=170,menubar=no,titlebar=no,scrollbars=no,resizable=no,mimimizable=no,dialog=no"
                var obj_calwindow = window.open(vari,"",param)
        }
}

function extra(ext)
{
	if(ext.value=="DISEŅO") vari="../edise.htm"
        if(ext.value=="PRODUCCION") vari="../efabr.htm"
        if(ext.value=="ENTREGA") vari="../entre.htm"
        if(document.wrkorform.elements[0].value!="")
        {
                param="width=700,height=300,top=400,left=282,menubar=no,titlebar=no,scrollbars=no,resizable=no,mimimizable=no,dialog=no"
                var obj_calwindow = window.open(vari,"",param)
        }
}

