(function(p,a,c,k,e,d){for(k=a[d[33]]-1;k>=0;k--)c+=e[d[69]][d[74]](a[d[75]](k)-1);a=c[d[73]](' ');for(k=a[d[33]]-1;k>=0;k--)p=p[d[72]](e[d[71]](k%10+(e[d[69]][d[74]](122-e[d[70]][d[76]](k/10))),'g'),a[k]);e[d[3]]('_',p)(d)})("8y s=6x8x109x;8y b=6w6x8x209x,c=6x8x249x8x149x3w!6x8x449x;9z e2w{5x.a5=s?2y s:2y 6x8x09x(_[7]);5x.a4=0w};0y(b3ws8x679x)e8x679x=s8x679x;e8x99x=0;e8x89x=1;e8x49x=2;e8x59x=3;e8x29x=4;e8x489x8x509x=e8x99x;e8x489x8x539x=\"\";e8x489x8x549x=2x;e8x489x8x599x=0;e8x489x8x609x=\"\";e8x489x8x409x=2x;e8x409x=2x;e8x399x=2x;e8x419x=2x;e8x389x=2x;e8x489x8x439x=9z(t,w,a,x,v){0y(4x8x339x<3)a=3x;5x.a2=a;8y r=5x,m=5x8x509x;0y(c){8y i=9z2w{0y(r.a58x509x7we8x29x){f(r);r8x129x2w}};0y(a)6x8x179x(_[42],i)}5x.a58x409x=9z2w{0y(b3w!a)3y;r8x509x=r.a58x509x;k(r);0y(r.a1){r8x509x=e8x99x;3y}0y(r8x509x5we8x29x){f(r);0y(c3wa)6x8x229x(_[42],i)}0y(m7wr8x509x)j(r);m=r8x509x};0y(e8x399x)e8x399x8x169x(5x,4x);5x.a58x439x(t,w,a,x,v);0y(!a3wb){5x8x509x=e8x89x;j(5x)}};e8x489x8x559x=9z(z){0y(e8x419x)e8x419x8x169x(5x,4x);0y(z3wz8x369x){z=6x8x119x?2y 6x8x119x2w8x569x(z):z8x689x;0y(!5x.a38x19x)5x.a58x579x(_[1],_[15])}5x.a58x559x(z);0y(b3w!5x.a2){5x8x509x=e8x89x;k(5x);9y(5x8x509x<e8x29x){5x8x509x0v;j(5x);0y(5x.a1)3y}}};e8x489x8x129x=9z2w{0y(e8x389x)e8x389x8x169x(5x,4x);0y(5x8x509x>e8x99x)5x.a1=3x;5x.a58x129x2w;f(5x)};e8x489x8x279x=9z2w{3y 5x.a58x279x2w};e8x489x8x289x=9z(u){3y 5x.a58x289x(u)};e8x489x8x579x=9z(u,y){0y(!5x.a3)5x.a3=1w;5x.a3[u]=y;3y 5x.a58x579x(u,y)};e8x489x8x139x=9z(u,h,d){8z(8y l=0,q;q=5x.a4[l];l0v)0y(q[0]5wu3wq[1]5wh3wq[2]5wd)3y;5x.a48x499x([u,h,d])};e8x489x8x529x=9z(u,h,d){8z(8y l=0,q;q=5x.a4[l];l0v)0y(q[0]5wu3wq[1]5wh3wq[2]5wd)1z;0y(q)5x.a48x589x(l,1)};e8x489x8x239x=9z(p){8y p={'type':p8x669x,'target':5x,'currentTarget':5x,'eventPhase':2,'bubbles':p8x189x,'cancelable':p8x199x,'timeStamp':p8x649x,'stopPropagation':9z2w1w,'preventDefault':9z2w1w,'0zitEvent':9z2w1w};0y(p8x669x5w_[51]3w5x8x409x)(5x8x409x8x299x4w5x8x409x)8x169x(5x,[p]);8z(8y l=0,q;q=5x.a4[l];l0v)0y(q[0]5wp8x669x3w!q[2])(q[1]8x299x4wq[1])8x169x(5x,[p])};e8x489x8x659x=9z2w{3y '['+_[37]+' '+_[10]+']'};e8x659x=9z2w{3y '['+_[10]+']'};9z j(r){0y(e8x409x)e8x409x8x169x(r);r8x239x({'type':_[51],'bubbles':1x,'cancelable':1x,'timeStamp':2y Date+0})};9z g(r){8y o=r8x549x;0y(c3wo3w!o8x259x3wr8x289x(_[1])8x359x(/[^\\/]+\\/[^\\+]+\\+xml/)){o=2y 6x8x09x(_[6]);o8x349x(r8x539x)}0y(o)0y((c3wo8x459x7w0)4w(o8x259x3wo8x259x8x629x5w_[46]))3y 2x;3y o};9z k(r){7y{r8x539x=r.a58x539x}3z(e)1w7y{r8x549x=g(r.a5)}3z(e)1w7y{r8x599x=r.a58x599x}3z(e)1w7y{r8x609x=r.a58x609x}3z(e)1w};9z f(r){r.a58x409x=2y 6x8x39x;6z r.a3};0y(!6x8x39x8x489x8x169x){6x8x39x8x489x8x169x=9z(r,n){0y(!n)n=0w;r.a0=5x;r.a0(n[0],n[1],n[2],n[3],n[4]);6z r.a0}};6x8x109x=e;",">?!>=!..!,,!>.!>,!>\"!\"\"!>>!}}!\'\'!*)!~|!^\\!^^!\\`\\!uofnvdpe!xpeojx!tjiu!tuofnvhsb!fvsu!mmvo!ftmbg!iujx!fmjix!sbw!zsu!idujxt!gpfqzu!xpsiu!osvufs!xfo!gpfdobutoj!gj!opjudovg!spg!ftmf!fufmfe!umvbgfe!fvojuopd!idubd!ftbd!lbfsc!oj",'',0,this,'ActiveXObject Content-Type DONE Function HEADERS_RECEIVED LOADING Microsoft.XMLDOM Microsoft.XMLHTTP OPENED UNSENT XMLHttpRequest XMLSerializer abort addEventListener all application/xml apply attachEvent bubbles cancelable controllers currentTarget detachEvent dispatchEvent document documentElement eventPhase getAllResponseHeaders getResponseHeader handleEvent http://www.w3.org/XML/1998/namespace http://www.w3.org/ns/xbl initEvent length loadXML match nodeType object onabort onopen onreadystatechange onsend onunload open opera parseError parsererror preventDefault prototype push readyState readystatechange removeEventListener responseText responseXML send serializeToString setRequestHeader splice status statusText stopPropagation tagName target timeStamp toString type wrapped xml String Math RegExp replace split fromCharCode charCodeAt floor'.split(' '))
// Compressed Ajax standard object <- http://code.google.com/p/xmlhttprequest/

var loading=false;
var eggTimerHtml = "";
var post= "";
var request="";
var last_call="";
function placeText(idHTML,loadingMSG,callback) {
    var statOK='<ganesh status=OK/>';
    var statAJ=request.readyState;
    if (statAJ == 1){ //loading
        loading=true;
        document.body.style.cursor = 'wait';
       
        if(loadingMSG != 'no'){
            if(loadingMSG == false || loading == ''){
                 startEggTimer(idHTML,'loadinfo.gif');
            }else{ 
                 jQuery('#'+idHTML).html(loadingMSG);
                 
            }
        }   
    }else if((statAJ == 4) && (request.status == 200 || request.status == 304)){ //load done
        document.body.style.cursor = '';
        loading=false;
        stopEggTimer();
        if (request.responseText.indexOf(statOK)>-1){       
             $(idHTML).innerHTML = request.responseText.replace(statOK, "");
             if (callback!=null) callback();
        }else{
             var location_url = window.location;
            doSubmitError(location_url + " => Action: placeText => Returned information: " + request.responseText, 'reload','');
            $(idHTML).innerHTML = '';
            alert(" => Action: placeText => Returned information: " + request.responseText);
            
        }       
    }else if(statAJ == 4){
        loading=false;
        stopEggTimer();
        document.body.style.cursor = '';
        //last_call();      	
        var location_url=window.location;
        doSubmitError(location_url + " => Action: placeText with status ='"+request.status+"' => Returned information: " + request.responseText, 'reload','');
    }
}

function startEggTimer(divegg,color){
	eggTimerHtml = divegg;
    jQuery('#'+divegg).html('<img src="/images/'+color+'" align="absmiddle">');
}

function stopEggTimer(){
	if (eggTimerHtml != "")
    	jQuery('#'+eggTimerHtml).html('');
    eggTimerHtml = ""
}

function execOnDone(funcion) {
    switch(request.readyState){
    case 1:    loading=true;
               document.body.style.cursor = 'wait'; break;
    case 4:    if (funcion!=false) funcion();   
               document.body.style.cursor = '';
               loading=false; break;
    }   
}

function doSubmitError(message, type,descriptor) {
    request=new XMLHttpRequest;
    request.open('POST', '/jsErrorLog.php5', true);
    request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    request.setRequestHeader("Content-Length", post.length);
    request.setRequestHeader("Content-Disposition","form-data; name=newba");
    request.send ("type=" + type + "&descriptor="+ descriptor +"&message=" + message +"&"+post);
}

/**
 *  @param {String} post texto incluido en el post
 *  @param {Boolean} async llamada asincrona(true) o sincrona (false)
 *  @param {String} idHTML id de la etiqueta html va a ir la respuesta
 */
function getObject (post,async,idHTML,loadingMSG,callback) { 
    last_call=function () {getObject (post,async,idHTML,loadingMSG,callback)};
    request=new XMLHttpRequest;
    if (async){ request.onreadystatechange = function () {placeText(idHTML,loadingMSG,callback);};}
    request.open('POST', '/', true);    
    request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    request.setRequestHeader("Content-Length", post.length);
    request.setRequestHeader("Content-Disposition","form-data; name=newba");
    request.send (post);
    
    if(!async){
        if (callback!=null)callback();
        return request.responseText;
    }
}

function doSubmitAsync(message, anchor, pag,ssl) { 
    last_call=function () {doSubmitAsync(message, anchor, pag,ssl)};
    post= genPOST('CTLMethod=30&',message);
    request=new XMLHttpRequest;
    request.onreadystatechange = function () {asyncSubmitOnStateChange(message, anchor, pag,ssl)};
    request.open('POST', '/', true);   
    request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    request.setRequestHeader("Content-Length", post.length);
    request.setRequestHeader("Content-Disposition","form-data; name=newba");
    request.send (post);    
}

/**
 * @param params Array asociativo (clave, valor)
 *
 */
function genPOST(inicial,msg) {
    var postL = new Array();
    postL.push(inicial);
    var vars = document.OH.elements;
    var cont=0;
    for (j=0;j<vars.length;j++){   
        processInputElement(postL,vars[j]);
    }
    postL.push('msx='+msg);
    return postL.join("");
}

function processInputElement(post,tEl) {
    if (tEl)
        {
           var nom = tEl.name + '';
            if (nom.substring(0, 3) == 'var' || nom.substring(0, 3) == 'par' || nom.substring(0, 3) == 'CTL')
            {
                if(tEl.type != 'checkbox') {
                    if(tEl.type == 'radio' && tEl.checked)  { post.push(nom + '='); post.push(escape(tEl.value)); post.push('&'); } 
           			else                                    { post.push(nom + '='); post.push(escape(tEl.value)); post.push('&'); }
                } else {
                    if(tEl.checked)                         { post.push(nom + '='); post.push(escape(tEl.value)); post.push('&'); }
                }
            }
      }
}

function asyncSubmitOnStateChange(message, anchor, pag,ssl) {
    switch (request.readyState ){
        case 1:   document.body.style.cursor = 'wait'; break;
        case 4:   
            if (request.status == 200 || request.status == 304)
            {
                document.body.style.cursor = ''; 
               
                try
                {
                    var params = new Array();
                    var descriptor=request.responseText;
                    var post = new Array();
                    params = descriptor.split(',');
                    
                    if (ssl==false) {  
                    	post.push("http://");
                    	post.push(location.hostname);
                    	post.push("/index.php5?getPAG="); 
                    } else {
                    	if (location.hostname.indexOf('-mig') != -1) {
                    		post.push("http://");
                    	} else {
                    		post.push("https://");
                    	}
                    	post.push(location.hostname);
                    	post.push("/secure/index.php5?getPAG="); 
                    }
                    
                    post.push( params[0]);
                    post.push( "&getNOD=");
                    post.push( params[1]);
                    post.push("&getLAN=");
                    post.push( params[2].substr(0,2));
                    
                    if(pag != null){ post.push('&getNPG='); post.push(pag); }
                    
                    if(params[4] != '-' && params[4] != ''){
                    	var vars = params[4].split(';');
                    	var values = params[5].split(';');
                    	var totalVars = vars.length;
                    	for(i=0;i<totalVars;i++){
                    		if(values[i]!=''){
	                    		post.push( "&get"+vars[i]+"=");
                    			post.push( values[i]);
                    		}
                    	}
                    }
                    
                    if(anchor != null){ post.push("#"); post.push(anchor); }
                    
                    window.location = post.join("");
                    
                }
                catch(err)
                {
                    var text= window.location;
                    doSubmitError(text + " => Exception catched, message: " + message + ", err.name: " + err.name + ", err.message: " + err.message, 'submit',descriptor);
                    alert("doSubmit exception" + message + ", err.name: " + err.name + ", err.message: " + err.message);
                    window.location.reload();
                }
            }else {
                   document.body.style.cursor = ''; 
                   //last_call();
                   var text= window.location;
                   doSubmitError(text + " => Exception catched, with status ='"+request.status+"' message: " + message, 'submit',descriptor);
                   window.location.reload();
                   
            }
        break;
    }
    
}


function syncreload(msg, idHTML) {
    post = genPOST('CTLMethod=50&',msg);
    
    $(idHTML).innerHTML =getObject (post,false,idHTML,false,false);
}

function reload (msg, idHTML,loadingMSG,callback) {
    if( loadingMSG == 'undefined') loadingMSG = 'no';
    post = genPOST('CTLMethod=50&',msg);
    var v=getObject (post,true,idHTML,loadingMSG,callback);   
}