	jQuery(function($){	
		$.history.init(pageload);
		if(!window.location.hash){
			storeAppear();
		}
	});	
	 
	function pageload(hash){
		if(hash){			
			var	local=hash.split("=");
			finderContent(local[0],local[1],0)
		}else{
			finderContent('Alpha','A',1)
		}
	}	
	
	function newHash(hash){
		jQuery.history.load(hash);
	}
	
	function storeAppear(){
		jQuery(".sf_retailers li:not(.sf_pipe):hidden:first").each(function(i,el){	
			var $navItem=jQuery(el);				
			$navItem.fadeIn(200,function(){	
				storeAppear();
			});							
		});
	}

	function finderContent(type,val,start){	
		var url='/assets/includes/front/storefinder/sf_finder.cfm';	
		if(type=='Alpha'){var postBody='Alpha='+val;}
		if(type=='Cat'){var postBody='Category='+val;}			
		jQuery('.sf_retailers').fadeOut("normal", function () {													
			jQuery.ajax({
				  type: 'get',
				  data: postBody ,
				  url: url,
				  cache: true,
				  dataType: 'HTML',
				  success: function(success){
					jQuery('#changingContent').show();	
					jQuery('#changingContent').html(success);
					storeAppear();
					if((type=='Alpha')&&(start!=1)){jQuery('#category').val('');} 
				 }			  
				});			
		 });		
		return false;
	}	
