<!--
//turn off error messages
window.onerror=function(){return true;}

var agt=navigator.userAgent.toLowerCase();
var is_ie   = (agt.indexOf("msie") != -1);
var is_opera   = (agt.indexOf("opera") != -1);
var is_nets  = (document.layers ? true : false);
var is_nets7 = (agt.indexOf("netscape/7") != -1);
var is_mac = (navigator.appVersion.indexOf("Mac") != -1);
var openwidth;
var openheight;

function restore_frames(){
var development = '';
var plprefix = '';
var lastslash,mypath;
var here = new String(window.location.href.toLowerCase());
if (here.indexOf('tnct2002') != -1) development = '/TNCT2002';
if (here.indexOf('internet-taxprep') != -1) plprefix = 'pl';
lastslash = window.location.pathname.lastIndexOf('/',window.location.pathname.length-2);
if (lastslash == -1 || here.indexOf('pl') != -1 || here.indexOf('faq_files') != -1)
  mypath = window.location.pathname;
else
  mypath = window.location.pathname.substring(0,lastslash+1) + plprefix + window.location.pathname.substring(lastslash+1,window.location.pathname.length);
  if (document.location == top.document.location)
    if (window.location.href.replace)
        window.location.replace('http://' + window.location.host + development + '/' + plprefix + 'index.asp?page=http://' + window.location.host + mypath);
    else
        // causes problems with back button, but works
        window.location.href = 'http://' + window.location.host + development + '/' + plprefix + 'index.asp?page=http://' + window.location.host + mypath;
}

function dosearch(){
  var url = new String();
//  var searchstring = new String(document.search.searchfor.value);
  var searchstring = new String(cleanString(document.search.searchfor.value));
  if(!(document.search.searchfor.value == "") && !(document.search.searchfor.value == "?")){
    searchstring = searchstring.replace(/ /g, "%20");
    url = "faqs/search.asp?browsestring=&category=All&searchstring=" + searchstring;
    if (document.location == top.location)
      document.location = url;
    else
      top.main.location = url;
  }
}

function pldosearch(){
  var url = new String();
//  var searchstring = new String(document.plsearch.searchfor.value);
  var searchstring = new String(cleanString(document.plsearch.plsearchfor.value));
  if(!(document.plsearch.plsearchfor.value == "") && !(document.plsearch.plsearchfor.value == "?")){
    searchstring = searchstring.replace(/ /g, "%20");
    url = "faqs/plsearch.asp?browsestring=&category=All&searchstring=" + searchstring;
    if (document.location == top.location)
      document.location = url;
    else
      top.main.location = url;
  }
}

function get_cookie(name){
var allcookies = document.cookie;
pos = allcookies.indexOf(name);
if(pos != -1){
  var start = pos + name.length + 1;
  var end = allcookies.indexOf(";", start);
  if (end == -1)
    end = allcookies.length;
  if(start == end)
    var value = "";
  else
    var value = allcookies.substring(start,end);
 }
return(value);
}

/* Lycos functions*/
function isIE4() {
  return( navigator.appName.indexOf("Microsoft") != -1 && (navigator.appVersion.charAt(0)=='4') );
}

function launchHelp(helpurl) {
  HelpWin = window.open(helpurl, 'HelpWindow','toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=500');
    if( ! isIE4() ) {
      if (HelpWin.focus) {
        HelpWin.focus();
      }
    }
    if (HelpWin.focus!=null  &&  !isIE4()) 
      {
        HelpWin.focus();
      }
    if (HelpWin.opener == null) HelpWin.opener = window;
      HelpWin.opener.name = "LycosMain";
}
/* end Lycos functions*/

function equiz_next(next_url){
	if(q1 && q2 && q3 && q4){
		window.document.location = next_url;
	}
	else{
	  alert("Please answer Yes or No to all questions before pressing \"Next.\"");
	}
}


function openAWindow( pageToLoad, winName, width, height, center) {
  /* Opens a new window on the users desktop.

     Arguments:
     pageToLoad - The URL of a page to load in the browser window.
                  This can be a relative URL or fully qualified.
     winName -    Name of the new window.  NO SPACES!
     width -      The horizontal size of the new window.
     height -     The vertical size of the new window.
     center -     toggle centering on 4.0 browsers.
                  1=centered window 0=no centering

     Values in the "args" section below can all be toggled in the
     same fashion as the center toggle.  Just modify the appropriate
     value in the args section to be either 0 or 1.

     A call to this function might look like this:
     <a href="javascript:openAWindow('ice.html','ice',375,250,1)">Ice</a>

     Created by Glenn Davis of Project Cool, Inc. for general use.  If
     you use this routine please leave all comments in place so that
     others may benefit as well.
     */
                                         
     xposition=0; yposition=0;
     if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
          xposition = (screen.width - width) / 2;
          yposition = (screen.height - height) / 2;
     }
     if (center == 2){
          xposition = 0;
          yposition = 0;
     }
     args = "width=" + width + "," 
             + "height=" + height + "," 
             + "location=0," 
             + "menubar=0,"
             + "resizable=0,"
             + "scrollbars=1,"
             + "status=0," 
             + "titlebar=0,"
             + "toolbar=0,"
             + "hotkeys=0,"
             + "screenx=" + xposition + ","  //NN Only
             + "screeny=" + yposition + ","  //NN Only
             + "left=" + xposition + ","     //IE Only
             + "top=" + yposition;           //IE Only 

      return (window.open( pageToLoad,winName,args ));
}

//code to disable right clicks
function right(e) {
  if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2 || (e.modifiers & Event.SHIFT_MASK))){
    status='Special clicks disabled.';
    status='';
    return false;
  }
  else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3 || (event.button == 1 && event.shiftKey))) {
    status="Special clicks disabled.";
    alert("Special clicks disabled.");
    status='';
    return false;
  }
return true;
}

function killclicks(){
  document.onmousedown=right;
  document.onmouseup=right;
  if (document.layers) 
    window.captureEvents(Event.MOUSEDOWN);
  if (document.layers)
    window.captureEvents(Event.MOUSEUP);
  window.onmousedown=right;
  window.onmouseup=right;
}

function noquotes(line){
//removes quotes marks
  var s = new String();
  var i;

  for (i=0;i<line.length;i++){
    //if not a quote
    if(line.charAt(i)!='\"'){
        //then write this character to output string
        s = s + line.charAt(i);
    }
    else
      s = s + "\'";
  }
  return (s);
}

function cleanString(line){
//removes illegal characters and compresses multiple spaces
  var s = new String();
  var i;

  for (i=0;i<line.length;i++){
    //if not an illegal character
    if((line.charAt(i)!='?') && (line.charAt(i)!='\"') && (line.charAt(i)!=';') && (line.charAt(i)!='!') && (line.charAt(i)!=',') && (line.charAt(i)!='.') && (line.charAt(i)!='%') && (line.charAt(i)!='*') && (line.charAt(i)!='<') && (line.charAt(i)!='>') && (line.charAt(i)!='&') && (line.charAt(i)!='#') && (line.charAt(i)!='(') && (line.charAt(i)!=')') && (line.charAt(i)!=']') && (line.charAt(i)!='[') && (line.charAt(i)!='\\') && (line.charAt(i)!='+') && (line.charAt(i)!='^') && (line.charAt(i)!='\"')){
      //if not consecutive space or last character is not space
      if((i==0) || !(line.charAt(i)==' ' && s.charAt(s.length-1)==' ') || !(line.charAt(i)==' ' && i == line.length-1))
        //then write this character to output string
        s = s + line.charAt(i);
    }
  }
  return (s);
}

function RemoveCommonWords(words){
  var i;

  for(i=0;i<words.length;){
    if(
        /*words to ignore*/
       (words[i].toUpperCase() == "THIS") || 
       (words[i].toUpperCase() == "THAT") || 
       (words[i].toUpperCase() == "YOUR") || 
       (words[i].toUpperCase() == "BOTH") || 
       (words[i].toUpperCase() == "HAVE") || 
       (words[i].toUpperCase() == "COMPLETETAX") || 
       (words[i].toUpperCase() == "HELP") || 
       (words[i].toUpperCase() == "WHEN") || 
       (words[i].toUpperCase() == "WHERE") || 
       (words[i].toUpperCase() == "WHAT") || 
       (words[i].toUpperCase() == "ISN'T") || 
       (words[i].toUpperCase() == "THANKS") || 
       (words[i].toUpperCase() == "THANK") || 
       (words[i].toUpperCase() == "PROBLEM") || 
       (words[i].toUpperCase() == "SUPPORT") ||
        /*ignore words less than 3 letters unless it is in this list*/
      ((words[i].length < 4) && 
       (words[i].toUpperCase() != "IRS") && 
       (words[i].toUpperCase() != "ID") && 
       (words[i].toUpperCase() != "W2") && 
       (words[i].toUpperCase() != "800") && 
       (words[i].toUpperCase() != "600") && 
       (words[i].toUpperCase() != "AGI"))
      )
      words = DeleteElement(words, i);
    else
//not removing word
      i++;
  }
  return(words);
}

function DeleteElement(a,i){
var temp = new Array();
  if (i == 0)
  //removing first element
    return (a.slice(1));
  else
    if (a.length == i+1)
    //removing last element
      return (a.slice(0, i));
    else{
    //removing element in middle of array
      temp = a.slice(i+1);
      a = a.slice(0,i);
//alert("beginning of array to keep" + temp);
//alert("end of array to keep" + a);
      a = a.concat(temp);
      return (a);
    }
}

function WeightWords(stRaw){
  var words = new Array();
  var stResults = new String();

  stRaw = cleanString(stRaw);
  words = RemoveCommonWords(stRaw.split(" "));

  stResults = words.toString();
  stResults = stResults.replace(/[,]/g, " ");
  while((stResults.lastIndexOf(" ") != -1) && (stResults.lastIndexOf(" ") == stResults.length-1)){
    stResults = stResults.slice(0,-1);
  }
//alert("!!" + stResults + "!!");
  return stResults;
}
function go_tvcalc(type){/*open calculators in a new window for Netscape 4*/
var strURL;
switch(type){
    case 1:  //All Calculators
      strURL = "http://www.tcalc.com/tvwww.dll?user?tmplt=usertool.htm&cstm=completetax2";
      break;
    case 2:  //Home Financing
      strURL = "http://www.tcalc.com/tvwww.dll?user?tmplt=homesuite.htm&cstm=completetax2";
      break;
    case 3:  //Personal Finance
      strURL = "http://www.tcalc.com/tvwww.dll?user?tmplt=persfin.htm&cstm=completetax2";
      break;
    case 4:  //Investment
      strURL = "http://www.tcalc.com/tvwww.dll?user?tmplt=investsuite.htm&cstm=completetax2";
      break;
    case 5:  //Retirement
      strURL = "http://www.tcalc.com/tvwww.dll?user?tmplt=retsuite.htm&cstm=completetax2";
      break;
    case 6:  //Lease
      strURL = "http://www.tcalc.com/tvwww.dll?user?tmplt=leasesuite.htm&cstm=completetax2";
      break;
    default:  //All Calculators
      strURL = "http://www.tcalc.com/tvwww.dll?user?tmplt=usertool.htm&cstm=completetax2";
      break;
  }
    window.open(strURL,"tvcalc","top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=580,height=520");
}

function go_taxes02(type){
  var strURL;
  switch(type){
    case 1:  //new return
      if (get_cookie("&acc") == "132017")
        strURL = "ae_tracker.html";
      else{
        if (document.location.host.toUpperCase() == "TNCTWEB" || document.location.host == "165.181.11.1")
          strURL = "http://" + document.location.host + "/TNCT2002/CT/CTBegin.asp?CTMode=new";
        else
          if (document.location.host.toUpperCase() == "TAXGUIDE2002.COMPLETETAX.COM" ||document.location.host.toUpperCase() == "TAXGUIDE.COMPLETETAX.COM")
            strURL = "https://www.completetax.com/CT/CTBegin.asp?CTMode=new";
          else
            strURL = "https://" + document.location.host + "/CT/CTBegin.asp?CTMode=new";
      }
      break;
    case 2:  //password hint
      if (document.location.host.toUpperCase() == "TNCTWEB" || document.location.host == "165.181.11.1")
        strURL = "http://" + document.location.host + "/TNCT2002/CT/gethint.asp";
      else
        if (document.location.host.toUpperCase() == "TAXGUIDE2002.COMPLETETAX.COM" ||document.location.host.toUpperCase() == "TAXGUIDE.COMPLETETAX.COM")
          strURL = "https://www.completetax.com/CT/gethint.asp";
        else
          strURL = "https://" + document.location.host + "/CT/gethint.asp";
      break;
    case 3:  //continue return
      if (document.location.host.toUpperCase() == "TNCTWEB" || document.location.host == "165.181.11.1")
        strURL = "http://" + document.location.host + "/TNCT2002/CT/CTBegin.asp?CTMode=old";
      else
        if (document.location.host.toUpperCase() == "TAXGUIDE2002.COMPLETETAX.COM" ||document.location.host.toUpperCase() == "TAXGUIDE.COMPLETETAX.COM")
          strURL = "https://www.completetax.com/CT/CTBegin.asp?CTMode=old";
        else
          strURL = "https://" + document.location.host + "/CT/CTBegin.asp?CTMode=old";
      break;
    case 4:  //electronic filing status
      if (document.location.host.toUpperCase() == "TNCTWEB" || document.location.host == "165.181.11.1")
        strURL = "http://" + document.location.host + "/TNCT2002/CT/CTBegin.asp?CTMode=old&eFile=Y";
      else
        if (document.location.host.toUpperCase() == "TAXGUIDE2002.COMPLETETAX.COM" ||document.location.host.toUpperCase() == "TAXGUIDE.COMPLETETAX.COM")
          strURL = "https://www.completetax.com/CT/CTBegin.asp?CTMode=old&eFile=Y";
        else
          strURL = "https://" + document.location.host + "/CT/CTBegin.asp?CTMode=old&eFile=Y";
      break;
    case 5:  //proforma return
      if (document.location.host.toUpperCase() == "TNCTWEB" || document.location.host == "165.181.11.1")
        strURL = "http://" + document.location.host + "/TNCT2002/CT/CTBegin.asp?CTMode=P";
      else
        if (document.location.host.toUpperCase() == "TAXGUIDE2002.COMPLETETAX.COM" ||document.location.host.toUpperCase() == "TAXGUIDE.COMPLETETAX.COM")
          strURL = "https://www.completetax.com/CT/CTBegin.asp?CTMode=P";
        else
          strURL = "https://" + document.location.host + "/CT/CTBegin.asp?CTMode=P";
      break;
    default:  //new return for backwards compatability
      if (document.location.host.toUpperCase() == "TNCTWEB" || document.location.host == "165.181.11.1")
        strURL = "http://" + document.location.host + "/TNCT2002/CT/CTBegin.asp?CTMode=new";
      else
        if (document.location.host.toUpperCase() == "TAXGUIDE2002.COMPLETETAX.COM" ||document.location.host.toUpperCase() == "TAXGUIDE.COMPLETETAX.COM")
          strURL = "https://www.completetax.com/CT/CTBegin.asp?CTMode=new";
        else
          strURL = "https://" + document.location.host + "/CT/CTBegin.asp?CTMode=new";
      break;
  }
  if (document.layers){
    openwidth = screen.availWidth - 12;
    openheight = screen.availHeight - 30;
  }else{
    openwidth = screen.availWidth;
    openheight = screen.availHeight;
  }
//  if (type == 4)
//    window.open(strURL,"OnlineTax","width="+openwidth+",height="+openheight+",top=0,left=0,scrollbars=1");
//  else
    window.open(strURL,"OnlineTax","width="+openwidth+",height="+openheight+",top=0,left=0,scrollbars=1");

}
/*Verisign function*/
function popUp(url) {
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=715,height=450');
//self.name = "mainWin";
}
/*Better Business Bureau function*/
function Pcertify(){
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=2021220133327619', 'Participant','location=yes,scrollbars=yes,width=450,height=370'); 
//window.name = 'opener';
} 
function Rcertify() {
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=10211051319427423', 'Participant','location=yes,scrollbars=yes,width=450,height=370'); 
//window.name = 'opener';
}

killclicks();
//-->

