var MensajeError1='O domínio apenas pode conter letras ou números';
var MensajeError2='O domínio apenas pode conter letras ou números';
var MensajeError3='O domínio deve ter entre 2 e 26 caracteres de tamanho';
var MensajeError4='Por favor digite nome de domínio';

function popitup(location, title) {
  window.open(location, title, 'toolbar=no,resizable=yes,scrollbars=yes,width=609,height=420');
}

function curType_change() {
  document.frm.action = "ntrademarkprices.asp?curType="+document.getElementById("selCurType").value;
  document.frm.submit();
}

function OwnerType_change() {
  document.frm.action = "ntrademarkprices.asp?OwnerType="+document.getElementById("selOnePrice").value;
  document.frm.submit();
}

function pop(thistag) {
  styleObj = document.getElementById(thistag).style;
  imgminus=document.getElementById('img'+thistag).style;
  imgplus=document.getElementById('img'+thistag+'1').style;

  if (styleObj.display=='none') {
    styleObj.display = "";
    imgplus.display = "none";
    imgminus.display = "block";
  }
  else {
    styleObj.display = 'none';
    imgplus.display = "block";
    imgminus.display = "none";
  }
}


function abreventana(direccion,nomven,propiedades) {
  MiVentana=open(direccion,nomven,propiedades);
}

function CheckNomDom(okChar,minLength,maxLength,startEndChar) {
  nom = document.form1.dominio.value;
  //ok = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-";
  ok = okChar;
  sw = 0;
  if (!nom == "") {
    if (nom.length >= minLength && nom.length <= maxLength) {
      if (nom.charAt(0) != startEndChar && nom.charAt(nom.length-1) != startEndChar) {
        for (i=0; i <= nom.length-1;i++) {
          if (ok.indexOf(nom.charAt(i)) == -1 ) {
            sw = 1;
          }
        }
        if (sw == 0) { r = true; }
        else { MensajeError(MensajeError1); }
      }
      else { MensajeError(MensajeError2); }
    }
    else { MensajeError(MensajeError3); }
  }
  else { MensajeError(MensajeError4); }
}


function MensajeError(mensaje) {
  alert(mensaje);
  r = false;
  document.form1.dominio.focus();
}

function hidediv(id) {
  //safe function to hide an element with a specified id
  if (document.getElementById) { // DOM3 = IE5, NS6
    document.getElementById(id).style.display = 'none';
  }
  else {
    if (document.layers) { // Netscape 4
      document.id.display = 'none';
    }
    else { // IE 4
      document.all.id.style.display = 'none';
    }
  }
}

function showdiv(id) {
  //safe function to show an element with a specified id

  if (document.getElementById) { // DOM3 = IE5, NS6
    document.getElementById(id).style.display = 'block';
  }
  else {
    if (document.layers) { // Netscape 4
      document.id.display = 'block';
    }
    else { // IE 4
      document.all.id.style.display = 'block';
    }
  }
}

function Pais(cual,page) {
  document.FormPaisDeRegistro.PaisDeRegistro.value = cual;
  document.FormPaisDeRegistro.action = "Registro_"+page+".asp?country="+cual;
  document.FormPaisDeRegistro.submit();
}

function pop(thistag) {
  styleObj = document.getElementById(thistag).style;
  if (styleObj.display=='none')
  {
    styleObj.display = '';
  }
  else
  {
    styleObj.display = 'none';
  }
}

function openWindow(anchor, options) {

  var args = '';

  if (typeof(options) == 'undefined') { var options = new Object(); }
  if (typeof(options.name) == 'undefined') { options.name = 'win' + Math.round(Math.random()*100000); }

  if (typeof(options.height) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
    args += "height=" + options.height + ",";
  }

  if (typeof(options.width) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
    args += "width=" + options.width + ",";
  }

  if (typeof(options.fullscreen) != 'undefined') {
    args += "width=" + screen.availWidth + ",";
    args += "height=" + screen.availHeight + ",";
  }

  if (typeof(options.center) == 'undefined') {
    options.x = 0;
    options.y = 0;
    args += "screenx=" + options.x + ",";
    args += "screeny=" + options.y + ",";
    args += "left=" + options.x + ",";
    args += "top=" + options.y + ",";
  }

  if (typeof(options.center) != 'undefined' && typeof(options.fullscreen) == 'undefined') {
    options.y=Math.floor((screen.availHeight-(options.height || screen.height))/2)-(screen.height-screen.availHeight);
    options.x=Math.floor((screen.availWidth-(options.width || screen.width))/2)-(screen.width-screen.availWidth);
    args += "screenx=" + options.x + ",";
    args += "screeny=" + options.y + ",";
    args += "left=" + options.x + ",";
    args += "top=" + options.y + ",";
  }

  if (typeof(options.scrollbars) != 'undefined') { args += "scrollbars=1,"; }
  if (typeof(options.menubar) != 'undefined') { args += "menubar=1,"; }
  if (typeof(options.locationbar) != 'undefined') { args += "location=1,"; }
  if (typeof(options.resizable) != 'undefined') { args += "resizable=1,"; }

  var win = window.open(anchor, options.name, args);
  return false;

}
