
function toggleDisplay (e)
{
  var n = new Array("navMarca", "navCores", "navTipografia", "navImagens");
  
  for (var i = n.length - 1; i >= 0; i--)
  {
    var el = n[i];
    var pEl = $(el)
    
    if (el == e)
    {
      pEl.toggle();
    }
    else
    {
      pEl.hide();
    }
  }
}

function openHelp()
{
  var width = 350;
  var height = 250;
  var top = (screen.height) ? (screen.height - height) / 2 : 0;
  var left = (screen.width) ? (screen.width - width) / 2 : 0;
  var url = "ajuda.html";
  var name = "PopHelp";
  var features = "top=" + top + ",left=" + left + ",width=350,height=250";

  window.open(url, name, features);
}

function openNextStep (step)
{
  var s = '/';
  var url = 'download' + s;
  var el = $('itemContent-' + step);
  var d = $('down');
  
  url += c.type + s;
  url += c.signature + s;
  url += c.direction + s;
  url += c.filetype + '_';
  url += c.color + '.zip';
  
  d.innerHTML = '<a href="' + url + '">Clique aqui</a> para baixar a marca selecionada';
  
  var s2a = $('step-2a');
  var s2b = $('step-2b');
  var s3a = $('step-3a');
  var s3b = $('step-3b');
  var s4a = $('step-4a');
  var s4b = $('step-4b');
  var s5a = $('step-5a');
  var s5b = $('step-5b');
  
  s2a.innerHTML = '<strong>Com assinatura</strong><a href="#" onClick="c.setSignature(\'assinatura\');return false;"><img src="download/' + c.type + '/assinatura/marca.gif" alt="Com assinatura" border="0"></a>';
  s2b.innerHTML = '<strong>Sem assinatura</strong><a href="#" onClick="c.setSignature(\'simples\');return false;"><img src="download/' + c.type + '/simples/marca.gif" alt="Sem assinatura" border="0"></a>';
  
  s3a.innerHTML = '<strong>Positiva</strong><a href="#" onClick="c.setDirection(\'positivo\');return false;"><img src="download/' + c.type + '/' + c.signature + '/positivo/marca.gif" alt="Com assinatura" border="0"></a>';
  s3b.innerHTML = '<strong>Negativa</strong><a href="#" onClick="c.setDirection(\'negativo\');return false;"><img src="download/' + c.type + '/' + c.signature + '/negativo/marca.gif" alt="Sem assinatura" border="0"></a>';
  
  s4a.innerHTML = '<strong>Monocromática</strong><a href="#" onClick="c.setColor(\'preto\');return false;"><img src="download/' + c.type + '/' + c.signature + '/' + c.direction + '/marca.gif" alt="Monocromática" border="0"></a><br />';
  s4b.innerHTML = '<strong>Colorida</strong>';
  s4b.innerHTML += '<a href="#" onClick="c.setColor(\'verde\');return false;"><img src="download/' + c.type + '/' + c.signature + '/' + c.direction + '/marca-verde.gif" alt="Verde" border="0"></a><br />';
  s4b.innerHTML += '<a href="#" onClick="c.setColor(\'azul\');return false;"><img src="download/' + c.type + '/' + c.signature + '/' + c.direction + '/marca-azul.gif" alt="Azul" border="0"></a><br />';
  s4b.innerHTML += '<a href="#" onClick="c.setColor(\'roxo\');return false;"><img src="download/' + c.type + '/' + c.signature + '/' + c.direction + '/marca-roxo.gif" alt="Roxo" border="0"></a><br />';
  s4b.innerHTML += '<a href="#" onClick="c.setColor(\'bordo\');return false;"><img src="download/' + c.type + '/' + c.signature + '/' + c.direction + '/marca-bordo.gif" alt="Bordo" border="0"></a><br />';
  s4b.innerHTML += '<a href="#" onClick="c.setColor(\'mostarda\');return false;"><img src="download/' + c.type + '/' + c.signature + '/' + c.direction + '/marca-mostarda.gif" alt="Mostarda" border="0"></a><br />';
  
  if (c.color == 'preto')
  {
    s5a.innerHTML = '<img src="download/' + c.type + '/' + c.signature + '/' + c.direction + '/marca.gif" alt="' + c.color + '" border="0">';
    s5b.innerHTML =  '<a href="download/' + c.type + '/' + c.signature + '/' + c.direction + '/eps_preto.zip" style="font-weight: bold; color: #8A0304">.EPS</a><br />';
    s5b.innerHTML += '<a href="download/' + c.type + '/' + c.signature + '/' + c.direction + '/jpg_preto.zip" style="font-weight: bold; color: #8A0304">.JPG</a><br />';
    if (c.direction == 'positivo')
    {
      s5b.innerHTML += '<a href="download/' + c.type + '/' + c.signature + '/' + c.direction + '/png_preto.zip" style="font-weight: bold; color: #8A0304">.PNG</a><br />';
    }
  }
  else
  {
    s5a.innerHTML = '<img src="download/' + c.type + '/' + c.signature + '/' + c.direction + '/marca-' + c.color + '.gif" alt="' + c.color + '" border="0">';
    s5b.innerHTML =  '<a href="download/' + c.type + '/' + c.signature + '/' + c.direction + '/cmyk_' + c.color + '.zip" style="font-weight: bold; color: #8A0304">.EPS CMKY</a><br />';
    s5b.innerHTML += '<a href="download/' + c.type + '/' + c.signature + '/' + c.direction + '/pantone_' + c.color + '.zip" style="font-weight: bold; color: #8A0304">.EPS PANTONE</a><br />';
    s5b.innerHTML += '<a href="download/' + c.type + '/' + c.signature + '/' + c.direction + '/rgb_' + c.color + '.zip" style="font-weight: bold; color: #8A0304">.JPG RGB</a><br />';
    if (c.direction == 'positivo')
    {
      s5b.innerHTML += '<a href="download/' + c.type + '/' + c.signature + '/' + c.direction + '/png_' + c.color + '.zip" style="font-weight: bold; color: #8A0304">.PNG RGB Transparente</a><br />';
    }
  }
  
  el.show();
  
  /*
  var d = $('myDebugger');
  
  var s = '';
  
  s += c.type + "<br />";
  s += (c.signature == undefined ? '' : c.signature) + "<br />";
  s += (c.direction == undefined ? '' : c.direction) + "<br />";
  s += (c.color == undefined ? '' : c.color) + "<br />";
  s += (c.filetype == undefined ? '' : c.filetype) + "<br />";
  
  d.innerHTML = s;
  */
}

function Cultura (){ }

Cultura.prototype.setType = function (type)
{
  this.type = type;
  openNextStep(2);
}

Cultura.prototype.setSignature = function (signature)
{
  this.signature = signature;
  openNextStep(3);
}

Cultura.prototype.setDirection = function (direction)
{
  this.direction = direction;
  openNextStep(4);
}

Cultura.prototype.setColor = function (color)
{
  this.color = color;
  openNextStep(5);
}

Cultura.prototype.setFileType = function (filetype)
{
  this.filetype = filetype;
  openNextStep(6);
}

var c = new Cultura();

