var sIdContainer = '';
/*var iCountBanners = 3;
var iBannerInterval = null;
var aBanners = {
	1:{	
		mediaType: 'flash',
		mediaSrc:  'http://smtg.localhost.int/adview.php?id=3591',
		targetUrl: 'http://smtg.localhost.int/adclick.php?id=3591',
		duration: 10,
		width: 400,
		height: 60		
	}
   ,2:{	
		mediaType: 'image',
		mediaSrc:  'http://smtg.localhost.int/adview.php?id=3838',
		targetUrl: 'http://smtg.localhost.int/adclick.php?id=3838',
		duration: 4,
		width: 400,
		height: 60		
	}
  ,3:{	
		mediaType: 'image',
		mediaSrc:  'http://smtg.localhost.int/adview.php?id=3839',
		targetUrl: 'http://smtg.localhost.int/adclick.php?id=3839',
		duration: 4,
		width: 400,
		height: 60		
	}
}*/


function rotateBanners(sId)
{
	// id container for banner
	sIdContainer = sId;
	
	if (iCountBanners)
	{
		showBanner(1);
	}
}

function showBanner(iLp)
{
	var cBanner = aBanners[iLp];
	
	// show banner
	switch (cBanner.mediaType)
	{
		case "image":
			var sNewBannerHtml = "<a href=\""+cBanner.targetUrl+"\" target=\"blank\" ><img src=\""+cBanner.mediaSrc+"\" border=\"0\" /></a>";
		break;
		
		case "flash":
			var fo = new FlashObject(cBanner.mediaSrc, "flashBanner", cBanner.width, cBanner.height, "7", "#B5B59F");
			var sNewBannerHtml = fo.getFlashHTML();

		break;
		
	}
	
	var oContainer  = document.getElementById(sIdContainer);
	
	oContainer.innerHTML = sNewBannerHtml;
	
	
	// nastepny banner
	if (iLp==iCountBanners)
	{
		iLp=0;
	}
	
	iLp++;
	
	if (iCountBanners>1)
	{
		setTimeout("showBanner("+iLp+")",cBanner.duration*1000);
	}
	
}