var bannerIdArray = new Array();
var bannerSrcArray = new Array();

var bannerIdArrayMax = 0;
var bannerSrcArrayMax = 0;

function b2wbanner(position, priority, tag) { 
	
    var host = 'www.shoptime.com.br';
	position = 'pos'+position;
	priority = 'pri'+priority;
	if (tag.length > 0) {
		tag = 'tag'+tag;
	}
	var clause = position + ',' + '_' + priority + ',' + '_' + tag;
	var m3_u = (location.protocol == 'https:' ? 'https://'+host+'/openx/www/delivery/ajs.php' : 'http://'+host+'/openx/www/delivery/ajs.php'); 
	if (!document.MAX_used) { document.MAX_used = ','; }
	m3_u = m3_u + '?what='+clause;
	if (document.MAX_used != ',') { m3_u = m3_u + "&amp;exclude=" + document.MAX_used; }
	//m3_u = m3_u + "&amp;loc="+escape(window.location);
	if (document.referrer) { m3_u = m3_u + "&amp;referer=" + escape(document.referrer); }
	if (document.context) { m3_u = m3_u + "&context=" + escape(document.context); }
	if (document.mmm_fo) { m3_u = m3_u + "&amp;mmm_fo=1"; }	
	//new Ajax.Updater(divId, m3_u);
	return m3_u;
}

function shopAsyncBanner(divId, position, priority, tag) { 

    var host = 'www.shoptime.com.br';	
	position = 'pos'+position;
	priority = 'pri'+priority;
	if (tag.length > 0) {
		tag = 'tag'+tag;
	}
	var clause = position + ',' + '_' + priority + ',' + '_' + tag;
	var m3_u = (location.protocol == 'https:' ? 'https://'+host+'/openx/www/delivery/aajx.php' : 'http://'+host+'/openx/www/delivery/aajx.php'); 
	if (!document.MAX_used) { document.MAX_used = ','; }
	m3_u = m3_u + '?what='+clause;
	if (document.MAX_used != ',') { m3_u = m3_u + "&amp;exclude=" + document.MAX_used; }
	//m3_u = m3_u + "&amp;loc="+escape(window.location);
	if (document.referrer) { m3_u = m3_u + "&amp;referer=" + escape(document.referrer); }
	if (document.context) { m3_u = m3_u + "&context=" + escape(document.context); }
	if (document.mmm_fo) { m3_u = m3_u + "&amp;mmm_fo=1"; }	
	new Ajax.Updater(divId, m3_u);
	//return m3_u;
}

function blocAsyncBanner(divId, position) { 
	var host = 'www.'+getHost().split('.')[1]+'.com.br';
	var m3_u = (location.protocol == 'https:' ? 'https://'+host+'/openx/www/delivery/aajx.php' : 'http://'+host+'/openx/www/delivery/aajx.php'); 
	if (!document.MAX_used) { document.MAX_used = ','; }
	m3_u = m3_u + '?what='+position;
	if (document.MAX_used != ',') { m3_u = m3_u + "&amp;exclude=" + document.MAX_used; }
	//m3_u = m3_u + "&amp;loc="+escape(window.location);
	if (document.referrer) { m3_u = m3_u + "&amp;referer=" + escape(document.referrer); }
	if (document.context) { m3_u = m3_u + "&context=" + escape(document.context); }
	if (document.mmm_fo) { m3_u = m3_u + "&amp;mmm_fo=1"; }	
	//alert(m3_u);
	new Ajax.Updater(divId, m3_u);
	//return m3_u;
}

function getHost() {
	var url = window.location.href;	
	var host = url.split('//')[1];	
	url = host.split('/');
	host = url[0];
	return host;
}