//Author: Gal M
//©Copyright AV://Studio (http://www.av-studio.si). All rights reserved.

var indeks=-1,st=[],ime=[],dir=[],dat=[];

function GinicSlik() {
	if (document.images) {
		var pot,slike=new Array();
		dat[++indeks] = GinicSlik.arguments;
		ime[indeks] = dat[indeks][0]
		pot = eval('document.'+ime[indeks]+'.src');
		dir[indeks] = pot.substring(pot.indexOf('/',pot.indexOf('//')+2),pot.lastIndexOf('/')+1);
		dat[indeks][0] = pot.substring(pot.lastIndexOf('/')+1,pot.length);
		for (var i=1;i<dat[indeks].length;i++) {
			slike[i-1] = new Image();
			slike[i-1].src = dir[indeks]+dat[indeks][i];
		}
		st[indeks] = [1];
		setTimeout('GzamenjajSliko('+indeks+')',1000);
		setInterval('GzamenjajSliko('+indeks+')',3000);
	}
}
function GzamenjajSliko(id) {
	if (!(st[id]<dat[id].length)) st[id]=0;
	if (eval('document.'+ime[id]+'.filters')) { // MS IE
		eval(ime[id]+'.style.filter="blendTrans(duration=1.5)"');
		eval(ime[id]+'.filters.blendTrans.apply()');
		eval(ime[id]+'.filters.blendTrans.play()');
	}
	eval('document.'+ime[id]+'.src=\''+dir[id]+dat[id][st[id]]+'\'');
	st[id]++;
}