
//--------------------------------------------------------------------------

	function getStream(username,albumid,imageid) {
    	var xmlHttpReq = false;
	    var self = this;
    	// Mozilla/Safari
	    if (window.XMLHttpRequest) {
    	    self.xmlHttpReq = new XMLHttpRequest();
	    }
    	// IE
	    else if (window.ActiveXObject) {
    	    self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	    }
    	self.xmlHttpReq.open('POST', "/tools/ext_stream.pl", true);
	    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    	self.xmlHttpReq.onreadystatechange = function() {
	        if (self.xmlHttpReq.readyState == 4) {
    	        updatepage2(self.xmlHttpReq.responseText);
        	}
	    }
    	self.xmlHttpReq.send(getquerystring2(username,albumid,imageid));
	}

	function getquerystring2(username,albumid,imageid) {
    	qstr = 'imageid='+imageid+'&albumid='+albumid+'&shoptype=crafted&profile='+username;  // NOTE: no '?' before querystring
	    return qstr;
	}

	function updatepage2(str){
    	document.getElementById("stream").innerHTML = str;
	}


//--------------------------------------------------------------------------

	function getCompleteStream(username,albumid,imageid) {
    	var xmlHttpReq = false;
	    var self = this;
    	// Mozilla/Safari
	    if (window.XMLHttpRequest) {
    	    self.xmlHttpReq = new XMLHttpRequest();
	    }
    	// IE
	    else if (window.ActiveXObject) {
    	    self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	    }
    	self.xmlHttpReq.open('POST', "/tools/ext_stream.pl", true);
	    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    	self.xmlHttpReq.onreadystatechange = function() {
	        if (self.xmlHttpReq.readyState == 4) {
    	        updatepage3(self.xmlHttpReq.responseText);
        	}
	    }
    	self.xmlHttpReq.send(getquerystring3(username,albumid,imageid));
	}

	function getquerystring3(username,albumid,imageid) {
    	qstr = 'imageid='+imageid+'&albumid='+albumid+'&profile='+username+'&mode=complete';  // NOTE: no '?' before querystring
	    return qstr;
	}

	function updatepage3(str){
    	document.getElementById("completestream").innerHTML = str;
	}




