


function XXX(val) 
{
   var sURL = document.location;
   var thisDomain = location.protocol+"//"+location.host;
   if( val != thisDomain){
      thisDomain = val;
   }
   var query1 = this.location+"";
   if (query1.indexOf("?") > 0) query1 = query1.replace("?","&");
   var logomesg = thisDomain+"/liferequest/redir"+"?url="+query1;
	document.write('<IMG src="'+logomesg+'">');
}


function popupSurvey(fromPage, toPage, refid, windowprops, popNow){
   if(windowprops==null){
      windowprops = "width=515,height=260,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";
   }

   var winleft = (screen.width / 2) - (515 / 2);
   var wintop = (screen.height / 2) - (260 / 2);
   windowprops=windowprops+",top="+wintop+",left="+winleft;

   if (document.all) {
      var top=self.screenTop;
      if (top>9000 || popNow) {
         window.open(toPage+"?FROM_PAGE="+fromPage+"&REF_ID="+refid, "popSale", windowprops);
      }
   }
   else {
      var top = window.outerWidth;
      if (top==0 || popNow) {
         window.open(toPage+"?FROM_PAGE="+fromPage+"&REF_ID="+refid, "popSale", windowprops);
      }
   }
}


function bodyUnload(){
   var currentURL = document.location;
   var devIP = /localhost:8080/;
   var testIP = /10.1.1.210/;
   var darienURL = /darien/;
   var insureURL = /lifequotes.com/;
   var quotesmithURL = /lifequotes.com/;

   var localPC=/pc.*|demo.*/;

   if(localPC.test(currentURL) || devIP.test(currentURL) || testIP.test(currentURL) || darienURL.test(currentURL) || insureURL.test(currentURL)){
//         popupSurvey('TERM-qstermindex', '/liferequest/Surveys','12345');
   }
}





var baseURL = 'https://www.lifequotes.com';
var linkURL = 'http://www.lifequotes.com';


var tabsName=new Array();
var tabs=new Array();
var myTarget='';
// force ref code
/*var query = location.search.substring(1);
var testRef=/REF=/;
if (query.length > 0) query="&"+query;
var ref = "";
if (!testRef.test(query)) ref="&REF=99998";
if (testRef.test(query)) ref=query;
*/
var searchString=location.search;
var refIndex=searchString.indexOf("REF=");
var ref="99998";
if(refIndex>0){
   var ref=searchString.substring(refIndex+4, refIndex+9);
}  

function getTabs(selectedTabName, isAgent, hideYourAccount, hideHorizontalLine, secure, customCareNumber){

  getTabs(selectedTabName, isAgent, hideYourAccount, hideHorizontalLine, secure, customCareNumber, null, null, null, null,null,null,null)

}

function getTabs(selectedTabName, isAgent, hideYourAccount, hideHorizontalLine, secure, customCareNumber, target, hideTabs, hideRightSpace, shiftTabBy){

  getTabs(selectedTabName, isAgent, hideYourAccount, hideHorizontalLine, secure, customCareNumber, target, hideTabs, hideRightSpace, shiftTabBy,null,null,null)

}


function getTabs(selectedTabName, isAgent, hideYourAccount, hideHorizontalLine, secure, customCareNumber, target, hideTabs, hideRightSpace, shiftTabBy,tabArray,ibaseURL,ilinkURL){
   var currentURL = document.location;
   var devIP = /10.1.1.200/;
   var testIP = /10.1.1.210/;
   var darienURL = /darien/;
   var localPC=/pc.*|demo.*|localhost.*/;
   var secureprotocol = "https://";
   var protocol = "http://";
   

   if(shiftTabBy==null){
      shiftTabBy=67;
   }

//   var baseURL = 'www.insure.com';

//   var linkURL = 'www.insure.com';

   
   
   baseURL = document.domain;
   linkURL = document.domain;
   if (document.location.port != '80') {
	   baseURL = baseURL+":"+document.location.port;
	   linkURL = linkURL+":"+document.location.port;
   }
   //alert("domain: " + document.domain);

   // allow overide of baseURL
   if(ibaseURL!=null){
      baseURL=ibaseURL;
   }


   // allow overide of linkURL
   if(ilinkURL!=null){
      linkURL=ilinkURL;
   }
   
   var secureBase = location.href;
   if(secureBase.indexOf('https:') < 0){
      baseURL = protocol+baseURL;
   }
    else
   {
      baseURL = secureprotocol+baseURL;
   }
   linkURL = protocol+linkURL; // protocol should be passed as well
 
   if (devIP.test(currentURL)){
      linkURL = 'http://10.1.1.200';
      baseURL=linkURL;
   }
   else if (testIP.test(currentURL)){
      linkURL = 'http://10.1.1.210';
      baseURL=linkURL;
   }
   else if (darienURL.test(currentURL)){
      linkURL = 'http://darien.quotesmith.com';
      baseURL=linkURL;
   }
//   else if (localPC.test(currentURL)){
//      linkURL = '';
//      baseURL=linkURL;
//   }

   var myTarget='';
   if(target!=null){
      myTarget=' target="'+target+'"';
   }


   tabsName=new Array();
   tabsName["homepage"]=2;
   tabsName["auto"]=3;
   tabsName["life"]=4;

   tabsName["home"]=6;

   tabsName["business"]=7;
   //tabsName["travel"]=8;
   tabsName["health"]=5;


  tabsName["dental"]=8;
  tabsName["lifesettlement"]=9;

  tabsName["sitemap"]=13;

   var selectedTab=tabsName[selectedTabName];

   
   tabs=new Array(
      new Array('<a href="'+linkURL+'/"'+myTarget+'><img border="0" src="'+baseURL+'/images/lifemodule/lq_logo.gif" alt="LifeQuote.com"></a>'),

      new Array('<a href="'+linkURL+'/"'+myTarget+'><img src="'+baseURL+'/images/common/homepage_', '.gif" border="0" alt="Home page"></a>'),

	  new Array('<a href="'+linkURL+'/redirect.jsp?qs_pageID=62&REF=48237&qs_type=auto"'+myTarget+'><img src="'+baseURL+'/images/common/auto_', '.gif" border="0" alt="Auto"></a>'),

      new Array('<a href="'+linkURL+'/liferequest/controller?reqid=qstermindex&REF='+ref+'"'+myTarget+'><img src="'+baseURL+'/images/common/life_', '.gif" border="0" alt="Life"></a>'),
	  new Array('<a href="'+linkURL+'/goto_healthinsurance.html"'+myTarget+'><img src="'+baseURL+'/images/common/health_', '.gif" border="0" alt="Health"></a>'),
      new Array('<a href="'+linkURL+'/goto_home.html"'+myTarget+'><img src="'+baseURL+'/images/common/home_', '.gif" border="0" alt="Home"></a>'),
      new Array('<a href="'+linkURL+'/goto_business.html"'+myTarget+'><img src="'+baseURL+'/images/common/business_', '.gif" border="0" alt="Business"></a>'),

      new Array('<a href="'+linkURL+'/goto_dental.html"'+myTarget+'><img src="'+baseURL+'/images/common/dental_', '.gif" border="0" alt="Dental"></a>')


   );

   // allow overide of tabs
   if(tabArray!=null){
      tabs=tabArray;
   }
  document.write('<center>');       

    
  //first lets do the css.  note:  there is not a universal .css file in all pages so its best kept here inline

  document.write("<style type=\"text\/css\">");
  document.write("  .jtopnav      { text-align: center;");
  document.write("				    border-left:none;");
  document.write("				    border-right:1px solid #D4D4D4; ");
  document.write("				    border-top:none; ");
  document.write("				    border-bottom:none; ");
  //document.write("				    background-color: #D4D4D4; ");
 // document.write("				    background-image: url('"+baseURL+"\/images\/common\/topnavback.gif'); ");
 // document.write("              	background-position:50%;");
  document.write("                }   ");
  document.write("  .jtopnavNoR      { text-align: center;");
  document.write("				    border:none; ");
  document.write("                }   ");
  document.write("  .navbutton  { font-family: Arial; ");
  document.write("					color: #36578C; ");
  document.write("					font-size: 10pt; ");
  document.write("					font-weight: bold;");

  document.write("					margin: 0 5 0 5; ");
  document.write("					white-space:nowrap ;");

  document.write("			    }");



  document.write("a:active.navbutton { font-family: Arial; color: #36578C; font-size: 10pt; font-weight: bold }");

  document.write("a:link.navbutton { font-family: Arial; color: #36578C; text-decoration: none; font-size: 10pt; font-weight: bold }");

  document.write("a:visited.navbutton { font-family: Arial; color: #36578C; text-decoration: none; font-size: 10pt; font-weight: bold }");

  document.write("a:hover.navbutton { font-family: Arial; color: #fe0000; font-size: 10pt; font-weight: bold}");


  
  document.write(" <\/style>");




  document.write("<br><table border=\"0\" cellSpacing=\"0\" width=\"100%\" valign=\"bottom\">");

  /* This first group is the first line, logo...*/
  
  document.write("    <tr>");
  document.write("      <td vAlign=\"bottom\" align=\"middle\">");
  document.write("      <table style=\"border-collapse: collapse\"  width=\"920\" height=\"48\">");
  document.write("          <tr>");
  document.write("            <td width=\"50%\" style=\"padding-right:0px\" align=\"left\">");
  document.write("                  "+getImageTab(1, selectedTab));
  document.write("            <\/td>");
  document.write("            <td width=\"50%\" style=\"padding-right:50px\" align=\"right\">");
  document.write("            <img border=\"0\" src=\""+baseURL+"\/images\/common\/selectionsafetysavings.jpg\"  >");
  document.write("            <\/td>");
  document.write("          <\/tr>");
  document.write("      <\/table>");
  document.write("      <\/td>");
  document.write("    <\/tr>");



 /* document.write("    <tr>");
  document.write("      <td vAlign=\"bottom\" align=\"middle\">");
  



  document.write("      <table \" border=\"0\" cellSpacing=\"0\"  width=\"700\" height=\"15\">");
  document.write("          <tr>");

  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\"");

  document.write(gethomecolor(2, selectedTab) + ">Home<\/a><\/td>");

  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/liferequest\/controller?reqid=qstermindex&REF=99998\"");

  document.write(gethomecolor(4, selectedTab) + ">Life Insurance<\/a><\/td>");

  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/car/car_index.html?REF=10005\"");

  document.write(gethomecolor(3, selectedTab) + ">Auto Insurance<\/a><\/td>");

  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/goto_healthinsurance.html\"");

  document.write(gethomecolor(5, selectedTab) + ">Health Insurance<\/a><\/td>");

  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/goto_home.html\"");

  document.write(gethomecolor(6, selectedTab) + ">Home Insurance<\/a><\/td>");

  document.write("            <td class=\"jtopnavNoR\" \"><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/goto_business.html\"");

  document.write(gethomecolor(7, selectedTab) + ">Business Insurance<\/a><\/td>");

  document.write("          <\/tr>");
  document.write("      <\/table>");

  
   This is the second row of tabs.   



  document.write("      <table border=\"0\" cellSpacing=\"0\"   width=\"700\" height=\"15\">");
  document.write("          <tr>");

  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/goto_dental.html\"");

  document.write(gethomecolor(8, selectedTab) + ">Dental Insurance<\/a><\/td>");
  
  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/lifesettlement\"");

  document.write(gethomecolor(9, selectedTab) + ">Life Settlement<\/a><\/td>");

  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + "href=\"" + linkURL + "\/goto_disability.html\"");

  document.write(gethomecolor(10, selectedTab) + ">Disability<\/a><\/td>");

  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/goto_longterm_care.html\"");

  document.write(gethomecolor(11, selectedTab) + ">Long-term Care Insurance<\/a><\/td>");

  document.write("            <td class=\"jtopnav\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/goto_ID_theft.html\"");

  document.write(gethomecolor(12, selectedTab) + ">Identity Theft<\/a><\/td>");

  document.write("            <td class=\"jtopnavNoR\" ><h3 class=\"navbutton\"><a class=\"navbutton\" " + myTarget + "href=\"" + linkURL + "\/sitemap.html\"");

  document.write(gethomecolor(13, selectedTab) + ">Site Map<\/a><\/td>");

  document.write("          <\/tr>");
  document.write("      <\/table>");
  document.write("");

 document.write("       <\/td>");
 document.write("    <\/tr>");*/


  var customCarePhone = "1-800-324-6370";
  if (customCareNumber != null && customCareNumber != "1-800-324-6370") {
      customCarePhone = customCareNumber;
  }
  
  document.write("<\/table>");





   document.write('</center>');
}





function writeBottomLinks(baseURL, linkURL, customCarePhone, myTarget){
//   document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
	 // document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/noMed_redir.html" class="pageLink"><font color=blue>No-Exam Life Insurance</font></a>&nbsp;&nbsp;&nbsp;&nbsp;');
   document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/lifesettlement" class="pageLink"><font color=blue>Life Settlement</font></a> &nbsp;&nbsp;&nbsp;&nbsp;');
// document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/EIAnnuity_redir.html" class="pageLink"><font color=blue>Index Annuities</font></a> &nbsp;&nbsp;&nbsp;&nbsp;');
 //document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/redirect.jsp?qs_pageID=3&qs_type=motorcycle&qs_field1=43493" class="pageLink"><font color=blue>Motorcycle</font></a> &nbsp;&nbsp;&nbsp;&nbsp;');-->
   document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/goto_disability.html" class="pageLink"><font color=blue>Disability</font></a> &nbsp;&nbsp;&nbsp;&nbsp;');
   document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/goto_longterm_care.html" class="pageLink"><font color=blue>Long-Term Care Insurance</font></a>&nbsp;&nbsp;&nbsp;&nbsp;');
 //  document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">Buy online or call '+customCarePhone+' &nbsp;&nbsp;&nbsp;&nbsp;');
 //  document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/dentalplans_redir.html" class="pageLink"><font color=blue>Dental Plans</font></a>&nbsp;&nbsp;&nbsp;&nbsp;');
//   document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/liferequest/controller?reqid=equityindexannuity" class="pageLink"><font color=blue>Index Annuities</font></a>&nbsp;&nbsp;&nbsp;&nbsp;');
      document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/goto_ID_theft.html" class="pageLink"><font color=blue>Identity Theft</font></a>&nbsp;&nbsp;&nbsp;&nbsp;');

document.write('<img border="0" src="'+baseURL+'/images/common/blueArrow.gif">&nbsp;<a href="/sitemap.html" class="pageLink"><font color=blue>Site Map</font></a>&nbsp;&nbsp;&nbsp;&nbsp;');
document.write('<input type="text" name="query" style="font-size:10px;width=140">&nbsp;&nbsp;<input type="image" src="'+baseURL+'/images/common/search.gif"  alt="Search" style="position:relative;top:3px"></a>&nbsp;&nbsp;&nbsp;&nbsp;');
}



function getYourAccount(hide){
   if(hide){
      return "&nbsp;";
   }
   else{
      //return '<img height="1" width="52" src="/images/common/clear.gif"><a href="'+baseURL+'/apr.html"'+myTarget+'><img border="0" src="'+baseURL+'/images/common/your_account.gif" alt="Your Account"></a>';
      return "&nbsp;"; // TR 5659
   }
}

function getImageTab(tabIndex, selectIndex){
   var result=tabs[tabIndex-1][0];
   if(tabs[tabIndex-1][1]!=null){
      if(selectIndex==tabIndex){
         result+='1';
      }
      else{
         result+='0';
      }
      result+=tabs[tabIndex-1][1];
   }
   return result;

}

/* This function sets the color of the active page tab to red. --jim v.*/


function gethomecolor(tabIndex, selectIndex) {

    var result = "";
        if (selectIndex == tabIndex) {

            result += 'style="text-decoration: none"><font color="#FE0000"';
          
        }
        else {
            result = '';
        }
       
   
    return result;
}

function getFooter(width){
   document.write('<style>\n');
   document.write('<!--\n');
   document.write('td.bpleftcol, td.bprightcol {\n');
   document.write('  width: 3px;\n');
   document.write('  background-color: #cccc99;\n');
   document.write('}\n');

   document.write('td.boilerplate {\n');
   document.write('  font-family: Arial,Univers,Helvetica ;\n');
   document.write('  font-size: 12px ;\n');
   document.write('  color: black ;\n');
   document.write('  text-align: justify;\n');
   document.write('  padding: 0px 4px ;\n');
   document.write('}\n');
   document.write('-->\n');
   document.write('</style>\n');

   document.write('<table bgcolor=#FFFFFF width="'+width+'" border="0" cellspacing="0" cellpadding="0" align="center">');
   document.write('        <TR>');
   document.write('          <TD>');
   document.write('            <table width="'+width+'" border="0" cellspacing="0" cellpadding="0" align="center">');
   document.write('              <TBODY>');
   document.write('                <TR>');
   document.write('                  <TD class=bpleftcol>&nbsp;</TD>');
   document.write('                  <TD class=boilerplate>Copyright &#169;1984-2010 Life Quotes, Inc., 8205 South Cass Avenue, Suite 102, Darien, Illinois. Life Quotes, Inc. and certain of its personnel are licensed as insurance agents, brokers or producers in all states. CA agent #0A13858, LA agent #200696, MA agent #333509159. dba Life Quotes Insurance Services in CA under agent #0827712, in LA under agent #205078. dba Life Quotes Insurance Services, Inc. in UT under agent #90093. All rights reserved. Telephone (630) 515-0170. Founded 1984.</TD>');
   document.write('                  <TD class=bprightcol>&nbsp;</TD>');
   document.write('                </TR>');
   document.write('              </TBODY>');
   document.write('            </TABLE>');
   document.write('          </TD>');
   document.write('        </TR>');
   document.write('    </TABLE>');
}
//window.onunload=bodyUnload;




