//-----------------------------------------------------------------------------

cpPage = null;
cpTabs = new Array();
cpCurr = null;
cpHome = '';

function cpTab(tab)
{
  var t = tab;

  if(cpPage == null)
  {
    cpPage = document.getElementById('cpPage');
    cpHome = cpPage.innerHTML;

    var i, id, els = document.getElementsByTagName('a');
    for(i in els)
    {
      if(els[i] && els[i].id && (els[i].id.substr(0,2) == 'cp'))
      {
        id = els[i].id.substr(2);
        cpTabs[id] = els[i];

        if(typeof(t) == 'undefined')
        {
          t = id;
        }
      }
    }
  }

  if(typeof(t) == 'undefined') t=cpCurr;

  if(cpTabs[t])
  {
    for(var i in cpTabs)
    {
      cpTabs[i].className = t == i ? 'act' : '';
    }
    cpTabs[t].blur();

    if(cpCurr != null)
    {
      if(t=='Home') { if(cpPage) cpPage.innerHTML = cpHome; HideBigWait(); }
      else            PageRequest(t);
    }
    cpCurr = t;
  }
  return false;
}

var elBW = null;
var TmBW = null;
var OpBW = 0;
function PageRequest(page)
{
  elBW = document.getElementById('bigwait');
  if(elBW)
  {
    OpBW = 0;
    ShowBigWait();
    elBW.style.display='';
  }
  ShowFormBtn(false);
  ADRequest('cpPage',page,'cpPage');
}

function ShowBigWait()
{
  if(elBW)
  {
    SetOpacity(elBW, OpBW++);
    if(OpBW<=100) TmBW=setTimeout('ShowBigWait()', 10);
  }
}

function HideBigWait()
{
  if(elBW)
  {
    clearTimeout(TmBW);
    SetOpacity(elBW, 0);
    OpBW = 0;
    elBW.style.display='none';
  }
}

addLoadEvent(cpTab);

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

function SetDomLogin(Set)
{
  Cust.Data['f_cDomLogin'] = Set;
  Cust.SetPass(true);
}

//-----------------------------------------------------------------------------

function SetAutoOK(Set)
{
  Cust.Data['f_cAutoOK'] = Set;
  Cust.SetPass(true);
}

//-----------------------------------------------------------------------------

function SavePass(Type)
{
  switch(Type)
  {
    case 1: if(Cust.CheckPass()) cpExport('cpSavePass', Cust.PassExport(1)); break;
    case 2: cpExport('cpSaveDomLogin', Cust.PassExport(2)); break;
    case 3: cpExport('cpSaveAutoOK',  Cust.PassExport(3)); break;
  }
  return false;
}

//-----------------------------------------------------------------------------

function CheckCust()
{
  if(tmCheckZip) setTimeout("CheckCust()", 200);
  else
  if(Cust.CheckCust())
  {
    cpExport('cpCheckUser', Cust.Export());
  }
  return false;
}

//-----------------------------------------------------------------------------

function cpExport(Type, data)
{
  var exp='<controlpanel>';

  if(typeof(data) != 'undefined')
  {
    exp += data;
  }
  exp += '</controlpanel>'

  ADRequest(Type, exp, 'controlpanel');
  ShowFormBtn(false);
}

//-----------------------------------------------------------------------------
var tmFormBtn = null;
function ShowFormBtn(bShow)
{
  var btn, i=0;

  clearTimeout(tmFormBtn)
  if(bShow)
  {
    tmFormBtn = setTimeout("HideFormBtn(100)", 30000);
  }

  while(btn=document.getElementById('cp_Form'+i))
  {
    SetOpacity(btn, 100);
    btn.style.display = bShow ? '' : 'none';
    i++;
  }
}

//-----------------------------------------------------------------------------

function HideFormBtn(bAlpha)
{
  var btn, i=0;
  while(btn=document.getElementById('cp_Form'+i))
  {
    if(bAlpha)
    {
      SetOpacity(btn, bAlpha);
    }
    else
    {
      btn.style.display = 'none';
    }
    i++;
  }
  if(bAlpha)
  {
    bAlpha -= 1;
    tmFormBtn = setTimeout("HideFormBtn("+bAlpha+")", 25);
  }
}

//-----------------------------------------------------------------------------

function StopChange(el, id)
{
  var spn = document.getElementById('spn_'+id);
  if(el && spn) spn.style.display = el.value=='stop' ? '' : 'none';
}

//-----------------------------------------------------------------------------

function cpCheckStop()
{
  var el, id, act, date;
  var exp = '';
  for(var i=0, l=DomList.length; i<l; i++)
  {
    id=DomList[i];
    el = document.getElementById('act_'+id); if(!el) return false;
    act = el.value;
    if(!act)
    {
      alert('Kies een actie voor domeinnaam '+(i+1));
      el.focus();
      return false;
    }
    if(act != 'Leave')
    {
      el = document.getElementById('per_'+id); if(!el) return false;
      date = el.value;

      exp += '<domain><id>'+id+'</id><action>'+act+'</action><date>'+date+'</date></domain>';
    }
  }

  if(exp) cpExport('cpStopDom', exp);
  else    alert('Geen wijzigingen');

  return false;
}

//-----------------------------------------------------------------------------
/*
function cpDisableStop()
{
  for(var i=0, l=DomList.length; i<l; i++)
  {
    id=DomList[i];
    el = document.getElementById('act_'+id); if(el) el.disabled=true;
    el = document.getElementById('spn_'+id); if(el) el.onclick=null;
    el = document.getElementById('cal_'+id); if(el) el.style.display='none';
  }
  ShowFormBtn(true);
}
*/
//-----------------------------------------------------------------------------

function AccChange(el, id)
{
  var tim = document.getElementById('tim_'+id);
  var tm_ = document.getElementById('tim_'+id+'_');
  if(Accs && el && tim && tm_)
  {
    var t = tim.value ? tim.value : tm_.value;
    tim.options.length=0;

    var p, sel=-1;
    for(var i in Accs[id][el.value])
    {
      switch(i)
      {
        case 'm': p='per maand';     break;
        case 'q': p='per kwartaal';  break;
        case 'h': p='per half jaar'; break;
        case 'y': p='per jaar';      break;
      }
      tim.options[tim.options.length] = new Option(p, i);
      if(i == t)    sel = i;
      if(sel == -1) sel = i;
    }
    tim.value = sel;
    PerChange(tim, id);
  }
}

//-----------------------------------------------------------------------------

function PerChange(el, id)
{
  var acc = document.getElementById('acc_'+id);
  var prc = document.getElementById('prc_'+id);
  if(Accs && el && acc && prc)
  {
    Price = Math.ceil(Accs[id][acc.value][el.value]*100)/100;
    prc.innerHTML = '&euro; '+ (Price).toFixed(2);
  }
}

//-----------------------------------------------------------------------------

function cpCheckAccount()
{
  var id, acc, acc_, tim, tim_;
  var exp = '', notchanged=0;
  for(var i=0, l=DomList.length; i<l; i++)
  {
    id=DomList[i];
    acc = document.getElementById('acc_'+id); if(!el) return false;
    acc_= document.getElementById('acc_'+id+'_'); if(!el) return false;
    tim = document.getElementById('tim_'+id); if(!el) return false;
    tim_= document.getElementById('tim_'+id+'_'); if(!el) return false;

    if((acc.value != acc_.value) ||
       (tim.value != tim_.value))
    {
      exp += '<domain><id>'+id+'</id><account>'+acc.value+'</account><time>'+tim.value+'</time></domain>';
    }
    else
    {
      notchanged++;
    }
  }

  if(exp)
  {
    if((notchanged==0) ||
        confirm('U heeft '+nochange+' domeinen niet gewijzigd.\nWilt u doorgaan met degene die wel gewijzigd zijn?'))
    {
      cpExport('cpAccount', exp);
    }
  }
  else
  {
    alert('Geen wijzigingen');
  }

  return false;
}

//-----------------------------------------------------------------------------
var PreSsl = null;
function SslChange(el, id)
{
  var ssl_info = document.getElementById('ssl_info');
  if(ssl_info)
  {
    if(PreSsl) PreSsl.style.display = 'none';
    var ssl_div  = document.getElementById('sslinfo_'+el.value);
    var price    = document.getElementById('prc_'+id);

    if(ssl_div)
    {
      ssl_info.style.display = '';
      PreSsl = ssl_div;
      PreSsl.style.display = '';
      price.innerHTML = '&euro; '+ SslPrice[el.value]+' p.j.';
    }
    else
    {
      ssl_info.style.display = 'none';
      price.innerHTML = '';
    }
  }
}

//-----------------------------------------------------------------------------

function cpCheckSSL()
{
  var id, ssl;
  var exp = '';
  for(var i=0, l=DomList.length; i<l; i++)
  {
    id=DomList[i];
    ssl = document.getElementById('ssl_'+id); if(!el) return false;

    if(ssl.value != '-')
    {
      exp += '<domain><id>'+id+'</id><ssl>'+ssl.value+'</ssl></domain>';
    }
    else
    {
      alert('U heeft nog geen Type (IP of SSL-type) gekozen');
      return false;
    }
  }

  if(exp)
  {
    cpExport('cpSSL', exp);
  }

  return false;
}

//-----------------------------------------------------------------------------

function StopSSL(DomID)
{
  cpExport('cpStopSSL', '<domain><id>'+DomID+'</id></domain>');
}

//-----------------------------------------------------------------------------
/*
function cpDisableAcc()
{
  for(var i=0, l=DomList.length; i<l; i++)
  {
    id=DomList[i];
    el = document.getElementById('acc_'+id); if(el) el.disabled=true;
    el = document.getElementById('tim_'+id); if(el) el.disabled=true;
  }
  ShowFormBtn(true);
}
*/
//-----------------------------------------------------------------------------

function cpCheckWho()
{
  if(DomList.length)
  {
    if(Whos.GetForm())
    {
      var exp = '';
      for(var i=0, l=DomList.length; i<l; i++)
      {
        exp += '<domain><id>'+DomList[i]+'</id></domain>';
      }
      exp += Whos.Export();

      cpExport('cpWho', exp);
    }
    else
    {
      alert(Whos.Msg);
    }
  }
  return false;
}

//-----------------------------------------------------------------------------

function cpSendAccInfo()
{
  var tm = document.getElementById('a_tTemplate');
  var fn = document.getElementById('a_tFromName');
  var fe = document.getElementById('a_tFromEmail');
  var tn = document.getElementById('a_tToName');
  var te = document.getElementById('a_tToEmail');
  var bc = document.getElementById('a_cBccEmail');

  if(tm && fn && fe && tn && te && bc)
  {
    if(!tm.value.length) { alert('Geef een geldige template URL'); return; }
    if(!tn.value.length) { alert('Geef de naam van de ontvanger'); return; }
    if(!te.value.length) { alert('Geef het e-mail adres van de ontvanger'); return; }
    if(!fn.value.length) { alert('Geef de naam van de verstuurder'); return; }
    if(!fe.value.length) { alert('Geef het e-mail adres van de verstuurder'); return; }

    var exp = '<accinfo><id>'+DomID+'</id><template>'+encodeURIComponent(tm.value)+'</template><to_name>'+encodeURIComponent(tn.value)+'</to_name><to_email>'+encodeURIComponent(te.value)+'</to_email><from_name>'+encodeURIComponent(fn.value)+'</from_name><from_email>'+encodeURIComponent(fe.value)+'</from_email><bcc>'+(bc.checked?1:0)+'</bcc></accinfo>';

    cpExport('cpAccInfo', exp);
  }
}

//-----------------------------------------------------------------------------

function cpShowAccInfo()
{
  var fr = document.getElementById('MailTemplate');
  var tm = document.getElementById('a_tTemplate');
  var nm = document.getElementById('a_tToName');
  if(tm && fr && nm)
  {
    var d = new Date().getTime();
    fr.src = 'php/acc_info.php?ses='+SesID+'&DomID='+DomID+'&Name='+nm.value+'&Tmpl='+encodeURIComponent(tm.value)+'&t='+d;
    GetWindowSize();
    if((WindowT + WindowH) < 1000)
    {
      window.scrollTo(0, (1000-WindowH));
    }
  }
}

//-----------------------------------------------------------------------------
/*
function cpDisableWho()
{
  for(var id in Whos.Fields)
  {
    el = document.getElementById(Whos.Fields[id]); if(el) el.disabled=true;
  }
  ShowFormBtn(true);
}
*/
//-----------------------------------------------------------------------------

var img = new Array(), imgW, imgH, imgID, SessionID;
function ShowImg(id)
{
  var month   = document.getElementById('f_sMonth'+id);
  img[id] = document.getElementById('theimg'+id);
  imgID = id;

  if(img[id].width > 1)
  {
    imgW = img[id].width;
    imgH = img[id].height;
  }

  img[id].width  = 1;
  img[id].height = imgH;
  img[id].onload = LoadImg;

  switch(id)
  {
    case 3:
      var server = document.getElementById('f_sServer'+id);
      if(server.value) server = "&server="+server.value;
      else             server = '';

      img[id].onload = LoadImg3;
      img[id].src="php/traffic.php?ses="+SessionID+"&dedicated="+month.value+server;

      id = 93;
      img[id] = document.getElementById('theimg'+id);
      if(img[id].width > 1)
      {
        imgW = img[id].width;
        imgH = img[id].height;
      }

      img[id].width  = 1;
      img[id].height = imgH;
      img[id].onload = LoadImg93;
      img[id].src="php/traffic.php?ses="+SessionID+"&load="+month.value+server;
      break;

    case 2:
      var limit = document.getElementById('f_cLimit');
      var ftp   = document.getElementById('f_cFtp');
      var mail  = document.getElementById('f_cMail');
      var web   = document.getElementById('f_cWeb');
      var total = document.getElementById('f_cTotaal');
      var domain= document.getElementById('f_sDomain'+id);
      img[id].src="php/traffic.php?ses="+SessionID+"&month="+month.value+
      "&limit="+limit.checked+
      "&ftp="+ftp.checked+
      "&mail="+mail.checked+
      "&web="+web.checked+
      "&total="+total.checked+
      "&domain="+domain.value;
      break;

    case 1:
      img[id].src="php/space.php?ses="+SessionID+"&month="+month.value;
      break;
  }
}

function LoadImg93()
{
  _LoadImg(93);
}

function LoadImg3()
{
  _LoadImg(3);
}

function LoadImg()
{
  _LoadImg(imgID);
}
function _LoadImg(id)
{
  img[id]   = document.getElementById('theimg'+id);
  img[id].width  = imgW;
  img[id].height = imgH;
}

//-----------------------------------------------------------------------------

var ResAcc = 0;
var ResGb  = 0;
var ResUpAcc = 0;
var ResUpGb  = 0;
var ResGbsSize = 1;
var ResGbsPrice = 0;
var ResSize  = new Array();
var ResPrice = new Array();
var ResDisc  = new Array();
var ResAccPrice = 0;
var ResAccDisc = 0;
var ResGbPrice = 0;

function SetResAcc(AccUp, GbUp)
{
  var UpTxt = '';
  var UpPay = '';
  var UpTot = 0;

  ResAccPrice = 0;
  ResGbPrice = 0;

  var ElResAcc     = document.getElementById('ResAcc');
  var ElNewResAcc  = document.getElementById('NewResAcc');
  var ElResDom     = document.getElementById('ResDom');
  var ElNewResDom  = document.getElementById('NewResDom');
  var ElExtraGB    = document.getElementById('ExtraGB');
  var ElNewExtraGB = document.getElementById('NewExtraGB');
  var ElTotGB      = document.getElementById('TotGB');
  var ElNewTotGB   = document.getElementById('NewTotGB');
  var ElResStop    = document.getElementById('ResStop');
  var ElUpgrade    = document.getElementById('Upgrade');
  var ElUpTxt      = document.getElementById('UpTxt');
  var ElUpPay      = document.getElementById('UpPay');
  var ElSaveBtn    = document.getElementById('SaveBtn');

  if(AccUp)
  {
    if((ResAcc + ResUpAcc + AccUp) >= 1) ResUpAcc += AccUp;
  }

  if(GbUp)
  {
    ResUpGb += GbUp;
    if((ResGb + ResUpGb) < 0) ResUpGb = -ResGb;
  }

  if(ResUpAcc>0)
  {
    var i, cnt = 0, res = ResAcc*10, up = ResUpAcc*10;

    for(i in ResSize)
    {
      if(ResSize[i] > res)
      {
        cnt = Math.min(up, ResSize[i] - res);
        res += cnt;
        up -= cnt;
        ResAccPrice += ResPrice[i]*cnt;
        ResAccDisc = ResDisc[i];
        if(up==0) break;
      }
    }
    if(up>0) ResAccPrice += ResPrice[i]*up;

    UpTot += ResAccPrice;
    UpTxt += ResUpAcc+' x Reseller pakket<br/>';
    UpPay += '&euro; '+ResAccPrice.toFixed(2)+' p.m.<br/>';
    if(ResAccDisc)
    {
      UpTxt += '<div style="text-align:right; line-height: 7px; padding-bottom: 11px">('+ResAccDisc+'% korting)</div>';
      UpPay += '<br/>';
    }
  }
  if(ResUpGb>0)
  {
    ResGbPrice = ResGbsPrice * ResUpGb;
    UpTot += ResGbPrice;
    UpTxt += 'Uitbreiding met '+ResUpGb+'x'+1+' GB<br/>';
    UpPay += '&euro; '+ResGbPrice.toFixed(2)+' p.m.<br/>';
  }
  if(UpTot)
  {
    UpTxt += '<hr/><b>Totaal</b> (excl BTW)';
    UpPay += '<hr/><b>&euro; '+UpTot.toFixed(2)+' p.m.</b>';
  }

  ElResAcc    .innerHTML = '<h2>'+ResAcc+'</h2>';
  ElNewResAcc .innerHTML = '<h2>'+(ResUpAcc?ResAcc+ResUpAcc:'')+'</h2>';
  ElResDom    .innerHTML = '<h2>'+(ResAcc*10)+'</h2>';
  ElNewResDom .innerHTML = '<h2>'+(ResUpAcc?(ResAcc+ResUpAcc)*10:'')+'</h2>';
  ElExtraGB   .innerHTML = '<h2>'+(ResGb?(ResGb*1)+' GB':'-')+'</h2>';
  ElNewExtraGB.innerHTML = '<h2>'+(ResUpGb?((ResGb+ResUpGb)*1)+' GB':'')+'</h2>';

  ElTotGB     .innerHTML = '<h2>'+(ResAcc*ResGbsSize+ResGb)+' GB</h2>';

  //ElNewTotGB  .innerHTML = '<h2>'+(ResAcc*ResGbsSize+ResGb)+' GB</h2>';
  ElNewTotGB  .innerHTML = '<h2>'+((ResUpAcc || ResUpGb)?((ResAcc+ResUpAcc)*ResGbsSize+ResGb+ResUpGb)+' GB':'')+'</h2>';

  ElUpTxt     .innerHTML = UpTxt;
  ElUpPay     .innerHTML = UpPay;

  ElResStop.style.display = ResUpAcc || ResUpGb ? 'none' : '';
  ElUpgrade.style.display = UpTot ? '' : 'none';
  ElSaveBtn.style.display = ResUpAcc || ResUpGb ? '' : 'none';
}

//-----------------------------------------------------------------------------

function SaveResAcc()
{
  if(ResUpAcc || ResUpGb)
  {
    cpExport('cpSaveResAcc', '<ResUpAcc>'+ResUpAcc+'</ResUpAcc><ResAccPrice>'+ResAccPrice+'</ResAccPrice><ResAccDisc>'+ResAccDisc+'</ResAccDisc><ResUpGb>'+ResUpGb+'</ResUpGb><ResGbPrice>'+ResGbPrice+'</ResGbPrice>');
  }
  return false;
}

//-----------------------------------------------------------------------------

function StopRes()
{
  cpExport('cpStopResAcc', '<StopResAcc/>');
}

//-----------------------------------------------------------------------------

var arMailChecks = new Array();
var blMailCheck = true;

function CheckMail(Nr, Login, Pass, Server)
{
  var Mail = Nr+";"+Login+";"+Pass+";"+Server;
  if(Nr==1)
  {
    arMailChecks = new Array();
    blMailCheck = true;
    arMailChecks[Nr] = Mail;
    StartMailCheck(Nr);
  }
  else
  {
    arMailChecks[Nr] = Mail;
  }
}

//-----------------------------------------------------------------------------

function StartMailCheck(Nr)
{
  if(!blMailCheck)
  {
    var el=document.getElementById('m_'+Nr);
    if(el) el.innerHTML = "<img src='tmpl/checking_.gif' alt='' title='Ophalen e-mail informatie...'/>";
  }

  setTimeout("ADRequest('CheckMail', '"+arMailChecks[Nr]+"', 'checkmail_"+Nr+"')", 10);
}

//-----------------------------------------------------------------------------

function SetMail(Nr, Mail)
{
  var el=document.getElementById('m_'+Nr);
  if(el) el.innerHTML = Mail;

  if(blMailCheck)
  {
    if(arMailChecks[++Nr])  StartMailCheck(Nr);
    else                    blMailCheck = false;
  }
}

//-----------------------------------------------------------------------------

function CheckSpam(Email, Server)
{
  ADRequest('SpamMail', Email+";"+Server);
}

//-----------------------------------------------------------------------------

function OpenEatWeb(Login, Passw)
{
  el_f = document.getElementById('implogin');
  el_l = document.getElementById('imapuser');
  el_p = document.getElementById('pass');
  if(el_f && el_l && el_p)
  {
    el_l.value = Login;
    el_p.value = Passw;

    try {
      document.getElementById('ie_version').value = objCCaps.getComponentVersion('{89820200-ECBD-11CF-8B85-00AA005B4383}','componentid');
    } catch (e) {
    }

    window.open('https://webmail.eatserver.nl/login.php?logout_reason=logout', 'webmail');
    window.setTimeout("window.open('https://webmail.eatserver.nl/login.php?new_lang=nl_NL', 'webmail');", 400);
    window.setTimeout("document.getElementById('implogin').submit()", 600);
  }
}

//-----------------------------------------------------------------------------

function OpenEatWeb(Login, Passw)
{
  el_f = document.getElementById('implogin');
  el_l = document.getElementById('imapuser');
  el_p = document.getElementById('pass');
  if(el_f && el_l && el_p)
  {
    el_l.value = Login;
    el_p.value = Passw;

    try {
      document.getElementById('ie_version').value = objCCaps.getComponentVersion('{89820200-ECBD-11CF-8B85-00AA005B4383}','componentid');
    } catch (e) {
    }

    window.open('https://webmail.eatserver.nl/login.php?logout_reason=logout', 'webmail');
    window.setTimeout("window.open('https://webmail.eatserver.nl/login.php?new_lang=nl_NL', 'webmail');", 400);
    window.setTimeout("document.getElementById('implogin').submit()", 600);
  }
}

//-----------------------------------------------------------------------------

function OpenRoundCubeWeb(Domain, Login, Passw)
{
  var MailWin = window.open('http://www.'+Domain+'/roundcube/?_task=logout', 'webmail');
  //setTimeout('OpenRoundCubeWeb_('+MailWin+', '+Domain+', '+Login+', '+Passw+')', 1000);

  // http://blog.philippheckel.com/2008/05/16/roundcube-login-via-php-script/
}

function OpenRoundCubeWeb_(MailWin, Domain, Login, Passw)
{
  if(MailWin)
  {
    el_l = MailWin.document.getElementById('rcmloginuser');
    el_p = MailWin.document.getElementById('rcmloginpwd');
    if(el_l && el_p)
    {
      el_l.value = Login;
      el_p.value = Passw;
    }
    else alert('elem not found');
  }
  else alert('no win');
}



//-----------------------------------------------------------------------------

function StartWhois()
{
  var el_w=document.getElementById('whois_domain');
  var el_d=document.getElementById('div_whois');

  if(el_w && el_d && el_w.value)
  {
    var domain, ext, name = el_w.value;
    var i = name.indexOf('.');

    if(i == -1)
    {
      domain = name;
      ext = 'nl';
    }
    else
    {
      domain = name.substr(0, i);
      ext = name.substr(i+1);
    }

    switch(ext)
    {
      case 'com': case 'net':
        StatWhois=true;
        el_d.innerHTML = "<br/><div id='s_whois'><div style='margin: 20px'>Domein status informatie opzoeken van "+domain+'.'+ext+"<br/><img src='tmpl/bigwait.gif'/></div></div><br/><hr/>";
        ADRequest('cpWhoIs_stat', domain+"."+ext, 'WhoIsStat');
        break;

      default: el_d.innerHTML='';
    }

    el_d.innerHTML += "<br/><div id='d_whois'><div style='margin: 20px'>WhoIs informatie opzoeken van "+domain+'.'+ext+"<br/><img src='tmpl/bigwait.gif'/></div></div>";
    ADRequest('cpWhoIs_dom', domain+"."+ext);
  }
}

function SetWhoIs(Cmd, Output)
{
  var id = false;
  switch(Cmd)
  {
    case 'cpWhoIs_dom':  id = 'd_whois'; break;
    case 'cpWhoIs_stat': id = 's_whois'; break;
  }
  if(id)
  {
    var el = document.getElementById(id);
    if(el) el.innerHTML = '<pre style="font-family: Arial">'+Output+'</pre>';
  }
  else
  {
    alert('Invalid cmd: '+Cmd);
  }
}

//-----------------------------------------------------------------------------
// Dummy function which is defined in domain.js for use in the request phase
function SetAllLists()
{
}
