// Equal Heights on Home Page Boxes

//function equalHeight(group) {
//   tallest = 0;
//   group.each(function() {
//      thisHeight = $(this).height();
//      if(thisHeight > tallest) {
//         tallest = thisHeight;
//      }
//   });
//   group.height(tallest);
//}
//$(document).ready(function() {
//   equalHeight($(".box"));
//});

function redirecttoSearch()
{
    window.location='/SearchResults.aspx?Search=' + document.getElementById('HeadSearch').value
    return false;
}

$(function(){
	var slideHeight = 250; // px
	var defHeight = $('.products').height();
	if(defHeight >= slideHeight){
		$('.products').css('height' , slideHeight + 'px');
		$('.read-more1').append('<a href="#">&darr; More &darr;</a>');
		$('.read-more1 a').click(function(){
			var curHeight = $('.products').height();
			if(curHeight == slideHeight){
				$('.products').animate({
				  height: defHeight
				}, "normal");
				$('.read-more1 a').html('&uarr; Close &uarr;');
				$('.gradient1').fadeOut();
			}else{
				$('.products').animate({
				  height: slideHeight
				}, "normal");
				$('.read-more1 a').html('&darr; More &darr;');
				$('.gradient1').fadeIn();
			}
			return false;
		});
	}
});

$(function(){
	var slideHeight = 250; // px
	var defHeight = $('.lab_services').height();
	if(defHeight >= slideHeight){
		$('.lab_services').css('height' , slideHeight + 'px');
		$('.read-more2').append('<a href="#">&darr; More &darr;</a>');
		$('.read-more2 a').click(function(){
			var curHeight = $('.lab_services').height();
			if(curHeight == slideHeight){
				$('.lab_services').animate({
				  height: defHeight
				}, "normal");
				$('.read-more2 a').html('&uarr; Close &uarr;');
				$('.gradient2').fadeOut();
			}else{
				$('.lab_services').animate({
				  height: slideHeight
				}, "normal");
				$('.read-more2 a').html('&darr; More &darr;');
				$('.gradient2').fadeIn();
			}
			return false;
		});
	}
});

$(function(){
	var slideHeight = 250; // px
	var defHeight = $('.clinical_specialties').height();
	if(defHeight >= slideHeight){
		$('.clinical_specialties').css('height' , slideHeight + 'px');
		$('.read-more3').append('<a href="#">&darr; More &darr;</a>');
		$('.read-more3 a').click(function(){
			var curHeight = $('.clinical_specialties').height();
			if(curHeight == slideHeight){
				$('.clinical_specialties').animate({
				  height: defHeight
				}, "normal");
				$('.read-more3 a').html('&uarr; Close &uarr;');
				$('.gradient3').fadeOut();
			}else{
				$('.clinical_specialties').animate({
				  height: slideHeight
				}, "normal");
				$('.read-more3 a').html('&darr; More &darr;');
				$('.gradient3').fadeIn();
			}
			return false;
		});
	}
});

$(function(){
	var slideHeight = 250; // px
	var defHeight = $('.featured_product').height();
	if(defHeight >= slideHeight){
		$('.featured_product').css('height' , slideHeight + 'px');
		$('.read-more4').append('<a href="#">&darr; More &darr;</a>');
		$('.read-more4 a').click(function(){
			var curHeight = $('.featured_product').height();
			if(curHeight == slideHeight){
				$('.featured_product').animate({
				  height: defHeight
				}, "normal");
				$('.read-more4 a').html('&uarr; Close &uarr;');
				$('.gradient4').fadeOut();
			}else{
				$('.featured_product').animate({
				  height: slideHeight
				}, "normal");
				$('.read-more4 a').html('&darr; More &darr;');
				$('.gradient4').fadeIn();
			}
			return false;
		});
	}
});

