
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}





<!-- Begin
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}
//  End -->





// Alert and confirmation messages

function checkRemoveTest() {
	confirm ("Are you sure you wish to remove this test?");
}


function toggle2(e) {
//alert (e);
  	
	if ($(e).style.display == "none") {
		Effect.Appear(e);
	} else {
		Effect.Fade(e);
	}
}
	
function toggle3(e) {
//alert (e);
  	
	if ($(e).style.display == "none") {
		$(e).style.display = "";
	} else {
		$(e).style.display = "none";
	}
}

function collapse(e)  {
//alert (e);
  	
	if ($(e).style.display == "none") {
		$(e).style.display = "none";
	} else {
		$(e).style.display = "none";
	}
}

function expand(e)  {
//alert (e);
  	
	if ($(e).style.display == "none") {
		$(e).style.display = "";
	} else {
		$(e).style.display = "";
	}
}



function expandAll() {
			expand('group1');
			expand('group2');
			expand('group3');
			expand('group4');
			expand('group5');
			expand('group6');
			expand('group7');
			expand('group8');
			expand('group9');
			expand('group10');
			expand('group11');
		}
		
		function collapseAll() {
			collapse('group1');
			collapse('group2');
			collapse('group3');
			collapse('group4');
			collapse('group5');
			collapse('group6');
			collapse('group7');
			collapse('group8');
			collapse('group9');
			collapse('group10');
			collapse('group11');
		}


function showHelp(e) {
	
	 setTimeout("toggle2('help')",3000);
	 
	 
	 
}

function gotoUnder65() {
	window.location = "browse.html";
}
					
function gotoOver65() {
	window.location = "medicare_browse.html";
}


function getQuote() {
		var appYear = document.quote.app_date_year.value;
		
		//alert (appYear);
		
		if  (appYear == "" ) {
			//alert ("Please enter a date of birth")
			window.location = 'view_plan_comparison.html';
		} else if (appYear <= 1942  ) {
			Effect.Appear('message_dateold');
			document.getElementById('gender').style.visibility = "hidden";
			document.getElementById('county').style.visibility = "hidden";
		} else {
			window.location = 'view_plan_comparison.html';
		}
		
		
	}
	
	function cancelMessage() {
		document.getElementById('gender').style.visibility = "visible";
		document.getElementById('county').style.visibility = "visible";
		Effect.Fade('message_dateold');
	}
			




// TRANSITION AND QUESTION TOGGLES

function controlSection(control) {
	var row = control + "_row";
	var box = control + "_box";
		
	if ($(box).style.display == "none") {
		$(row).className = "expand_image";
		$(box).style.display = "";
	} else { 
		if ($(box).style.display == "") {
		$(row).className = "collapse_image";
		$(box).style.display = "none";
		}
	}
}



// For Yes - No questions that toggle detail DIV
// Pass value and name ID with _row and _box
function checkRadio(value,control) {
	var row = control + "_row";
	var box = control + "_box";
		
	if(value=="yes") { 
		
		if ($(box).style.display == "none") {
			$(row).className = "question_row_on";
			Effect.toggle(box,'blind', { duration: .5 });
			}
				
		}
		else { 
		if ($(box).style.display == "") {
			$(row).className = "question_row_off";
			Effect.toggle(box,'blind', { duration: .5 });
			}
	}
	
}	


// For Yes - No questions that toggle detail DIV
// Pass value and name ID with just control, no row or box
function checkRadioSimple(value,control) {
	var box = control + "_box";
		
	if(value=="yes") { 
		
		if ($(box).style.display == "none") {
			Effect.toggle(box,'blind', { duration: .5 });
			}
				
		}
		else { 
		if ($(box).style.display == "") {
			
			Effect.toggle(box,'blind', { duration: .5 });
			}
	}
	
}	

// For Yes - No questions that SWITCH OUT detail DIVs
// Pass value and name ID with just control, no row or box
function checkRadioSwitch(value,controlA,controlB) {
	var boxA = controlA + "_box";
	var boxB = controlB + "_box";
		
		
	///alert (boxA);
	//alert (boxB);	
	if(value=="yes") { 
		
			//alert ("Show Box A");
			Effect.Appear(boxA,'blind', { duration: .2 });
			Effect.Fade(boxB,'blind', { duration: .1 });
			}
				
		
		else { 
			//alert ("Show Box B");
			Effect.Fade(boxA,'blind', { duration: .1 });
			Effect.Appear(boxB,'blind', { duration: .2 });
			
			
	}
	
}	

// For Checkbox questions that open DIV detail
// Pass value and name ID with just control

function checkShowDetail(item,control) {
	var box = control + "_box";
	var row = control + "_row";

	if (item.checked == true) {
		$(box).style.display = "block";
		$(row).className = "question_row_on";
		
	} else {
		$(box).style.display = "none";
		$(row).className = "question_row";
	}
}

// For Checkbox questions that open DIV detail
// Pass value and name ID with just control
function checkShowDetailSimple(item,control) {
	var box = control + "_box";
	
	if (item.checked == true) {
		$(box).style.display = "";
	} else {
		$(box).style.display = "none";
	}
}



function checkMoreInfo(val) {
		if(val=="1") {
			document.getElementById('applicant').style.display = "";
			document.getElementById('spouse').style.display = "none";
			document.getElementById('dpartner').style.display = "none";
			document.getElementById('child1').style.display = "none";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('removechildbutton').style.display = "";
			document.getElementById('tobacco').style.display = "";
			document.getElementById('life_checkoption').style.display = "";
					
			//Tracks
			
			
			document.getElementById('deduct_family').style.display = "none";
			document.getElementById('deduct_ind').style.display = "";
			document.getElementById('opm_family').style.display = "none";
			document.getElementById('opm_ind').style.display = "";
			
			
			}

		else if (val=="2"){
			document.getElementById('applicant').style.display = "";
			document.getElementById('spouse').style.display = "";
			document.getElementById('dpartner').style.display = "";
			document.getElementById('child1').style.display = "";
			document.getElementById('addchildbutton').style.display = "";
			document.getElementById('removechildbutton').style.display = "";
			document.getElementById('tobacco').style.display = "";
			document.getElementById('life_checkoption').style.display = "none";
			
			//Tracks
			document.getElementById('deduct_family').style.display = "";
			document.getElementById('deduct_ind').style.display = "none";
			document.getElementById('opm_family').style.display = "";
			document.getElementById('opm_ind').style.display = "none";
			
			}
		else {
			document.getElementById('applicant').style.display = "none";
			document.getElementById('spouse').style.display = "none";
			document.getElementById('dpartner').style.display = "";
			document.getElementById('child1').style.display = "";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('removechildbutton').style.display = "none";
			document.getElementById('tobacco').style.display = "none";
			document.getElementById('life_checkoption').style.display = "none";
			
			//Tracks
			document.getElementById('deduct_family').style.display = "none";
			document.getElementById('deduct_ind').style.display = "";
			document.getElementById('opm_family').style.display = "none";
			document.getElementById('opm_ind').style.display = "";
			
			
			}	
			
	}



function checkMoreInfoNew(val) {
		if(val=="1") {
			document.getElementById('applicant').style.display = "";
			document.getElementById('spouse').style.display = "none";
			document.getElementById('child1').style.display = "none";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('removechildbutton').style.display = "";
			document.getElementById('tobacco').style.display = "";
			
			//Tracks
			document.getElementById('deduct_family').style.display = "none";
			document.getElementById('deduct_ind').style.display = "";
			document.getElementById('opm_family').style.display = "none";
			document.getElementById('opm_ind').style.display = "";
			
			
			}

		else if (val=="2"){
			document.getElementById('applicant').style.display = "";
			document.getElementById('spouse').style.display = "";
			document.getElementById('child1').style.display = "";
			document.getElementById('addchildbutton').style.display = "";
			document.getElementById('removechildbutton').style.display = "";
			document.getElementById('tobacco').style.display = "";
			
			//Tracks
			document.getElementById('deduct_family').style.display = "";
			document.getElementById('deduct_ind').style.display = "none";
			document.getElementById('opm_family').style.display = "";
			document.getElementById('opm_ind').style.display = "none";
			
			}
		else {
			document.getElementById('applicant').style.display = "none";
			document.getElementById('spouse').style.display = "none";
			document.getElementById('child1').style.display = "";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('removechildbutton').style.display = "none";
			document.getElementById('tobacco').style.display = "none";
			
			//Tracks
			document.getElementById('deduct_family').style.display = "none";
			document.getElementById('deduct_ind').style.display = "";
			document.getElementById('opm_family').style.display = "none";
			document.getElementById('opm_ind').style.display = "";
			
			
			}	
			
	}
	
	
function checkMoreInfoNoTrack(val) {
		if(val=="1") {
			document.getElementById('applicant').style.display = "";
			document.getElementById('spouse').style.display = "none";
			document.getElementById('child1').style.display = "none";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('removechildbutton').style.display = "";
			document.getElementById('tobacco').style.display = "";
			//document.getElementById('life_checkoption').style.display = "";
			}

		else if (val=="2"){
			document.getElementById('applicant').style.display = "";
			document.getElementById('spouse').style.display = "";
			document.getElementById('child1').style.display = "";
			document.getElementById('addchildbutton').style.display = "";
			document.getElementById('removechildbutton').style.display = "";
			document.getElementById('tobacco').style.display = "";
			//document.getElementById('life_checkoption').style.display = "none";
			
			}
		else {
			document.getElementById('applicant').style.display = "none";
			document.getElementById('spouse').style.display = "none";
			document.getElementById('child1').style.display = "";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('removechildbutton').style.display = "none";
			document.getElementById('tobacco').style.display = "none";
			//document.getElementById('life_checkoption').style.display = "";
			
			
			
			}	
			
	}
	
	
// Calculate height of browser window.
function calcHeight() {
	var windowHeight = 0;
		var windowWidth = 0;
		if (typeof(window.innerHeight) == 'number') {
			windowHeight = window.innerHeight;
			windowWidth = window.innerWidth;
		}
		else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
				windowWidth = document.documentElement.clientWidth;
			}
			else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
					windowWidth = document.body.clientWidth;
				}
			}
		}
}	
	
	
function toggleCenterPopup(element) {
	if ($(element).style.display == ""){
		$(element).style.display = "none";
	}
	else {
		var windowHeight = 0;
		var windowWidth = 0;
		if (typeof(window.innerHeight) == 'number') {
			windowHeight = window.innerHeight;
			windowWidth = window.innerWidth;
		}
		else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
				windowWidth = document.documentElement.clientWidth;
			}
			else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
					windowWidth = document.body.clientWidth;
				}
			}
		}
		// Determine the offset.
		var centerTop = windowHeight / 2;
		var divTop = centerTop - 50;
		var centerLeft = windowWidth / 2;
		var divLeft = centerLeft - 250;
		// Toggle Div at that point.
		$(element).style.top = divTop+"px";
		$(element).style.left = divLeft+"px";
		$(element).style.display = "";
	}
}


function Set_Cookie( name, value, expires, path, domain, secure ) 
{
//alert ("setting cookie");
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
http://techpatterns.com/downloads/javascript_cookies.php
Set command: Set_Cookie( 'mycookie', 'visited 9 times', 30, '/', '', '' );

if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}


function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			
			return cookie_value;
			
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
		
	}
	if ( !b_cookie_found )
	{
		return null;
	}
	
}	

function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


function highlight(e) {
			if (document.getElementById(e).className != "visit_current") {
				//alert ("yes");
				document.getElementById(e).className = "visit_highlight";
			} else {
				
			}
			
			
		}
		
		function highlightOff(e) {
		
			if (document.getElementById(e).className == "visit_current") {
				//alert ("off yes");
			} else {
				document.getElementById(e).className = "visit_off";
			}
		
			
		}
		
	function SelectRow(strIndex) {
	  	//alert (strCurrentRow);
		var Row =  strIndex;
		//clear previous Row
		new Effect.DropOut("vig_" + strCurrentRow);
        if ( strCurrentRow != 0 )
        {
          for (var i = 1; i < intRowCount; i++) {
		    document.getElementById('nav' + '_' + i).className = 'visit_off';
          }
        }
		
		//set Current Row:
		strCurrentRow = Row;
		document.getElementById('nav' + '_' + Row).className = 'visit_current';
     	//alert (strCurrentRow);
		var newVig = "vig_" + strCurrentRow;
		//alert (newVig);
	 	timeoutID = window.setTimeout(showSelected,1000);
	 	
		//window.setTimeout('Effect.Appear("strCurrentRow", {duration:.3})',25);
	 
	  }
	  
	  function showSelected() {
	  	new Effect.Appear("vig_" + strCurrentRow);
	  }



