// for submenu
var otherproduct = 0;
var helpcontent = 0;
jQuery(document).ready(function() {
	jQuery("#nav2").click(function() {
		if (otherproduct % 2 == 0) {
			otherproduct ++;
			setTimeout('if (otherproduct == ' + otherproduct + ') {\
				jQuery("#otherproducts").show();\
				jQuery("#nav2").addClass("expanded-menu");\
				}' ,1);
		} else {
			otherproduct ++;
			setTimeout('if (otherproduct == ' + otherproduct + ') {\
				jQuery("#otherproducts").hide();\
				jQuery("#nav2").removeClass("expanded-menu");\
				}' ,1);
		}
		return false;
	});
	jQuery("#nav2").mouseover(function() {
		if (otherproduct % 2 == 0) {
			otherproduct ++;
			setTimeout('if (otherproduct == ' + otherproduct + ') {\
				jQuery("#otherproducts").show();\
				jQuery("#nav2").addClass("expanded-menu");\
				}', 20);
		}
	});
	jQuery("#otherproducts").mouseover(function() {
		if (otherproduct % 2 == 0) {
			otherproduct ++;
			setTimeout('if (otherproduct == ' + otherproduct + ') {\
				jQuery("#otherproducts").show();\
				jQuery("#nav2").addClass("expanded-menu");\
				}', 20);
		}
	});
	jQuery("#otherproducts iframe").mouseover(function() {
		if (otherproduct % 2 == 0) {
			otherproduct ++;
			setTimeout('if (otherproduct == ' + otherproduct + ') {\
				jQuery("#otherproducts").show();\
				jQuery("#nav2").addClass("expanded-menu");\
				}', 20);
		}
	});
	jQuery("#nav2").mouseout(function() {
		if (otherproduct % 2 == 1) {
			otherproduct ++;
			setTimeout('if (otherproduct == ' + otherproduct + ') {\
				jQuery("#otherproducts").hide();\
				jQuery("#nav2").removeClass("expanded-menu");\
				}', 20);
		}
	});
	jQuery("#otherproducts").mouseout(function() {
		if (otherproduct % 2 == 1) {
			otherproduct ++;
			setTimeout('if (otherproduct == ' + otherproduct + ') {\
				jQuery("#otherproducts").hide();\
				jQuery("#nav2").removeClass("expanded-menu");\
				}', 20);
		}
	});
	jQuery("#otherproducts iframe").mouseout(function() {
		if (otherproduct % 2 == 1) {
			otherproduct ++;
			setTimeout('if (otherproduct == ' + otherproduct + ') {\
				jQuery("#otherproducts").hide();\
				jQuery("#nav2").removeClass("expanded-menu");\
				}', 20);
		}
	});
	
	jQuery("#nav3").click(function() {
		if (helpcontent % 2 == 0) {
			helpcontent ++;
			setTimeout('if (helpcontent == ' + helpcontent + ') {\
				jQuery("#helpcontent").show();\
				jQuery("#nav3").addClass("expanded-menu");\
				}' ,1);
		} else {
			helpcontent ++;
			setTimeout('if (helpcontent == ' + helpcontent + ') {\
				jQuery("#helpcontent").hide();\
				jQuery("#nav3").removeClass("expanded-menu");\
				}' ,1);
				return false;
		}
	});
	jQuery("#nav3").mouseover(function() {
		if (helpcontent % 2 == 0) {
			helpcontent ++;
			setTimeout('if (helpcontent == ' + helpcontent + ') {\
				jQuery("#helpcontent").show();\
				jQuery("#nav3").addClass("expanded-menu");\
				}', 20);
		}
	});
	jQuery("#helpcontent").mouseover(function() {
		if (helpcontent % 2 == 0) {
			helpcontent ++;
			setTimeout('if (helpcontent == ' + helpcontent + ') {\
				jQuery("#helpcontent").show();\
				jQuery("#nav3").addClass("expanded-menu");\
				}', 20);
		}
	});
	jQuery("#nav3").mouseout(function() {
		if (helpcontent % 2 == 1) {
			helpcontent ++;
			setTimeout('if (helpcontent == ' + helpcontent + ') {\
				jQuery("#helpcontent").hide();\
				jQuery("#nav3").removeClass("expanded-menu");\
				}', 20);
		}
	});
	jQuery("#helpcontent").mouseout(function() {
		if (helpcontent % 2 == 1) {
			helpcontent ++;
			setTimeout('if (helpcontent == ' + helpcontent + ') {\
				jQuery("#helpcontent").hide();\
				jQuery("#nav3").removeClass("expanded-menu");\
				}', 20);
		}
	});
	
	jQuery("a.secondarymenu").each(function() {
		if (jQuery(this).html() == "group insurance" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "group.html");
		else if (jQuery(this).html() == "dental insurance" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "dental.html");
		else if (jQuery(this).html() == "travel insurance" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "travel.html");
		else if (jQuery(this).html() == "study USA insurance" && jQuery(this).attr("href") == "#")
			jQuery(this).attr("href", "student.html");
		else if (jQuery(this).html() == "medicare supplement" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "medicaresupplements.html");
		else if (jQuery(this).html() == "long term care" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "longterm.html");
		else if (jQuery(this).html() == "life insurance" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "life.html");
		else if (jQuery(this).html() == "FAQs" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "faq.html");
		else if (jQuery(this).html() == "knowledge center" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "knowledge.html");
	});		

	jQuery("#footnotelinks a").each(function() {
		if (jQuery(this).html() == "about us" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "aboutus.html");
		else if (jQuery(this).html() == "contact us" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "contactus.html");
		else if (jQuery(this).html() == "privacy" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "privacy.html");
		else if (jQuery(this).html() == "legal &amp; licensing" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "legal.html");
		else if (jQuery(this).html() == "disclaimer" && jQuery(this).attr("href") == "#") 
			jQuery(this).attr("href", "disclaimer.html");
	});
	
	jQuery(".otherproduct form .formblock .required").each(function() {
		for (var l = jQuery(this).parent(); ! l.hasClass('formblock'); l = l.parent());
		var l = l.children(jQuery("label")).get(0);
		if (! /\*/.test(l.innerHTML)) {
			if (/:/.test(l.innerHTML))
				jQuery(l).html(jQuery(l).html().replace(/:/, '<span class="red">*</span>:'));
			else if (/\?/.test(l.innerHTML))
				jQuery(l).html(jQuery(l).html().replace(/\?/, '<span class="red">*</span>?'));
			else 
				jQuery(l).html(jQuery(l).html() + '<span class="red">*</span>');;
		}
	});
});

