
//go to before window


function openWindow(url, name)
{
	BrWindow = window.open(url, name, 'status=no,menubar=yes,scrollbars=yes,resizable=no,width=400,height=250')
}

function fOpenBeforeWindow()
{   window.history.back();
	return(false);}


function fOpenDocumet(as_Document)
{
    window.open(as_Document,"_blank","top=120,left=100,width=640,height=420,scrollbars=yes,resize=1,resizable=1,menubar=1,titlebar=0,toolbar=0,directories=0");
}


function fAction(Form,as_Action)
{
	if (as_Action!=="Add")	
	{if (fvalida(as_Action)) 
		{
		Form.HddAction.value = as_Action;
		return(true);		
		}
	 else
		{
		return(false);
		}
	}
	else
	{
		Form.HddAction.value = as_Action;
		return(true);		
	}
}

function fActionB(as_Action)
{
	window.document.frm2.submit();
}

function fActionE(Form,as_Action)
{
	return fvalida(as_Action);
	//if (fvalida(Accion)) 
	//{
		//window.document.frm1.HddEAccion.value = as_Action;
		//window.document.frm1.HddEEstado.value = as_state;
		//window.document.frm1.submit();
	//}
}

function fActionS(as_Action)
{
	if (as_Action=="Select")
	{
		if (fvalida()) 
		{
			window.document.frmData.HddAction.value = as_Action;
			window.close();
		}
	}
	else if (as_Action=="Add") {window.open(document.frmData.HddArchivo.value+'?HddAction=Add'+document.frmData.HddOtrasV.value,'Miembro','top=180,left=150,width=600,height=400,scrollbars=yes,resize=1,resizable=1,menubar=0,titlebar=0,toolbar=0,directories=0');}
}

function fSelectAll(chkAll){
var lb_sel = chkAll.checked;
var objAll = chkAll;

	chkRow = objAll.form.elements;
	for(i=0;i<chkRow.length;i++)
	if(chkRow[i].type=="checkbox" && chkRow[i].id!=objAll.id)
		{
		if(chkRow[i].chkRow!=lb_sel)
		chkRow[i].click();
		}
}

function fSelectRow(chkRow,ai_fila)	{
var lb_sel = chkRow.checked;
if(lb_sel)
	{
	chkRow.parentElement.parentElement.className = "Selection";  
	}else 
	{
		if (ai_fila==0)
		{
		chkRow.parentElement.parentElement.className = "Detail";
		}
		else
		{
		chkRow.parentElement.parentElement.className = "DetailA";
		}
	}
}

function flogin()
{
	if (window.document.FrmData.txtprovider.value=="")
	{
		alert("You have to enter provider name");
	}
	else
	{
	if (window.document.FrmData.txtuser.value=="")
	{
		alert("You have to enter your user account");
	}
	else
	{
	
	window.document.frmLogin.txtprovider.value = window.document.FrmData.txtprovider.value;
	window.document.frmLogin.txtuser.value = window.document.FrmData.txtuser.value;
	window.document.frmLogin.txtpass.value = window.document.FrmData.txtpass.value;
	window.document.frmLogin.hddaction.value = "login"
	window.document.frmLogin.submit();
	}
	}
}

function floginUser()
{
	if (window.document.FrmData.txtCusUser.value=="")
	{
		alert("You have to enter your user account");
	}
	else
	{
		window.document.frmCusLogin.txtuser.value = window.document.FrmData.txtCusUser.value;
		window.document.frmCusLogin.txtpass.value = window.document.FrmData.txtCuspass.value;
		window.document.frmCusLogin.hddaction.value = "login"
		window.document.frmCusLogin.submit();
	}
}



function searchProvider()
{
	if (window.document.FrmData.txtProvider.value=="")
	{
		alert("You have to enter search criteria");
	}
	else
	{
	window.document.frmSearch.txtProvider.value = window.document.FrmData.txtProvider.value;
	window.document.frmSearch.hddaction.value = "search"
	window.document.frmSearch.submit();
	}

}