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

	function xmlhttpPost(strURL) {
    	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', strURL, true);
	    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    	self.xmlHttpReq.onreadystatechange = function() {
	        if (self.xmlHttpReq.readyState == 4) {
    	        updatepage(self.xmlHttpReq.responseText);
        	}
	    }
    	self.xmlHttpReq.send(getquerystring());
	}

	function getquerystring() {
    	var form     = document.forms['f1'];
	    var word = form.word.value;
    	qstr = 'w=' + escape(word);  // NOTE: no '?' before querystring
	    return qstr;
	}

	function updatepage(str){
    	document.getElementById("result").innerHTML = str;
	}

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

	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+'&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;
	}




//JavaScript:xmlhttpPost("/tools/ajax.pl")


function popUp2(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=540,height=570,left = 475,top = 345');");
}

function PopUp(URL) {
    popUp(URL);
}

function popUp(URL) {
    day = new Date();
    id = day.getTime();
    ok = window.open(URL, id , 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=710,height=490,left = 300,top = 150');
    //return false;
    //if (ok) return false;
  //else return true;

}

