	$(document).ready(function(){


/*************************************
GOBAL NAV
On rollover we are displaying the subnav
and giving it a little animation
***********************************/
		$('.menu li').hoverIntent(function(){
			$(this).find('dd.submenu')
			.css({top: "65px"})
			.animate(
				{top: "45px",
				opacity: 'toggle'},
				{duration: 400}
			);
		//	$(this).toggleClass('on');
		}, function() {
			$(this).find('dd.submenu')
			.animate(
				{top: "65px",
				opacity: 'toggle'},
				{duration: 400}
			);
		//	$(this).toggleClass('on');
		});
		



//	BANNER MENU HOVER PROPERTY
		$('.banner_menu li').hover(function(){
			$(this).parent().find('li#on').attr('id', '');
			$(this).attr('id', 'on');
		}, function(){
			$(this).attr('id', '');
		});

// SIDEBAR NAV
	$('ul.nav ul.subnav').hide();
	$('li.current ul.subnav').show();
	$('ul.nav li').hoverIntent(function(){
		$(this).find('ul.subnav:hidden').slideToggle('fast');
	}, function(){
		if($(this).hasClass('current')){
			//do nothing
		} else {
			$(this).find("ul.subnav").slideToggle('fast');	
		};
	});

// SUBNAV - temp style to simulate the 'on' state		
		$('.subnav li').hover(function(){
			$(this).toggleClass('on');
		}, function() {
		$(this).toggleClass('on');
		});
		
		
		
//whole block clickable
	$(".home_banner_submenu dl").click(function(){
		  window.location=$(this).find("a").attr("href"); return false;
		});

/*
*************************************
SCROLLING BACKGROUND IMAGE
js to dynamically scroll bg image
on mouseover
***********************************
$(function(){
		$('.menu li')
			.css( {backgroundPosition: "100px 65px"} )
			.mouseover(function(){
				$(this).stop().animate(
					{backgroundPositionY:"0"}, 
					{duration:500})
				})
			.mouseout(function(){
				$(this).stop().animate(
					{backgroundPositionY:"0"}, 
					{duration:500})
				})
});
*/
	
/*************************************
COMPARISON CHART
Dynamically replace the 'yes' checkmark
and applying certain centering styles
****************************************/
		$("span.yes").hide().parent()
		.css({
			background:"#eaf5ff",
		})
		.html('<img src="/images/icons/bullet_black.png" width="15" height="15" alt="Check Green" class="yes">');
		$("span.yesnew").hide().parent()
		.css({
			background:"#eaf5ff",
		})
		.html('<img src="/images/icons/check_green.jpg" width="15" height="15" alt="Check Green" class="yes">');
		$('span.no').hide();
		$('#comparison_chart').find('tr').find('td:first').addClass('first');
		$('#comparison_chart').find('tr').find('th:first').addClass('first');
		
		

/*************************************
EQUAL HEIGHT
plugin to dynamically equalize heights
****************************************/    		
		$(function(){ $('.equal_height').equalHeights(); });
		$(function(){ $('.equal_height2').equalHeights(); });


/*************************************
VERT CENTER
figures out the height of the containing element
and the hight of the element wanting to center
and positions it absolutely
****************************************/	
		$(function(){
			$('.vert_center').each(function(){
				var bannerHeight = $('.banner').height();
				var targetHeight = $(this).height();
				$(this).css({
					"top": bannerHeight/2 - targetHeight/2,
				});
			});

		});
		
/*************************************
STORE
****************************************/
$(function(){
	
	
	$('.info_format1 dd.more').click(function(){
		window.location=$(this).find("a").attr("href"); return false;
	}).hide();
	
	$('.info_format1 dd.more, .info_format1 dd.buy').each(function(){
		var containerWidth = $(this).parent().width();
		$(this).css({
			position:"absolute",
			bottom: "0",
			width: containerWidth - 20
		});
	});
	

	$('dd.buy span').each(function(){	
			var width = $(this).parent().find('a').width();
			$(this).css({
				paddingRight: width + 10
			})
			.parent().find('a').each(function(){
				var height = $(this).parent().height();
				$(this).css({
					height: height,
					padding: "0 10"
				})
			});
		});

/*		
		$('.info_format1').each(function(){
			var buyHeight = $(this).find('dd.buy').height();
			$(this).hover(function(){
				$(this).find('dd.more')
				.animate({
					bottom: buyHeight + 20,
					opacity: "toggle"
					}, {duration: 500})
				}, 
				function(){
					$(this).find('dd.more')
					.animate({
					bottom: "0px",
					opacity: "toggle"
				}, {duration: 500});
			});

		});
		

	});
*/	
	$('.info_format1').each(function(){
		var buyHeight = $(this).find('dd.buy').height();
		$(this).hoverIntent(function(){
			$(this).find('dd.more').css({bottom: buyHeight + 20})
			.animate({
				opacity: "toggle"
				}, {duration: 200})
			}, 
			function(){
				$(this).find('dd.more')
				.animate({
				opacity: "toggle"
			}, {duration: 200});
		});

	});
	

});	
	
	
//TABS

/*
		$('.info_format1 dd.compare, .info_format1 dd.buy').hide();
		$('.info_format1').hover(function(){
			$(this).find('dd.compare, dd.buy').css({
				top:"-20px"
			}).animate({
				opacity: 'toggle',
				top: '0px'
			}, {duration: '2000'});
		}, function(){
			$(this).find('dd.compare, dd.buy').animate({
				opacity: 'toggle',
				top: '-20px'
			}, {duration: '2000'});
		});
*/		
	});
