﻿jQuery.fn.equalHeight = function() {
	var maxHeight = 0;
	this.each(function() {
		if ($(this).height() > maxHeight) {
			maxHeight = $(this).height();
		}
	});
	this.height(maxHeight);
};

jQuery.fn.center = function() {
	this.css("position", "absolute");
	this.css("top", ($(window).height() - this.height()) / 2 + $(window).scrollTop() + "px");
	this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
	return this;
}

jQuery.fn.equalMinHeight = function() {
    var maxHeight = 0;
    this.each(function() {
        if ($(this).height() > maxHeight) {
            maxHeight = $(this).height();
        }
    });
    if ($(".ie6,.ie7").length) {
        this.height(maxHeight);
    }
    else {
        this.css({ 'min-height': maxHeight });
    }
};

