function ordenar(por,hacia,ocat) { 
	var temporalhref;
	var re = new RegExp("/[0-9]+/", "g");
	var ajaxo = new ajaxFunction();
	
	ajaxo.onreadystatechange=function(){
		if(ajaxo.readyState==4){
			if(ajaxo.responseText=='ok'){
				temporalhref = window.location.href;
				temporalhref = temporalhref.replace(re,'/');
				window.location.href = temporalhref;
			}
		}
    }	
	ajaxo.open("POST","/includes/ordenar.php",true);
	ajaxo.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajaxo.send("o_por="+por+"&o_hacia="+hacia+"&o_cat="+ocat);
}

function ajaxFunction()
  { var xmlHttp;
  try { xmlHttp=new XMLHttpRequest();return xmlHttp; }
  catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");return xmlHttp; }
  catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");return xmlHttp; }
  catch (e) { alert("Tu navegador no soporta AJAX!");return false; }
}}}