function FlashLoop()
{
	this.currMovie = -1;
	this.holderElm = null;
	this.movieTimeOut = null;
	
	this.movieArray = new Array(
							//{'file' : 'http://www.directory.ge/banners/tbc_million468x60ge.swf', 'time' : 13},
							/*{'file' : 'http://www.directory.ge/banners/photo468x60.swf', 'time' : 8},*/
							{'file' : 'http://www.directory.ge/banners/shoba.swf', 'time' : 57}
							//{'file' : 'http://www.directory.ge/banners/adjarabet_468x60new.swf', 'time' : 25},
							//{'file' : 'http://www.directory.ge/banners/top.swf', 'time' : 57}
							);
this.preloadedArray = new Array();
	
	this.preloadFlashes = function()
	{
		var temp = null; 
		var dBody = document.getElementsByTagName('body')[0];
		for (var i=0; i<this.movieArray.length;i++)
		{
			temp = document.createElement('div');
			temp.style.visibility	= 'hidden';
			temp.style.display		= 'none';
			temp.style.width		= '1px';
			temp.style.height		= '1px';
			
			temp.innerHTML = '\
			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="468" height="60">\
			  <param name="movie" value="'+this.movieArray[i]['file']+'" />\
			  <param name="quality" value="high" />\
			  <param name="wmode" value="opaque" />\
			  <embed src="'+this.movieArray[i]['file']+'" quality="high" wmode="opaque" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="468" height="60"></embed>\
			</object>\
			';
			dBody.appendChild(temp);
			this.preloadedArray[i] = temp;
		}
	}
	
	this.SwapMovie = function()
	{
		if (this.currMovie>=this.movieArray.length-1) this.currMovie = -1;
		this.currMovie ++;
		
		//alert (this.preloadedArray.length);
				
		this.holderElm.innerHTML = this.preloadedArray[this.currMovie].innerHTML;
		this.setMovieTimeOut();
		if (actInput != null)  { actInput.focus(); }
	}

	this.setMovieTimeOut = function(TO)
	{
		if (this.movieTimeOut){
			clearInterval(this.movieTimeOut);
		}
		if (!TO) TO = this.movieArray[this.currMovie]['time'];
		this.movieTimeOut = setInterval("FLSwap.SwapMovie()",TO*1000);	
	}	
	
	this.setHolderElm = function(elm)
	{
		this.holderElm = elm;
	}
	
	this.initAll = function(Elm)
	{
		FLSwap.preloadFlashes();
		FLSwap.setHolderElm(document.getElementById(Elm));		
		FLSwap.setMovieTimeOut(4);
	}
	
}

var FLSwap = new FlashLoop();
