top.importt("js.alertbox.AlertBox");

top.EnviarVagaBox = function EnviarVagaBox() {

  this.id = "enviarVaga";
  this.cssArqName  = "brastemp";
  this.codVaga = 0;

  this.alertBoxHTML = "";
  this.alertBoxHTML += "<table cellpadding='0' cellspacing='0' class='table_alertBox'>";
  this.alertBoxHTML += "<tr>";
  this.alertBoxHTML += "<td id='alertBoxTitle" + this.id + "' class='td_alertBoxTitle' onmousedown='top.activateEnviarVagaBox(event);'>&nbsp;</td>";
  this.alertBoxHTML += "</tr>";
  this.alertBoxHTML += "<tr>";
  this.alertBoxHTML += "<td class='td_alertBox'>";
  this.alertBoxHTML += "<table cellpadding='0' cellspacing='0' class='table_alertBoxMsg'>";
  this.alertBoxHTML += "<tr>";
  this.alertBoxHTML += "<td class='td_alertBoxMsg'>";
  this.alertBoxHTML += "<div id='alertBoxMsg" + this.id + "' class='div_alertBoxMsg'>&nbsp;</div>";
  this.alertBoxHTML += "</td>";
  this.alertBoxHTML += "</tr>";
  this.alertBoxHTML += "<tr>";
  this.alertBoxHTML += "<td class='td_promptBoxTxt'>";
  this.alertBoxHTML += "<form id='enviarOportunidade' name='enviarOportunidade' action='html/branco.html' method='post'>";
  this.alertBoxHTML += "<table cellspacing='1' cellpadding='3' border='0' class='fill'>";
  this.alertBoxHTML += "<tr>";
  this.alertBoxHTML += "<td class='campoNome' nowrap><li>Seu nome: </li></td>";
  this.alertBoxHTML += "<td class='campo'><input type='text' name='NOME' validation='required' label='Seu nome'></td>";
  this.alertBoxHTML += "</tr>";
  this.alertBoxHTML += "<tr>";
  this.alertBoxHTML += "<td class='campoNome' nowrap><li>Seu e-mail: </li></td>";
  this.alertBoxHTML += "<td class='campo'><input type='text' name='EMAIL' validation='required,email' label='Seu e-mail'></td>";
  this.alertBoxHTML += "</tr>";
  this.alertBoxHTML += "<tr>";
  this.alertBoxHTML += "<td class='campoNome' nowrap><li>Nome do amigo: </li></td>";
  this.alertBoxHTML += "<td class='campo'><input type='text' name='NOME_AMIGO' validation='required' label='Nome do amigo'></td>";
  this.alertBoxHTML += "</tr>";
  this.alertBoxHTML += "<tr>";
  this.alertBoxHTML += "<td class='campoNome' nowrap><li>E-mail do amigo: </li></td>";
  this.alertBoxHTML += "<td class='campo'><input type='text' name='EMAIL_AMIGO' validation='required,email' label='E-mail do amigo'></td>";
  this.alertBoxHTML += "</tr>";
  this.alertBoxHTML += "</table>";
  this.alertBoxHTML += "</form>";
  this.alertBoxHTML += "</td>";
  this.alertBoxHTML += "</tr>";
  this.alertBoxHTML += "<tr>";
  this.alertBoxHTML += "<td class='td_alertBoxButton'>";
  this.alertBoxHTML += "<img id='alertBoxButton' src='images/bt_cancelar.gif' onclick='top.closeEnviarVagaBox();'>&nbsp;<img src='images/bt_enviar.gif' onclick='top.enviarVaga();'>"
  this.alertBoxHTML += "</td>";
  this.alertBoxHTML += "</tr>";
  this.alertBoxHTML += "</table>";
  this.alertBoxHTML += "</td>";
  this.alertBoxHTML += "</tr>";
  this.alertBoxHTML += "</table>";

  this.vaga = function(msg, title, cod) {
    if(!cod) {
      cod = title;
    }
    this.codVaga = cod;
    this.alert(msg, title);
  }

  this.enviarVaga = function() {
    if(!top.formcheck(top.getObj("enviarOportunidade", top.mainFrame), true, "check/checkEnviarVaga.asp?c=" + this.codVaga, top.submitFrame.name)) {
      return;
    }
    this.closeAlert();
  }

}
top.EnviarVagaBox.prototype.extendss("AlertBox");
top.EnviarVagaBox.instance = null;
top.EnviarVagaBox.getInstance = function() {
  if(this.instance == null) {
    this.instance = new top.EnviarVagaBox();
  }
  return this.instance;
}

top.enviarvagabox = function enviarvagabox(msg, title, cod) {
  top.EnviarVagaBox.getInstance().vaga(msg, title, cod);
}
top.activateEnviarVagaBox = function (e) {
  top.EnviarVagaBox.getInstance().activateAlertBox(e);
}
top.closeEnviarVagaBox = function() {
  top.EnviarVagaBox.getInstance().closeAlert();
}
top.enviarVaga = function() {
  top.EnviarVagaBox.getInstance().enviarVaga();
}