<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function fixNSStretch() {
	var browser_name = navigator.appName;
	// is browser Netscape? If so, write blank table to fix stretching issues in Netscape		
	if(browser_name == "Netscape") {
		document.writeln("<table width='764' height='600' border='0' cellspacing='0' cellpadding='0'><tr valign='top'>");
		document.writeln("<td width='760' height='600' bgcolor='#FFFFFF'><p>&nbsp;</p><br /><br /><br /><br /><br /></td>");
		document.writeln("<td width='4' background='/images/page_edge.gif'><img src='/images/spacer.gif' width='4' height='1' /></td></tr></table>");
	}
	// otherwise, write nothing
	else {
		document.writeln(" ");
	}
}

function fixNSStretchInterior() {
	var browser_name = navigator.appName;
	// is browser Netscape? If so, write blank table to fix stretching issues in Netscape		
	if(browser_name == "Netscape") {
		document.writeln("<table width='764' height='600' border='0' cellspacing='0' cellpadding='0'><tr valign='top'>");
		document.writeln("<td width='760' height='600' bgcolor='#FFFFFF'><p>&nbsp;</p><br /><br /><br /><br /><br /></td>");
		document.writeln("<td width='4' background='../images/page_edge.gif'><img src='images/spacer.gif' width='4' height='1' /></td></tr></table>");
	}
	// otherwise, write nothing
	else {
		document.writeln(" ");
	}
}

function fixNSStretchSecondary() {
	var browser_name = navigator.appName;
	// is browser Netscape? If so, write blank table to fix stretching issues in Netscape		
	if(browser_name == "Netscape") {
		document.writeln("<table width='764' height='600' border='0' cellspacing='0' cellpadding='0'><tr valign='top'>");
		document.writeln("<td width='760' height='600' bgcolor='#FFFFFF'><p>&nbsp;</p><br /><br /><br /><br /><br /></td>");
		document.writeln("<td width='4' background='../images/page_edge.gif'><img src='../images/spacer.gif' width='4' height='1' /></td></tr></table>");
	}
	// otherwise, write nothing
	else {
		document.writeln(" ");
	}
}

function fixNSStretchTertiary() {
	var browser_name = navigator.appName;
	// is browser Netscape? If so, write blank table to fix stretching issues in Netscape		
	if(browser_name == "Netscape") {
		document.writeln("<table width='764' height='600' border='0' cellspacing='0' cellpadding='0'><tr valign='top'>");
		document.writeln("<td width='760' height='600' bgcolor='#FFFFFF'><p>&nbsp;</p><br /><br /><br /><br /><br /></td>");
		document.writeln("<td width='4' background='../../images/page_edge.gif'><img src='../../images/spacer.gif' width='4' height='1' /></td></tr></table>");
	}
	// otherwise, write nothing
	else {
		document.writeln(" ");
	}
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() //v3.0
{ 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*********************                                       ********************************/
/********************    function setSectionHeader()        *********************************/
/********************                                       *********************************/
/* This script passes the respective section header indicator to the search engine logic.     */
/* The engine will use the the parm to load the respective section header on the search page. */
/* Author: M.Shmagin;  Date orignally written: May 2003                                       */ 
// This function is used to indicate which header the search engine should display. 
//   1) It will parse the URL that the search value was keyed in from. 
//   2) If the second node indicates that it's a Domino Notes page (ie. value of "ecommerce")
//           then we will search the array list for the respective header value
//      else
//           Should the originating page be a NON-Domino page we simply parse out the 
//           second node (ie AFTER ".com/") & use that as the header value for the search
//           engine to use
//   3) A default header will be set if any value is not found.
//   4) The following is an example to visually help understand the pointers used:
//
//    Using this URL as an EXAMPLE:  http://www.carefirst.com/hipaa/brokers/...
//    Pointers used in the code below:
//    1) "startPtr"  would point to the position of "." in ".com"                                                
//    2) "startPtr1" would point to the position of "/" after ".com"                                                
//    3) "endPtr"    would point to the position of "/" after "hipaa"                                                
//    4) "endPtr2"   would point to the position of "/" after "brokers"                                                
//=========================================================================================
// Side Notes for programmer:
//             The value "custom_worker" is used for debug. As that is the directory on the
//             search engine where we do our testing from. It is tested by calling: 
//             "http://2ks-intersrch-1:8765/customer_worker/query.html"  
//=========================================================================================
// Modification history
// 10/21/05 MS  support for new carefirst.com/partd
// 07/28/05 MS 1) fetch just those docs that are in the hippa SUB-section (eg hipaa/brokers, or hipaa/emplyers, etc.) & attachments
//             2) modified "My Care First" site by replacing "http://www.carefirst.healthinkonline.com" with "http://carefirst.staywellsolutionsonline.com"
// 03/11/05 MS  additional support for State of Maryland site (ie "statemd") called from Domino
// 03/11/05 MS  support for eSales 
// 03/01/05 MS  support for new State of Maryland site (ie "statemd")
// 09/20/04 MS  only search "MyCareFirst.com" for membsvcs or home page searches
// 04/22/04 MS  support for the subdirectory "cf"
// 04/17/04 MS  support for testing on server port "8766" (added 'startPtrDebug3') 
// 03/18/04 MS  support for the portal pdf's (added 'attachments' to the 'qp' variable and added the 'qs' value)
// 01/29/04 MS  support for  "media" site  & support for using 170.22.106.16 in the CareFirst test domain name
// 08/11/03 MS  support for  "ADVANCED" search page
// 08/01/03 MS  support for "marylandmedicare.com"
// 07/28/03 MS  To support carefirst.onlinepresskits.com changed...   
//						document.frmMain.qp.value = "site:carefirst.com";  to
//						document.frmMain.qp.value = "";
// 06/17/03 MS   1) added chk for empty or null string in the search box
//               2) added code to handle debug (ie " /customer_worker" ) mode
//               3) sent back "return" values (ie either true or false
function setSectionHeader() {
	// begin 06/17/03 added chk for empty search string: 
    // Convert all spaces that are at the beginning and end of text and replace with nulls:
	var inputBox = document.frmMain.qt.value.replace(/^\s+/,'').replace(/\s+$/,'');
	// chk for nothing entered after the above conversion takes place:
	if (inputBox=="")
		// 08/11/03 MS  support for  "ADVANCED" search page:
		{
			if (document.frmMain.tx0) //test to see if the we are on the "ADVANCED" search:
				{ 
					// Convert all spaces that are at the beginning and end of text and replace with nulls:
					document.frmMain.tx0.value=document.frmMain.tx0.value.replace(/^\s+/,'').replace(/\s+$/,'');
					document.frmMain.tx1.value=document.frmMain.tx1.value.replace(/^\s+/,'').replace(/\s+$/,'');
					document.frmMain.tx2.value=document.frmMain.tx2.value.replace(/^\s+/,'').replace(/\s+$/,'');
					if ( (document.frmMain.tx0.value=="")
										&&
				   	     (document.frmMain.tx1.value=="") 
					   					&&
				         (document.frmMain.tx2.value=="") )
				    	{
						alert("Please enter text to search.");
						// make sure curser is reset to the first "ADVANCED" input box:
						document.frmMain.tx0.focus();
						return false;
						}
					else
						{
						//continue
						}
				}
			else 
				// we are on the"SIMPLE" search:
				{
				alert("Please enter text to search.");
				// make sure curser is reset to the "SIMPLE" input box:
				document.frmMain.qt.focus();
				return false;
				}
		}		
		
	// end 06/17/03 added chk for empty search string: 
	
	
	// parse the URL & get the portal name:
   	// Make sure the originating page is a ".com" otherwise default the header value. This takes
   	// care of any case, though doubtful of a page which won't have the ".com" in it.
	// begin 06/17/03 added 'startPtrDebug' 
	startPtrDebug=location.href.indexOf("8765");
	// begin 04/17/04 added 'startPtrDebug3' 
	startPtrDebug3=location.href.indexOf("8766");
    // 01/29/04 MS  added 'startPtrDebug2' to allow for using 170.22.106.16:
	startPtrDebug2=location.href.indexOf("6.16");

	// end 06/17/03 added 'startPtrDebug' 
	
   	startPtr = location.href.indexOf(".com");

	// begin 04/17/04 added 'startPtrDebug3' 
	// begin 06/17/03 added 'if' statement 
    // 01/29/04 MS  added 'startPtrDebug2' to allow for using 170.22.106.16:
	if ( (startPtr == -1) && (startPtrDebug==-1) && (startPtrDebug2==-1) && (startPtrDebug3==-1)) // "-1" means that ".com" & "6.16" & "8765" & "8766" not found on URL
	// end 06/17/03 'if' statement 
    	{
    	// ".com" not found on URL so we'll use default:
    	sectionValue = "company";
      	}

	else // ".com" or "6.16" or "8765" or "8766" was found on URL, continue:
       {

		   // begin 06/17/03 'if' statement 
		   if (startPtrDebug != -1){ // we are in the debug mode/server (:8765)
		      startPtr = startPtrDebug;
		   	  }
		   else
			   // 01/29/04 MS  added 'startPtrDebug2' to allow for using 170.22.106.16:
			   if (startPtrDebug2 != -1){ // we are in the debug mode/server (170.22.106.16)
			      startPtr = startPtrDebug2;
			      }
		   	   else
			   	  // 04/17/04 MS  added 'startPtrDebug3' to allow for using server port 8766:
        		  if (startPtrDebug3 != -1){ // we are in the debug mode/server 
			         startPtr= startPtrDebug3;
			      }
		   // end 06/17/03 'if' statement 

   		   // Cursor over to the first node of the originating page:
		   startPtr1 = startPtr + 4;
       	   endPtr    = location.href.indexOf("/",startPtr1+1);

    	   // This is the value of the first node:
       	   var sectionValue = location.href.substring(startPtr1+1,endPtr);

		   // 10/21/05 MS  support for new carefirst.com/partd
		   // 03/01/05 MS  support for new State of Maryland site (ie "statemd")
		   // 04/22/04 MS  support for subdirectory "cf"
		   // 08/01/03 MS  support for "marylandmedicare.com". added the value "pages"  :
		   // 06/17/03 added 'custom_worker'(ie the test environment), "custom" is already there: 
		   // 01/29/04 MS   added "media":
    	   nonDomino_sectionValues="brokers,careers,cf,company,custom,custom_worker,email,employers,eSales,glossary,hipaa,media,membsvcs,options,pages,partd,pharmacy,providers,statemd";

       	  // See if it's a valid NON-Domino section header. If not, see if the node indicates it as a Domino (ie "ecommerce") page:
	       domino_Or_Not_Indicator = nonDomino_sectionValues.indexOf(sectionValue);

           // See if the node indicates a Domino (ie "ecommerce") page:
	       if (domino_Or_Not_Indicator == -1) // "-1" means possible Domino 
		         {  
					 if (sectionValue.toLowerCase() == "ecommerce" || sectionValue.toLowerCase() == "formulary") 
		        		{
					        // create an array of the format"    "nodename/foldername"; 
        					//       for example:  "jobsite/careers" ==> "jobsite" is the node on the url & it's header is found in the "careers" folder
					        domino_sectionValue_list = new Array();
        					domino_sectionValue_list[0]="formulary/pharmacy";
		        			domino_sectionValue_list[1]="provseminarreg/providers";
			        		domino_sectionValue_list[2]="medicalpolicy/providers";

							/*********************************************************************************/
							// BEGIN 03/11/05 MS  additional support for State of Maryland site (ie "statemd") called from Domino:
			        		faqstate_ind= location.href.indexOf("faqstate");
			        		statemd_ind = location.href.indexOf("StateMD");
					 		if (faqstate_ind >= 0 || statemd_ind >= 0 )       // ">=0" means found  
								{
								domino_sectionValue_list[3]="GlossAcrony/statemd";
					       		domino_sectionValue_list[4]="faq/statemd";
								}
							// END 03/11/05 MS  additional support for State of Maryland site (ie "statemd") called from Domino
							/*********************************************************************************/


					        //locate the "." just before the extension of the file (ie .nsf):
		        			endPtr1 = location.href.indexOf(".",endPtr+1);

	        				// assign the value of the ".nsf" file (ie jobsite)
			    		    sectionValueWorker = location.href.substring(endPtr+1,endPtr1);

		    			    // initialize the sectionheader (to "company or null")in case the interrogated value was not found in the array:
							// 06/17/03 made it null instead of "company":
		    			    sectionValue = "";
          
		    				// Now lookup the value in the "domino_sectionValue_list" above & set the mapped value of it:
			        		i=0;
		    			    do {
			        			 domino_sectionValue_found_YN = domino_sectionValue_list[i].indexOf(sectionValueWorker);
						         if (domino_sectionValue_found_YN == -1)  // not found yet
          							{
				        			  // continue
							        }
						         else
          							{
							          // find the "/" after the found array value  (i.e.  jobside/careers):
							          startPtr2=domino_sectionValue_list[i].indexOf("/",domino_sectionValue_found_YN);
				        			  // now pick off the array value up until the next comma (i.e.  careers, ). This
							          // will be the final value for the sectionheader:
   			     			          sectionValue = domino_sectionValue_list[i].substring(startPtr2+1);
								    }
						         i=i+1;
			        		} while ( (i < domino_sectionValue_list.length) && (domino_sectionValue_found_YN == -1) )

			        	} //end 'sectionValue == "ecommerce"...sectionValue == "formulary"' chk

	    	   		else 
    			    	{
				        // node was not in the "nonDomino_sectionValues" above & not a Domino (ie. "ecommerce") page:
				        // so we'll default:
		    		    sectionValue = "company";
        				}
  			     } //end "domino_Or_Not_Indicator" chk
	       else
	    		 {
			     //continue
      			 }
		  
	      // Should the first node be "hipaa" or "pages" then we must go down to the second node as well,
    	  // & then set the sectionValue to the first node combined with the second node.
       	  // For example:  "hipaa/brokers", or  "hipaa/members", or "hipaa/employers", or  "pages/mdedicare", etc.
       	  // For "hipaa", a check is made in the search engine server (ie in queryform0.html) to set the "qp" parm
		  // which will tell it to search the ENTIRE hipaa section:
		  // 08/01/03 MS   support for "marylandmedicare.com" (ie "pages")
		  if (sectionValue == "hipaa" || sectionValue == "pages") 
         		{
				  // Using this as an example:  http://www.carefirst.com/hipaa/brokers/...
				  
				  // Using the above example: "endPtr2" will get the value of the slash after the hipaa subsection (ie "brokers")
			      endPtr2  = location.href.indexOf("/",endPtr+1);
    			  
				  // This will fetch the value of the first & second node combined: (EXAMPLE: hipaa/brokers ) &
				  // it will be used by the search engine to select the respective page header: 
				  // Using the above example: "startPtr1+1" would be pointing to the "h" in "hippa"
		          sectionValue = location.href.substring(startPtr1+1,endPtr2);
      		    }
		  
		  // begin 06/17/03 
    	  else   
   		     // 04/22/04 MS  support for subdirectory "cf"
		  	 // chk to see if we are "sitting" on the search engine server page (i.e. "cf/custom/query.html" or "cf_worker/custom/query.html")
 	  	     //if (sectionValue == "custom_worker" || sectionValue == "custom" ) 
 	  	     if (sectionValue == "cf" || sectionValue == "cf_worker") 
   	         	  {
					  sectionValue = document.frmMain.sectionheader.value;
					  if (sectionValue=="members")
					  	{
						// change the value to the actual directory name for search purposes:
					  	sectionValue="membsvcs";
					  	}	
	              } 
			 else
   	         	  {
				  // continue:
	              } 
	   	  // end 06/17/03

       } // end else for '.com' chk

	   //*******************************************************************************************
	   // This sets the variable "sectionheader" that comes from the search form on all the CMS pages.
	   // Variable "sectionheader" is used by the search engine to:
	   // 1) dynamically set the section header images on top of the search pages. That is, the
	   //    engine will dynamically bring in the correct "include" for the respective header.
	   // 2) help populate the "qp" search engine variable which decides what folders to search... 
	   //   for example, "site:carefirst.com" or "url:http://www.carefirst.com/brokers" etc.
       document.frmMain.sectionheader.value = sectionValue; 
	  
	   //*******************************************************************************************
       // Business rule...on the home page we'll search the entire site but
       // on all other pages we'll just search that section:
	   // begin new  as of nite 6/2/03 added 'email' check
	   // This sets the "qp" search engine variable which decides what folders to search...
	   //   for example, "site:carefirst.com" or "url:http://www.carefirst.com/brokers" etc.

	   document.frmMain.qs.value = ""; //initialize the 'qs' variable

	   if (sectionValue == "company" || sectionValue == "email" || sectionValue == "pharmacy") 

			// 07/25/05 MS  testing new "My Care First" site of http://carefirst.staywellsolutionsonline.com
			{
				// search the cf (ie carefirst.com) & mycf (ie my care first) collections:
				document.frmMain.col.value = "cf mycf";
			}

	   else
		   // 03/11/05 MS  support for eSales 
		   // 01/29/04 MS  support for "media" site (ie only include carefirst.com directly):
		   if (sectionValue == "media" || sectionValue == "eSales" ) 
	         	{
				// set the query to fetch only from 'carefirst.com' urls (i.e. it will not fetch from URL's like 'onlinepresskits.com'):
				document.frmMain.qp.value = "url:http://www.carefirst.com";
				// reset it back to 'company' for the correct header gifs to show:
				sectionValue = "company";  
				document.frmMain.sectionheader.value = sectionValue; 
     			}
		   else
	   			if ( sectionValue.indexOf("hipaa") != -1 ) 	// its a hipaa page. set it to search the hipaa sub-section:
					{
				    // 07/28/05 MS fetch just those docs that are in the hippa SUB-section (eg hipaa/brokers, or hipaa/emplyers, etc.) & attachements:
			   		document.frmMain.qp.value = "url:http://www.carefirst.com/"+sectionValue+" "+"url:http://www.carefirst.com/attachments";
					//note: no need to code the "col" parm because we search that by default as defined on the Verity console for that "cf" collection
				   	}
				else
					// 08/01/03 MS   support for "marylandmedicare.com"
		   			if ( sectionValue.indexOf("mdmedicare") != -1 )	// its a mdmedicare page. set it to search entire mdmedicare section:
						{
						document.frmMain.qp.value = "url:http://www.marylandmedicare.com/pages/mdmedicare";
						//note: no need to code the "col" parm because we search that by default as defined on 
						//      the Verity console for that "cf" collection
						}		
					else
						// 09/20/04 MS  only search "MyCareFirst.com" for membsvcs or home page searches:
			    	 	if (sectionValue=="membsvcs") // its a member services page so search the entire SECTION plus ATTACHMENTS plus the MyCarefirst site:
			     			{ 
                            // here we are only returning pages from this sectionValue's folder, attachments folder, & my carefirst site:  
					   		//document.frmMain.qp.value = "url:http://www.carefirst.com/"+sectionValue+" "+"url:http://www.carefirst.com/attachments"+" "+"url:http://www.carefirst.healthinkonline.com";
					   		document.frmMain.qp.value = "url:http://www.carefirst.com/"+sectionValue+" "+"url:http://www.carefirst.com/attachments"+" "+"url:http://carefirst.staywellsolutionsonline.com";
							// search the cf (ie carefirst.com) & mycf (ie my care first) collections:
   							document.frmMain.col.value = "cf mycf";
																																					
							}
						else
							// 09/20/04 MS  only search "MyCareFirst.com" for membsvcs or the main home page searches:
				   			if (sectionValue=="") // its the home page so search entire site plus the MyCarefirst site:
				     			{ 
						   		//document.frmMain.qp.value = "url:http://www.carefirst.com"+" "+"url:http://www.carefirst.healthinkonline.com";
						   		document.frmMain.qp.value = "url:http://www.carefirst.com/"+sectionValue+" "+"url:http://www.carefirst.com/attachments"+" "+"url:http://carefirst.staywellsolutionsonline.com";
								// search the cf (ie carefirst.com) & mycf (ie my care first) collections:
   								document.frmMain.col.value = "cf mycf";
								}
							else
								// 03/01/05 MS  support for new State of Maryland site: 
					   			if (sectionValue=="statemd") // its a State of MD page so search "statemd" (ATTACHMENTS are housed inside the site) plus the MyCarefirst site:
					     			{ 
									// We are doing it this way to allow Verity's Report to show that the search came from the state of md portal! 
									// (That is, the call to the engine, from the state's page, is also inserting the 'col' parm) 
					   				//document.frmMain.qp.value = "url:http://www.carefirst.com/"+sectionValue+" "+"url:http://www.carefirst.healthinkonline.com";
					   				document.frmMain.qp.value = "url:http://www.carefirst.com/"+sectionValue+" "+"url:http://carefirst.staywellsolutionsonline.com";
									//note: The "col" parm with the value="statemd mycf" is already in the State's html pages so no need to do it here.
									}
								else
									// 10/21/05 MS  support for new carefirst.com/partd
						   			if (sectionValue=="partd") // its a "partd" page so search "partd" site ONLY:
						     			{ 
										// We are doing it this way to allow Verity's Report to show that the search came from the "partd" portal! 
										// (That is, the call to the engine, from the "partd"'s page, is also inserting the 'col' parm) 
						   				document.frmMain.qp.value = "url:http://www.carefirst.com/"+sectionValue;
										//note: The "col" parm with the value="partd" is already in the "partd"'s html pages so no need to do it here.
										}
									else
										{ 
										// 03/18/04 MS  support for the portal pdf's (added 'attachments' to the 'qp' variable and added the 'qs' value):
						   				document.frmMain.qp.value = "url:http://www.carefirst.com/"+sectionValue+" "+ "url:http://www.carefirst.com/attachments";
										document.frmMain.qs.value = "| keywords:"+ sectionValue;
										}
		// begin 06/17/03:
		return true;
		// end 06/17/03:

} //end function setSectionHeader


//-->
