prepareOnLoad = function() {

    var qs = document.location.href.toString().split("?");
    if (qs[1]) {
        $("#calendar_list").each(function() {

            $("li a", this)
            .removeClass("active")
            .end()
            .find("li a[rel='" + qs[1] + "']")
            .addClass("active");

        });
    }

    $("#block_calendar_current").each(function() {
        $(this)
        .find(".col1, .col2, .col3, .col7, thead")
        .hide()
        .end()
        .show();
    });

    $("#block_ranking_teams").each(function() {

        var self = this;
        $(self).
        find(".ranking_header1,.ranking_header2,.col1,.col2,.col3,.col4,.col5,.col6,.col7,.col8,.col9,.col10,.col11,.col12,.col13,.col14,.col15,.col16,.col17,.col18,.col19,.col20,.col21,.col22,.col23,.col24,.col25,.col26,.col27")
        .hide()
        .end()
        .show();


    });

    $("#block_ranking_players").each(function() {

        var self = this;
        $(self).
        find("thead")
        .hide()
        .end()
        .show();

    });
	
	$('ul.sub_main_navigation').find('a').each( function() {

	var urlString = $(this).attr('href');
	
	if( (new RegExp(urlString)).test(window.location)  ) {
		$(this).addClass('selected');
	}
	
	})

};





