jQuery(function($){	
	$(function(){
		$('.box').each(function(){
			$(this).append('<div class="reflection">');
		});

		$('#navigation ul li:last').addClass('last');

		$('.faq-section .entry').each(function(){
			
			if($(this).index()%3==0){
				$(this).addClass('last-entry');
			}
		});

		$('.blink').focus(function () {
			if ($(this).val() == $(this).attr('title')) {
				$(this).val('');
			}
		});

		$('.blink').blur(function () {
			if ($(this).val() == '') {
				$(this).val($(this).attr('title'));
			}
		});

		$('.benefits ul li').hover(function(){
			$(this).addClass('hover');
		},function(){
			$(this).removeClass('hover');
		});

		$('#footer .footer-nav  ul li:last').addClass('last');

		$('.services li:last').addClass('last');

		$('.pricing-type:not(:first)').each(function() {
			$(this).css('margin-top', 40);	
		});

		$("p").filter( function() {
			return $.trim($(this).html()) == '';
		}).remove();

		$('.boxes br').remove();

		plan=0;

		$('.plans-cnt-b .plan').each(function() {
			plan++;
			if (plan == 3) {
				plan = 0;
				$(this).addClass('last-plan');
			}	
		});
		// /$('.plans-cnt-b .plan:last').addClass('last-plan');

		$('.col > h3:not(:first)').each(function() {
			$(this).css('margin-top', '30px');
		})

		$('#search-answers').submit(function() {
			highlight_term = $('#highlight_term').val();
			$('.faq-section h2').highlight(highlight_term);
			$('.entry').highlight(highlight_term);
			return false;
		});

		$('.last-plan').each(function() {
			$(this).after('<div class="cl">&nbsp;</div>');	
		});

		if ($('#blog-sidebar').height() < $('.page-content').height()) {
			$('#blog-sidebar').height($('.page-content').height());
		}

	})

	$(window).load( function() {
		max_height = 0;

		$('.boxes .box-c').each(function() {
			if ($(this).height() > max_height) {
				max_height = $(this).height();
			}
		});

		$('.boxes .box-c').each(function() {
			h4_height = $(this).find('h4').height();
			box_padding = (max_height - h4_height)/2;
			$(this).find('h4').css('padding-top', box_padding);
			$(this).find('h4').css('padding-bottom', box_padding);
		});

		max_height = 0;

		$('.checks p').each(function() {
			if ($(this).height() > max_height) {
				max_height = $(this).height();
			}	
		});

		$('.checks p').each(function() {
			$(this).height(max_height);
		});

		$('.right-col:first > h3').css('margin-top', '0');

		max_height = 0;

		$('.featured .box-c').each(function() {
			if ($(this).height() > max_height) {
				max_height = $(this).height();
			}
		});

		$('.featured .box-c:last').each(function() {
			box_padding = (max_height - $(this).height())/2 + 10;
			$(this).css('padding-top', box_padding);
			$(this).css('padding-bottom', box_padding);
		});

		featured_boxes = $('.box').length;
		for (i=3; i<featured_boxes; i++) {
			$('.box').eq(i).css('padding-top', 15);
		}

		$('#footer .footer-inner .shell .cols .col h3').each(function() {
			$(this).css('margin-top', 0);	
		});

		
	});

});
