var refreshid;

function openWindow(name, track)
{
	pageTracker._trackPageview(track);
	
	window.open (name, "mywindow","location=0,status=0,scrollbars=1,addressbar=0,width=400,height=500"); 	
}

function banner_refresh(_section, _zone)
{
	clearInterval (refreshid);
	
	refreshid = setInterval("banner_refresh('" + _section + "','" + (_zone ? _zone : "") +"');", 180000);
	
	//alert("refresh: " + _section);
	var section, zone, sky_url, ldr_url;
	
	var rand = Math.floor(Math.random() * 1000000);
	var gender = SITE_GENDER == "m" ? "b" : "g";

	if (_zone)
		zone = gender + "." + _zone;	
	else
		zone = "_default";

	if (_section == "splash" || _section == "test")
		section = _section + "/_default";
	else
		section = _section + "." + gender + "/" + zone;
	
	sky_url = "http://ad.uk.doubleclick.net/adi/toonattik.tv." + section + ";pos=2;tile=2;sz=120x600,1x1;ord=" + rand;
	ldr_url = "http://ad.uk.doubleclick.net/adi/toonattik.tv." + section + ";pos=1;tile=1;sz=728x90,1x1;dcopt=ist;ord=" + rand;
	mpu_url = "http://ad.uk.doubleclick.net/adi/toonattik.tv." + section + ";pos=5;tile=5;sz=300x250,1x1;ord=" + rand;
		
	var leader = document.getElementById("leader_iframe");
	leader.src = ldr_url;
	
	try 
	{
		var sky = document.getElementById("sky_iframe");
		sky.src = sky_url;
	}
	catch(error)
	{}
	
	try
	{
		var mpu = document.getElementById("mpu_iframe");
		mpu.src = mpu_url;
	}
	catch(error)
	{}
}