function getDivContent(hiddenDiv, containerDiv)
{
	if ((document.getElementById(hiddenDiv))&&(document.getElementById(containerDiv)))
	{
		document.getElementById(containerDiv).innerHTML = document.getElementById(hiddenDiv).innerHTML
	}
}

function flashOver()
{
	if ((document.getElementById('flashSticle'))&&(document.getElementById('istoricBox')))
	{
		document.getElementById('istoricBox').style.zIndex = 1;
		document.getElementById('flashSticle').style.zIndex = 10;
	}
}

function flashUnder()
{
	if ((document.getElementById('flashSticle'))&&(document.getElementById('istoricBox')))
	{
		document.getElementById('istoricBox').style.zIndex = 10;
		document.getElementById('flashSticle').style.zIndex = 1;
	}
}

function scrollPopularLeft()
{

	var currPos = $('popularThumbs').offsetLeft;
	if (currScrollIndex < maxScrollIndex - 3)
	{
		$('popularThumbs').effect('left', {
			duration: 1000,
			transition: Fx.Transitions.Bounce.easeOut
		}).start( - currScrollIndex * 150, - (currScrollIndex + 1) * 150);
		currScrollIndex++;
	}
}

function scrollPopularRight()
{
	
	var currPos = $('popularThumbs').offsetLeft;
	if (currScrollIndex > 0)
	{
		$('popularThumbs').effect('left',{
			duration: 1000,
			transition: Fx.Transitions.Bounce.easeOut
		}).start(- currScrollIndex * 150, - (currScrollIndex - 1) * 150);
		currScrollIndex--;
	}
}

function flashItemSelected(id)
{
	getDivContent("proba" + id, "descriereContent");
}

function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
}


function clearDefaultValue(defaultValue, fieldName)
{
	if ((document.getElementById(fieldName))&&(document.getElementById(fieldName).value == defaultValue))
	{
		document.getElementById(fieldName).value = '';
	}
}

function replaceDefaultValue(defaultValue, fieldName)
{
	if ((document.getElementById(fieldName))&&(document.getElementById(fieldName).value == ''))
	{
		document.getElementById(fieldName).value = defaultValue;
	}
}

function playMovie(id)
{
	getFlashMovie('widget').sendTextToFlash(id);
}


function changeGame(game)
{
	if (game == "cornet")
	{
		document.getElementById('gameContainer').style.backgroundImage = "url(../images/background-joc-cornet.jpg)";
		document.getElementById('textOlimpiada').style.display = 'none';
		document.getElementById('autobuzContainer').style.display = 'none';
		document.getElementById('cornetContainer').style.display = 'block';
	}
	
	if (game == "text")
	{
		document.getElementById('gameContainer').style.backgroundImage = "url(../images/background-joc-olimpiada.jpg)";
		document.getElementById('cornetContainer').style.display = 'none';
		document.getElementById('autobuzContainer').style.display = 'none';		
		document.getElementById('textOlimpiada').style.display = 'block';
	}
	if (game == "autobuz")
	{
		document.getElementById('gameContainer').style.backgroundImage = "url(../images/background-joc-autobuz.jpg)";
		document.getElementById('cornetContainer').style.display = 'none';
		document.getElementById('textOlimpiada').style.display = 'none';			
		document.getElementById('autobuzContainer').style.display = 'block';		
	}
}