
//<![CDATA[


	$(function() { 
		$('#tabs ul a').click(function() {
			$('#tabs .tab.active').removeClass('active');
			$('#tabs .tab#tab-' + $(this).attr('rel')).addClass('active');
			$('#tabs ul a.active').removeClass('active');
			$(this).addClass('active').blur();
			return false;
		});
	});

	function updateJobs($country) {
		$(function() {
			var $links = $('div#jobSummary a');
			var $href = '';
			
			var $json = eval('(' + $('input#jobs-' + $country).val() + ')');
			
			$country = $json.country; 
			$jobs = $json.jobs;
			if($json.region) {
				$region = $json.region;
			}else{
				$region = '';	
			}
			
			$links.each(function() { 
				$href = $(this).attr('href');
				$href = $href.split('/');
				
				
				if($region.length > 0) {					
					$href[5] = $region;
				}else{
					$href[5] = '';
				}
				
				if ($href.length > 4) { 
					if($country != 'All') {	
						$href[4] = $country;
					}else{
						$href[4] = '';	
					}
					
					
				} else { 					
					$href.push($country);
				}
				if ($href[$href.length-1] == 'All')
				{
					$href.pop();
				}
				
				$(this).attr('href', $href.join('/'));
				
				var $count = 0;
				var $key = $(this).attr('rel');
				
				if (!$(this).hasClass('cufon')){
					if	($key.indexOf('-') == -1) {
						$count = eval('$jobs.' + $key);
					} else { 
						$key = $key.split('-');
						$count = eval('$jobs.' + $key[0] + '.' + $key[1]);
					}
					$('span', this).html('(' + $count + ')');
					if($count > 0) {
						$('span', this).addClass('yellow');	
					}else{
						$('span', this).removeClass('yellow');	
					}
				}
			}); 
			return false;
		});
	}

	
//]]>

