function advlookupvalidate(){
  return true;
}

function help(elt){
  var h = new Array("help_1","help_2","help_3","help_4","help_5","help_6");
  for(i=0; i<h.length;i++){
    if(document.getElementById(h[i])) document.getElementById(h[i]).style.display="none";
  }
  document.getElementById(elt).style.display="block";
  document.getElementById(elt).parentNode.style.backgroundColor=document.getElementById(elt).style.backgroundColor;
}

function redirect_links(){
  var equity = "https://researchcapital.stockgroup.com/snapshot_quote.asp?";
  var mutual = "https://researchcapital.stockgroup.com/mutualfund.asp?";

  var count = 0;
  for(i=0; i<document.links.length;i++){
    if(document.links[i].href && document.links[i].href.substr(0,equity.length) == equity){
      document.links[i].href = "login/mtools.php?tool=equity&" + document.links[i].href.substring(1+document.links[i].href.indexOf('?'));
      document.links[i].target = "";
      count++;
    } else {
      if(document.links[i].href && document.links[i].href.substr(0,mutual.length) == mutual){
        document.links[i].href = "login/mtools.php?tool=mutual&" + document.links[i].href.substring(1+document.links[i].href.indexOf('?'));
        document.links[i].target = "";
        count++;
      }
    }
  }
//  if(count) alert("Changed " + count + " links");
}

ndexwindow = "";
function openndex(a){
  var feats = "toolbar=yes,location=no,status=yes,width=800,height=600,resizable=yes";
  if(a.action.substring(0,4) == "http"){
    ndexwindow = window.open(a.action,"n_account",feats);
  } else {
    ndexwindow = window.open('/' + a.action,"n_account",feats);
  }
  if(window.focus){ ndexwindow.focus();}
  return(false);
}

function openndexlink(link){
  var feats = "toolbar=yes,location=no,status=yes,width=800,height=600,resizable=yes";
  if(link.substring(0,4) == "http"){
    ndexwindow = window.open(link,"n_account",feats);
  } else {
    ndexwindow = window.open('/' + link,"n_account",feats);
  }
  return(false);
}

helpwindow = "";
function openhelp(link){
  var feats = "toolbar=yes,location=no,status=yes,width=800,height=600,resizable=yes,scrollbars=yes";
  if(link.substring(0,4) == "http"){
    helpwindow = window.open(link,"help_rcc",feats);
  } else {
    helpwindow = window.open('/' + link,"help_rcc",feats);
  }
  if(window.focus){ helpwindow.focus();}
  return(false);
}

function check_consent(){
  var stat = document.getElementById('statements');
  var conf = document.getElementById('confirms');
  var consent = document.getElementById('consent');

  if(stat[stat.selectedIndex].value == "Online Statements" || conf[conf.selectedIndex].value == "Online Confirms"){
    // show
    consent.style.display = "block";
  } else {
    // hide
    consent.style.display = "none";
  }
}

function testenterown(){
  el = document.getElementById('nquestionpick');
  if(el[el.selectedIndex].text == "Enter my own question..."){
//    el.style.display = 'none';
    document.getElementById('nquestionzone').style.display = 'block';
  } else {
    document.getElementById('nquestionzone').style.display = 'none';
  }
}


