
var result;var ventana;var m_absResDlg;function screenHeight(){return screen.availHeight;}
function screenWidth(){return screen.availWidth;}
function abrirInterficie(location){if(!IsPopupBlocker()){var sScreenWidth=screenWidth()-8;var winprops='directories=no, toolbar=no,menubar=no, scrollbars=no,status=no,resizable=0, height='+screenHeight()+',width='+sScreenWidth+',top=0,left=0';var f=window.open(location,"ABSInicio",winprops);if(f!=null){f.focus();}
else{alert('La ventana de login ha sido bloqueada por su navegador. Verifique la configuración para permitir ventanas pop-ups.');}}else{alert('La ventana de login ha sido bloqueada por su navegador. Verifique la configuración para permitir ventanas pop-ups.');}}
function abrirVentana(location,w,h,scroll,resizable,menus){var l=0;var t=0;if(w!=0)l=(screen.availWidth-w)/2;else w=screen.availWidth;if(h!=0)t=(screen.availHeight-h)/2;else h=screen.availHeight;if(scroll==null){scroll="yes";}
if(resizable==null){resizable="no";}
if(menus==null){menus="no";}
var winprops='directories=no, toolbar=no,menubar='+menus+', scrollbars='+scroll+',status=no,resizable='+resizable+', height='+h+',width='+w+',top='+t+',left='+l+'w';var f=window.open(location,"_blank",winprops);return f;}
function abrirVentanaEx(location,w,h,scroll,resizable,menus,target){var l=0;var t=0;if(w!=0)l=(screen.availWidth-w)/2;else w=screen.availWidth;if(h!=0)t=(screen.availHeight-h)/2;else h=screen.availHeight;if(scroll==null){scroll="yes";}
if(resizable==null){resizable="no";}
if(menus==null){menus="no";}
var winprops='directories=no, toolbar=no,menubar='+menus+', scrollbars='+scroll+',status=no,resizable='+resizable+', height='+h+',width='+w+',top='+t+',left='+l+'w';var f=window.open(location,target,winprops);return f;}
function abrirDlg(location,w,h,title,type,resizable,fnRetEsp,idElemSesion,scrollable,edge,usarDialogHandler,offsetTop){var result=null;if(!NavegadorIE()){if(type==2)result='';ventana=abrirVentanaModal(location,w,h,null,resizable,title);setTimeout("evaluaCierreDialogo("+type+",'"+fnRetEsp+"','"
+idElemSesion+"')",500);}
else{if(resizable==null){resizable="no";}
if(typeof(edge)=="undefined"){edge="raised";}
if(offsetTop==undefined)offsetTop=0;var winSettings;if(offsetTop==0){winSettings="center:yes";}
else{var left=(screen.availWidth-w)/2;var top=(screen.availHeight-h)/2;top=top+offsetTop;if(top<0)top=0;if(top+h>screen.availHeight)top=screen.availHeight-h;winSettings="dialogLeft:"+left+";dialogTop:"+top;}
winSettings=winSettings+";dialogHeight:"+h+"px;dialogWidth:"+w+"px;edge:"+edge+";help:no;resizable:"+resizable+";status:no;";if(typeof(usarDialogHandler)=="undefined"||usarDialogHandler){var myDialog=new Object;myDialog.window=window;myDialog.scroll=true;myDialog.title=title;myDialog.url=location;myDialog.referrer=window.location.pathname;myDialog.argument=null;if(location.indexOf('estilo=')>-1){myDialog.estilo=location.split('estilo=')[1]}
var urlDialogoModal='';if(typeof __urlBase!='undefined'){urlDialogoModal=__urlBase;}
urlDialogoModal+="/absis/comun/html/dialoghandler/dialoghandler.html"
result=window.showModalDialog(urlDialogoModal,myDialog,winSettings);}
else{if(resizable==null){resizable="no";}
if(edge==null){edge="raised";}
winSettings=winSettings+"scroll:"+scrollable;result=window.showModalDialog(location,null,winSettings);}
if(type==null){evaluarPostBack(result);}
else if(type==1){evaluarPostBack(result);}
else if(type==2){establecerValor(result,fnRetEsp);}
return result;}}
function abrirVentanaModal(location,w,h,scroll,resizable,title){var l=0;var t=0;if(w!=0)l=(screen.availWidth-w)/2;else w=screen.availWidth;if(h!=0)t=(screen.availHeight-h)/2;else h=screen.availHeight;if(scroll==null){scroll="yes";}
if(resizable==null){resizable="no";}
var winprops='title='+title+',modal=1,dialog=1,dependant=1,directories=no, toolbar=no,menubar=0, scrollbars='+scroll+',status=no,resizable='+resizable+', height='+h+',width='+w+',top='+t+',left='+l+'w';var f=window.open(location,"_blank",winprops);return f;}
function cambiarTitulo(nuevoTitulo){if(document.title)
document.title=nuevoTitulo;}
function cambiarTituloDialogo(nuevoTitulo){window.top.document.title=nuevoTitulo;}
function resize(w,h){var ileft,itop;ileft=Math.round((window.screen.availWidth-w)/2);if(ileft<0)ileft=0;itop=Math.round((window.screen.availHeight-h)/2);if(itop<0)itop=0;top.window.moveTo(ileft,itop);top.window.resizeTo(w,h);}
function mover(t,l){top.window.moveTo(t,l);}
function centrar(){try{var w=(screenWidth()-document.body.clientWidth)/2;var h=(screenHeight()-document.body.clientHeight)/2;top.window.moveTo(w,h);}
catch(e)
{}}
function ocuparMaximo(){try{top.window.moveTo(0,0);top.window.resizeTo(screenWidth(),screenHeight());}
catch(e)
{}}
function closeWizardWithBtnCancel(){var rtn=false;if(confirm(sWzCancelMessage)){if(!sWzAperturaSmartClient){if(sWzRetornoEspecifico){if(typeof(sWzValorRetorno)=="undefined"){rtn='';}else{rtn=sWzValorRetorno;}}
window.returnValue=rtn;window.close();}else{window.external.Cerrar();}}else{return false;}}
function closeWizardDlgConceptos(){var field=document.form1.list;var sResult='';for(i=0;i<field.length;i++){if(sResult!=''){sResult=sResult+'&';}
if(field[i].checked){sResult=sResult+'1';}
else{sResult=sResult+'0';}}
document.getElementById('hdValores').value=sResult;}
function evaluaCierreDialogo(type,fnRetEsp,idElemSesion){var dialog=ventana;if(dialog!=null){if(dialog.closed){if(type==null){evaluarPostBack(result);}
else{if(type==1){evaluarPostBack(result);}
if(type==2){establecerValor(result,fnRetEsp);}}}
else{setTimeout("evaluaCierreDialogo("+type+",'"+fnRetEsp+"','"+idElemSesion+"')",500);}}}
function evaluarPostBack(result){if(result){realizarPostBack();}}
function establecerValor(result,fnRetEsp){m_absResDlg=result;if((fnRetEsp)&&(fnRetEsp!=undefined)&&(fnRetEsp.length>0))eval(fnRetEsp);}
function establecerResultado(r){result=r;}
function establecerFoco(e){var dialog=ventana;if(dialog!=null&&!dialog.closed){dialog.focus();if(window.event){window.event.cancelBubble=true;}
if(e&&e.stopPropagation){e.stopPropagation();}
if(typeof(dialog.establecerFoco)!="undefined"){dialog.establecerFoco(e);}
return false;}
return true;}
function getValorRetornoDlg(){if((m_absResDlg)&&(m_absResDlg!=undefined))return m_absResDlg;else return'';}
function nada(){}
function NavegadorIE(){if(navigator.appName.indexOf("Microsoft")!=-1){return true;}else{return false;}}
function leftTrim(sString){while(sString.substring(0,1)==' '){sString=sString.substring(1,sString.length);}
return sString;}
function rightTrim(sString){while(sString.substring(sString.length-1,sString.length)==' '){sString=sString.substring(0,sString.length-1);}
return sString;}
function trimAll(sString){while(sString.substring(0,1)==' '){sString=sString.substring(1,sString.length);}
while(sString.substring(sString.length-1,sString.length)==' '){sString=sString.substring(0,sString.length-1);}
return sString;}
function IsNumeric(strString){var strValidChars="0123456789.-";var strChar;var blnResult=true;if(strString.length==0)return false;for(i=0;i<strString.length&&blnResult==true;i++){strChar=strString.charAt(i);if(strValidChars.indexOf(strChar)==-1){blnResult=false;}}
return blnResult;}
function IsPopupBlocker(){var oWin=window.open("","testpopupblocker","width=100,height=50,top=5000,left=5000");if(oWin==null||typeof(oWin)=="undefined"){return true;}else{oWin.close();return false;}}
function ComprobarBloqueoPopups(){if(IsPopupBlocker()){document.getElementById('btnAcceptar').disabled=true;alert(sBLOQUEO_POPUPS_ACTIVADO);}}
function GetIdSesion(){var query=window.location.search.substring(1);var vars=query.split("&");for(var i=0;i<vars.length;i++){var pair=vars[i].split("=");if(pair[0].toLowerCase()=='sesionid'){return pair[1];}}}
function GetValorQueryString(id){var query=window.location.search.substring(1);var vars=query.split("&");for(var i=0;i<vars.length;i++){var pair=vars[i].split("=");if(pair[0].toLowerCase()==id.toLowerCase()){return pair[1];}}}
function ObtenerEstilo(){var estilo=null;var head=null;if(document.getElementsByTagName("head")!=null){if(document.getElementsByTagName("head")[0]!=null){var head=document.getElementsByTagName("head")[0].innerHTML;if(head.indexOf('href="/absis/comun/css/estilos/')!=-1){var start=head.indexOf('href="/absis/comun/css/estilos/')
+'href="/absis/comun/css/estilos/'.length;var stop=head.indexOf('/',start);estilo=head.substring(start,stop);}}}
return estilo;}
