//Gets the browser specific XmlHttpRequest Object
 function getXmlHttpRequestObject()
 {
   if (window.XMLHttpRequest) {
     return new XMLHttpRequest();
   } else if (window.ActiveXObject) {
     return new ActiveXObject("Microsoft.XMLHTTP");
   } else {
     alert("Unsupported browser");
   }
 }
 
//========================================== НЕ му е тук мястото, но не знам къде е по-подходящо
var streamQuotesReq = getXmlHttpRequestObject();
//Starts the AJAX request.

function changeStreamQuotes() {
  if (streamQuotesReq.readyState == 4 || streamQuotesReq.readyState == 0) {
    document.streamQuotes = !document.streamQuotes;
    //alert('change stream to: ' + document.streamQuotes);
    streamQuotesReq.open("GET", '/ar/streamQuotes/' + document.streamQuotes, true);
    streamQuotesReq.send(null);
    
    document.getElementById("stream_quotes").innerHTML = document.streamQuotes ? document.msgs["yes"] : document.msgs["no"];
  }
}

