﻿// JScript Files
//Download
function GetFile(href) { isIE6 = /msie|MSIE 6/.test(navigator.userAgent); if (document.getElementById('iframeForceDownload')) { document.getElementById('iframeForceDownload').src = href; document.getElementById('iframeForceDownload').location.href = href; try { if (isIE6) { document.getElementById('iframeForceDownload').contentWindow.location.reload(); } else { } } catch (err) { window.open(href, '', '') }; } else { window.open(href, '', '') } }

function doPostBack(o,e){__doPostBack(o,e);}
//<Buscador Formulario>
function ModificarDatoBus(idDato,NOBus){CallbackManager.AjaxRequest('_CallBackBus_btnMod,F_' + NOBus + ','+idDato)}
function EliminarDatoBus(idDato,NOBus){CallbackManager.AjaxRequest('_CallBackBus_btnEli,F_' + NOBus + ','+idDato)}

//<Eventos botones>            
function KeyMod(e){var KeyID = (window.event) ? event.keyCode : e.keyCode;switch(KeyID){case 17:ctrlKey = true;break;case 18:altKey = true;break;}}
function KeyCheck(e){var NOBus='1bus';var KeyID = (window.event) ? event.keyCode : e.keyCode;if(altKey && (KeyID==66)){try{AplicarFiltro('1',NOBus);}catch(err){}};if(altKey && (KeyID==76)){try{AplicarFiltro('3',NOBus);}catch(err){}};if(altKey && (KeyID==82)){try{AplicarFiltro('2',NOBus);}catch(err){}}}
function noenterCD(e) {e = getEvent(e);if (e.keyCode == 13){stopProp(e);stopDef(e);setTimeout('condicionDirecta()',100);return false;}else{return true;};}
function condicionDirecta(){var NOBus='1bus';try{a=document.getElementById(NOBus+'_BGyBCondiciones');if(a){a.focus();a.style.border='lightsteelblue 1px inset';attachEvent('blur',a,blurBGyBCondiciones);}}catch(err){};}
function blurBGyBCondiciones(e) {var NOBus='1bus';try{a=document.getElementById(NOBus+ '_BGyBCondiciones');if(a){a.style.border='lightsteelblue 1px outset';}}catch(err){};}
//</Eventos botones>            

function AplicarFiltro(accion,NOBus){if(accion=='1'){doPostBack('B_'+NOBus+'_ReiniciarFiltro','')};if(accion=='2'){doPostBack('B_'+NOBus+'_ActualizarFiltro','')};if(accion=='3'){doPostBack('B_'+NOBus+'_AplicarFiltro','')};if(accion=='4'){doPostBack('B_'+NOBus+'_QuitarFiltro','')};}
//</Buscador Formulario>

//<Eventos>
function stopProp(e) {if (e && e.stopPropogation) e.stopPropogation();else if (window.event && window.event.cancelBubble)window.event.cancelBubble = true;}
function stopDef(e) {if (e &&e.preventDefault) e.preventDefault();else if (window.event && window.event.returnValue)window.eventReturnValue = false;}
function attachEvent(name,element,callBack) {if (element.addEventListener) {element.addEventListener(name, callBack,false);} else if (element.attachEvent) {element.attachEvent('on' + name, callBack);}}
function getEvent(e){if(window.event != null){return event;}else{return e;}}
//</Eventos>

//<fJavaScriptComboTree> Funciones Javascript de apoyo para un control CamboTree (radTreeView desplegable)
function ProcesarClaAccion(IdEst,CTAccion,node,EsClasificacion,SinInput){var CTLabel=document.getElementById(IdEst + '_Label');CTAccionWrapper=document.getElementById(IdEst + '_AccionWrapper');var CTInputValue=document.getElementById(IdEst + '_InputValue');CTInputValue.value=CTAccion.GetValue()+node.Value;CTAccionWrapper.style.display = 'inline';CTLabel.innerHTML=CTLabel.innerHTML+'<a class="linkboton" href="javascript:reponer('+IdEst+'_Tree,\''+IdEst+'\','+EsClasificacion+','+SinInput+');" title="Restaurar el valor original">R</a>';}
function ProcessNode(node,IdEst,EsClasificacion,SinInput){var CTInputRO=document.getElementById(IdEst + '_InputRO');var CTInputValue=document.getElementById(IdEst + '_InputValue');var CTInputCat=document.getElementById(IdEst + '_InputCat');var CTInputText=document.getElementById(IdEst + '_InputText');var CTLabel=document.getElementById(IdEst + '_Label');
if(node){migas=TreeMigas(node,EsClasificacion,SinInput);CTLabel.innerHTML = migas;CTInputRO.value=migas;CTInputValue.value=node.Value;CTInputCat.value=node.Category;CTInputText.value=node.Text;}else{CTLabel.innerHTML = '';CTInputRO.value='';CTInputValue.value='';CTInputCat.value='';CTInputText.value='';}}
function reponer(CTTree,IdEst,EsClasificacion,SinInput){CTAccionWrapper=document.getElementById(IdEst + '_AccionWrapper');CTOriginal=document.getElementById(IdEst + '_ValorOriginal');
var node;if(CTOriginal.value!=''){node=CTTree.FindNodeByValue(CTOriginal.value);};CTAccionWrapper.style.display = 'none';ProcessNode(node,IdEst,EsClasificacion,SinInput);}
function TreeClasificacionAccion(IdEst,item){cValor=document.getElementById(IdEst + '_InputValue');var str=cValor.value;if(str!=''){var a=String(str).substring(0,1);if (a=='a' || a=='b' || a=='d'){var iLen = String(str).length;var cla = new String(String(str).substring(iLen, 1));valor=item.Value+cla;cValor.value = valor;}}}
function ToggleComboTree(e,layId,OffSetTop,OffSetLeft){var lay =  document.getElementById(layId);if (lay.style.display == ''){HideComboTree(layId);}else{ShowComboTree(e,layId,OffSetTop,OffSetLeft);}}
function TreeMigas(node,Cla,Input){var separador='&nbsp;&gt;&nbsp;';if(!Input){separador=' > '};var migas;if(1==2){migas = node.Text;while(node.Parent != null){node=node.Parent;migas=node.Text + separador + migas;};}else{migas = node.Text;while(node.Parent != null){node=node.Parent;migas=node.Text + separador + migas;};} return migas;}
function TreeMigasB(node){var separador=' > ';var migas;migas = node.Text;while(node.Parent != null){node=node.Parent;if (node.Category!='5_32' && node.Category!='7_32' && node.Category!='14_32'){migas=node.Text + separador + migas};}; return migas;}
function limpiarPrimerEspacio(texto){var ep = texto.indexOf(' ');if(ep >-1){texto=texto.slice(ep+1);}; return texto;}
function findPosTop(obj) {var curtop = 0;if (obj.offsetParent) {curtop = obj.offsetTop;while (obj = obj.offsetParent) {curtop += obj.offsetTop}}return curtop;}
function findPosLeft(obj) {var curleft = 0;if (obj.offsetParent) {curleft = obj.offsetLeft;while (obj = obj.offsetParent) {curleft += obj.offsetLeft}}return curleft;}
function HideComboTree(layId) { var lay = document.getElementById(layId); lay.style.display = 'none'; }
function ShowComboTree(e, layId, OffSetTop, OffSetLeft) { var layi = document.getElementById(replace(layId, 'Placeholder', '')); var lay = document.getElementById(layId); lay.style.left = (findPosLeft(e) - OffSetLeft) + 'px'; lay.style.top = (findPosTop(e) + OffSetTop) + 'px'; lay.style.display = ''; layi.style.height = Math.max(layi.offsetHeight,200); layi.width = layi.offsetWidth + 40; }
function HideTreeTO(el,varTO) { TOTree=setTimeout(function() { if (document.getElementById(el)) { document.getElementById(el).style.display = 'none'; } }, 500) }
function CancelTreeTO() {clearTimeout(TOTree);}
//</fJavaScriptComboTree>

//<fJavaScriptPuente> Funciones para los formularios relacionados
var idEstCEp;var IdDatoCEp;
function fconfirmEliminarPuente(idEst,IdDato){idEstCEp=idEst;IdDatoCEp=IdDato;radconfirm('¿Eliminar este registro relacionado?<br>la eliminación no será efectiva hasta que guarde el registro', AjaxDeletePuenteConfirm, 330, 180);}
function AjaxDeletePuenteConfirm(arg){if(arg){AjaxDeletePuente(idEstCEp,IdDatoCEp);};}
function AjaxDeletePuente(idEst,IdDato){window.top.setTimeout(function(){CallbackManager.AjaxRequest('_CallBackEli,F_' + idEst +',' +IdDato);}, 0);}
function SPA(IDEst) {NEMAX=eval('NEMax_' + IDEst + 'V');NE=document.getElementById('Val_TP_'+IDEst).value;if (NEMAX==0){return true;} else {if(NE==''){return true;} else {if(NE<NEMAX){return true;}else{alert('No se pueden asignar más');return false;}} } }
function AjaxAsignarPuente(idEst, IdDato) { CallbackManager.AjaxRequest('_CallBackAsi,F_' + idEst + ',' + IdDato); }
function AjaxAsignarPuentePF(idEst, IdDato) { CallbackManager.AjaxRequest('_CallBackAsiPF,F_' + idEst + ',' + IdDato); }
function AjaxAsignarPuenteBus(Objeto,IdDato){AsignarDatoBus(Objeto,IdDato);}
function fconfirmEliminarPuenteCombo(idEst,IdDato){idEstCEp=idEst;IdDatoCEp=IdDato;radconfirm('¿Eliminar este registro relacionado?<br>la eliminación no será efectiva hasta que guarde el registro', AjaxDeletePuenteConfirmCombo, 330, 180);}
function fconfirmEliminarPuenteComboCla(idEst,IdDato){idEstCEp=idEst;IdDatoCEp=IdDato;radconfirm('¿Eliminar este registro relacionado?<br>la eliminación no será efectiva hasta que guarde el registro', fconfirmEliminarPuenteComboCla, 330, 180);}
function AjaxDeletePuenteConfirmCombo(arg){if(arg){AjaxDeletePuenteCombo(idEstCEp,IdDatoCEp)};}
function AjaxDeletePuenteConfirmComboCla(arg){if(arg){AjaxDeletePuenteComboCla(idEstCEp,IdDatoCEp)};}
function AjaxDeletePuenteCombo(idEst,IdDato){window.top.setTimeout(function(){CallbackManager.AjaxRequest('_CallBackComboEli,F_' + idEst +',' +IdDato);}, 0);}
function AjaxDeletePuenteComboCla(idEst,IdDato){window.top.setTimeout(function(){CallbackManager.AjaxRequest('_CallBackComboEliCla,F_' + idEst +',' +IdDato);}, 0);}
function AjaxAsignarPuenteCombo(idEst,IdDato){CallbackManager.AjaxRequest('_CallBackCombo,F_' + idEst +',' +IdDato);}
function AjaxAsignarPuenteComboCla(idEst,IdDato){CallbackManager.AjaxRequest('_CallBackComboCla,F_' + idEst +',' +IdDato);}
function isBindOption(IdEst,value){try{eval('BindOption'+IdEst+'('+value+')')} catch(err){}}
//</fJavaScriptPuente>

//<fJavaScriptOW> Funciones para el manejo de ventanas RAD Window
function GetRadWindow(){var oWindow = null;if (window.radWindow){oWindow = window.radWindow} else {if (window.frameElement){if (window.frameElement.radWindow) {oWindow = window.frameElement.radWindow}}};return oWindow;}
function openWindowAux(IDcampo,wName){opW=GetRadWindow();if(opW!=null){opW.Maximize()}; oWE=window.radopen('pagina.aspx?rnd=' + Math.random() + '&' + IDcampo, wName);oWE.SetSize(700, 600);oWE.MoveTo(20, 20+Offset('y'));return false;}
function openWindowAuxFicha(Pagina,wName){opW=GetRadWindow();if(opW!=null){opW.Maximize()}; oWE=window.radopen(Pagina, wName);}
function openWindowAuxFichaR(Pagina, wName) { opW = GetRadWindow(); if (opW != null) { opW.Maximize() }; oWE = window.radopen(Pagina, wName); return false; }
function closeWindowAuxP(wName) {window.parent.closeWindowAux(wName);}
function closeWindowAux(wName){ var oManager = GetRadWindowManager();var oWnd = oManager.GetWindowByName(wName);if(oWnd){oWnd.Close()};return false;}
function Offset(t) { var x, y; if (self.pageYOffset) { x = self.pageXOffset; y = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop) { x = document.documentElement.scrollLeft; y = document.documentElement.scrollTop; } else if (document.body) { x = document.body.scrollLeft; y = document.body.scrollTop; }; if (t == 'x') { return x } else { return y } }
function openWindowAuxSL(Pag, wName) { opW = GetRadWindow(); if (opW != null) { opW.Maximize() }; oWE = window.radopen(Pag, wName); oWE.SetSize(1100, 800); oWE.MoveTo(10, 10 + Offset('y')); oWE.Maximize(); return false; }
function openWindowAuxFicha_sf(Pagina, wName) { opW = GetRadWindow(); if (opW != null) { opW.Maximize() }; oWE = window.radopen(Pagina, wName) }
//</fJavaScriptOW>

//<fAjaxComboBusSel> Funciones para el manejo de Busquedas, selecciones y columnas de listado
function AfterClientClickTreeBus(node,NOBus){var tipoCampos=node.Category.split('_');tipoCampo=tipoCampos[0];if(tipoCampo.indexOf('NE')==-1){CallbackManager.AjaxRequest('_CallBackBus_Tree,F_' + NOBus + ','+ node.Value+'##'+TreeMigasB(node)+'##'+node.Category);}}
function AfterClientClickTreeBusOrder(node,NOBus,IdEst,IdEstTipo){if(node){var tipoCampos=node.Category.split('_');tipoCampo=tipoCampos[0];if(tipoCampo.indexOf('NE')==-1){var BusCampoValor=document.getElementById(IdEst);var BusCampoLabel=document.getElementById("BusCampo_input_label_" + NOBus);var BusCampoTipo =document.getElementById(IdEstTipo);var BusCampoTexto=document.getElementById("BusCampo_input_" + NOBus);
migas=TreeMigas(node,false,false);BusCampoLabel.value = migas;BusCampoValor.value=node.Value;BusCampoTipo.value=node.Category;BusCampoTexto.value=node.Text;}}else{BusCampoLabel.value = '';BusCampoValor.value='';BusCampoTipo.value='';BusCampoTexto.value='';}}
function BusGB(NOBus){CallbackManager.AjaxRequest('_CallBackBus_btnGuardarBusqueda,F_'+NOBus)}
function BusRB(NOBus){CallbackManager.AjaxRequest('_CallBackBus_btnRecuperarBusqueda,F_'+NOBus)}
function AjaxComboBusSel(Opener,dato){CallbackManager.AjaxRequest('_CallBackComboBusSel,F_' + Opener + ',' + dato);closeWindowcdb();}
function AjaxComboBusSelDel(Opener,dato){CallbackManager.AjaxRequest( '_CallBackComboBusSelDel,F_' + Opener + ',' + dato);closeWindowcdb();}
function checkSelectGuardar(Opener){var Valores=checkSelect(Opener);if (Valores!=''){__doPostBack('BSeleccion_'+Opener+'_GChecked','')}}
function checkSelectEliminar(Opener){var Valores=checkSelect(Opener);if (Valores!=''){__doPostBack('BSeleccion_'+Opener+'_EChecked','')}}
function checkSelectTodoListado(Opener){__doPostBack('BSeleccion_'+Opener+'_GListado','')}
function checkSelect(Opener){var Valores='';elm=document.Form_MAV.elements;for(i=0;i<elm.length;i++){if(elm[i].type=='checkbox' && elm[i].id.indexOf('Listado_'+Opener)>-1){if (elm[i].checked){var word=elm[i].id.split('_');Valores+=','+word[word.length-1];}}}document.getElementById('Seleccion_'+Opener+'_Valores').value=Valores;return Valores}
function SelectAllCheckboxes(e,Opener){var che=true;if(!e.checked){che=false};elm=document.Form_MAV.elements;for(i=0;i<elm.length;i++){if(elm[i].type=='checkbox' && elm[i].id.indexOf('Listado_'+Opener)>-1){elm[i].checked=che;}}}
function closeWindowcdb(){var oManager = GetRadWindowManager();var oWnd = oManager.GetWindowByName('cdb');if(oWnd){oWnd.Close()};return false;}
//</fAjaxComboBusSel>
        
//<JavaScriptCajaBus>
function DisplayById(id,display){if(document.getElementById(id)){document.getElementById(id).style.display=display;}}
function ClassNameById(id,classname){if(document.getElementById(id)){document.getElementById(id).className=classname;}}
function BuscadorToolbarClick(id){ClassNameById('aBusquedas','busbtn');ClassNameById('aSelecciones','busbtn');ClassNameById('aColumnas','busbtn');DisplayById('PanelSelecciones','none');DisplayById('PanelBusquedas','none');DisplayById('PanelColumnas','none');if(id!=''){ClassNameById('a'+id,'busbtnAct');DisplayById('Panel'+id,'block');}}
function ExpandCollapse(id){if(id=='Collapse'){DisplayById('imgBusCollapse','none');DisplayById('imgBusExpand','block');DisplayById('BuscadorTool','none');}else {DisplayById('imgBusExpand','none');DisplayById('imgBusCollapse','block');DisplayById('BuscadorTool','block');}}
function CajaBusInit(){ExpandCollapse(CajaBusIDSplitter);BuscadorToolbarClick(CajaBusID);}
function BuscadorToolbarClickA(id,Obj){BuscadorToolbarClick(id);CallbackManager.AjaxRequest('_ToolBars,F_' + Obj +',' +id);}
function ExpandCollapseA(id,Obj){ExpandCollapse(id);CallbackManager.AjaxRequest('_ToolBars,F_' + Obj +',' +id);}
//</JavaScriptCajaBus>

//<Informes>
function doAccionCallBackI(accion,generacion,NO){CallbackManager.AjaxRequest( '_CallBackInformes,F_' + NO +',' + accion + ',' + generacion);closeWindowI();}
function openWindowInformes(Pagina){oWE=window.radopen(Pagina, 'vinformes');oWE.SetSize(700, 600);oWE.MoveTo(20, 20);return false;}
function closeWindowI(){var oManager = GetRadWindowManager();var oWnd = oManager.GetWindowByName('vinformes');oWnd.Close();return false;}
//</Informes>

//<JavascriptTreeCampos>
function UpdateAllChildren(nodes, checked){var i;for (i=0; i<nodes.length; i++){if (checked){nodes[i].Check();}else{nodes[i].UnCheck();}if (nodes[i].Nodes.length > 0){UpdateAllChildren(nodes[i].Nodes, checked)}}}
function AfterCheck(node,IdEst){if(node.Parent != null && node.Checked) {UpdateAllParent(node.Parent);};UpdateValue(node.TreeView,IdEst);}
function AfterCheckE(node){if(node.Parent != null && node.Checked) {UpdateAllParent(node.Parent);};UpdateValueE(node.TreeView);}
function UpdateAllParent(parent){if(parent.Value!=0){parent.Check();if(parent.Parent != null) {UpdateAllParent(parent.Parent);};}}
function fNodesChecked(nodes){var NodesChecked='';var eNodesChecked='';var i;for (i=0; i<nodes.length; i++) {if (nodes[i].Checked){NodesChecked+=', '+nodes[i].Value;eNodesChecked+=', '+nodes[i].Text}}; var aChecked = [NodesChecked,eNodesChecked]; return aChecked}
function UpdateValueE(treeView){NodesChecked=fNodesChecked(treeView.AllNodes);window.frames['IFrameExportar'].document.Form_Export.CamposTree.value=NodesChecked[0].replace(/, /g,',');window.frames['IFrameExportar'].document.Form_Export.EtiquetasTree.value=NodesChecked[1].replace(/, /g,',');}
function UpdateValue(treeView,IdEst){NodesChecked=fNodesChecked(treeView.AllNodes);document.getElementById('MAVc_' + IdEst + '_Value').value=NodesChecked[0].replace(/, /g,',');}
function verColumnas(IdEst){tbVC=document.getElementById('tbVC_' + IdEst );tbVC.value=document.getElementById('MAVc_' + IdEst + '_Value').value;tbVC.style.display='';tbVC.select();};
//</JavascriptTreeCampos>
            
//<Eliminar Listado>
function confirmEliminarLis(arg){if(arg){if (window.location.replace){window.location.replace(locationEli)}else {window.location.href=locationEli}}}
function fradconfirm(Text){radconfirm(Text, confirmEliminarLis, 330, 180);}
//</Eliminar Listado>

//<Control_MAV_Dato_auxiliar_normalizado_Lista_checks>
function CambioCheckAjax(value,Checked,e,IdEst,tarea){if(Checked){if (value!='' && SPA(IdEst)){AjaxAsignarPuente(IdEst,value,Tarea);}else {e.checked=false;}} else {if (value!=''){AjaxDeletePuente(IdEst,value);}}}
//<Control_MAV_Dato_auxiliar_normalizado_Lista_checks>

//<Control_MAV_Dato_auxiliar_normalizado_Subform_linea_Asignacion_Combo>
function fOD(comboInstance,IdEst,valor){TROD=document.getElementById('Tabla_Form_MAV_'+ IdEst);ODmostrar=document.getElementById('ODMostrar'+ IdEst);ODocultar=document.getElementById('ODocultar'+ IdEst);
if (valor){TROD.style.display='';ODmostrar.style.display='none';ODocultar.style.display='';if(comboInstance.GetValue()=='-2'){comboInstance.SetValue('-1');var comboItem = comboInstance.FindItemByValue('-1');comboItem.Select();}}else{TROD.style.display='none';ODmostrar.style.display='';ODocultar.style.display='none';};}
function CambioComboAjaxSubformularioAccion(value,IdEst){TROD=document.getElementById('Tabla_Form_MAV_'+IdEst);BADP=document.getElementById('B_ADP_'+IdEst);ODmostrar=document.getElementById('ODMostrar'+IdEst);ODocultar=document.getElementById('ODocultar'+IdEst);
BADP.style.display='';if(value=='-2'){TROD.style.display='none';ODmostrar.style.display='';ODocultar.style.display='none';BADP.style.display='none'}else{if(value=='-1'){BADP.style.display='none';TROD.style.display='';ODmostrar.style.display='none';ODocultar.style.display='';}};CallbackManager.AjaxRequest('_CallBackMod,F_'+IdEst +','+value);}
//</Control_MAV_Dato_auxiliar_normalizado_Subform_linea_Asignacion_Combo>

//<Control_MAV_Memo_HTML>                
function openEditorAux(IDcampo,ID){opW=GetRadWindow();if(opW!=null){opW.Maximize()};oWE=window.radopen('Editor_Auxiliar.aspx?idEst=' + IDcampo + '&ido=' + ID, IDcampo);oWE.SetSize(800,600);return false;}
function closeEditorAux(IDcampo){var oManager = GetRadWindowManager();var oWnd = oManager.GetWindowByName(IDcampo);oWnd.Close();return false;}
//</Control_MAV_Memo_HTML>                

//<Control_MAV_Lista_Check_Directa>
function ActualizarCheck(val,a,checked){Cadenafinal = val.value;valor = ',' + a + ',';Cadena=',' + Cadenafinal+ ',';esta = Cadena.indexOf(valor);
if (checked){if (esta==-1){if(Cadenafinal==''){Cadenafinal = a;}else{Cadenafinal += ',' +  a;}} 
} else {if (esta!=-1){Cadenafinal=replace(Cadenafinal,a,'');Cadenafinal=replace(Cadenafinal,',,',',');Pc=Cadenafinal.indexOf(',');if(Pc==0){Cadenafinal=Cadenafinal.substring(1)};Uc=Cadenafinal.lastIndexOf(',');if(Uc==Cadenafinal.length-1){Cadenafinal=Cadenafinal.substring(0,Cadenafinal.length-1)}}}
val.value=Cadenafinal;}
function replace(s, t, u) {i = s.indexOf(t);r = '';if (i == -1) {return s;}else{r += s.substring(0,i) + u;if ( i + t.length < s.length){ r += replace(s.substring(i + t.length, s.length), t, u);}return r;}}
//</Control_MAV_Lista_Check_Directa>

//<Control_MAV_Archivo>
function openUpload(IDcampo){opW=GetRadWindow();if(opW!=null){opW.Maximize()};oWE=window.radopen('Upload.aspx?idEst='+IDcampo, IDcampo);oWE.SetSize(600, 400);return false;}
function closeUpload(IDcampo){var oManager = GetRadWindowManager();var oWnd = oManager.GetWindowByName(IDcampo);oWnd.Close();return false;}
function resizeUpload(){var oManager = GetRadWindowManager();var oWnd = oManager.GetWindowByName(IDcampo);oWnd.SetSize(600, 600);return false;}
function EliminarArchivo(idest){UploadDelete=document.getElementById('UploadDelete_' + idest);ncFile=document.getElementById('MAVc_' + idest);ncName=document.getElementById('MAVc_Name_' + idest);
ncSize=document.getElementById('MAVc_Size_' + idest);ncContent=document.getElementById('MAVc_Content_' + idest);ncDesArchivo=document.getElementById('MAVc_L_' + idest);
ncFile.value='';ncName.value='';ncSize.value='';ncContent.value='';ncDesArchivo.innerHTML='';UploadDelete.style.display='none';}
function EliminarArchivoConfirm(arg){if(arg){EliminarArchivo(idEstCEp);};}
function fconfirmEliminarArchivo(idEst){idEstCEp=idEst;radconfirm('¿Eliminar este archivo?<br>la eliminación no será efectiva hasta que guarde el registro', EliminarArchivoConfirm, 330, 180);}
//</Control_MAV_Archivo>


function Refresh() {window.location.reload();}
function RadWindowResize(){var oWindow = GetRadWindow();array_datosParent = viewPorts(window.parent);viewportwidthParent = array_datosParent[0]-25;viewportheightParent = array_datosParent[1]-25;viewportwidth =document.body.scrollWidth+40;viewportheight = document.body.scrollHeight+70;oWindow.SetSize(Math.max(500,Math.min(viewportwidth,viewportwidthParent)),Math.max(400,Math.min(viewportheight,viewportheightParent)))}
function iFrameResizeOL(objIframe){array_datosParent = viewPorts(objIframe.window);objIframe.style.height=array_datosParent[1]+10+'px';objIframe.style.width=array_datosParent[0]+10+'px';}
function viewPorts(o){
        var viewportwidth;var viewportheight;var array_medidas = new Array();       
        if (typeof o=='undefined'){o=window;}         
        // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
        if (typeof window.innerWidth != 'undefined'){viewportwidth = o.innerWidth,viewportheight = o.innerHeight} 
        // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
        else if (typeof document.documentElement != 'undefined' && typeof o.document.documentElement.clientWidth != 'undefined' && o.document.documentElement.clientWidth != 0){viewportwidth = o.document.documentElement.clientWidth,viewportheight = o.document.documentElement.clientHeight}         
        // older versions of IE
        else {viewportwidth = o.document.getElementsByTagName('body')[0].clientWidth,viewportheight = o,document.getElementsByTagName('body')[0].clientHeight}                
        array_medidas[0]= viewportwidth;array_medidas[1]= viewportheight;return array_medidas;}
        
        //Get value of a input Radio
        function getRadioValue(idOrName) {var value = null;var element = document.getElementById(idOrName);var radioGroupName = null;if (element == null) {radioGroupName = idOrName;} else {radioGroupName = element.name;}if (radioGroupName == null) {return null};var radios = document.getElementsByTagName('input'); for (var i=0; i<radios.length; i++) {var input = radios[ i ];if (input.type == 'radio' && input.name == radioGroupName && input.checked) {value = input.value;break;}}return value;}        
        function getCheckedValue(radioObj) {if(!radioObj){return "";};var radioLength = radioObj.length;if(radioLength == undefined){if(radioObj.checked){return radioObj.value;}else{return "";}};	for(var i = 0; i < radioLength; i++) {if(radioObj[i].checked) {return radioObj[i].value;}};return "";}
        function setCheckedValue(radioObj, newValue){if(!radioObj){return;};var radioLength = radioObj.length;if(radioLength == undefined) {radioObj.checked = (radioObj.value == newValue.toString());return;}; for(var i = 0; i < radioLength; i++) {radioObj[i].checked = false;if(radioObj[i].value == newValue.toString()) {radioObj[i].checked = true;}}}
        