﻿function onLoad(){
    /**/
	/*var body_width = document.body.offsetHeight;
	var imgfooter = document.getElementById("imgfooter");
	imgfooter.style.top = body_width - 247 + 'px';*/
    
    /*sidebar*/
    var coll_sidebar1 = document.getElementById("coll_sidebar1");
	var coll_sidebar1_height = coll_sidebar1.offsetHeight;
	
    var coll_sidebar2 = document.getElementById("coll_sidebar2");
	var coll_sidebar2_height = coll_sidebar2.offsetHeight;
	
    if (coll_sidebar1_height <= coll_sidebar2_height){
		coll_sidebar1.style.height = coll_sidebar2_height + 'px';
	}
    /*mainbox*/
    var coll_leftcol = document.getElementById("leftcol");
	var coll_leftcol_height = coll_leftcol.offsetHeight;
	
    var coll_rightcol = document.getElementById("rightcol");
	var coll_rightcol_height = coll_rightcol.offsetHeight;
	
    if (coll_leftcol_height <= coll_rightcol_height){
		coll_leftcol.style.height = coll_rightcol_height + 'px';
	}
}
$(document).ready(function(){
    $(window).scroll(function(){
        var scrolled = window.pageYOffset || document.documentElement.scrollTop;
        if(scrolled > 130){
            $('.up_button').show();
            $('#mainnav').addClass('up_menu');
        }else{
            $('.up_button').hide();
            $('#mainnav').removeClass('up_menu');
        }
    });
    $('.up_button').click(function(){
        window.scrollTo(0,0);
    });

    /*меню*/
    $("ul#topnav li").hover(function() { //Hover over event on list item
    	$(this).css({ 'background' : '#007780'}); //Add background color + image on hovered list item
        $(this).find("a").css({'color':'#DAF5F7'});
    	$(this).find("span").show(); //Show the subnav
    } , function() { //on hover out...
    	$(this).css({ 'background' : 'none'}); //Ditch the background
        $(this).find("a").css({'color':'#000000'});
    	$(this).find("span").hide(); //Hide the subnav
    });
});

