$(document).ready(function(){
    $('ul#splash').innerfade({
	   speed: 2000,
	   timeout: 5000,
	   type: 'random',
	   containerheight: '303px'
	});


    if($('.tablesorter').length){
    $(".tablesorter")
			.tablesorter({widthFixed: true, widgets: ['zebra']})
			.tablesorterPager({container: $("#pager")});
    }
    
    $('#filter_country, #filter_city').change(function(){
         filter=$(this).attr('name');
         filter_value=$(this).val();
         $(".tablesorter").find('tr').show();
         if(filter_value){
         filter_td=$(".tablesorter").find('td.'+filter);
         filter_td.each(function(){
            if($(this).html()!=filter_value)
                $(this).parent().hide();            
         });
         }
    });
    
    
    $('#career').change(function(){
        $('#worker').css('display','none');
        $('#learner').css('display','none');
        if($(this).val()=='worker' || $(this).val()=='learner')
            $('#'+$(this).val()).slideDown('slow');
        
    });

});

function resize_site(){
    var site_width=$(document).width();
    if(site_width<1020) $('#site').css('margin-left','5px');
    else $('#site').css('margin','0 auto');
}
$(document).ready(function(){resize_site()});
$(window).resize(function(){resize_site()});
