/* coloca as colunas com o mesmo tamanho */
function SetColsHeigth () {
  var tamCol1 = document.getElementById(arguments[0]).offsetHeight;
  var tamCol2 = document.getElementById(arguments[1]).offsetHeight;
  var objAlt1  = document.getElementById(arguments[0]);
  var objAlt2  = document.getElementById(arguments[1]);
  
  if (tamCol1 > tamCol2) { 
    objAlt2.style.height = tamCol1-3 + "px";
    objAlt1.style.height = eval(tamCol1+17) + "px";
  }
  else objAlt1.style.height = tamCol2-2 + "px";

}


function menu () {
  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="menuFlash">');
  document.write('<PARAM NAME=movie VALUE="http://d.i.uol.com.br/27bienal/bienal_menu_2006.swf">');
  document.write('<PARAM NAME=quality VALUE=high>');
  document.write('<PARAM NAME=wmode VALUE=opaque>');
  document.write('<PARAM NAME=allowScriptAccess VALUE=always>');
  document.write('<EMBED src="http://d.i.uol.com.br/27bienal/bienal_menu_2006.swf" allowScriptAccess="always" quality=high wmode=opaque NAME="menuFlash" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
  document.write('</OBJECT>')
}


/* mosta os dados do artista */
function DadosArtista (Artista) {
  for (var x=0; x<Artista.length; x++) {
    if (x > 0) var dados_1 = Artista[x-1].split("|");
    var dados_2 = Artista[x].split("|");

    switch (dados_2[0]) {
      case "0": document.write("<h4>"+dados_2[1]+"</h4>"); break; // tópico
      case "1": document.write("<p class=\"texto\"> <span>-</span> "+dados_2[1]+"</p>"); break; // parágrafo
      case "2": document.write("<p class=\"credito\">"+dados_2[1]+"</p>"); break; // crédito
      case "3": document.write("<p class=\"imagem\" id=\"imgArtista_"+x+"\">"+dados_2[1]+"</p>"); break; // imagem
      case "4": document.write("<p class=\"legenda\">"+dados_2[1]+"</p>"); break; // legenda imagem
    }

    if (x > 0) {
      if (dados_1[0] == 3 && dados_2[0] == 3)
        document.getElementById("imgArtista_"+(x-1)).className = "margem";
    }

    /*
    if (dados[0] == "0")
      document.write("<h4>"+dados[1]+"</h4>");
    else
      document.write("<p> <span>-</span> "+dados[1]+"</p>");
    */

  }
}

function Imprimir () {
  if (location.href.toString().indexOf('action=print') != -1) {
    document.write('<link type="text/css" rel="stylesheet" href="" id="styles" />');
    document.getElementById('styles').href = '/27bienal/ultnot/styles-print.css';
  	onload=waitAndPrint;
  }
  function waitAndPrint() { setTimeout('print()',500); }
}

/* mostra indice na página de artistas */
function MostraIndice (artistas) {

	for(i=0;i<artistas.length;i++)
	{
		artistas[i] = artistas[i].charAt(0).toUpperCase()+artistas[i];
	}

  artistas.sort();
  
  fCharAnt  = '';
  fCharCount  = 0;
  
  for(i=0;i<artistas.length;i++)
  {
  
	artistas[i] = artistas[i].split(";");
  
  	fCharDavez = artistas[i][0].charAt(0);
  
  	if(fCharDavez != fCharAnt)
  	{
  		fCharCount++;
  		document.write((fCharAnt != '' ? '</div></div></a>' : '')+'<a name="'+fCharDavez.toLowerCase()+'"><div class="box'+(fCharCount%2 == 0 ? '1' : '2')+'"><div class="char"><a name="'+fCharDavez.toLowerCase()+'" id="'+fCharDavez.toLowerCase()+'">'+fCharDavez+'</a></div><div class="nomes">');
  	}
  
  	document.write('<a href="'+artistas[i][1]+'"><span class="artista">'+artistas[i][0].substring(1)+';</span> <span class="desc">'+artistas[i][2]+'; '+artistas[i][3]+(typeof(artistas[i][4]) != 'undefined' ? '; '+artistas[i][4] : '')+'</span></a>');
  	
  	fCharAnt = fCharDavez;
  
  }
  document.write('</div></div></a>');
}


function TrocaSetaPaginacao () {
  var objPag = document.getElementById("paginacao");
  var ImgPag = objPag.getElementsByTagName("img");
  for (z=0;z<ImgPag.length;z++)
    ImgPag[z].src = "http://d.i.uol.com.br/27bienal/seta_branca.gif";
}
