$(document).ready( function() {
	// ;
	//$("a[href*=.flv]").flowplayer("/flowplayer.swf");
	$("img.grey").css("opacity","0.6");
    
    $('.item_times').mouseover(function(){
        
        var changeClass='';
        if(Math.random()>0.5)
            changeClass='item_times_select';
        else
            changeClass='item_times_select_1';
        
        $(this).addClass(changeClass);
        $(this).removeClass('item_times');
    });
    
    $('.item_times').mouseout(function(){
        
        var changeClass='';
        if(Math.random()>0.5)
            changeClass='item_times_select';
        else
            changeClass='item_times_select_1';
            
        $(this).removeClass('item_times_select');
        $(this).removeClass('item_times_select_1');
        $(this).addClass('item_times');
    });
    /*
    $('.item_times_select').mouseover(function(){
        $(this).removeClass('item_times_select');
        $(this).addClass('item_times');
    });
    */
    
    $('.img-big', $('body')).fancybox();     
});

// ;
function loadtime(id) {
    $('#offices a').css( { color: '#234b87', background: 'none', 'text-decoration': 'underline' } );
	$('#office'+id).css( { color: '#fdf9e8', background: '#374e8a', 'text-decoration': 'none' } );
    //$('#load').show();
    $('#time').load('/systems/includes/php/times.php', { 'id':id }, function () {
		//$('#load').hide();
	});
}
// ;
function time(a,t) {
	$('div.item_times').css( { background: '#dbdbdb' } );
	$('#teachers a').css( { color: '#999999', background: 'none' } );
	$('#areas a').css( { color: '#999999', background: 'none' } );
	if (a) {
    	$('.a'+a).css( { background: '#e5b804' } );
    	$('#area').css( { color: '#234b87' } );
    	$('#area'+a).css( { color: '#234b87', background: '#e5b804' } );
    	$('.aa'+a).css( { color: '#234b87' } );
	}
	if (t) {
    	$('.t'+t).css( { background: '#e5b804' } );
    	$('#teacher').css( { color: '#234b87' } );
    	$('#teacher'+t).css( { color: '#234b87', background: '#e5b804' } );
    	$('.tt'+t).css( { color: '#234b87' } );
	}
}    


