var m_TimeVal = 3000;
//var isIE = false;
//var isNN = false;
var currentVisible = new Array();
var slidesTimer = new Array();
var links = new Array();
var images = new Array();

/* uncomment if common.js is not used
function Initialize()
{
	if (document.getElementById && navigator.appName.indexOf("Microsoft") < 0)
		isNN = true;
	else if (document.all)
		isIE = true;
}
function GetElement(id)
{
	if (document.getElementById)
		return document.getElementById(id);
	else if (document.all)
		return document.all(id);
	return null;
}
*/
function ChangeRealization(id)
{
	var a = GetElement(id + "_a");
	var image = GetElement(id);
	if (!a || !image)
		return;
	clearTimeout(slidesTimer[id]);		
	if (currentVisible[id] >= links[id].length)
		currentVisible[id] = 0;
	a.href = links[id][currentVisible[id]];
	image.src = images[id][currentVisible[id]];
	slidesTimer[id] = setTimeout('ChangeRealization("' + id + '")', m_TimeVal);
	currentVisible[id] = currentVisible[id] + 1;
}
function InitializeRealization(id)
{
	currentVisible[id] = 0;
	links[id] = new Array();
	images[id] = new Array();
}
function StartRealization(id)
{
	currentVisible[id] = Math.floor(Math.random()*images[id].length);
	ChangeRealization(id);
//	slidesTimer[id] = setTimeout('ChangeRealization("' + id + '")', m_TimeVal);	
}
function AddLinkRealization(id, image, link)
{
	images[id][images[id].length] = image;
	links[id][links[id].length] = link;
}
