$(document).ready(function(){$(".filterbox").colorbox({scrolling:false})
});
$().bind("cbox_complete",function(){$(".filterbox").colorbox();
$("#fb_content a").each(function(){$(this).click(function(B){B.preventDefault();
var A=$(this).parent().parent().find("input");
if(A.is(":checked")){A.attr("checked",false);
$("#fb_rail a").each(function(){this.href=$.fn.removeValueFromQueryString(this.href,A.attr("name"),escape(A.attr("value")))
});
submitLink=$.fn.removeValueFromQueryString(submitLink,A.attr("name"),escape(A.attr("value")))
}else{A.attr("checked",true);
$("#fb_rail a").each(function(){this.href+="&"+A.attr("name")+"="+escape(A.attr("value"))
});
submitLink+="&"+A.attr("name")+"="+escape(A.attr("value"))
}})
});
$("#fb_content input").click(function(){that=$(this);
if(!$(this).is(":checked")){$("#fb_rail a").each(function(){this.href=$.fn.removeValueFromQueryString(this.href,that.attr("name"),escape(that.attr("value")))
});
submitLink=$.fn.removeValueFromQueryString(submitLink,that.attr("name"),escape(that.attr("value")))
}else{$("#fb_rail a").each(function(){this.href+="&"+that.attr("name")+"="+escape(that.attr("value"))
});
submitLink+="&"+that.attr("name")+"="+escape(that.attr("value"))
}});
$("#fb_close").click(function(){$.fn.colorbox.close()
});
$("#fb_submit").click(function(){window.location.href=submitLink
})
});
$.fn.removeValueFromQueryString=function(B,N,O){var A=B,M="";
var E=[],L=[];
if(O.indexOf("%20")>-1){O=O.replace("%20","+")
}if(B.indexOf("?")>-1){var J=B.split("?");
M=J[0]+"?";
A=J[1]
}var C=A.split("&");
for(var I=0;
I<C.length;
I++){var G=C[I].split("=");
var D=G[0];
if(E[D]!=undefined){if(E[D].length>0){E[D]+=","+G[1]
}}else{E[D]=G[1]
}}var K=0;
for(key in E){var P=E[key];
var F=0,H=[];
if(P.indexOf(",")>-1){var L=P.split(",");
for(var I=0;
I<L.length;
I++){if(key==N){if(L[I]!=O){H[F++]=L[I]
}}else{H[F++]=L[I]
}}E[key]=H.join()
}else{if(key==N){if(E[key]==O){E[key]=""
}}else{E[key]=P
}}K++
}var I=0;
for(var D in E){M+=D+"="+E[D];
if(I++<K-1){M+="&"
}}return M
};