/*Gestion d'affichage des annonces selon le type d'arrangement */
var url;
	function type_arrang(old_ord_by,old_ord,new_ord_by,new_ord){
		var pos_old_ord_by = document.location.href.search(old_ord_by);
		var pos_new_ord_by = document.location.href.search(new_ord_by);
		var pos_old_ord = document.location.href.search(old_ord);
		var pos_new_ord = document.location.href.search(new_ord);
		if ((pos_old_ord_by==(-1))||(pos_old_ord==(-1))){			
			url=document.location.href.replace('to=concess','to=concess&ord_by=soc&ord=desc');
			document.location.replace(url);
		}
		else if ((pos_old_ord_by!=(-1))&&(pos_old_ord!=(-1))){
			url=document.location.href.replace(old_ord_by,new_ord_by);
			url=url.replace(old_ord,new_ord);
			document.location.replace(url);
		}
	}
	
	function type_arrang2(old_ord_by,old_ord,new_ord_by,new_ord){
		var pos_old_ord_by = document.location.href.search(old_ord_by);
		var pos_new_ord_by = document.location.href.search(new_ord_by);
		var pos_old_ord = document.location.href.search(old_ord);
		var pos_new_ord = document.location.href.search(new_ord);
		var pos_to_search = document.location.href.search('to=search');		
		if ((pos_old_ord_by==(-1))||(pos_old_ord==(-1))){			
			if (pos_to_search==(-1)){
				url=document.location.href;
				document.location.replace(url+'&'+new_ord_by+'&'+new_ord);
			}
			else {
				url=document.location.href.replace('to=search','to=search&'+new_ord_by+'&ord=asc');
				document.location.replace(url);
			}
		}
		else if ((pos_old_ord_by!=(-1))&&(pos_old_ord!=(-1))){
			url=document.location.href.replace(old_ord_by,new_ord_by);
			url=url.replace(old_ord,new_ord);
			document.location.replace(url);
		}
	}