function ow(url,name,width,height) { 
 if (screen.availHeight&&height*1>screen.availHeight-30)	height = screen.availHeight-30;
 if (screen.availWidth&&width*1>screen.availWidth-30)		width = screen.availWidth-70;
 win = window.open(url,name,'width='+width+',height='+height+',location=no,scrollbars=yes,resizable=yes,left=30,top=30,');
 win.focus();
}

required_banners = '/b/';
j = 0;
k = 0;
line = new Array();

function loadXMLDoc(url) {
	if (window.XMLHttpRequest) {
		req= new XMLHttpRequest();
		req.onreadystatechange = processReqChange;
		req.open("GET", url, true);
		req.send(null);
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			req.onreadystatechange = processReqChange;
			req.open("GET", url, true);
			req.send();
		}
	}
}

function processReqChange() {
	if (req.readyState == 4) {
		if (req.status == 200) {
      		response = req.responseXML.documentElement;
     		for (var i = 0; i < response.childNodes.length; i++){
				if (response.childNodes[i].nodeName != '#text') {
					var banner = response.childNodes[i];
					document.getElementById(banner.getAttribute('container')).innerHTML = banner.firstChild.data;
					k++;
      		   }
      		}
      		
      		if ( k < j) {
      			loadXMLDoc(line[k]);
      		}
		}
	}
}


function getBanner(input,container_id,template) {
	line[j] = required_banners + input + ';' + container_id + ';' + ((typeof template == 'undefined')?'':template) + '/';
	if ( k == j) { loadXMLDoc(line[k]);	}
	j++;
}
