$(document).ready(function() { 
		$('.equalHeight').equalHeight();
		$('.equalHeight2').equalHeight();
		
		$('input.name').clearType();
		$('input.phone').clearType();
		$('input.email').clearType();
		$('input.lastname').clearType();
		$('input.business').clearType();
		$('input.position').clearType();
		$('.contactForm .field textarea').clearType();
		
		
		$('#search').css('width', $('.searchContainer').width() - 47 + 'px');
		
		$('.second-level .active').next().addClass('thirdActive');
		$('.third-level li.active').parent().parent().parent().parent().addClass('active');
		$('.third-level li.active').parent().parent().addClass('active');
		$('.third-level li.active').parent().siblings('a').addClass('active');
		
});

$.fn.equalHeight = function () {
		var height		= 0;
		var maxHeight	= 0;
	
		// Store the tallest element's height
		this.each(function () {
			height		= $(this).outerHeight();
			maxHeight	= (height > maxHeight) ? height : maxHeight;
		});
	
		// Set element's min-height to tallest element's height
		return this.each(function () {
			var t			= $(this);
			var minHeight	= maxHeight - (t.outerHeight() - t.height());
			var property	= $.browser.msie && $.browser.version < 7 ? 'height' : 'min-height';
	
			t.css(property, minHeight + 'px');
		});
	
};

$.fn.clearType = function () {
	var thisVal = $(this).val();
	$(this).focus(function() {
		if($(this).val()==thisVal){
			$(this).val('');
		}
	});
	$(this).blur(function() {
		if($(this).val()==''){
			$(this).val(thisVal);
		}					  
	});
	
};
