/* drop down menu and navigation functions */


var ie4=(document.all)?1:0;
var ns4=(document.layers)?1:0;
var dom=((document.getElementById)&&(!ie4))?1:0; 
var fl=false;
var tm=null;

// "anchor","dropdown",xpos,ypos
var dropdown=new Array();

if( !ns4 )
{
dropdown[0]=new Array("","d0",0,0);
dropdown[1]=new Array("m1","d1",283,45);
dropdown[2]=new Array("m2","d2",348,45);
dropdown[3]=new Array("m3","d3",413,45);
dropdown[4]=new Array("m4","d4",478,45);
}
else
{
dropdown[0]=new Array("","d0",0,0);
dropdown[1]=new Array("m1","d1",320,53);
dropdown[2]=new Array("m2","d2",401,53);
dropdown[3]=new Array("m3","d3",482,53);
dropdown[4]=new Array("m4","d4",563,53);
}

function hide()
{	
	if( !fl )
   {
      for( i = 0; i < dropdown.length; i++ )
      {
         if( dropdown[i][0] == "" ) continue;
         if(ns4)
            document.layers[dropdown[i][1]].visibility = "hidden";
         else
            document.getElementById(dropdown[i][1]).style.visibility = "hidden";
      }
   }
}

function show( id )
{
   if( id == 0 ) return;
   var m = dropdown[id];   
   clearTimeout(tm);
   hide();
   fl=true;
   if( dom ) 
   {
      l = document.getElementById(m[1]);
      l.style.visibility = "visible";
      l.style.top = m[3];
      l.style.left = m[2];		
   }
   else 
   {	
      l = (ns4) ? document.layers[m[1]] : document.all[m[1]].style;
      l.visibility = "visible";
      l.top = m[3];
      l.left = m[2];
   } 	
}

function ov() { clearTimeout(tm); fl=true; }
function ou() { clearTimeout(tm); fl=false; tm=setTimeout("hide()",300); }

// pull domain name out of URL
function extractDomainName()
{
   // get where we are
   var here = new String(document.URL);
   // get the position of the delimeter in the URL
   var colon = here.indexOf("://");
   // offset past the delimiter
   colon = colon + 3;
   // get the substring past the delimiter
   var pastdelim = here.substring(colon);
   // get the position of the slash
   var slash = pastdelim.indexOf("/");
   // initialize storage for the root url
   var root = "";
   // extract the root url from the remaining string
   if( slash != -1 )
   {
      root = pastdelim.substring(0,slash);
   }
   else
   {
      root = pastdelim;
   }
   return root;
}

// go to a channel+subchannel
function go( chan, subchan )
{
   window.location =
      "http://" +
      extractDomainName() +
      "/servlet/com.kx.cs.servlets.CsServlet?" +
      "channel=" +
      chan +
      "&subchannel=" +
      subchan;
}

// go to a channel+subchannel in SSL
function gos( secure, chan, subchan )
{
   window.location =
      secure +
      "://" +
      extractDomainName() +
      "/servlet/com.kx.cs.servlets.CsServlet?" +
      "channel=" +
      chan +
      "&subchannel=" +
      subchan;
}

// go to a channel+product+subproduct+anchor (anchor optional) 
function gop( chan, product, subproduct, anchor )
{
   window.location = 
      "http" +
      "://" +
      extractDomainName() +
      "/servlet/com.kx.cs.servlets.CsServlet?" +
      "channel=" +
      chan +
      "&product=" +
      product +
      "&subproduct=" +
      subproduct +
      "&anchor=" +
      anchor;
}

// // go to a channel+product+subproduct in SSL
function gosp( secure, channel, product, subproduct)
{
   window.location =
      secure +
      "://" +
      extractDomainName() +
      "/servlet/com.kx.cs.servlets.CsServlet?" +
      "channel=" +
      channel +
      "&product=" +
      product + 
	  "&subproduct=" + 
	  subproduct;
}

// Product navigation links

// Health Section
function HPul(f) 
{
   if( f != "on" )
      gop('health','healthpulse','order',''); 
   else
      gop('health','healthpulse','members','');
}
function Doct() {gop('health','doctor','search','')}
function Chir() {gop('health','chiro','search','')}
function Dent() {gop('health','dentist','search','')}
function Nurs() {gop('health','nurse','search','')}
function NuHo() {gop('health','facility','search','')}

// Home Section
function PrPk() {go('welcome','clue')}
function PrSc() {go('welcome','insscore')}
function PrCl() {go('welcome','clue')}
function PrCh() {gop('home','propertycheck','search','')}

// Auto Section
function AuPk() {go('welcome','clue')}
function AuSc() {go('welcome','insscore')}
function AuCl() {go('welcome','clue')}
function AuMv() {gop('auto','mvr','default','')}

// Family Section
function chip() {gop('home','chip','default','')}
function chiplet() {gop('home','chiplet','default','')}
function pesc() {gop('home','pesc','default','')}
function instantCrim() {gop('home','clearcheck','order','')}
function BgCh() {gop('home','bgcheck','default','')}
function BuCh() {gop('money','bcheck','search','')}
function CoCh() {gop('home','contractorcheck','search','')}

// Property Insurance Claims Report/Real Estate
function PrIn() {gop('home','propertycheck','propertyins','')}
function REst() {gop('money','real','search','')}

// general navigation links
function Welc() {go('welcome','')}
function Affe() {go('affected','')}
function AbUs() {go('welcome','aboutus')}
function Cont() {go('welcome','contacts')}
function Priv() {go('welcome','privacy')}
function Righ() {go('welcome','rights')}
function GFAQ() {faqMain = window.open("http://choicetrust-solutions.custhelp.com/cgi-bin/choicetrust_solutions.cfg/php/enduser/home.php","help","scrollbars=yes,width=800,height=480");faqMain.focus();}
function GFAQA() {faqMain = window.open("http://consumer-solutions.custhelp.com","help","");faqMain.focus();}
function Site() {go('welcome','sitemap')}
function PLst() {go('welcome','pricelist')}

// function links
function Lin() {go('welcome','login')}
function Reg(s) {gos(s,'welcome','openacct')}
function Zap() {go('welcome','zap')}
function ScHs() {go('welcome','scorehistory')}
function Frnd() {go('welcome','tellafriend')}
function EmPg() {go('welcome','email')}
function Acc(s) {gos(s,'welcome','myaccount')}

// FACT Act / Facelift links
function clue() {go('welcome','clue_info')}
function clueproprisk() {gop('home','ror','order','')}
function tenant() {go('welcome','tenanthist')}
function emphist() {go('welcome','emphist')}
function persrec() {go('welcome','persrecords')}
function persins() {go('welcome','persinsreport')}
function insscore() {go('welcome','insscore')}
function help() { faqMain = window.open("http://choicetrust-solutions.custhelp.com/cgi-bin/choicetrust_solutions.cfg/php/enduser/home.php","help","scrollbars=yes,width=800,height=480"); faqMain.focus(); }



