function chng(x) {
if(x==0) valact()
//if(x==8) document.membrform.elements[x-1].value=document.membrform.elements[x].value
}
//function exswap()
//{
	//return
//}
function cons(xx) { botonpres=xx.value }
function uplphoto()
{
		var ilist = document.images;
		for(var i = 0; i < ilist.length; i++) if (ilist[i].name!="")
		for (j=0; j< document.forms[0].length; j++) 
		if(document.forms[0].elements[j].name==ilist[i].name)
			document.forms[0].FOTO.value=ilist[i].name

var obj_calwindow = window.open('../upload/',"","width=300,height=300,top=50,left=50,titlebar=no,resizable=no,mimimizable=no,dialog=no")
}
function closeform()
{
        swapin()
        fld=0
        if(botonpres=="Consultar")
        {
                for(i=0;i<nhd+ncd;i++) if( document.membrform.elements[i].value!="") fld=1
                if(fld==0) document.membrform.elements[0].value="*"
                return true
        }
        if(botonpres=="Actualizar")
	{
		var ilist = document.images;
		for(var i = 0; i < ilist.length; i++) if (ilist[i].name!="")
		{
			//alert(ilist[i].name)
			for (j=0; j< document.membrform.length; j++) 
			if(document.membrform.elements[j].name==ilist[i].name)
			{
				//alert(j+ " " + document.membrform.FOTO.value)
				document.membrform.elements[j].value="NEWFOTO>>>"
			}
		}
	}
}
function insert(rrow)
{
row=nhd+nrd*ncd+rrow*(ncd+1)
rw=(document.membrform.elements[row].value)-1
if(document.membrform.elements[row+1].value !="")
if(document.membrform.elements[nhd+(nrd-1)*ncd].value=="")
{
	swapin()
	for(i=nrd-1;i>rw;i--) for (j=0;j<ncd;j++)
	document.membrform.elements[nhd+i*ncd+j].value=document.membrform.elements[nhd+i*ncd+j-ncd].value
	for (j=0;j<ncd;j++) document.membrform.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.membrform.elements[nhd+i*ncd+j].value=document.membrform.elements[nhd+i*ncd+j+ncd].value
	for (j=0;j<ncd;j++)
	document.membrform.elements[nhd+i*ncd+j].value=""
	swapout()
}
}
function clearform()
{
lreg=nhd+nrd*ncd+lin*(ncd+1)
for (i=0;i<lreg;i++)
{
	document.membrform.elements[i].value=""
	if(document.membrform.elements[i].type=="checkbox")
		document.membrform.elements[i].checked=false
}
document.membrform.elements[i++].disabled=false
document.membrform.elements[i++].disabled=true
document.membrform.elements[0].readOnly=false
tp=0
for (j=i;j< document.membrform.elements.length;j++)
if(document.membrform.elements[j].type=="text") document.membrform.elements[j].value=""
swapout()
}
function chkbx1(ind)
{
	for (z=17; z<21; z++)
	{
		document.membrform.elements[z].checked=false
		document.membrform.elements[z].value=""
	}
        ind.checked=true
	ind.value="1"
}


