$(document).ready(function(){

   

});


function goFilter(){

	var link = "";
	$("div.refine-controls ul").each(function(index) {
		var ul = $(this);
		if ($(this).find("a.selected").length>0) {
			var UlId = ul.attr("id");
			if (link != '') {
				link += ":"+UlId+"=";
			}else {
				link += UlId+"=";
			}
			$(this).find("a.selected").each(function(index) {
				//var pattern = /\/sale\/.*=(.*\W+)\//;                    
				var hr = $(this).attr("rel");
				
				if (index>0) {
					link += "&"+hr;	
				}else {
					link += hr;	
				}
			});
		}
	});
	var minPrice = $("#DoubleTrack-1-LeftText").html();
	var maxPrice = $("#DoubleTrack-1-RightText").html();		minPrice = str_replace(" ", "", minPrice);	maxPrice = str_replace(" ", "", maxPrice);
		
	minPrice = minPrice.replace(/\s/g, "");
	maxPrice = maxPrice.replace(/\s/g, "");
			
	if (link != '') {
		link +=":";
	}			
	link +="price="+minPrice+"&"+maxPrice;	//alert(link);	//return false;
	if (link != '') {
		window.location = '/sale/' + link + '/';
	}else{
		window.location = '/sale/';
	}

	return false;
}function str_replace(search, replace, subject) {return subject.split(search).join(replace);}
