function chng(x) {
if(x==0) valact()
}
//function exswap()
//{
	//return
//}
function cons(xx) { botonpres=xx.value }
function insert(rrow)
{
row=nhd+nrd*ncd+rrow*(ncd+1)
rw=(document.textbform.elements[row].value)-1
if(document.textbform.elements[row+1].value !="")
if(document.textbform.elements[nhd+(nrd-1)*ncd].value=="")
{
	swapin()
	for(i=nrd-1;i>rw;i--) for (j=0;j<ncd;j++)
	document.textbform.elements[nhd+i*ncd+j].value=document.textbform.elements[nhd+i*ncd+j-ncd].value
	for (j=0;j<ncd;j++) document.textbform.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.textbform.elements[nhd+i*ncd+j].value=document.textbform.elements[nhd+i*ncd+j+ncd].value
	for (j=0;j<ncd;j++)
	document.textbform.elements[nhd+i*ncd+j].value=""
	swapout()
}
}
function clearform()
{
lreg=nhd+nrd*ncd+lin*(ncd+1)
for (i=0;i<lreg;i++)
{
	document.textbform.elements[i].value=""
	if(document.textbform.elements[i].type=="checkbox")
		document.textbform.elements[i].checked=false
}
document.textbform.elements[i++].disabled=false
document.textbform.elements[i++].disabled=true
document.textbform.elements[0].readOnly=false
tp=0
for (j=i;j< document.textbform.elements.length;j++)
if(document.textbform.elements[j].type=="text") document.textbform.elements[j].value=""
swapout()
}
fld=location.href.split("?").slice(-1)
//alert(window.opener.document.wrkorform.elements[fld/1+1].value)
document.textbform.elements[0].value=window.opener.document.wrkorform.elements[fld/1+1].value
//document.textbform.elements[1].value=window.opener.document.wrkorform.elements[(fld/1+3)].value
mynew=window.opener.document.wrkorform.elements[(fld/1+3)].value
b=mynew.split("|")
mynew=b[0]
for (i=1;i<b.length;i++) mynew=mynew+"\r"+b[i]
document.textbform.elements[1].value=mynew
function closeform()
{
	mynew=""
	mystring=document.textbform.elements[1].value
	for (i=0;i<mystring.length;i++)
	{
		if( 10 == mystring.charCodeAt(i)) mynew=mynew + "|"
		else mynew=mynew + mystring.charAt(i)
	}
		
	//alert(window.opener.document.wrkorform.elements[(fld/1+3)].name)
	window.opener.document.wrkorform.elements[(fld/1+3)].value=mynew
        self.close()
}
