function _StockMailHttpRequest(){
     var thePage = false
    if (window.XMLHttpRequest) {// Si es Mozilla, Safari etc
    thePage = new XMLHttpRequest()
        } else if (window.ActiveXObject){ // pero si es IE
        try {
    thePage = new ActiveXObject("Msxml2.XMLHTTP")
        } 
        catch (e){ // en caso que sea una versión antigua
        try{
        thePage = new ActiveXObject("Microsoft.XMLHTTP")
        }
        catch (e){}
        }
        }
        else
        return false
        return thePage;
    }
    
    function  _StockMailViewResponse(thePage){
if (thePage.readyState == 4 && (thePage.status==200 || window.location.href.indexOf("http")==-1)){
            //document.getElementById('GNALoginCustomerHolder').innerHTML=thePage.responseText;
            //$.unblockUI(); 
            result=thePage.responseText.split('|');            
            resultNumber = result[0].replace(/^\s*|\s*$/g,"");
            if(resultNumber!='0')
                document.getElementById('_lblSPMSInvalidMail').innerHTML = result[1];                
                //$.blockUI({ message: $('#_MeGustaError') }); 
                else{
                
                $.blockUI({ message: $('#_CDMStockSpamOk'), css: { width: '350px' } }); 
                //document.getElementById('_meGustaNum_').innerHTML = result[1];                
                //$.blockUI({ message: $('#_MeGustaOk') }); 
                 setTimeout($.unblockUI, 3000); 
                }
             
        }
} 


function _StockMailGetFromResult(OPath,IId,email){
//$.blockUI({ message: $('#_MeGustaBlock') }); 
var rand   = Math.random(9999);         
var url = OPath+'/Stock.aspx?Id='+IId+'&uEmail='+email+'&rand='+rand;
var thePage = _MeGustaHttpRequest();
    if(thePage=== false)
    return;
     thePage.onreadystatechange=function(){ // función de respuesta        
        _StockMailViewResponse(thePage)
        }                
        thePage.open('GET', url, true) // asignamos los métodos open y send
        thePage.send(null)
}

/*function GNALoginSubmitForm(OPath, cName, cPwd){
$.blockUI({ message: $('#GNALoadingLoginBox') }); 
 var rand   = Math.random(9999);         

var urlLand = OPath+'/?Template=_includes/_NGNAjaxLogin/NGNALoginResult';
urlLand = Base64.encode(urlLand);
var url = OPath+'/Actions.aspx?moduleName=customer&_action=login&customerName='+cName+'&customerPassword='+cPwd+'&returnUrl='+urlLand+'&rand='+rand;
var thePage = GNALoginGetHttpRequest();
    if(thePage=== false)
        return;
    
        thePage.onreadystatechange=function(){ // función de respuesta
        GNALoginLoadLoginResponse(thePage,OPath)
        }                
        thePage.open('GET', url, true) // asignamos los métodos open y send
        thePage.send(null)
}
*/

function _ShowStockMailBox(){

     $.blockUI({ message: $('#_CDMStockSpamForm'), css: { width: '350px' } }); 
    }
    
    function _HideMailBox(){

     $.unblockUI(); 
    }