function getCookieValue(cookieName) {
  var exp = new RegExp(escape(cookieName) + "=([^;]+)");
  if (exp.test(document.cookie + ";")) {
    exp.exec(document.cookie + ";");
    return unescape(RegExp.$1);
  }
  else return false;
}

function writeCookie(cookieName,_val) {
	var expDate = new Date();
	expDate.setTime(expDate.getTime() + ((365*10) * 24 * 3600 * 1000)); //roughly 10 years
	
	document.cookie = escape(cookieName) + "=" + escape(_val) + "; expires=" + expDate.toGMTString() + "; path=/";
}

// this deletes the cookie when called
function deleteCookie( name, path, domain ) {
	if ( getCookieValue( name ) ) document.cookie = name + "=" +
	( ( path ) ? ";path=" + path : "") +
	( ( domain ) ? ";domain=" + domain : "" ) +
	";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function updateState(_stateName) {
	var sn = (_stateName.indexOf("+") != -1) ? _stateName.replace("+"," ") : _stateName;
	if (document.getElementById("statename")) {
		var stateName = document.getElementById("statename");
		
		if (stateName.childNodes.length > 0) {
			for (var i=stateName.childNodes.length-1; i>=0; i--) {
				stateName.removeChild(stateName.childNodes[i]);
			}
		}
		
		var stateNameTextNode = document.createTextNode(sn);
		stateName.appendChild(stateNameTextNode);
	}
}

var stateAbbrev_array = new Array("AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD",
									"MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","PR","RI","SC",
									"SD","TN","TX","UT","VT","VA","VI","WA","WV","WI","WY");
var stateNames_array = new Array("Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","D.C.","Florida","Georgia",
									"Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts",
									"Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico",
									"New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Puerto Rico","Rhode Island",
									"South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Virgin Islands","Washington",
									"West Virginia","Wisconsin","Wyoming");

function getState(_stateNameOrAbbrev) {
	var stateVal = "";
	var stateNameOrAbbrev = _stateNameOrAbbrev;
	
	if (stateNameOrAbbrev.toString().length === 2) { //state abbrev
		for (var i=0; i<stateAbbrev_array.length; i++) {
			if (stateNameOrAbbrev.toUpperCase() === stateAbbrev_array[i].toUpperCase()) {
				stateVal = stateNames_array[i];
				i = stateAbbrev_array.length;
			}
		}
	} else { //state name
		for (var i=0; i<stateNames_array.length; i++) {
			if (stateNameOrAbbrev.toUpperCase() === stateNames_array[i].toUpperCase()) {
				stateVal = stateAbbrev_array[i];
				i = stateNames_array.length;
			}
		}
	}
	
	return stateVal;
}

function getParameterByName(name, source)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec(source);
  if( results == null )
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}


/*function getCountdown() {
	document.write('<div id="countdown" class="displayNone">Due to inactivity, your session will expire in <strong id="seconds">60</'+'strong> seconds.<div style="margin-top:6px;"><a href="javascript:continueApp()">Continue Application &raquo;</'+'a></'+'div></'+'div>');
}*/
function updateField(_thisID, _parentClass, _msgID, _msgDisplay) {
	//start session clock
	if (location.href.indexOf("/application/") != -1) {
		startSession();
	}
	
	if (_thisID.indexOf("coverageAmount") != -1) {
		//alert(document.getElementById(_thisID).parentNode.parentNode.parentNode.parentNode.tagName);
		document.getElementById(_thisID).parentNode.parentNode.parentNode.parentNode.parentNode.className = _parentClass;
	} else if (_thisID.indexOf("reviewLink") != -1) {
		document.getElementById(_thisID).parentNode.parentNode.className = _parentClass;
	} else if (_thisID.indexOf("replaceReviewLink") != -1) {
		document.getElementById(_thisID).parentNode.parentNode.className = _parentClass;
	} else {
		document.getElementById(_thisID).parentNode.className = _parentClass;
	}
	if(_msgID !== '') {
		document.getElementById(_msgID).className = _msgDisplay;
	}
}

// Start Form Validation
function validateFullDate(strValue){
	var objRegExp = /(^(((0[1-9]){1})|((1[0-2]){1}))\/(((0[1-9]){1})|(([1-2][0-9]){1})|((3[0-1]){1}))\/(19|20){1}[0-9]{2})$/;
	return objRegExp.test(strValue);
}
function validateAlpha(strValue) {
	var objRegExp  = /(^[a-zA-Z',.\-\ ]+$)/;
	return objRegExp.test(strValue);
}
function validateAlphaNum(strValue) {
	var objRegExp = /(^[a-zA-Z0-9'\-\.,#\/ &]+$)/;
	return objRegExp.test(strValue);
}
function validateNum(strValue) {
	var objRegExp  =  /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;
	return objRegExp.test(strValue);
}
function validateEmail(strValue) {
	var objRegExp  = /^[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9\-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9\-]*[A-Za-z0-9])?$/i;
					 
	//var objRegExp  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;
	return objRegExp.test(strValue);
}
function validateZip(strValue) {
	var objRegExp  = (/(^\d{5,9}$)|(^\d{5}-\d{4}$)/);
	return objRegExp.test(strValue);
}
function validateAreaCode(strValue) {
	var objRegExp  = (/(^\d{3}$)/);
	return objRegExp.test(strValue);
}
function validate4DigitPhone(strValue) {
	var objRegExp  = (/(^\d{4}$)/);
	return objRegExp.test(strValue);
}
function validateCreditCard(strValue) {
	
	var Visa  = (/(^4[0-9]{12}(?:[0-9]{3})?$)/);
	var MC  = (/(^5[1-5][0-9]{14}$)/);
	
	if(Visa.test(strValue))
	{
		return 'VISA';
	}
	else if(MC.test(strValue))
	{
		return 'MASTERCARD';
	}
}
function validateCSC(cardType,strValue){
    var objRegExp = null;
    if(cardType != null){
        if(cardType == "American Express" || cardType.toUpperCase() == "AMEX"){
            objRegExp = /^\d{3,4}$/;
            return objRegExp.test(strValue);
        } else { //Mastercard, Visa(, Discover)
             objRegExp = /^\d{3}$/;
            return objRegExp.test(strValue);
        }
    }

}

function validateRoutingNum(routingNumber) {
	if(routingNumber)
	{
		var equation = ( (3*(Number(routingNumber.charAt(0))+Number(routingNumber.charAt(3))+Number(routingNumber.charAt(6)))) + (7*(Number(routingNumber.charAt(1))+Number(routingNumber.charAt(4))+Number(routingNumber.charAt(7)))) + Number(routingNumber.charAt(2)) + Number(routingNumber.charAt(5)) + Number(routingNumber.charAt(8) )) % 10;
		
		if(Number(equation) !== 0 || routingNumber.length !== 9 || !validateNum(routingNumber)) {
			return false;
		} else {
			return true;
		}
	}
}
// End Form Validation

function showTest() {
	document.getElementById('guaranteed_issue').className="displayBlock modal";
	
	document.getElementById('overlay').className="displayBlock";
}

function setState(_caller) { //_state
	var stateSelects;
	var _state;
	var stateName_str = "";
	
	if (_caller == "stateform") {
		stateSelects = document.getElementById("stateform").getElementsByTagName("select");
		_state = stateSelects[0].value;
	} else if (_caller == "statemenu" || _caller == "statemenu_pd") {
		if (document.getElementById(_caller).value.length == 2) {
			_state = document.getElementById(_caller).value;
		} else {
			if (getCookieValue("visitorState") != undefined && getCookieValue("visitorState").toString().length > 0) {
				stateName_str = unescape(getCookieValue("visitorState"));
				if (stateName_str.indexOf("+") != -1) {
					stateName_str.replace("+", " ");
				}
			}
			
		}
	}
	
	
	//find a match
	if (stateName_str == "") {
		
		for (var i=0; i<stateAbbrev_array.length; i++) {
			if (_state.toUpperCase() == stateAbbrev_array[i].toUpperCase()) {
				stateName_str = stateNames_array[i];
				i=stateAbbrev_array.length;
			}
		}
	}
		
	
	//if statemenu is on the page, update it
	if (_caller != "statemenu") {
		if (document.getElementById("statemenu")) {
			//update drop-down
			
			var stateOptions = document.getElementById("statemenu").getElementsByTagName("option");
			
			//alert(_state);
			//alert(stateOptions.length);
			
			for (var i=0; i<stateOptions.length; i++) {
				if (_state.toUpperCase() == stateOptions[i].value) {
					//stateName_str = stateNames_array[i];
					stateOptions[i].selected = 'selected';
					i=stateOptions.length;
				}
			}
		}
	}
	
	if (_caller == "statemenu_pd") {
		document.getElementById("state").className = "displayBlock";
		document.getElementById("subnav_menu").className = "displayBlock";
		document.getElementById("select_state").className = "displayNone";
		if (location.href.indexOf("childrens") != -1) {
			swapContent('product-guide','overview',0);
		} else if (location.href.indexOf("life") != -1) {
			swapContent('product_details','overview',0);
		}
	}
	
	updateState(stateName_str);
	//save the cookie
	writeCookie("visitorState",stateName_str);
	
	//hide change_state div
	if (document.getElementById("change_state").className == "displayBlock") {
		toggleDisplay('change_state','displayNone');
	}
}

function setQuote() {
	
	
	
}


function toggleDisplay(_id,_display) {
	if (_id == "change_state") { //if they've clicked this link, it's assumed the state has been stored
		//read cookie and jump to appropriate state in drop-down
		var stateName = getCookieValue("visitorState");
		var stateAbbrev = "";
		
		for (var i=0; i<stateNames_array.length; i++) {
			if (stateName.toUpperCase() == stateNames_array[i].toUpperCase()) {
				stateAbbrev = stateAbbrev_array[i];
				i=stateNames_array.length;
			}
		}
		
		var stateOptions = document.getElementById("statemenu_top").getElementsByTagName("option");
		
		for (var ii=0; ii<stateOptions.length; ii++) {
			if (stateAbbrev.toUpperCase() == stateOptions[ii].value) {
				//stateName_str = stateNames_array[i];
				stateOptions[ii].selected = 'selected';
				ii=stateOptions.length;
			}
		}
	}
	
	if (_display == "toggle") {
		var tempClassName;
		
		if (document.getElementById(_id).className == "displayBlock") {
			document.getElementById(_id).className = "displayNone";
			if (_id.indexOf("review_") != -1 || _id.indexOf("beneficiary") != -1) {
				tempClassName = "expand";
			}
		} else {
			document.getElementById(_id).className = "displayBlock";
			if (_id.indexOf("review_") != -1 || _id.indexOf("beneficiary") != -1) {
				tempClassName = "collapse";
			}
		}
		
		if (_id.indexOf("review_") != -1) {
			document.getElementById("link" + _id.substr(6,_id.length)).className = tempClassName;
		} else if (_id.indexOf("beneficiary") != -1) {
			document.getElementById("link_" + _id).className = tempClassName;
		}
		
		/*if (_id == "family_coverage") {
			fcBoxClicked = false;
		}*/
		if (_id == "chexplanation" || _id == "cvv") {
			if (document.getElementById(_id).className == "displayBlock") {
				document.getElementById("payment").className = "displayNone";
			} else {
				document.getElementById("payment").className = "displayInline";
			}
		}
	} else {
		document.getElementById(_id).className = _display;
	}
}

function swapContent(_menu, _show, _selected) {
	var subnavListItems
	if (document.getElementById("subnav_menu")) {
		subnavListItems = document.getElementById("subnav_menu").getElementsByTagName("li");
		for (var i=0; i<subnavListItems.length; i++) {
			subnavListItems[i].className = "";
		}
		subnavListItems[_selected].className = "on";
		
		if (_menu == "product_details" || _menu == "product-guide") {
			if (document.getElementById("overview")) {
				document.getElementById("overview").className = "displayNone";
			}
			if (document.getElementById("features")) {
				document.getElementById("features").className = "displayNone";
			}
			if (document.getElementById("notcovered")) {
				document.getElementById("notcovered").className = "displayNone";
			}
			// document.getElementById("notcovered").className = 
			document.getElementById(_show).className = "displayBlock";
			
			var sectionDesc = (_show == "overview") ? "guaranteed_benefits" : "additional_information";
			
			if (location.href.indexOf("itg") == -1 && location.href.indexOf("cat") == -1) {
				var uri = "/";
				if (location.href.indexOf("mutualdirect") != -1) {
					uri += "life/";
				}
				pageTracker._trackPageview(uri+"product_details.php?view="+sectionDesc);
			}
		} else if (_menu == "faqs") {
			document.getElementById("coverage_q").className = document.getElementById("coverage_a").className = "displayNone";
			
			// If AD
			if (location.href.indexOf("accidental") != -1) {
				document.getElementById("eligibility_q").className = document.getElementById("eligibility_a").className = "displayNone";
			// If SAL or JWL
			} else {
				document.getElementById("benefits_q").className = document.getElementById("beneficiary_a").className = 
				document.getElementById("application_q").className =  document.getElementById("application_a").className =
				document.getElementById("beneficiary_q").className = document.getElementById("benefits_a").className = "displayNone";
			}
			
			/*if (location.href.indexOf("itg") == -1 && location.href.indexOf("cat") == -1) {
				var uri = "/";
				if (location.href.indexOf("mutualdirect") != -1) {
					uri += "life/";
				}
				pageTracker._trackPageview(uri+"faqs.php?view="+_show);
			}*/
			
			//highlight first answer
			updateFAQ(_show,1);
			
			document.getElementById(_show + "_q").className = "displayBlock";
			document.getElementById(_show + "_a").className = "displayBlock";
		}
		
	}
	
}

function updateFAQ(_section,_answer) {
	var faqListQuestions = document.getElementById(_section + "_q").getElementsByTagName("ul");
	var faqListQuestionItems = faqListQuestions[0].getElementsByTagName("li");
	
	for (var i=0; i<faqListQuestionItems.length; i++) {
		faqListQuestionItems[i].getElementsByTagName("a")[0].className = '';
	}
	faqListQuestionItems[Number(_answer)-1].getElementsByTagName("a")[0].className = 'on';
	
	var faqListAnswers = document.getElementById(_section + "_a").getElementsByTagName("ul");
	var faqListAnswerItems = faqListAnswers[0].getElementsByTagName("li");
	//alert(faqListItems.length);
	for (var i=0; i<faqListAnswerItems.length; i++) {
		faqListAnswerItems[i].className = 'displayNone';
	}
	
	document.getElementById("faq_" + _section + "_" + _answer).className = 'displayBlock';
	
	if (location.href.indexOf("itg") == -1 && location.href.indexOf("cat") == -1) {
		var uri = "/";
		if (location.href.indexOf("mutualdirect") != -1) {
			uri += "life/";
		}
		pageTracker._trackPageview(uri+"faqs.php?view="+_section+"&question="+_answer);
	}
}

function updateTabs(_section) {
	// alert(_section);
	if (location.href.indexOf("childrens") != -1) {
		document.getElementById("features").className = document.getElementById("benefits").className = document.getElementById("facts_figures").className = "displayNone";
		document.getElementById(_section).className = "displayBlock";
		document.getElementById("tabs").className = _section;
	} else if (location.href.indexOf("life") != -1) {
		document.getElementById("features").className = document.getElementById("benefits").className = document.getElementById("facts_figures").className = "displayNone";
		document.getElementById(_section).className = "displayBlock";
		document.getElementById("home_tabs").className = _section;
	} else if (location.href.indexOf("accidental") != -1) {
		document.getElementById("features").className = document.getElementById("benefits").className = document.getElementById("facts_figures").className = "displayNone";
		document.getElementById(_section).className = "displayBlock";
		document.getElementById("home_tabs").className = _section;
	}
	
	if (location.href.indexOf("itg") == -1 && location.href.indexOf("cat") == -1) {
		var uri = "/";
		if (location.href.indexOf("mutualdirect") != -1) {
			uri += "life/";
		}
		pageTracker._trackPageview(uri+"?view="+_section);
	}
	//alert(document.getElementById("home_tabs").className);
}




//credit-card number, security code, credit-card type, and expiration date
function verify(ccard,secure_code,cctype,ccexp){
    if(secure_code.length < 3) {
        //eMsg("Please enter a valid value for the security code.","red");
		alert("Please enter a valid value for the security code.");
        return;}
    if(cctype=="Choose one...") {
        alert("Please enter a valid value for the credit card type.");
        return;}
    if (!clientsideVerify(ccard)) {
        alert("Please enter a valid value for the credit card.");}
    else{
        alert("Please wait while we process the credit card.");
        ccard=remDashSpace(ccard);
        url="http://www.parkerriver.com/s/verify?cc="+
            encodeURIComponent(ccard)+"&scode="+
            encodeURIComponent(secure_code)+"&type="+
            encodeURIComponent(cctype)+"&exp="+
            encodeURIComponent(ccexp);
        httpRequest("GET",url,true,handleCheck);
    }
}
/* Check whether the credit-card entry is null, not lengthy enough,
  or contains any letters. Remove any dashes or spaces from the entry, then
   run the Luhn algorithm on the resulting number. */
function clientsideVerify(ccVal){
    if(ccVal == null || ccVal.length < 13 ||
       ccVal.search(/[a-zA-Z]+/) != -1){ return false; }
    ccVal=remDashSpace(ccVal);
    return (applyLuhn(ccVal) % 10) == 0;

}
function remDashSpace(_number){
    //remove dashes or spaces
    _number = _number.replace(/-/g,"");
    _number = _number.replace(/ /g,"");
    return _number;
}
//http://en.wikipedia.org/wiki/Luhn_formula
function applyLuhn(cc){
    //reverse the String
    var rev = reverse(cc);
    //get array of character Strings
    var revArr = rev.split("");
    var total = 0;
    var tmp = 0;
    //add up the numbers
    for(var i = 0; i < revArr.length; i++){
        if((i % 2) > 0){
            tmp = revArr[i]*2;
            tmp= (tmp < 9 ? tmp : (tmp - 9) );
            total += tmp;
        }   else {
            total += Number(revArr[i]);
        }
    }//end for
    alert(total);
    return total;
}
//event handler for XMLHttpRequest
function handleCheck(){
    var sTag,answer,xmlReturnVal;
    if(request.readyState == 4){
        if(request.status == 200){
            //Implement document object in DOM
            xmlReturnVal = request.responseXML;
            sTag = xmlReturnVal.getElementsByTagName("cc_status")[0];
            answer= sTag.childNodes[0].data;
            if(answer=="okay"){ eMsg("Your purchase information has"+
                                     " been submtted to our online store.","blue");  }
            else { eMsg("There was a problem with processing the credit card.","red"); }
        } else {
            alert("A problem occurred with communicating between the XMLHttpRequest object and the server program.");
        }
    }//end outer if
}
/* Utility functions:
reverse a string. */
function reverse(str){

    var sArray = str.split("");
    var newS="";
    for(var i = sArray.length-1; i >= 0; i--){
        newS += sArray[i];
    }
    return newS;
}

function toggleSize(_int) {

	var cookie_step = parseInt(getCookieValue("fontSize"));
	
	if(_int == "+" && cookie_step >= 1 && cookie_step <= 3) {
		writeCookie("fontSize",cookie_step+1);
	} else if (_int == "-" && cookie_step >= 2 && cookie_step <= 4) {
		writeCookie("fontSize",cookie_step-1);
	}
	
	if(document.getElementById("column_single")) {
		document.getElementById("column_single").className = "toggleTextSingle_"+parseInt(getCookieValue("fontSize"));
	} else {
		document.getElementById("column_right").className = "toggleText_"+parseInt(getCookieValue("fontSize"));
	}
	
	if(parseInt(getCookieValue("fontSize")) === 1) {
		document.getElementById("text_Minus").className = "text_Minus_selected";
	} else {
		document.getElementById("text_Minus").className = "text_Minus";
	}
	
	if(parseInt(getCookieValue("fontSize")) === 4) {
		document.getElementById("text_Plus").className = "text_Plus_selected";
	} else {
		document.getElementById("text_Plus").className = "text_Plus";
	}
}

function textSizeControl() {
	document.writeln("<div style=\"margin-top:5px; float:right; width:120px;\"><div style=\"float:left; margin:5px 5px;\">Text size:</div><a href=\"#\" id=\"text_Minus\" class=\"text_Minus\" onclick=\"javascript:toggleSize('-');return false;\">-</a><a href=\"#\" id=\"text_Plus\" class=\"text_Plus\" onclick=\"javascript:toggleSize('+');return false;\">+</a></div>");
}

function productLaunch(path) {
	//location.href="http://www." + path;
	location.href = path;
}

function printPage() {
	window.print();
}
	
	window.onload = function() {
		
		copApp = false;
		
		
		if (location.href.indexOf("/cop/") != -1) {
			copApp = true;
		}
		
		var dir1p = "";
		if (location.hostname.indexOf("direct") != -1) {
			dir1p = "life/";
		}
		
		if (location.href.indexOf("faqs.php") != -1) {
			updateFAQ('coverage','1');
		}
		
		if (document.getElementById("statemenu")) {
			document.getElementById("statemenu").onchange = function() {
				this.className = "";
				if (getCookieValue("visitorState") != false) {
					setState(this.id);
				}
			};
		}
		
		if (document.getElementById("home_quote_btn")) {
			document.getElementById("home_quote_btn").onclick = function() {
				if (document.getElementById("statemenu").selectedIndex == 0) {
					//display message to select state
					document.getElementById("statemenu").className = "missing";
					//alert(document.getElementById("statemenu").className);
					return false;
				} else {
					document.getElementById("statemenu").className = "";
					setState("statemenu");
					var protocol = (location.href.indexOf("itg.") != -1) ? "" : "s";
					this.href = "http" + protocol + "://" + location.host + "/"+dir1p+"application/?state=" + document.getElementById("statemenu").options[document.getElementById("statemenu").selectedIndex].value;
				}
			};
		}
		
		if (getCookieValue("visitorState") != false) {
			updateState(getCookieValue("visitorState"));
			
			if (document.getElementById("state")) {
				document.getElementById("state").className = "displayBlock";
			}
			
			if (document.getElementById("statemenu")) {
				//alert(getCookieValue("visitorState"));
				for (var i=0; i<stateNames_array.length; i++) {
					if (getCookieValue("visitorState").toUpperCase() == stateNames_array[i].toUpperCase()) {
						for (var j=0; j<document.getElementById("statemenu").options.length; j++) {
							if (stateAbbrev_array[i].toUpperCase() == document.getElementById("statemenu").options[j].value) {
								document.getElementById("statemenu").selectedIndex = j;
								j = document.getElementById("statemenu").options.length;
							}
						}
						i = stateNames_array.length;
					}
				}
			}
			
			if (document.getElementById("column_right")) { //Plan Details, not Home page
				if (document.getElementById("overview")) {
					document.getElementById("overview").className = "displayBlock";
					//turn 'Benefits' nav item 'on'
				}
			}
		} else {
			//State not set
			if (document.getElementById("state")) {
				document.getElementById("state").className = "displayNone";
			}
			if (document.getElementById("statemenu")) {
				document.getElementById("statemenu").selectedIndex = 0;
			}
			
			if (document.getElementById("column_right") && location.href.indexOf("childrens") == -1) { //Plan Details, not Home page
				if (document.getElementById("overview")) {
					if (copApp) {
						document.getElementById("overview").className = "displayBlock";
					} else {
					
						document.getElementById("overview").className = "displayNone";
						
						//turn 'Benefits' nav item 'off'
						
						if (document.getElementById("select_state")) {
							document.getElementById("select_state").className = "displayBlock";
							//hide nav
							document.getElementById("subnav_menu").className = "displayNone";
						}
					}
				}
			}
		}
	};
	

