﻿


function readFileHttp(fname, callback) {
    var xmlhttp = getXmlHttp();

    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4) {
            //update right side
            try {
                var t = xmlhttp.responseText.split("<!--BEGINUPDATE-->");

                if (t.length > 0) {
                    t = t[1].split("<!--ENDUPDATE-->");
                    if (t.length > 0) {
                        //debugger
                        //$get("stockBar").innerHTML = t[0];
                        $("#stockBar").html(t[0]);
                        //;document.getElementById("stockBar").innerHTML = t[0];
                        //initStockBar();

                        //initStockBar2();
                        //initStockBarAbsoluteBottom();


                    }
                }

            } catch (e) {
            }
            xmlhttp = null;
            t = null;

        }

    }
    //debugger
    xmlhttp.open("GET", fname, true);
    //xmlhttp.open("POST", fname, true);
    xmlhttp.send(null);
    
    if (typeof (handler) == 'function') {
        handler();
    }
}



/*Return a cross-browser xmlhttp request object*/
function getXmlHttp() { if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp == null) { alert("Your browser does not support XMLHTTP."); } return xmlhttp; }



