String.prototype.trim = function () {
 return this.replace(/^\s*/, "").replace(/\s*$/, "");
}

function defVal(o) {
 if (o.value == '') {
  o.style.fontStyle='italic';
  o.style.color='#888888';
  o.value='ex: google.com';
 }
}

function noVal(o) {
 if (o.value == 'ex: google.com') {
  o.style.fontStyle='normal';
  o.style.color='#000000';
  o.value='';
 }
}

function doLoad(thedom) {
 var o = document.getElementById('domain');
 o.style.fontStyle='normal';
 o.style.color='#000000';
 o.value=thedom;
 o.focus();
}

function doWhois() {
 var o = document.getElementById('domain');
 o.value=o.value.trim();
 if (o.value == '' || o.value == 'ex: google.com') {
  alert('No domain name specified.');
 }
 else {
  window.location.href = 'http://www.whoisentry.com/domain/' + o.value;
 }
}