var limit=0;

function bannerXml() { 
	
	var xmldoc = xmlhttp.responseXML; 
	
	var image = xmldoc.getElementsByTagName('image');
	var url = xmldoc.getElementsByTagName('url'); 
   	
	if(xmlhttp.readyState==4){
	
	banner = document.getElementById("bannerbox");
	banner.innerHTML="";
	
	
	/* Temp */
	
	/* --- */
	
	for(var i = 0; i < image.length; ++i){
		
		img = document.createElement("img");
		img.setAttribute('src','thumb/banner/'+image[i].firstChild.nodeValue);
		
		try{
			if(url[i]){
				imgLink = document.createElement("a");
				imgLink.setAttribute('href','http://'+url[i].firstChild.nodeValue);
				imgLink.setAttribute('target','_blank');
				imgLink.appendChild(img);
				banner.appendChild(imgLink);
			}
		}catch(e){
			
			banner.appendChild(img);
		}
		
	}
		limit+=4;
		if(image.length==0) {
			limit=0;
			clearTimeout();
		}
		
	}
	
	
}

function init(){
	
	loadXMLDoc('php/xml.php?limit='+limit,'bannerXml');
	setTimeout("init()",15000);
}

