var backgroundPage=chrome.extension.getBackgroundPage(),defaultTabId=parseInt(location.href.replace(/.*tabid=([0-9]*).*/,"$1"));function insertTabInfo(a){isNaN(defaultTabId)&&(defaultTabId=a.id);if(!uls[a.id]){var b=$("<ul>").appendTo($("#logs_items"));uls[a.id]=b;var c=a.title;c||(c="Tab "+a.id);$("<a>").attr("href","#").attr("tabid",a.id).text(c).click(function(a){loadTabInfo(parseInt($(a.target).attr("tabid")))}).appendTo(b)}}var uls={};
$(document).ready(function(){chrome.tabs.query({},function(a){for(var b=0;b<a.length;++b){var c=a[b].url.replace(/(^[^:]*).*/,"$1");"http"!=c&&"https"!=c&&"file"!=c||insertTabInfo(a[b])}for(b in backgroundPage.tabStatus)insertTabInfo({id:b});$("#tracking").change(function(){var a=backgroundPage.tabStatus[currentTab];a&&(a.tracking=tracking.checked)});loadTabInfo(defaultTabId)})});
$(document).ready(function(){$("#beforeSubmit").click(function(){var a=$("#submitLink");beforeSubmit.checked?a.show():a.hide()})});var currentTab=-1;function loadTabInfo(a){if(!isNaN(a)&&a!=currentTab){-1!=currentTab&&uls[currentTab].removeClass("selected");currentTab=a;uls[a].addClass("selected");var b=backgroundPage.generateLogFile(a);$("#text").val(b);tracking.checked=backgroundPage.tabStatus[a].tracking}};
