
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 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

// 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 = "";
		$(row).className = "question_row_on";
		
	} else {
		$(box).style.display = "none";
		$(row).className = "question_row";
	}
}




// Personal Info pages Under65 / Remove and Add Child Rows
	
	function addChildRow()
	{ 		
		if(childCounter < maxChildren)
		{
		 childCounter = childCounter+1;
		 var child    = "child" + childCounter
		
		 document.getElementById(child).style.display = "";
		}
		
		if(childCounter == maxChildren) {
			document.getElementById("childbutton").style.display = "none";
		}
	}
	function removeChildRow(child)
	{
	 document.getElementById(child).style.display = "none";
	 childCounter = childCounter-1;
	 document.getElementById("addchildbutton").style.display = ""; 
	
	}
	
	function removeSpouse() {
		document.getElementById(e).value = "";
		
		 for (var i = 0; i < document.form1.radio1.length; i++) {
          document.form1.radio1[i].checked = false;
    	 }
		
		
		
	}



function checkMoreInfoFindPlan(val) {
		if(val=="1") {
			document.getElementById('applicant').style.display = "";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('family_coverage').style.display = "none";
			document.getElementById('child_solo').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 = "";
			//document.getElementById('tobaccoHeader').style.display = "";
			
			
			}

		else if (val=="2"){
			document.getElementById('applicant').style.display = "";
			document.getElementById('child_solo').style.display = "none";
			document.getElementById('addchildbutton').style.display = "";
			document.getElementById('family_coverage').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";
			//document.getElementById('tobaccoHeader').style.display = "";
			
			}
		else {
			document.getElementById('applicant').style.display = "none";
			document.getElementById('family_coverage').style.display = "none";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('child_solo').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 = "";
			if (document.getElementById('tobaccoChild1Soloradio').style.display == "none")
			{
				document.getElementById('tobaccoHeader').style.display = "none";
			}
			
		}	
			
	}
	
function checkTobaccoDisplay (monId, dayId, yearId, curId)
{
	var monVal = document.getElementById(monId).value;
	var dayVal = document.getElementById(dayId).value;
	var yearVal = document.getElementById(yearId).value;

	if (isTobaccoAge(monVal, dayVal, yearVal))
	{
		document.getElementById('tobaccoHeader').style.display = "";
		document.getElementById(curId).style.display = "none";
		document.getElementById(curId + "radio").style.display = "";
	}
	else
	{
		if (curId == "tobaccoChild1Solo")
		{
			document.getElementById('tobaccoHeader').style.display = "none";
		}
		document.getElementById(curId).style.display = "";
		document.getElementById(curId + "radio").style.display = "none";
	}
}
	
function isTobaccoAge (monVal, dayVal, yearVal)
{
	if (monVal == null || dayVal == null || yearVal == null) return false;
	if (monVal.length == 0 || dayVal.length == 0 || yearVal.length == 0) return false;

	var tobAge = 15;
	var curDate = new Date();
	var month = curDate.getMonth() + 1;
	var day	= curDate.getDate();
	var year = curDate.getFullYear();
	
	if (year - yearVal > tobAge) return true;
	else if (year - yearVal == tobAge)
	{
		if (month - monVal > 0) return true;
		else if (month - monVal == 0)
		{
			if (day >= dayVal) return true;
		}
	}
	
	return false;
}
	
function checkMoreInfo(val) {
		
		if(val=="1") {
			document.getElementById('applicant').style.display = "";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('family_coverage').style.display = "none";
			document.getElementById('child_solo').style.display = "none";
			//document.getElementById('tobaccoHeader').style.display = "";
			
			}

		else if (val=="2"){
			document.getElementById('applicant').style.display = "";
			document.getElementById('child_solo').style.display = "none";
			document.getElementById('addchildbutton').style.display = "";
			document.getElementById('family_coverage').style.display = "";
			//document.getElementById('tobaccoHeader').style.display = "";
			
			}
		else {
			document.getElementById('applicant').style.display = "none";
			document.getElementById('family_coverage').style.display = "none";
			document.getElementById('addchildbutton').style.display = "none";
			document.getElementById('child_solo').style.display = "";
			document.getElementById('tobaccoHeader').style.display = "none";
			
			
			
			
			}	
			
	}
	
// 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 = "";
	}
}
