// definicija

var brzinaAnimacije = 4000;
var marginaTop = '30px';
var velicinaFonta = '20px';
var bojaFonta = '#fff';

var gradovi = new Array(
		'Kupres',
		'Nova Bila',
		'Uskoplje',
		'Jajce',
		'Livno',
		'Bugojno',
		'Novi travnik',
		'Tomislavgrad',
		'Vitez',
		'Rama',
		'Grahovo',
		'Drvar',
		'Jablanica'
		
);

// to je to

	function gasiSveBogte()
	{
		$('#main_table').each(function()
		{
			$(this).hide("slow");
		});
	}


	function izmjeniFrekvu()
	{
		//document.getElementById('gDiv').innerHTML = gradovi[Math.floor(Math.random()*gradovi.length)];
		//setTimeout("izmjeniFrekvu()", brzinaAnimacije);
		$('#gDiv').fadeOut("slow", function()
		{
			
			document.getElementById('gDiv').innerHTML = '<img src="antena.png" /> ' + gradovi[Math.floor(Math.random()*gradovi.length)];
			$('#gDiv').fadeIn("slow");
			setTimeout("izmjeniFrekvu()", brzinaAnimacije);
		});
		
	}

$('document').ready(function()
{

    var m = document.getElementById('frekve');
    var gDiv = document.createElement('div');
	//gDiv.style.width = '300px';
	//gDiv.style.top = marginaTop;
	gDiv.style.fontSize = velicinaFonta;
	//gDiv.style.position = 'absolute';
	gDiv.style.display = 'block';
	//gDiv.style.textAlign = 'center';
	gDiv.style.verticalAlign = 'middle'; 
	gDiv.style.left = (screen.availWidth - 300) / 2 + "px";
	gDiv.style.color = bojaFonta;
	gDiv.style.fontFamily = 'Tahoma,Geneva,sans-serif';
	gDiv.id = 'gDiv';
    //gDiv.className = 'block';
	gDiv.style.cursor = 'pointer';
	gDiv.onclick = function() { document.location = '?go=page&id=1238765394'; };
	//gDiv.onclick = function() { gasiSveBogte(); };

	//document.body.appendChild(gDiv);
    m.appendChild(gDiv);
	
	izmjeniFrekvu();
	
	// test
	/*
	$('.more').each(function()
	{
		var hr = this.href;
		hr = hr.split('?');
		hr = hr[1];
		this.href = 'javascript:;';
		
		this.onclick = function()
		{
			$.get('inc/article.php?' + hr, function(data)
			{
				$('#frontpage').each(function() { this.innerHTML = data; });
			});
		}
		
		return false;
	});
	*/
	
	//$('#menu').sortable({ containment: 'parent' });

});

