$(document).ready(function(){
	$('#other_checkbox').change( function() {
		if ($('#other_checkbox').is(':checked')) {
			$('#other_field').removeAttr('disabled');
			$('#other_field').focus();
		} else {
			$('#other_field').attr('disabled', true);
		}
	});
});

function addToBasket(id) {
	if (confirm('Are you sure you want to add this vacancy to your basket?')) {
		 $.ajax({
		   type: "POST",
		   url: "/fileadmin/undutchables.nl/php/ajax.php?cmd=addToBasket",
		   data: "id="+id,
		   success: function(msg){
			 alert( msg );
		   }
		 });
	}
}

function removeFromBasket(id) {
	if (confirm('Are you sure you want to remove this vacancy to your basket?')) {
		 $.ajax({
		   type: "POST",
		   url: "/fileadmin/undutchables.nl/php/ajax.php?cmd=removeFromBasket",
		   data: "id="+id,
		   success: function(msg){
			 div_id = '#bask_' + id;
			 div_id2 = '#bask2_' + id;
			 $(div_id).hide();
			 $(div_id2).hide();
			 alert( msg );
		   }
		 });
	}
}

function job_language_select(sel) {
	if (sel.selectedIndex>0) {
		url='/jobs/?language['+sel.options[sel.selectedIndex].value+']='+sel.options[sel.selectedIndex].value;
		if (sel.form.job_discipline.selectedIndex>0) {
			url += '&discipline['+sel.form.job_discipline.options[sel.form.job_discipline.selectedIndex].value+']='+sel.form.job_discipline.options[sel.form.job_discipline.selectedIndex].value;
			location=url;
		}
	}
}


function job_discipline_select(sel) {
	if (sel.selectedIndex>0) {
		url='/jobs/?discipline['+sel.options[sel.selectedIndex].value+']='+sel.options[sel.selectedIndex].value;
		if (sel.form.job_language.selectedIndex>0) {
			url += '&language['+sel.form.job_language.options[sel.form.job_language.selectedIndex].value+']='+sel.form.job_language.options[sel.form.job_language.selectedIndex].value;
			location=url;
		}
	}
}

