function ajax(url,target,timeout) {
   document.getElementById(target).innerHTML = 'loading...';
   if (window.XMLHttpRequest) {
       req = new XMLHttpRequest();
       req.onreadystatechange = function() {ajaxDone(target);};
       req.open("GET", url, true);
       req.send(null);
   } else if (window.ActiveXObject) {
       req = new ActiveXObject("Microsoft.XMLHTTP");
       if (req) {
           req.onreadystatechange = function() {ajaxDone(target);};
           req.open("GET", url, true);
           req.send();
       }
   }
   setTimeout(function(){ajax(url,target,timeout)}, timeout);
}

function ajaxDone(target) {
	if (req.readyState == 4) {
		if (req.status == 200 || req.status == 304) {
			var parsedResponse = req.responseXML;
			var html_content = parsedResponse.getElementsByTagName('quotation').item(0).firstChild.nodeValue;
			document.getElementById(target).innerHTML = html_content;
		} else {
			document.getElementById(target).innerHTML="ajax error:\n" + req.statusText;
		}
	}
}

var timerID=0;
var imgArray = new Array(
	'concen.logo.1',
	'concen.logo.1c',
	'ConCenLogo2a',
	'ConCenLogo3',
	'ConCenLogo-April',
	'ConCenLogo-DD-Meth2',
	'ConCenLogo-Default',
	'ConCenLogo-Eyeball2',
	'ConCenLogo-Fingerprint',
	'ConCenLogo-F-Liquid',
	'ConCenLogo-Holes',
	'ConCenLogo-LED',
	'ConCenLogo-Mason',
	'ConCenLogo-NB-17',
	'ConCenLogo-NB-Black',
	'ConCenLogo-NB-Clean',
	'ConCenLogo-NB-Demon',
	'ConCenLogo-NB-Lunar',
	'ConCenLogo-Neon',
	'ConCenLogo-Pyramid',
	'ConCenLogo-Silva',
	'ConCenLogo-Static',
	'ConCenLogo-NB-Solar',
	'ConCenLogo-NB-White',
	'url-the-alien',
	'url-the-alien-ip'
);
function rotateLogo() {
	imgIndex = Math.ceil(Math.random() * imgArray.length) - 1;
	document.images["ConCenLogo"].src= "images/logos/" + imgArray[imgIndex] + ".png";
}
function setupLogo() {
	rotateLogo();
	timerID = setInterval("rotateLogo()", 5*1000); // refresh interval in thousandths of seconds
}
function setdownLogo() {
	if (timerID)
		clearInterval(timerID);
}


