// JavaScript Document

$(document).ready(function(){//
resize();
window.onresize = resize;

//alert($("#header").height());

function resize(){
//	alert($(window).width());				
winwh = $(window).width();
winht = $(window).height();
$("#name").css( "width", winwh - 332 + "px");

if($("table.main").height()<winht){
	$("table.main").css("height", winht);
}
//alert(winwh);	

}



$('#menu').each(function () {//yellow
		var distance = -80;
        var time = 150;
		var timeleft = 100;
        var hideDelay = 500;

        var hideDelayTimer = null;

        var beingShown = false;
        var shown = false;
        var trigger = $('.progr');
        var info = $('#popa',this).css('opacity', 1);
        $([trigger.get(0), info.get(0)]).mouseover(function () {
            if (hideDelayTimer) clearTimeout(hideDelayTimer);
            if (beingShown || shown) {
                return;
            } else {
                beingShown = true;
                info.css({
				 	top: 151,
					left: 90,
                    display: 'block'
                }).animate({
					left: '-=' + distance + 'px',
					opacity: 1
                }, time, 'swing', function() {
                    beingShown = false;
                    shown = true;
                });
            }

            return false;
        });
		$([trigger.get(0), info.get(0)]).mouseout(function () {
            if (hideDelayTimer) clearTimeout(hideDelayTimer);
            hideDelayTimer = setTimeout(function () {
                hideDelayTimer = null;
                info.animate({
					 left: '+=' + distance + 'px',
					 opacity: 0
                }, timeleft, 'swing', function () {
                    shown = false;
                    info.css('display', 'none');
                });
            }, hideDelay);

            return false;
        });
    });



});//-------
