﻿function SalvarStat(atributo)
{
    var xmlhttp;
        
    try
    { 
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
    }
    catch (e) { 
        try { 
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
        } catch (E) { 
            xmlhttp = false; 
        } 
    } 

    if  (!xmlhttp && typeof  XMLHttpRequest != 'undefined' ) { 
        try  { 
            xmlhttp = new  XMLHttpRequest(); 
        } catch  (e) { 
            xmlhttp = false ; 
        } 
    } 
    
    var url;
    var loc = location.href;
    
    if(loc.indexOf('www.repolitica.com.br') > 0)
        url = "http://www.repolitica.com.br/panel/stat.ashx?a=" + escape(atributo);
    else
        url = "http://repolitica.com.br/panel/stat.ashx?a=" + escape(atributo);
    
    xmlhttp.onreadystatechange = function() {//Call a function when the state changes.
        if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            //vazio
        }
    }
    
    xmlhttp.open("GET", url,  true);
    xmlhttp.send(null); 
}

function SalvarBusca(atributo)
{
    var xmlhttp;
        
    try
    { 
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
    }
    catch (e) { 
        try { 
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
        } catch (E) { 
            xmlhttp = false; 
        } 
    } 

    if  (!xmlhttp && typeof  XMLHttpRequest != 'undefined' ) { 
        try  { 
            xmlhttp = new  XMLHttpRequest(); 
        } catch  (e) { 
            xmlhttp = false ; 
        } 
    } 
    
    var url;
    var loc = location.href;
    
    if(loc.indexOf('www.repolitica.com.br') > 0)
        url = "http://www.repolitica.com.br/master/buscar.ashx?q=" + escape(atributo);
    else
        url = "http://repolitica.com.br/master/buscar.ashx?q=" + escape(atributo);
    
    xmlhttp.onreadystatechange = function() {//Call a function when the state changes.
        if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            //vazio
        }
    }
    
    xmlhttp.open("GET", url,  true);
    xmlhttp.send(null); 
}
