
function gowhois(goto) {
 var loc="?w=";
 if (!goto) { loc = "w/"; goto=""; }
 window.location = "http://www.v3whois.com/"+loc+document.getElementById('whois').value+goto;
}

function loading() {
  var r = "";
  var i_off = new Image();
  var i_on = new Image();
  var i_down = new Image();
  var i_down2 = new Image();
  var i_over = new Image();
  i_off.src = "http://www.v3whois.com/img/radio_off.png";
  i_on.src = "http://www.v3whois.com/img/radio_on.png";
  i_down.src = "http://www.v3whois.com/img/radio_down.png";
  i_down2.src = "http://www.v3whois.com/img/radio_down2.png";
  i_over.src = "http://www.v3whois.com/img/radio_over.png";
  
  if (document.getElementById('t')) {
    r = document.getElementById('t').value;
    document.getElementById(r).src = "http://www.v3whois.com/img/radio_on.png";
  }
  
  if(rCookie('v3results') == 'advanced') { document.getElementById('results').innerHTML="advanced"; }
  sf();
}

function cCookie(name,value,days) {
  var date = new Date();
  date.setTime(date.getTime()+(days*24*60*60*1000));
  var expires = "; expires="+date.toGMTString();
  document.cookie = name+"="+value+expires+"; path=/";
}

function rCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

function dCookie(name) {
  cCookie(name,"",-1);
}

function sf() {
  var input = document.f.w;
  input.focus(); 
  if (input.createTextRange) {
    var range = input.createTextRange();
    range.collapse(false);
    range.select();
  }
}

function tv(elemid) {
  if (document.getElementById(elemid).style.display=="none"){
    document.getElementById(elemid).style.display="block";
  }
  else {
    document.getElementById(elemid).style.display="none";
  }
}

function sh(elemid) {
  document.getElementById(elemid).style.display="block";
}

function hide(elemid) {
  document.getElementById(elemid).style.display="none";
}

function res() {
  if (document.getElementById('results').innerHTML=="simple") {
    document.getElementById('results').innerHTML="advanced";
    cCookie('v3results','advanced',365);
  }
  else {
    document.getElementById('results').innerHTML="simple";
    cCookie('v3results','simple',365);
  }
  if (document.getElementById('whois').value!="") { window.location.reload(); }
}
  
function bw() {
  alert(document.getElementById('domain').href);
  document.getElementById('confirm').style.display="inline";
}

function openList(tld) {
  window.open('http://www.v3whois.com/?'+tld,'list','width=340,height=350,toolbar=0,resizable=0,menubar=0,status=0,location=0,scrollbars=1');
}

function addPlugin() {
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
    window.sidebar.addSearchEngine(
      "http://www.v3whois.com/plugin/v3whois.src",
      "http://www.v3whois.com/img/v3whois.png", "V3Whois", "Web Tools");
  } else {
    alert("You will need a browser which supports Sherlock to install this plugin.");
  }
}

function m_down(obj) {
  chk_legal();
  if (obj.src.match(/radio_off.png/) || obj.src.match(/radio_over.png/)) { obj.src = "http://www.v3whois.com/img/radio_down.png"; }
  else { obj.src = "http://www.v3whois.com/img/radio_down2.png"; }
}

function m_up(obj) {
  chk_legal();
  if (obj.src.match(/radio_down.png/)) {
    document.getElementById('r1').src = document.getElementById('r2').src = document.getElementById('r3').src = "http://www.v3whois.com/img/radio_off.png";
    obj.src = "http://www.v3whois.com/img/radio_on.png";
    document.getElementById('t').value = obj.id;
  }
  else if (obj.src.match(/radio_down2.png/)) { 
    document.getElementById('r1').src = document.getElementById('r2').src = document.getElementById('r3').src = "http://www.v3whois.com/img/radio_off.png";
    obj.src = "http://www.v3whois.com/img/radio_on.png";
    document.getElementById('t').value = obj.id;
  }
}

function m_over(obj) {
  chk_legal();
  if (obj.src.match(/radio_off.png/)) { obj.src = "http://www.v3whois.com/img/radio_over.png"; }
}

function m_out(obj) {
  chk_legal();
  if (obj.src.match(/radio_over.png/) || obj.src.match(/radio_down.png/)) { obj.src = "http://www.v3whois.com/img/radio_off.png"; }
  else if (obj.src.match(/radio_down2.png/)) { obj.src = "http://www.v3whois.com/img/radio_on.png"; }
}

function chk_legal() {
  if (document.getElementById('r1').src == document.getElementById('r2').src && document.getElementById('r1').src == "http://www.v3whois.com/img/radio_on.png") { document.getElementById('r2').src = "http://www.v3whois.com/img/radio_off.png"; }
  if (document.getElementById('r1').src == document.getElementById('r3').src && document.getElementById('r1').src == "http://www.v3whois.com/img/radio_on.png") { document.getElementById('r3').src = "http://www.v3whois.com/img/radio_off.png"; }
  if (document.getElementById('r2').src == document.getElementById('r3').src && document.getElementById('r2').src == "http://www.v3whois.com/img/radio_on.png") { document.getElementById('r3').src = "http://www.v3whois.com/img/radio_off.png"; }
}

function ifr(id) {
  document.getElementById('img'+id).style.display = "none";
  tv('ifr'+id);
}

