/*------------------[      Dynamic Banners System      ]-------------------*/
/*                                                                         */
/*   This JavaScript module is a copyright of Svetlin Staev. It could be   */
/*  copied, modified and/or reproduced in any form let it be private or    */
/*  public with the only means of recognition to its authors in the form   */
/*  of this copyright message.                                             */
/*                                                                         */
/*  Date   : 04/29/2002                                                    */
/*  Author : Svetlin Staev (svetlins@yahoo.com)                            */
/*                                                                         */
/*     Copyright(c)2001,2002 Infinity Interactive. All rights reserved.    */
/*-------------------------------------------------------------------------*/
flagIt = false;
sup  = 2;
next = 1;
setTime = 5000;
data = ["" // Banner Data Container
	   ,""
	   ,""
	   ,""
	   ];

x2 = 20;
x1 = -100;
y = 55;
function matchBanners()
	{
		b = new obj("banner1");
		r = new obj("banner2");
		p = new Dimentions();
		r.moveTo((p.width-r.w)/2+y, x1);
		b.moveTo((p.width-b.w)/2+y, x2);
		r.show();
		b.show();
		set = setTimeout("swap()",setTime);
	}
i=0;
function swap()
	{
		ra = Math.round(Math.random()*(data.length-1));
		if (flagIt)
			{
				r.setZ(sup);
				r.slideTo(r.x,x2,5,5);
				b.slideTo(b.x,x1,5,5,b.write(data[ra]));
				flagIt = false;
				if (next >= (data.length-1))
					next = 1;
				else 
					next++;
			}
		else
			{
				b.setZ(sup);
				b.slideTo(r.x,x2,5,5);
				r.slideTo(r.x,x1,5,5,r.write(data[ra]));
				flagIt = true;
				if (next >= (data.length-1))
					next = 1;
				else 
					next++;
			}
		sup+=2;
		set = setTimeout("swap()",setTime);
	}