function _MeGustaHttpRequest(){
     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 versin antigua
        try{
        thePage = new ActiveXObject("Microsoft.XMLHTTP")
        }
        catch (e){}
        }
        }
        else
        return false
        return thePage;
    }
    
    function  _MeGustaViewResponse(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')
                $.blockUI({ message: $('#_MeGustaError'),css: {border: 'none'} }); 
                else{
                document.getElementById('_meGustaNum_').innerHTML = result[1];     
                document.getElementById('_megustaMensaje1').style.display='none';         
                document.getElementById('_megustaMensaje2').style.display='inline';  
                $.blockUI({ message: $('#_MeGustaOk'),css: {border: 'none'} }); 
                }
             setTimeout($.unblockUI, 3000); 
        }
} 


function _ThisItemLikesMe(OPath,IId){

/*alert('antes');
 jQuery.noConflict();
alert('hizo No conflict');*/
$.blockUI({ message: $('#_MeGustaBlock'),css: {border: 'none'} }); 

var rand   = Math.random(9999); 
var url = OPath+'/ILikeIt.aspx?PID='+IId+'&rand='+rand;
var thePage = _MeGustaHttpRequest();
    if(thePage=== false)
    return;
     thePage.onreadystatechange=function(){ // funcin de respuesta
        _MeGustaViewResponse(thePage)
        }                
        thePage.open('GET', url, true) // asignamos los mtodos 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(){ // funcin de respuesta
        GNALoginLoadLoginResponse(thePage,OPath)
        }                
        thePage.open('GET', url, true) // asignamos los mtodos open y send
        thePage.send(null)
}
*/
