 $(document).ready(function() {

	$(function() {
		$('a.fold').click(function() {
		var $container = $('div#' + $(this).attr('rel'));
		var $target = $('div.contentInner', $container);
		if ($container.hasClass('closed')) { 
			$target.slideDown('slow');
		} else { 
			$target.slideUp('slow');
		}
		$container.toggleClass('closed');
			$(this).blur();
			return false;
		});
		
		$('select#technical_skills').change(function() {														 
			var $ts = $(this).attr("value");
			if ($ts == '20') { 
				$('tr#technical_skills_other').slideDown('fast');
			} else { 
				$('tr#technical_skills_other').slideUp('fast');
			}											  
		});
		
		$('select#position_id').change(function() {														 
			var $ts = $(this).attr("value");
			if ($ts == '19') { 
				$('tr#position_other').slideDown('fast');
			} else { 
				$('tr#position_other').slideUp('fast');
			}											  
		});
		
		var $ts = $('select#position_id').val();
		if ($ts == '19') { 
			$('tr#position_other').slideDown('fast');
		} else { 
			$('tr#position_other').slideUp('fast');
		}
		
	});
	
	$('#infoCountry').change( function() {	
		if($(this).attr('value') == 29) {
			$('#infoRegionBlock').show();
		}else{
			$('#infoRegionBlock').hide();
		}		
	});
	
	
	$('#drop-multi-countries_eligible input').change( function() {
		if($(this).attr('value') == 29 && $(this).attr('checked')) {
			$('.region_hide').show();
		}else if($(this).attr('value') == 29 && $(this).attr('checked') == false && $('#countries_ineligible_29').attr('checked') == false){
			$('.region_hide').hide();
		}
	});
	
	$('#drop-multi-countries_ineligible input').change( function() {
		if($(this).attr('value') == 29 && $(this).attr('checked')) {
			$('.region_hide').show();
		}else if($(this).attr('value') == 29 && $(this).attr('checked') == false && $('#countries_eligible_29').attr('checked') == false){
			$('.region_hide').hide();
		}
	});
	
	
});
