
function populate(theType)
{

	var selectedValue, box2;
	if (theType == 'reg')
	{
		selectedValue = document.all.birthMonthStr.options[document.all.birthMonthStr.selectedIndex].value;
		box2 = document.all.birthDayStr;
	}
	else
	{
		selectedValue = document.all.psnMonthStr.options[document.all.psnMonthStr.selectedIndex].value;
		box2 = document.all.psnDayStr;
	}			

	box2.options.length= null;
	var len = box2.options.length;

	if ( selectedValue == "02" )
	{
		for(i=1;i<30;i++)
		{
			box2.options[0] = new Option("Day","00");
			box2.options[i] = new Option(i,i);
			// document.all.birthDayStr.options[0].selected = true
		}
	}
	else if( selectedValue == "04" || selectedValue == "06" || selectedValue == "09" || selectedValue == "11" )
	{
		for(i=1;i<31;i++)
		{
			box2.options[0] = new Option("Day","00");
			box2.options[i] = new Option(i,i);
			// document.all.birthDayStr.options[0].selected = true
		}
	}
	else
	{
		for(i=1;i<32;i++)
		{
			box2.options[0] = new Option("Day","00");
			box2.options[i] = new Option(i,i);
			// document.all.birthDayStr.options[0].selected = true
		}
	}
	if (theType == 'reg')
		document.all.birthDayStr.options[0].selected = true;
	else
		document.all.psnDayStr.options[0].selected = true;
}

function MonthFirst(theType)
{

	var selectedValue;
	if (theType == 'reg')
		selectedValue = document.all.birthMonthStr.options[document.all.birthMonthStr.selectedIndex].value;
	else
		selectedValue = document.all.psnMonthStr.options[document.all.psnMonthStr.selectedIndex].value;
		
	if( selectedValue == "00" || selectedValue == null )
	{
		alert("Please select a month first");
		if (theType == 'reg')
			document.all.birthMonthStr.focus();	
		else
			document.all.psnMonthStr.focus();	
	}
}

function clientAlert(lo)
{
var answer = confirm("You are now leaving A Healthy Me. You will be redirected to our corporate site, www.ahealthyme.com, which will open in a separate browser window. You will not be able to use the back arrow to return to A Healthy Me, but the site will remain open in a separate window. Click \"OK\"  to proceed.")
if (answer )
{
	window.open(lo , "" ,'toolbar=yes,menubar=yes,resizeable=yes,status=yes,location=yes');
}
}

function ex(form){
window.location.href=form.s.options[form.s.selectedIndex].value;
}

var shortName ='<%=shortName%>'

function doIt()
{
	var ch ="Test"; 

	if(  shortName == "womens")
	{
		ch = "switch1" ;
	}

	else if(  shortName == "mens")
	{
		ch = "switch2" ;
	}

	else if(  shortName == "senior")
	{
		ch = "switch3" ;
	}
	else if(  shortName == "childrens")
	{
		ch = "switch4" ;
	}

	else if(  shortName == "pregnancycenter")
	{
		ch = "switch5" ;
	}

	else if(  shortName == "fitness")
	{
		ch = "switch6" ;
	}
	else if(  shortName == "alternative")
	{
		ch = "switch7" ;
	}

	else if(  shortName == "lifestyle")
	{
		ch = "switch8" ;
	}
	else if(  shortName == "work")
	{
		ch = "switch9" ;
	}

	else if(  shortName == "illsandcond")
	{
		ch = "switch10" ;
	}

	else if(  shortName == "conditionCenter")
	{
		ch = "switch11" ;
	}
	
		else if(  shortName == "medlibrary")
	{
		ch = "switch12" ;
	}
	else if(  shortName == "cooltools")
	{
		ch = "switch13" ;
	}

	else if(  shortName == "dentalcenter")
	{
		ch = "switch15" ;
	}
	else if(  shortName == "multimedialib")
	{
		ch = "switch19" ;
	}
	
	/*else if(  shortName == "home")
	{
		ch = "switch14" ;
	}*/


	if(ch != "Test")
	{
		HighLight(ch);
	}
}
  function display(stuff) { window.status = stuff; }
if (document.images){
  switch1on =new Image(130,21);  switch1on.src ='/sites/cdma/nav_womens_over.gif';
  switch1off=new Image(130,21);  switch1off.src='/sites/cdma/nav_womens.gif';
  switch2on =new Image(130,21);  switch2on.src ='/sites/cdma/nav_mens_over.gif';
  switch2off=new Image(130,21);  switch2off.src='/sites/cdma/nav_mens.gif';
  switch3on =new Image(130,21);  switch3on.src ='/sites/cdma/nav_senior_over.gif';
  switch3off=new Image(130,21);  switch3off.src='/sites/cdma/nav_senior.gif';
  switch4on =new Image(130,21);  switch4on.src ='/sites/cdma/nav_child_over.gif';
  switch4off=new Image(130,21);  switch4off.src='/sites/cdma/nav_child.gif';
  switch5on =new Image(130,21);  switch5on.src ='/sites/cdma/nav_preg_over.gif';
  switch5off=new Image(130,21);  switch5off.src='/sites/cdma/nav_preg.gif';
  switch6on =new Image(130,21);  switch6on.src ='/sites/cdma/nav_fitness_over.gif';
  switch6off=new Image(130,21);  switch6off.src='/sites/cdma/nav_fitness.gif';
  switch7on =new Image(130,21);  switch7on.src ='/sites/cdma/nav_altern_over.gif';
  switch7off=new Image(130,21);  switch7off.src='/sites/cdma/nav_altern.gif';
  switch8on =new Image(130,21);  switch8on.src ='/sites/cdma/nav_lifestyle_over.gif';
  switch8off=new Image(130,21);  switch8off.src='/sites/cdma/nav_lifestyle.gif';
  switch9on =new Image(130,21);  switch9on.src ='/sites/cdma/nav_work_over.gif';
  switch9off=new Image(130,21);  switch9off.src='/sites/cdma/nav_work.gif';
  switch10on =new Image(130,21);  switch10on.src ='/sites/cdma/nav_ills_over.gif';
  switch10off=new Image(130,21);  switch10off.src='/sites/cdma/nav_ills.gif';
  switch11on =new Image(130,21);  switch11on.src ='/sites/cdma/nav_selfcare_over.gif';
  switch11off=new Image(130,21);  switch11off.src='/sites/cdma/nav_selfcare.gif';
  switch12on =new Image(130,21);  switch12on.src ='/sites/cdma/nav_medlib_over.gif';
  switch12off=new Image(130,21);  switch12off.src='/sites/cdma/nav_medlib.gif';
  switch13on =new Image(130,21);  switch13on.src ='/sites/cdma/nav_cooltools_over.gif';
  switch13off=new Image(130,21);  switch13off.src='/sites/cdma/nav_cooltools.gif';
  switch14on =new Image(130,22);  switch14on.src ='/sites/cdma/nav_top_lower_over.gif';
  switch14off=new Image(130,22);  switch14off.src='/sites/cdma/nav_top_lower.gif';
  switch15on =new Image(130,22);  switch15on.src ='/sites/cdma/nav_dental_over.gif';
  switch15off=new Image(130,22);  switch15off.src='/sites/cdma/nav_dental.gif';
  switch16on =new Image(130,22);  switch16on.src ='/sites/cdma/nav_espanol_over.gif';
  switch16off=new Image(130,22);  switch16off.src='/sites/cdma/nav_espanol.gif';
  switch19on =new Image(130,22);  switch19on.src ='/sites/cdma/nav_multimedialib_over.gif';
  switch19off=new Image(130,22);  switch19off.src='/sites/cdma/nav_multimedialib.gif';
  
}

  function HighLight(musswitch) {
        if (document.images) {
                switchnavn=eval(musswitch + "on");
                document [musswitch].src=switchnavn.src;
                }
        }

/*
function UndoHighLight(musswitch, topic)
{
        
     if (document.images)
     {
        if( topic != shortName ) 
        {
           switchnavn=eval(musswitch + "off");
           document [musswitch].src=switchnavn.src;
        }

     }
  }
  */
  
  
  function UndoHighLight(musswitch, topic)
{
        
     if (document.images)
     {
        if( topic != shortName ) 
        {
           switchnavn=eval(musswitch + "off");
           document [musswitch].src=switchnavn.src;
        }

     }
  }

var mydomain=document.location.hostname;
var suitesmartDomain="http://survey.suitesmart.com";
var consumerhiDomain="http://audio.consumerhi.com";

function leavingSitePopUp() {
	return confirm("You are about to leave the AHealthyMe web site. By clicking the \"OK\" button below, you will be connected to this new site. Please be sure to read the new site's Privacy Policy. \n\n To return to AHealthyMe, please click the \"cancel\" button.")

}

function clickHandlerNetscape6(e) {  
	//alert("In clickHandlerNetscape6")
	if (e.target.parentNode != "" && 
	e.target.parentNode.hostname.indexOf(mydomain)==-1 && 
	e.target.parentNode.hostname.indexOf(suitesmartDomain)==-1 &&
	e.target.parentNode.hostname.indexOf(consumerhiDomain)==-1 )
  	{
		return leavingSitePopUp()
	}
	else
		return true;
}

function clickHandlerNetscape(e) {  
	//alert("In clickHandlerNetscape")
	if (e.target != "" && 
		e.target.hostname.indexOf(mydomain)==-1 && 
		e.target.href.indexOf("JavaScript:")==-1 &&
		e.target.hostname.indexOf(consumerhiDomain)==-1 )
  	{
		return leavingSitePopUp()
	}
	else
		return true;
}

function clickHandlerIE() {  
	//alert("In clickHandlerIE")
	var elementTag = window.event.srcElement.tagName;
	var hrefUrl = "";
	if (elementTag.indexOf("IMG")>=0)
		hrefUrl = window.event.srcElement.parentElement.href;
	else if (elementTag.indexOf("B")>=0)
	{
		hrefUrl = window.event.srcElement.parentElement.href;
	}
	else if (elementTag.indexOf("EM")>=0)
	{
		hrefUrl = window.event.srcElement.parentElement.href;
	}
	else
		hrefUrl = window.event.srcElement.href;
	
	if (hrefUrl != null && 
		hrefUrl.indexOf(mydomain)==-1 && 
		hrefUrl.indexOf(suitesmartDomain)==-1 &&
		hrefUrl.indexOf("javascript:")==-1 &&
                hrefUrl.indexOf(consumerhiDomain)==-1 && hrefUrl.length > 1)
  	{
		return leavingSitePopUp()
	}
	else
		return true;
}

if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
	if (window.Event) document.captureEvents(Event.ONCLICK);
	document.onclick = clickHandlerIE;
}

if (navigator.appName == "Netscape") 
{
	//alert("Netscape version " + parseInt(navigator.appVersion))
	if (parseInt(navigator.appVersion) >= 6)
	{
		window.addEventListener(click, clickHandlerNetscape6, true)
	}
	else if (parseInt(navigator.appVersion) == 5)
	{
		window.captureEvents(Event.CLICK);
		window.onclick = clickHandlerNetscape6;
	}
	else 
	{
		window.captureEvents(Event.CLICK);
		window.onclick = clickHandlerNetscape;
	}
}

function hwsopen()

{
hwsopen =  window.open("http://www.urac.org/consumers/","_blank","width=800,height=800,resizable=yes,scrollbars=yes");
}

  // this function is needed to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   

 function stripe(id) {

    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = false;
  
    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#fff";
    var oddColor = arguments[2] ? arguments[2] : "#eee";
  
    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    if (! table) { return; }
    
    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s 
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {
    
     // find all the &lt;tr&gt; elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      
      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {

        // avoid rows that have a class attribute
        // or backgroundColor style
        if (! hasClass(trs[i]) &&
            ! trs[i].style.backgroundColor) {
 		  
          // get all the cells in this row...
          var tds = trs[i].getElementsByTagName("td");
        
          // and iterate through them...
          for (var j = 0; j < tds.length; j++) {
        
            var mytd = tds[j];

            // avoid cells that have a class attribute
            // or backgroundColor style
            if (! hasClass(mytd) &&
                ! mytd.style.backgroundColor) {
        
              mytd.style.backgroundColor =
                even ? evenColor : oddColor;
            
            }
          }
        }
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
  }