function change_sort(section_id, subsection_id, niveau_matiere_str, sort) {
	if (section_id != '' && subsection_id != '') {
		document.location.href = 'liste_produits.php?s=' + section_id + '&ss=' + subsection_id + '&sort=' + sort;
	}
	else {
		document.location.href = 'liste_produits.php?nm=' + niveau_matiere_str + '&sort=' + sort;
	}
}

function ouvre_popup(page) {
   window.open(page, 'nom_popup', 'menubar=no, status=no, scrollbars=yes, menubar=no, width=750, height=650');
}

function showBulletin() {
	file_name = document.getElementById('bulletinList').value;
	
	if (file_name != '') {
		window.open(url + 'uploads/bulletins/' + file_name, 'bulletin_file');
	}
}

function bs_search_keypress() {
	if (window.event.keyCode == 13) {
		bs_search();
	}
	
	return false;
}

function bs_search() {
	var bs_name = document.getElementById('bs_name').value;
	var bs_city = document.getElementById('bs_city').value;
	
	if (bs_name == 'Nom de la librairie') {
		bs_name = '';
	}
	
	if (bs_city == 'Ville') {
		bs_city = '';
	}
	
	if (bs_name != '' || bs_city != '') {
		window.location = 'librairies.php?bs_name=' + bs_name + '&bs_city=' + bs_city;
	}
}

function search_pedagogie(sort) {
	var niveau_matiere_str = document.getElementById('nm').value;
	
	if (niveau_matiere_str != '0') {
		document.location.href = 'liste_produits.php?nm=' + niveau_matiere_str + '&sort=' + sort;
	}
}

