
// promenljive:

niz_organi=
[
	[
	'<a href="http://www.mos.gov.rs/" target="_blank"><img src="/slike/baneri/ministarstvo.gif" alt="Ministarstvo omladine i sporta" width="90" height="63" border="0" title="Ministarstvo omladine i sporta Srbije" /></a><br/><br/><br/><a href="http://www.adas.org.rs" target="_blank"><img src="/slike/baneri/adas.gif" alt="Antidoping agencija Republike Srbije" title="Antidoping agencija Republike Srbije" width="128" height="52" border="0" /></a><br/><br/><br/><a href="http://www.oks.org.yu/" target="_blank"><img src="/slike/baneri/oks.gif" alt="Olimpijski komitet Srbije" width="50" height="63" border="0" title="Olimpijski komitet Srbije" /></a><br/><br/><br/><a href="http://www.serbiansport.com" target="_blank"><img src="/slike/baneri/sss.gif" alt="Sportski savez Srbije" title="Sportski savez Srbije" width="55" height="52" border="0" /></a><br/><br/><br/>'
	], [
	'<a href="http://www.bsma.info" target="_blank"><img src="/slike/baneri/bsma.jpg" alt="Balkan Sports Medicine Association" title="Balkan Sports Medicine Association" width="100" height="106" border="0" /></a><br/><br/><br/><a href="http://www.efsma.net" target="_blank"><img src="/slike/baneri/efsma.gif" alt="European Federation of Sports Medicine Associations" title="European Federation of Sports Medicine Associations" width="79" height="102" border="0" /></a><br/><br/><br/><a href="http://www.fims.org" target="_blank"><img src="/slike/baneri/fims.jpg" alt="International Federation of Sports Medicine" title="International Federation of Sports Medicine" width="88" height="97" border="0" /></a><br/><br/><br/><a href="http://www.ecss.de" target="_blank"><img src="/slike/baneri/ecss.gif" alt="European College of Sport Science" title="European College of Sport Science" width="100" height="101" border="0" /></a><br/><br/><br/>'
	]
]

niz_partneri=
[
	[
	'<a href="http://www.vita-maxima.org" target="_blank"><img src="/slike/baneri/vita-maxima.gif" alt="Vita Maxima" width="105" height="99" border="0" title="Vita Maxima" /></a><br/><br/><br/><a href="http://www.suplementi.org.yu" target="_blank"><img src="/slike/baneri/suplementi.gif" alt="Suplementi" title="Suplementi" width="120" height="44" border="0" /></a><br/><br/><br/><a href="http://www.aerolit.co.yu" target="_blank"><img src="/slike/baneri/aerolit.gif" alt="Aerolit" width="120" height="42" border="0" title="Aerolit" /></a><br/><br/><br/><a href="http://www.technogym.co.yu" target="_blank"><img src="/slike/baneri/technogym.gif" alt="Technogym" title="Technogym" width="120" height="50" border="0" /></a><br/><br/><br/>'
	], [
	'<strong>powergym</strong><br/><br/><br/><a href="http://www.bafa-scg.com" target="_blank"><img src="/slike/baneri/bafa.gif" alt="Belgrade Aerobic and Fitness Association" title="Belgrade Aerobic and Fitness Association" width="110" height="111" border="0" /></a><br/><br/><br/><a href="http://www.sebastian.org.yu" target="_blank"><img src="/slike/baneri/rk-sebastian.gif" alt="RK Sebastian" title="RK Sebastian" width="120" height="105" border="0" /></a><br/><br/><br/><a href="http://www.drfeelgood.org.yu"><img src="/slike/baneri/drfeelgood.gif" alt="Doctor Feelgood" title="Doctor Feelgood" width="105" height="63" border="0" /></a><br/><br/><br/>'
	]
]

niz_linkovi=
[
	[
	'<a href="http://www.med.bg.ac.rs/" target="_blank"><img src="/slike/baneri/med.jpg" alt="Medicinski fakultet" width="76" height="102" border="0" /></a><br/><br/><br/><a href="http://www.zdravlje.gov.rs/" target="_blank"><img src="/slike/baneri/zdravlje.jpg" alt="Ministarstvo zdravlja" width="102" height="72" border="0" /></a><br/><br/><br/><br /><a href="http://www.wada-ama.org/en/" target="_blank"><img src="/slike/baneri/wada.jpg" alt="Svetska antidoping agencija" border="0" /></a><br/><br/><br/>'
	], [
	'<a href="http://www.med.bg.ac.rs/" target="_blank"><img src="/slike/baneri/med.jpg" alt="Medicinski fakultet" width="76" height="102" border="0" /></a><br/><br/><br/><a href="http://www.zdravlje.gov.rs/" target="_blank"><img src="/slike/baneri/zdravlje.jpg" alt="Ministarstvo zdravlja" width="102" height="72" border="0" /></a><br/><br/><br/><br /><a href="http://www.wada-ama.org/en/" target="_blank"><img src="/slike/baneri/wada.jpg" alt="Svetska antidoping agencija" border="0" /></a><br/><br/><br/>'
	]
]

step=1

nextMessageOrg=1
nextMessagePar=1
nextMessageLin=1


// ovo je funkcija za inicijalizaciju koja se pokrece samo na pocetku
// <body onload="InicijalizacijaMarkija()">

function InicijalizacijaMarkija()
{
	kontejner_1=document.getElementById("div-organi-kontejner")
	kontejner_2=document.getElementById("div-partneri-kontejner")
	kontejner_3=document.getElementById("div-linkovi-kontejner")

	for(var i=0;i<2;i++)
	{
		newDiv=document.createElement("DIV")
		newDiv.setAttribute("id","div-organi"+i)
		newDiv.onmouseover=function(){clearTimeout(timer1)}
		newDiv.onmouseout=function(){skrolujOrgane()}
		newDiv.style.position="absolute"
		newDiv.style.padding="0 0 0 0" // top right bottom left
		kontejner_1.appendChild(newDiv)
		
		newDiv=document.createElement("DIV")
		newDiv.setAttribute("id","div-partneri"+i)
		newDiv.onmouseover=function(){clearTimeout(timer2)}
		newDiv.onmouseout=function(){skrolujPartnere()}
		newDiv.style.position="absolute"
		newDiv.style.padding="0 0 0 0"
		kontejner_2.appendChild(newDiv)
		
		newDiv=document.createElement("DIV")
		newDiv.setAttribute("id","div-linkovi"+i)
		newDiv.onmouseover=function(){clearTimeout(timer3)}
		newDiv.onmouseout=function(){skrolujLinkove()}
		newDiv.style.position="absolute"
		newDiv.style.padding="0 0 0 0"
		kontejner_3.appendChild(newDiv)
	}

	div_org0=document.getElementById("div-organi0")
	div_org1=document.getElementById("div-organi1")
	div_org0.innerHTML=niz_organi[0]
	div_org1.innerHTML=niz_organi[1]
	
	div_par0=document.getElementById("div-partneri0")
	div_par1=document.getElementById("div-partneri1")
	div_par0.innerHTML=niz_partneri[0]
	div_par1.innerHTML=niz_partneri[1]
	
	div_lin0=document.getElementById("div-linkovi0")
	div_lin1=document.getElementById("div-linkovi1")
	div_lin0.innerHTML=niz_linkovi[0]
	div_lin1.innerHTML=niz_linkovi[1]
	
	div_org0.style.top=kontejner_1.offsetHeight
	div_org1.style.top=kontejner_1.offsetHeight+div_org0.offsetHeight+"px"
	
	div_par0.style.top=kontejner_2.offsetHeight
	div_par1.style.top=kontejner_2.offsetHeight+div_par0.offsetHeight+"px"
	
	div_lin0.style.top=kontejner_3.offsetHeight
	div_lin1.style.top=kontejner_3.offsetHeight+div_lin0.offsetHeight+"px"
	
	skrolujOrgane()
	skrolujPartnere()
	skrolujLinkove()
}

function skrolujOrgane()
{
	div_org0Pos=parseInt(div_org0.style.top)
	div_org1Pos=parseInt(div_org1.style.top)
	
	div_org0Pos-=step
	div_org1Pos-=step

	div_org0.style.top=div_org0Pos+"px"
	div_org1.style.top=div_org1Pos+"px"
	
	if(div_org0Pos < -div_org0.offsetHeight)
	{
		nextMessageOrg++
		if(nextMessageOrg==niz_organi.length){nextMessageOrg=0}
		div_org0.innerHTML=niz_organi[nextMessageOrg]
		
		if(div_org1.offsetHeight<kontejner_1.offsetHeight)
		{
			if(div_org1.offsetTop<kontejner_1.offsetHeight-div_org1.offsetHeight)
				div_org0.style.top=kontejner_1.offsetHeight+"px"
			else div_org0.style.top=div_org1.offsetTop+div_org1.offsetHeight+"px"
		}
		else div_org0.style.top=div_org1.offsetTop+div_org1.offsetHeight+"px"
	}
	if(div_org1Pos < -div_org1.offsetHeight)
	{
		nextMessageOrg++
		if(nextMessageOrg==niz_organi.length){nextMessageOrg=0}
		div_org1.innerHTML=niz_organi[nextMessageOrg]
		
		if(div_org0.offsetHeight<kontejner_1.offsetHeight)
		{
			if(div_org0.offsetTop<kontejner_1.offsetHeight-div_org0.offsetHeight)
				div_org1.style.top=kontejner_1.offsetHeight+"px"
			else div_org1.style.top=div_org0.offsetTop+div_org0.offsetHeight+"px"
		}
		else div_org1.style.top= div_org0.offsetTop+div_org0.offsetHeight+"px"
	}

	timer1=setTimeout("skrolujOrgane()",20)
}

function skrolujPartnere()
{
	div_par0Pos=parseInt(div_par0.style.top)
	div_par1Pos=parseInt(div_par1.style.top)
	
	div_par0Pos-=step
	div_par1Pos-=step
	
	div_par0.style.top=div_par0Pos+"px"
	div_par1.style.top=div_par1Pos+"px"
	
	if(div_par0Pos < -div_par0.offsetHeight)
	{
		nextMessagePar++
		if(nextMessagePar==niz_partneri.length){nextMessagePar=0}
		div_par0.innerHTML=niz_partneri[nextMessagePar]
		
		if(div_par1.offsetHeight<kontejner_2.offsetHeight)
		{
			if(div_par1.offsetTop<kontejner_2.offsetHeight-div_par1.offsetHeight)
				div_par0.style.top=kontejner_2.offsetHeight+"px"
			else div_par0.style.top=div_org1.offsetTop+div_par1.offsetHeight+"px"
		}
		else div_par0.style.top=div_par1.offsetTop+div_par1.offsetHeight+"px"
	}
	if(div_par1Pos < -div_par1.offsetHeight)
	{
		nextMessagePar++
		if(nextMessagePar==niz_organi.length){nextMessagePar=0}
		div_par1.innerHTML=niz_partneri[nextMessagePar]
		
		if(div_par0.offsetHeight<kontejner_2.offsetHeight)
		{
			if(div_par0.offsetTop<kontejner_2.offsetHeight-div_par0.offsetHeight)
				div_par1.style.top=kontejner_2.offsetHeight+"px"
			else div_par1.style.top=div_par0.offsetTop+div_par0.offsetHeight+"px"
		}
		else div_par1.style.top= div_par0.offsetTop+div_par0.offsetHeight+"px"
	}
	
	timer2=setTimeout("skrolujPartnere()",20)
}

function skrolujLinkove()
{
	div_lin0Pos=parseInt(div_lin0.style.top)
	div_lin1Pos=parseInt(div_lin1.style.top)
	
	div_lin0Pos-=step
	div_lin1Pos-=step
	
	div_lin0.style.top=div_lin0Pos+"px"
	div_lin1.style.top=div_lin1Pos+"px"
	
	if(div_lin0Pos < -div_lin0.offsetHeight)
	{
		nextMessageLin++
		if(nextMessageLin==niz_linkovi.length){nextMessageLin=0}
		div_lin0.innerHTML=niz_linkovi[nextMessageLin]
		
		if(div_lin1.offsetHeight<kontejner_3.offsetHeight)
		{
			if(div_lin1.offsetTop<kontejner_3.offsetHeight-div_lin1.offsetHeight)
				div_lin0.style.top=kontejner_3.offsetHeight+"px"
			else div_lin0.style.top=div_lin1.offsetTop+div_lin1.offsetHeight+"px"
		}
		else div_lin0.style.top=div_lin1.offsetTop+div_lin1.offsetHeight+"px"
	}
	if(div_lin1Pos < -div_lin1.offsetHeight)
	{
		nextMessageLin++
		if(nextMessageLin==niz_linkovi.length){nextMessageLin=0}
		div_lin1.innerHTML=niz_linkovi[nextMessageLin]
		
		if(div_lin0.offsetHeight<kontejner_3.offsetHeight)
		{
			if(div_lin0.offsetTop<kontejner_3.offsetHeight-div_lin0.offsetHeight)
				div_lin1.style.top=kontejner_3.offsetHeight+"px"
			else div_lin1.style.top=div_lin0.offsetTop+div_lin0.offsetHeight+"px"
		}
		else div_lin1.style.top= div_lin0.offsetTop+div_lin0.offsetHeight+"px"
	}
	
	timer3=setTimeout("skrolujLinkove()",20)
}