﻿/*
	HealthPartners 2010
	broker global js
*/

$(document).ready(function() {
		
		// ie-roundies
	if ($.browser.msie && $.browser.version <= 8 ) {
		DD_roundies.addRule('ul#navigation', '0 0 8px 8px');
		DD_roundies.addRule('ul#navigation-auth', '0 0 8px 8px');
		DD_roundies.addRule('#navigation a#home', '0 0 0 8px');
		DD_roundies.addRule('#navigation-auth a#home', '0 0 0 8px');
		DD_roundies.addRule('#navigation a#broker-toolkit', '0 0 8px 0');
		DD_roundies.addRule('#navigation-auth a#broker-toolkit', '0 0 8px 0');
		DD_roundies.addRule('#logon-container', '4px');
		DD_roundies.addRule('.bordered', '8px');
		DD_roundies.addRule('.light-bordered', '8px');
		DD_roundies.addRule('.container-header', '8px 8px 0 0');
		DD_roundies.addRule('.landing-header', '8px 8px 0 0');
		DD_roundies.addRule('.landing-body', '0 0 8px 8px');
		DD_roundies.addRule('.landing-base', '8px');
		DD_roundies.addRule('.aside-header',  '8px 8px 0 0');
		DD_roundies.addRule('.aside-body',  '0 0 8px 8px');
		DD_roundies.addRule('#footer-navigation', '8px');
		DD_roundies.addRule('ul#broker-banner-container', '4px');
	}
				// ie-roundies
	if ($.browser.msie && $.browser.version >= 7 && $.browser.version <= 8 ) {
		DD_roundies.addRule('.container-body', '0 0 8px 8px');
	}
	
		// Move the h1 title down when an #banner is present on the page
	if ($("#banner").length > 0 && $("#banner.transactions").length == 0) {
		$("h1").addClass("banner-title");
	}
	
		// Move the h1 title down when an #banner.transactions is present on the page
	if ($("#banner").length > 0 && $("#banner.transactions").length > 0) {
		$("h1").addClass("transactions-banner-title");
	}
	
		// Promo hover
	$(".promo.hover").hover(function() {
		$(this).stop().animate({backgroundColor: "#f2f2f2"}, 200);
	}, function() {
		$(this).stop().animate({backgroundColor: "#fff"}, 200);
	});
	
		// Container Hover
	$(".container.hover").hover(function() {
    	$(this).stop().animate({backgroundColor: "#f2f2f2"}, 200);
	}, function() {
		$(this).stop().animate({backgroundColor: "#fff"}, 200);
	});
	
		// Primary Button Color Hover
	$(".button").hover(function() {
		$(this).stop().animate({backgroundColor: "#df9800"}, 100);
	}, function() {
		$(this).stop().animate({backgroundColor: "#efa300"}, 100);
	});

		// Secondary Button Color Hover
	$(".button.secondary").hover(function() {
    	$(this).stop().animate({backgroundColor: "#0c708c"}, 100);
	}, function() {
		$(this).stop().animate({backgroundColor: "#50b3cf"}, 100);
	});

		// Clear Button Color Hover
	$(".button.clear").hover(function() {
    	$(this).stop().animate({backgroundColor: "#999"}, 100);
	}, function() {
		$(this).stop().animate({backgroundColor: "#b3b3b3"}, 100);
	});
	
		// Table Data Hover
	$("table.data.hover tbody tr, table.data-results.hover tbody tr, table.data.ledger-hover tbody tr:odd, table.data-results.ledger-hover tbody tr:odd").hover(function() {
    	$(this).stop().animate({backgroundColor: "#eee"}, 200);
	}, function() {
		$(this).stop().animate({backgroundColor: "#fff"}, 300);
	});	
	
	$("table.data.ledger-hover tbody tr:even, table.data-results.ledger-hover tbody tr:even").hover(function() {
    	$(this).stop().animate({backgroundColor: "#eee"}, 200);
	}, function() {
		$(this).stop().animate({backgroundColor: "#f2f2f2"}, 300);
	});
	
		// Gecko 1.9.0 or less font-face override
	$.each($.browser, function(i, val) {
   		if(i=="mozilla" && $.browser.version.substr(0,5)<="1.9.0") {
	  		$("#home-banner h2").css({'font-size' : '19px'});
	  	}
 	});
	
});
