/*
 * document ready, init all behaviors
 */
$(function(){
	humana.init({
		overlay: $('input[type="text"]').not('.disable_overlay'),
		round: [$('#search input[name="search"]'),$('#tabset_nav a')]
	});
	humana.pw_input($('#member_form_password'),$('#member_form_password-actual'));
	humana.nav.init();
	humana.slideshow.init( {id:'#slideshow',controls:true} );
	humana.tabs.init( {id:'#tabset'} );
	humana.carousel.init( [$('#get_coverage_carousel')] );
	humana.mastnav.init([0,2,3],{
		0:[],
		2:[
			{
				'title':'&raquo; for Members &amp; Visitors', 
				'url':'http://www.humana.com/'
			},
			{
				'title':'&raquo; for Employers &amp; Administrators',
				'url':'http://www.humana.com/employers/'
			},
			{
				'title':'&raquo; for Providers',
				'url':'http://www.humana.com/providers/'
			},
			{
				'title':'&raquo; for Pharmacists',
				'url':'http://www.humana.com/pharmacists/'
			},
			{
				'title':'&raquo; for Agents &amp; Brokers',
				'url':'http://www.humana.com/agents/'
			},
			{
				'title':'&raquo; for Government &amp; Public Sectors',
				'url':'http://www.humana.com/resources/about/company_profile/business_units.aspx'
			},
			{
				'title':'&raquo; Other Humana Websites',
				'url':'http://www.humana.com/resources/about/company_profile/business_units.aspx'
			}
		],
		3:[
			{
				'title':'&raquo; Humana News',
				'url':'http://www.humana.com/resources/news/'
			},
			{
				'title':'&raquo; Company Profile',
				'url':'http://www.humana.com/resources/about/company_profile/'
			},
			{
				'title':'&raquo; Investor Relations',
				'url':'http://phx.corporate-ir.net/phoenix.zhtml?c=92913&p=irol-irhome'
			},
			{
				'title':'&raquo; Healthcare Innovation',
				'url':'http://www.humana.com/resources/about/healthcare_innovation/'
			},
			{
				'title':'&raquo; Corporate Responsibility',
				'url':'http://www.humana.com/resources/about/corporate/'
			},
			{
				'title':'&raquo; Public Policy',
				'url':'http://www.humana.com/resources/about/public_policy/'
			},
			{
				'title':'&raquo; Careers',
				'url':'http://www.humana.com/resources/about/careers/'
			}
		]
	});
	if($('#player').length > 0){ humana.video.init(); }
	if($('.pulldown').length > 0){ 
		humana.selectify([$('.pulldown')], null, arguments.callee);
		$('#nav_primary .submenu').bgiframe();
	}
	if($('.condense').length > 0){ humana.selectify([$('.condense')], null, arguments.callee); }
	//if($('#page_wrapper.medicare').length > 0){ humana.selectify([$('.condense')], null, arguments.callee); }
	humana.prepare_gmaps();
	humana.medicare_alert();
});

// New global functionality
$(document).ready( function(){
	$("#other_humana_websites h4").click(function(e) { 
		$(this).parent().find("ul").slideDown('fast').show(); 
		
		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul").slideUp('fast');
		});
		
		}).hover(function() {  
			$(this).addClass("subhover");
		}, function(){
			$(this).removeClass("subhover");
	});
	
	if ($('.product_gallery').length > 0) {
		var max_height = 0;
		$(".product_gallery ul.items li").each(function(i) {
			if ($(this).height() >= max_height) {
				max_height = $(this).height();
			}
		});
		$(".product_gallery ul.items li").css("height", max_height);
		$(".product_gallery ul.items li ul li").css("height", "auto");
	}
});

