var url = "/bookshop/topcart.jsp";
var ran = Math.random();
function gettopcart() {
	url = "/bookshop/topcart.jsp";
	url = url+"?"+ran;
	var data = "";
	getData(url,data);
}
function getData(url,data) {
        if (window.XMLHttpRequest) {
                req = new XMLHttpRequest();
                req.onreadystatechange = stateHandler1;
                req.open("POST", url, true);
                req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
                req.send(data);
                // branch for IE/Windows ActiveX version
        } else if (window.ActiveXObject) {
                req = new ActiveXObject("Microsoft.XMLHTTP");
                if (req) {
                        req.onreadystatechange = stateHandler1;
                        req.open("POST", url, true);
                        req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
                        req.send(data);
                }
        }
}

function stateHandler1() {
        if (req.readyState == 4){
                if (req.status == 200){
                        var val = req.responseText;
                        document.getElementById("topcart").innerHTML = val;
                }
                else{
                }
        }
        return true;
}
