﻿$(document).ready(
    function () {

        var tr_heights = new Array();

        // Get tr height from news table.
        var index = 0;
        var tableNews = $("#news table");
        tableNews.find("tbody tr").each(
            function () {
                tr_heights[index] = $(this).height();
                index++;
            }
        )

        // Get tr_heights with events table.
        index = 0;
        var tableEvents = $("#events table");
        tableEvents.find("tbody tr").each(
            function () {
                if ($(this).height() > tr_heights[index]) {
                    tr_heights[index] = $(this).height();
                }
                index++;
            }
        )

        // Update tr height in news table.
        index = 0;
        tableNews.find("tbody tr").each(
            function () {
                $(this).css("height", tr_heights[index]);
                index++;
            }
        )

        // Update tr height in events table.
        index = 0;
        tableEvents.find("tbody tr").each(
            function () {
                $(this).css("height", tr_heights[index]);
                index++;
            }
        )

        if (tableNews.outerHeight() > tableEvents.outerHeight()) {
            tableEvents.css("height", tableNews.height());
        }
        else {
            tableNews.css("height", tableEvents.height());
        }
		
	/*	
		// Button more.
		if($("#newsMore").position().top > $("#eventsMore").position().top)
		{

			$("#eventsMore").css("top", $("#newsMore").position().top);
		}
		else
		{
			$("#newsMore").css("top", $("#eventsMore").position().top);
		}
		
	*/
    }
);
