var jq = jQuery.noConflict();

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("navigation");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
  			}
  			node.onmouseout=function() {
  				this.className=this.className.replace(" over", "");
   			}
   		}
  	}
 	}
}
jq(document).ready(function(){
	startList();
	
	jq(".quickSelect").change(function(){
		quickSelect(jq(this).val())
	});
	jq(".go_btn").click(function(){
		quickSelect(jq(this).parent().find(".quickSelect").val());
	});
	
	jq(".life_nav").hover(function(){
		jq("#quote_selector").hide();		
	},function(){
		jq("#quote_selector").show();
	});
});


function showDiv(el,trig,div){
	if(jq("#"+el).val() == trig){
		jq("#"+div).slideDown("slow");
		jq("#"+el).addClass("m_b5");
	}else{
		if(jq("#"+div).css("display") == "block"){
			jq("#"+div).toggle("slow",function(){
			jq("#"+el).removeClass("m_b5");
			});
		}
	}
}

function quickValidate(form){
	if(form.quote_selector.value == ''){
		alert("Please select an item");
		return false;
	}else{
		return true;
	}
}

function ucwords(str) {
  return (str+'').replace(/^(.)|\s(.)/g, 
	function ( $1 ) { 
		return $1.toUpperCase ( ); 
	} );
}
function quickSelect(v){	
	if(v==''){
		alert("Please select an item");
		return false;
	}else	if(v == 'group'){
		window.open("https://www.netquote.com/quotes/grouphealth-insurance.aspx","_blank");
	}else if(v == 'health'){
		window.open("https://www.netquote.com/quotes/health-insurance.aspx","_blank");
	}else{
		window.open("/quote/"+v+"/","_self");
	}
}


