jQuery(document).ready(function($){

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

$(document).ready(function() {
	equalHeight($('div.fir'));
	equalHeight($('div.wt'));
});


$('div.paging ul li').hover(function(){
	$(this).children('ul.sub-menu').slideDown('fast')}, function(){
		$(this).children('ul.sub-menu').slideUp('fast');
	});

$('div.copy ul li').first().css('border', 'none');



$('div.work_click').click(function(){
	$('#work_global').toggleClass('change');
});


$('div.cl_left').click(function(){
	$.cookie('work_global', 'list');
	window.location.reload();
});

$('div.cl_right').click(function(){
	$.cookie('work_global', 'table');
	window.location.reload();
});


// COOKIES
// Left column state
var work_global = $.cookie('work_global');

// Set the user's selection for the left column
if (work_global == 'table') {
	$('.work_global').addClass('table');
	$('.cl_right').addClass('cl_right_active');
} else {
	$('.work_global').addClass('list');
	$('.cl_left').addClass('cl_left_active');
}


$('.sub-menu #menu-item-179').addClass('styleswitch');
$('.sub-menu #menu-item-180').addClass('styleswitch');

$('.sub-menu #menu-item-179 a').attr('rel', 'light');
$('.sub-menu #menu-item-180 a').attr('rel', 'dark');



 $('div.round_but').click(function(){
	$('div.round_but').removeClass('on_focus');					
	$(this).addClass('on_focus');
  });



if ($('li#ch_0').is('.roundabout-moveable-item, .roundabout-in-focus')) {
	 $('div.round_but').removeClass('on_focus')
	 $('div#to0').addClass('on_focus')
 };

if ($('li#ch_1').is('.roundabout-moveable-item, .roundabout-in-focus')) {
	 $('div.round_but').removeClass('on_focus')
	 $('div#to1').addClass('on_focus')
 };

if ($('li#ch_2').is('.roundabout-moveable-item, .roundabout-in-focus')) {
	 $('div.round_but').removeClass('on_focus')
	 $('div#to2').addClass('on_focus')
 };

if ($('li#ch_3').is('.roundabout-moveable-item, .roundabout-in-focus')) {
	 $('div.round_but').removeClass('on_focus')
	 $('div#to3').addClass('on_focus')
 };

if ($('li#ch_4').is('.roundabout-moveable-item, .roundabout-in-focus')) {
	 $('div.round_but').removeClass('on_focus')
	 $('div#to4').addClass('on_focus')
 };



























});
