function ConfirmaBorrado(irUrl) {
	if(confirm("¿Está seguro que desea borrar el registro?")) //traducir
		location=irUrl;
}

function ConfirmaBorradoMultiple(formulario) {
	if(confirm("¿Está seguro que desea borrar los registros seleccionados?")) //traducir
		ITdoSubmit(formulario,'ITEsBorrar')
}

function ConfirmaBorradoFichero(irUrl) {
	if(confirm("¿Está seguro que desea borrar el fichero?")) //traducir
		location=irUrl;
}

function ITdoSubmit(formulario,evento) {
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
			theform = document.forms[formulario];
		}
		else {
			eval('theform = document.'+formulario);
		}
		theform.ITEvento.value = evento;
		theform.submit();
}

function ExportarXml(formulario) {
	ITdoSubmit(formulario,'ITEsExportarXml')
}

function ImportarXml(url){
	var uploadpopupImportarXml = new PopupWindow();
	uploadpopupImportarXml.setSize(350,130);
	uploadpopupImportarXml.autoHide();

	uploadpopupImportarXml.setUrl(url);
	uploadpopupImportarXml.showPopup('ToolImportar')	
}

function teditChkComent(queId,clase) {
	var trc = document.getElementById(queId+'_c');
	
	if (trc!=undefined)
		trc.className = clase
}

function teditChk(chkRow) {
  var queId = chkRow.id.substr(0, chkRow.id.length-5);
  var tr = document.getElementById(queId);
  
  if (chkRow.checked) {
    if (tr.className=='GridRow')
      tr.className='GridCheckedRow';
    else if (tr.className=='GridAlternatingRow')
      tr.className='GridAlternatingCheckedRow';
  }
  else {
    if (tr.className=='GridCheckedRow')
      tr.className='GridRow';
    else if (tr.className=='GridAlternatingCheckedRow')
      tr.className='GridAlternatingRow';
  }
  
  teditChkComent(queId,tr.className)
}

function teditChkAll(chkAll, chkRow) {
  if (chkAll.checked != chkRow.checked) {
    chkRow.checked = chkAll.checked;
    teditChk(chkRow);
  }
}

