var person = 0;
var foto = 0;

function takePerson (id, show) {
	// zobrazenie
	if ( (document.getElementById('teamItem_' + id).style.visibility == 'hidden' || show == 1) )  	{
		person = person + 1;
		document.getElementById('teamItem_' + id).style.zIndex = person;
		document.getElementById('teamItem_' + id).style.visibility = 'visible';
		document.getElementById('listItem_' + id).className = 'blockListCaption LinkAct';
	}
	// schovatie
	else {
		document.getElementById('teamItem_' + id).style.visibility = 'hidden';
		document.getElementById('listItem_' + id).className = 'blockListCaption';
	}
}

function takePhoto (id, name, show) {

	if (document.getElementById('fotoItem_' + id).style.visibility == '' || show == 1) 	{
		foto = foto + 1;
		document.getElementById('fotoItem_' + id).style.zIndex = foto;
		document.getElementById('fotoItem_' + id).style.visibility = 'visible';
		if (name != '' && document.getElementById('listItem_' + id).className == 'fotoImage')
				document.getElementById('foto_' + id).src = name;
		document.getElementById('listItem_' + id).className = 'fotoImage fotoAct';
	}
	else {
		document.getElementById('fotoItem_' + id).style.visibility = '';
		document.getElementById('listItem_' + id).className = 'fotoImage';
	}
}

function decoder(mail) {
	var i, new_mail = new Array();
	
  for (i = 0; i < mail.length; i = i + 2)
	{
		if (i < mail.length - 1) {
			new_mail[i] = mail.substr(i + 1, 1);
			new_mail[i + 1] = mail.substr(i, 1);
		}
		else {
			new_mail[i] = mail.substr(i, 1);
		}
	}
	
	return (new_mail.join(''));
}

function decodeMails(links) {
	var id;
	
	
	for (id = 0; id < links; id++)
	{
	  document.getElementById('link_' + id).innerHTML = decoder(document.getElementById('link_' + id).innerHTML);
		document.getElementById('link_' + id).href = 'mailto:' + document.getElementById('link_' + id).innerHTML;
	}	
}

function imageChange(id, src) {
	document.getElementById(id).src = './frontend/Assets/images/' + src;
}

function jimmyChange(src) {
	document.getElementById('image_jimmy').src = './files/park/jimmy/' + src;
}

function titleChange(id, src) {
	document.getElementById('imageTitle_' + id).src = './files/title/buttons/' + src;
}

//music controller BEGIN

  var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
  var gone=0;
  var musicState = 1;
  var lang = 0
  
  var movieName = "noName";
  
  function thisMovie(movieName) {
    // IE and Netscape refer to the movie object differently.
    // This function returns the appropriate syntax depending on the browser.
    if (navigator.appName.indexOf ("Microsoft") !=-1) {
      return parent.music[movieName];
    } else {
      return parent.music.document[movieName][1];
    }
  }
  
  function menu_DoFSCommand(command,arg) {
	//alert(thisMovie('music'));
		if (command == 'lngEN'){
			lang = 1;
			top.location.href = './?f=&lang=1';
		}
		
		if (command == 'lngSK'){
			lang = 0;
			top.location.href = './?f=&lang=0';
		}
		
		if (command == 'pauseMusic'){
			musicState = 0;
			thisMovie('music').TGotoLabel('/', command);
		}
		
		if (command == 'playMusic'){
			musicState = 1;
			thisMovie('music').TGotoLabel('/', command);
		}
		
  }
  
  if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.writeln('<SCRIPT LANGUAGE=VBScript>');
    document.writeln('on error resume next');
    document.writeln('Sub menu_FSCommand(ByVal command, ByVal args)');
    document.writeln(' call menu_DoFSCommand(command, args)');
    document.writeln('end sub');
    document.writeln('</SCR'+'IPT>');
  }  
  
//music controller END


