+var urlParams;
+(window.onpopstate = function () {
+ var match,
+ pl = /\+/g, // Regex for replacing addition symbol with a space
+ search = /([^&=]+)=?([^&]*)/g,
+ decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
+ query = window.location.search.substring(1);
+
+ urlParams = {};
+ while (match = search.exec(query))
+ urlParams[decode(match[1])] = decode(match[2]);
+})();
+
$(function() {
doLog = function(aTextToLog, type){
$('[data-toggle].icon-check-empty').each(function(){
$(this).trigger('uncheck');
});
+
+ initial_enabled_toggles = {};
+ if (typeof(urlParams.q) == 'string') {
+ urlParams.q.split('|').forEach(function(a) { initial_enabled_toggles[a] = 1; })
+ }
+ $('[data-toggle]').each(function() {
+ if ($(this).data('toggle').substring(1) in initial_enabled_toggles) {
+ $(this).trigger('click');
+ }
+ });
+
if ($('input#id_q').val() == '') {
$('input#id_q').focus();
}