var banDelay = 5000; // display for 5.000 seconds each

var banners = {
banner_1 : [
'<object type="application/x-shockwave-flash" data="Banners/orange_01.swf" width="600" height="90"><param name="movie" value="Banners/orange_01.swf" \/><param name="wmode" value="transparent"><\/object>',
'<object type="application/x-shockwave-flash" data="Banners/orange_02.swf" width="600" height="90"><param name="movie" value="Banners/orange_02.swf" \/><param name="wmode" value="transparent"><\/object>' 
]
};

var banDelays = {
banner_1 : [13900, 19000]
};



// Banner Rotator
// copyright 12th October 2009 by Stephen Chapman
// http://javascript.about.com
// permission to use this Javascript on your web page is granted
// provided that all of the code below in this script (including these
// comments) is used without any alteration

var banimg = []; 

for (x in banners) 
{
	for (var i=banners[x].length-1; i >= 0; i--) 
	{
		var b = banners[x][i].match(/<img.+?src=['"](.*?)['"]/);
		if (b) banimg.push(b[1]);
	}
} 
for (var i = banimg.length - 1; i >= 0; i--) 
{
	var h = new Image(); 
	h.src = banimg[i];
}

function randOrd()
{
	return (Math.round(Math.random())-0.5); 
}

var banlist = [];

function Ban(b) 
{
	this.loc = document.getElementById(b);
	this.ary = banners[b];
	//var randOrder = randOrd();
	//this.ary.sort(randOrd);
	this.del = banDelays[b];
	//this.del.sort(randOrd);
	this.cnt = -1;
	banlist.push(this);
}

var delay = 0;

function rotateBan() 
{
//	for (var j = banlist.length - 1; j >= 0; j--) 
//	{
//		var max = banlist[j].ary.length;
//		banlist[j].cnt++;
//		if (banlist[j].cnt >= max) banlist[j].cnt = 0;
//		banlist[j].loc.innerHTML = banlist[j].ary[banlist[j].cnt];
//	}

    var max = banlist[0].ary.length;
	banlist[0].cnt++;
	if (banlist[0].cnt >= max) banlist[0].cnt = 0;
	banlist[0].loc.innerHTML = banlist[0].ary[banlist[0].cnt];

	
	//setTimeout(rotateBan,banDelay);
	setTimeout(rotateBan,banlist[0].del[banlist[0].cnt]);

} 

function startBanner() {
//	for (x in banners) 
//	{
//		if (document.getElementById(x)) new Ban(x);
//	} 
//	rotateBan();
} 

//window.onload = startBanner;

