﻿var MensajeError1='Favor ingresar un término con sólo letras y números.';
var MensajeError2='El dominio no puede partir ni terminar con \"-\".';
var MensajeError3='El dominio debe ser de al menos 2 caracteres y máximo de 63 de largo.';
var MensajeError4='Favor ingresar dominio a buscar';

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 externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
      anchor.target = "_blank";
  }
}
window.onload = externalLinks;

