$.fn.equalHeights = function() {  
    var maxHeight = 0;  
    $(this).each(function(index){  
        var height = $(this).height();  
  
        if (maxHeight < height) {  
            maxHeight = height  
        }  
   });  
   $(this).height(maxHeight);  
}

$(document).ready(function(){

	if ( $('.home #main .mainshadow').length ) {
		
		$('.home #main .mainshadow .slider').cycle({
			fx: 'fade',
			timeout: 8000
		});
	}
	
	if ( $('.contacts').length ){
		$('.contacts .contact').prepend('<div class="t">').append('<div class="b">').find('div.text').wrap('<div class="m" />');
		$('.contacts .contact:odd').addClass('even');
		$('.contacts .contact:even').addClass('odd');
	}
	
});

$(window).load(function(){
	//if is Home
	if ( $('.home #content').length ){
		$('#content, #sidebar').equalHeights();
		$('#content-bottom .service .m').equalHeights();
	}
});
