Ciao

Ho un problema con questa funzione del mio sito:

codice:
function addressSniffer(history, enabled){
	 var oldLocation = location.href, checker;
	 clearInterval(checker);
	 checker = setInterval(function(){
		 if(enabled){
			 if(oldLocation != location.href){
				 var position = $.inArray(location.href, history);
				 if(position > -1){
					 var target = history[position], loadingLayer = $('#loadingLayer'), siteFooter = $('#siteFooter');
					 changePage(target, history, loadingLayer, siteFooter);
					 addressSniffer(history, false);
					 }
				 }
			 }
		 else{
			 clearInterval(checker);
			 }
		 }, 1000);
	}
Il problema è che nel momento in cui la funzione arriva all'ultimo "if", quello con "position > -1", si richiama da sola e si dovrebbe disattivare l'intervallo, invece non ne vuole sapere e continua imperterrito a girare, senza considerare il clearInterval.

Dove sbaglio??

Grazie in anticipo!