var req;
var reqTimeout;

//send_currency 
function send_currency(url) {
    req = null;
    if (window.XMLHttpRequest) {
        try {
            req = new XMLHttpRequest();
        } catch (e){}
    } else if (window.ActiveXObject) {
        try {
            req = new ActiveXObject('Msxml2.XMLHTTP');
        } catch (e){
            try {
                req = new ActiveXObject('Microsoft.XMLHTTP');
            } catch (e){}
        }
    }
 
    if (req) {
        req.onreadystatechange = insert_into_DB;
        req.open("GET", url, true);
        req.send(null);
        reqTimeout = setTimeout("req.abort();", 5000);
    } else {
        alert("Браузер не поддерживает AJAX");
    }
}
 
function insert_into_DB() {
 
    if (req.readyState == 4) {
        clearTimeout(reqTimeout);
 
        // only if "OK"

    }  
}
 
function currency(params)
{
  send_currency('/currency/send_currency.php?'+params);
}

