$.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');
    });
};
$(document).ready(function() {
	// The root problem is that WebKit browsers (Safari and Chrome) load JavaScript and CSS information in parallel. Thus, JavaScript may execute before the styling effects of CSS have been computed, returning the wrong answer. In jQuery, I've found that the solution is to wait until document.readyState == 'complete', .e.g.,
	if (jQuery.browser.safari && document.readyState != "complete"){
	    //console.info('ready...');
	    setTimeout( arguments.callee, 100 );
	    return;
	  };
	// As far as width and height goes... depending on what you are doing you may want offsetWidth and offsetHeight, which include things like borders and padding.
	
	$("#slider").easySlider({
		auto: true,
		continuous: true,
		nextId: "slider1next",
		prevId: "slider1prev"
	});

	$('.jqModalBox').each(function(){
		el = $(this);el.jqm({trigger:'.'+el.attr('id')})
	})
	
	$("#nav li:nth-child(4)").addClass("clear");
	
	$('.project-gallery li a').lightBox({
		txtImage:'Изображение',
		txtOf	:'из'
	});
	
	$('.project-link').equalHeight();
});

