<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,3 @@
-project=tombloo
-mccoy=C:/ols/Development/mccoy-0.5.xuluwarrior.en-US.win32/mccoy.exe
-key=to
+project=tombloo
+mccoy=C:/ols/Development/mccoy-0.5.xuluwarrior.en-US.win32/mccoy.exe
+key=to</diff>
      <filename>build.sample.properties</filename>
    </modified>
    <modified>
      <diff>@@ -1,69 +1,69 @@
-&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
-&lt;project name=&quot;xpi&quot; default=&quot;build&quot;&gt;
-	&lt;property file=&quot;build.properties&quot; /&gt;
-	
-	&lt;target name=&quot;build&quot;&gt;
-		&lt;xmlproperty file=&quot;./xpi/install.rdf&quot; collapseAttributes=&quot;true&quot; /&gt;
-		&lt;delete dir=&quot;dest/build&quot; /&gt;
-		&lt;delete file=&quot;dest/${project}.xpi&quot; /&gt;
-		
-		&lt;mkdir dir=&quot;dest/build&quot; /&gt;
-		
-		&lt;copy todir=&quot;dest/build&quot;&gt;
-			&lt;fileset dir=&quot;./xpi&quot;&gt;
-				&lt;include name=&quot;**/**&quot; /&gt;
-				
-				&lt;exclude name=&quot;chrome/content/test/**&quot; /&gt;
-				&lt;exclude name=&quot;chrome/content/work/**&quot; /&gt;
-			&lt;/fileset&gt;
-		&lt;/copy&gt;
-		
-		&lt;zip destfile=&quot;dest/${project}.xpi&quot; basedir=&quot;dest/build&quot; /&gt;
-		
-		&lt;delete dir=&quot;dest/build&quot; /&gt;
-	&lt;/target&gt;
-	
-	&lt;target name=&quot;release&quot; depends=&quot;build&quot; &gt;
-		&lt;delete file=&quot;${project}.xpi&quot; /&gt;
-		&lt;delete file=&quot;update.rdf&quot; /&gt;
-		
-		&lt;checksum file=&quot;dest/${project}.xpi&quot; algorithm=&quot;SHA-512&quot; property=&quot;hash&quot; /&gt;
-		&lt;echo file=&quot;update.rdf&quot; &gt;&lt;![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
-&lt;RDF xmlns=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; 
-     xmlns:em=&quot;http://www.mozilla.org/2004/em-rdf#&quot;&gt;
-	&lt;Description about=&quot;urn:mozilla:extension:${RDF.Description.em:id}&quot;&gt;
-		&lt;em:updates&gt;
-			&lt;Seq&gt;
-				&lt;li&gt;
-					&lt;Description&gt;
-						&lt;em:version&gt;${RDF.Description.em:version}&lt;/em:version&gt;
-						&lt;em:targetApplication&gt;
-							&lt;Description&gt;
-								&lt;em:id&gt;${RDF.Description.em:targetApplication.Description.em:id}&lt;/em:id&gt;
-								&lt;em:minVersion&gt;${RDF.Description.em:targetApplication.Description.em:minVersion}&lt;/em:minVersion&gt;
-								&lt;em:maxVersion&gt;${RDF.Description.em:targetApplication.Description.em:maxVersion}&lt;/em:maxVersion&gt;
-								&lt;em:updateLink&gt;${RDF.Description.em:updateURL}&lt;/em:updateLink&gt;
-								&lt;em:updateHash&gt;sha512:${hash}&lt;/em:updateHash&gt;
-							&lt;/Description&gt;
-						&lt;/em:targetApplication&gt;
-					&lt;/Description&gt;
-				&lt;/li&gt;
-			&lt;/Seq&gt;
-		&lt;/em:updates&gt;
-	&lt;/Description&gt;
-&lt;/RDF&gt;]]&gt;&lt;/echo&gt;
-		&lt;replace file=&quot;update.rdf&quot; token=&quot;update.rdf&quot; value=&quot;${project}.xpi&quot; /&gt;
-		
-		&lt;property name=&quot;update.rdf&quot; location=&quot;update.rdf&quot;/&gt;
-		&lt;exec executable=&quot;${mccoy}&quot;&gt;
-			&lt;arg value=&quot;-command&quot;/&gt;
-			&lt;arg value=&quot;update&quot;/&gt;
-			&lt;arg value=&quot;-key&quot;/&gt;
-			&lt;arg value=&quot;${key}&quot;/&gt;
-			&lt;arg value=&quot;-updateRDF&quot;/&gt;
-			&lt;arg value=&quot;${update.rdf}&quot;/&gt;
-		&lt;/exec&gt;
-		
-		&lt;copy file=&quot;dest/${project}.xpi&quot; todir=&quot;.&quot; /&gt;
-	&lt;/target&gt;
-&lt;/project&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;project name=&quot;xpi&quot; default=&quot;build&quot;&gt;
+	&lt;property file=&quot;build.properties&quot; /&gt;
+	
+	&lt;target name=&quot;build&quot;&gt;
+		&lt;xmlproperty file=&quot;./xpi/install.rdf&quot; collapseAttributes=&quot;true&quot; /&gt;
+		&lt;delete dir=&quot;dest/build&quot; /&gt;
+		&lt;delete file=&quot;dest/${project}.xpi&quot; /&gt;
+		
+		&lt;mkdir dir=&quot;dest/build&quot; /&gt;
+		
+		&lt;copy todir=&quot;dest/build&quot;&gt;
+			&lt;fileset dir=&quot;./xpi&quot;&gt;
+				&lt;include name=&quot;**/**&quot; /&gt;
+				
+				&lt;exclude name=&quot;chrome/content/test/**&quot; /&gt;
+				&lt;exclude name=&quot;chrome/content/work/**&quot; /&gt;
+			&lt;/fileset&gt;
+		&lt;/copy&gt;
+		
+		&lt;zip destfile=&quot;dest/${project}.xpi&quot; basedir=&quot;dest/build&quot; /&gt;
+		
+		&lt;delete dir=&quot;dest/build&quot; /&gt;
+	&lt;/target&gt;
+	
+	&lt;target name=&quot;release&quot; depends=&quot;build&quot; &gt;
+		&lt;delete file=&quot;${project}.xpi&quot; /&gt;
+		&lt;delete file=&quot;update.rdf&quot; /&gt;
+		
+		&lt;checksum file=&quot;dest/${project}.xpi&quot; algorithm=&quot;SHA-512&quot; property=&quot;hash&quot; /&gt;
+		&lt;echo file=&quot;update.rdf&quot; &gt;&lt;![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;RDF xmlns=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; 
+     xmlns:em=&quot;http://www.mozilla.org/2004/em-rdf#&quot;&gt;
+	&lt;Description about=&quot;urn:mozilla:extension:${RDF.Description.em:id}&quot;&gt;
+		&lt;em:updates&gt;
+			&lt;Seq&gt;
+				&lt;li&gt;
+					&lt;Description&gt;
+						&lt;em:version&gt;${RDF.Description.em:version}&lt;/em:version&gt;
+						&lt;em:targetApplication&gt;
+							&lt;Description&gt;
+								&lt;em:id&gt;${RDF.Description.em:targetApplication.Description.em:id}&lt;/em:id&gt;
+								&lt;em:minVersion&gt;${RDF.Description.em:targetApplication.Description.em:minVersion}&lt;/em:minVersion&gt;
+								&lt;em:maxVersion&gt;${RDF.Description.em:targetApplication.Description.em:maxVersion}&lt;/em:maxVersion&gt;
+								&lt;em:updateLink&gt;${RDF.Description.em:updateURL}&lt;/em:updateLink&gt;
+								&lt;em:updateHash&gt;sha512:${hash}&lt;/em:updateHash&gt;
+							&lt;/Description&gt;
+						&lt;/em:targetApplication&gt;
+					&lt;/Description&gt;
+				&lt;/li&gt;
+			&lt;/Seq&gt;
+		&lt;/em:updates&gt;
+	&lt;/Description&gt;
+&lt;/RDF&gt;]]&gt;&lt;/echo&gt;
+		&lt;replace file=&quot;update.rdf&quot; token=&quot;update.rdf&quot; value=&quot;${project}.xpi&quot; /&gt;
+		
+		&lt;property name=&quot;update.rdf&quot; location=&quot;update.rdf&quot;/&gt;
+		&lt;exec executable=&quot;${mccoy}&quot;&gt;
+			&lt;arg value=&quot;-command&quot;/&gt;
+			&lt;arg value=&quot;update&quot;/&gt;
+			&lt;arg value=&quot;-key&quot;/&gt;
+			&lt;arg value=&quot;${key}&quot;/&gt;
+			&lt;arg value=&quot;-updateRDF&quot;/&gt;
+			&lt;arg value=&quot;${update.rdf}&quot;/&gt;
+		&lt;/exec&gt;
+		
+		&lt;copy file=&quot;dest/${project}.xpi&quot; todir=&quot;.&quot; /&gt;
+	&lt;/target&gt;
+&lt;/project&gt;</diff>
      <filename>build.xml</filename>
    </modified>
    <modified>
      <filename>tombloo@brasil.to</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
-content  tombloo  chrome/content/
-skin     tombloo  classic  chrome/skin/
-overlay  chrome://browser/content/browser.xul  chrome://tombloo/content/browser.xul
-
-locale   tombloo  en-US  chrome/locale/en-US/
-locale   tombloo  ja-JP  chrome/locale/ja-JP/
+content  tombloo  chrome/content/
+skin     tombloo  classic  chrome/skin/
+overlay  chrome://browser/content/browser.xul  chrome://tombloo/content/browser.xul
+
+locale   tombloo  en-US  chrome/locale/en-US/
+locale   tombloo  ja-JP  chrome/locale/ja-JP/</diff>
      <filename>xpi/chrome.manifest</filename>
    </modified>
    <modified>
      <diff>@@ -1,77 +1,77 @@
-&lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;?xml-stylesheet href=&quot;chrome://global/skin/&quot; type=&quot;text/css&quot;?&gt; 
-&lt;?xml-stylesheet href=&quot;chrome://mozapps/skin/extensions/about.css&quot; type=&quot;text/css&quot;?&gt; 
-&lt;?xml-stylesheet href=&quot;data:text/css,
-.famfamfam {
-	margin  : 0;
-	padding : 0;
-	cursor  : pointer;
-}
-.sectionTitle {
-  margin-top: 10px;
-}
-&quot; type=&quot;text/css&quot;?&gt;
-
-&lt;!DOCTYPE dialog SYSTEM &quot;chrome://mozapps/locale/extensions/about.dtd&quot;&gt;
-
-&lt;dialog 
-	id=&quot;genericAbout&quot;
-	xmlns:html=&quot;http://www.w3.org/1999/xhtml&quot; 
-	xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;
-	buttons=&quot;accept&quot; onload=&quot;init();&quot; onaccept=&quot;close();&quot;&gt;
-
-	&lt;script type=&quot;application/javascript&quot; src=&quot;chrome://global/content/contentAreaUtils.js&quot;/&gt;
-	
-	&lt;stringbundleset id=&quot;aboutSet&quot;&gt;
-		&lt;stringbundle id=&quot;extensionsStrings&quot; src=&quot;chrome://mozapps/locale/extensions/extensions.properties&quot;/&gt;
-	&lt;/stringbundleset&gt;
-
-	&lt;vbox id=&quot;clientBox&quot; flex=&quot;1&quot;&gt;
-		&lt;label value=&quot;Tombloo&quot; 
-			id=&quot;extensionName&quot; 
-			onclick=&quot;openURL('http://code.google.com/p/tombloo/')&quot; 
-			class=&quot;text-link&quot; /&gt;
-		
-		&lt;label class=&quot;sectionTitle&quot;&gt;&amp;creator.label;&lt;/label&gt;
-		&lt;vbox class=&quot;boxIndent&quot; &gt;
-			&lt;label value=&quot;to&quot; 
-				onclick=&quot;openURL('http://github.com/to')&quot; 
-				class=&quot;text-link&quot; /&gt;
-		&lt;/vbox&gt;
-			
-		&lt;label class=&quot;sectionTitle&quot;&gt;&amp;contributors.label;&lt;/label&gt;
-		&lt;vbox class=&quot;boxIndent&quot;&gt;
-			&lt;label value=&quot;ku&quot;/&gt;
-			&lt;label value=&quot;mattn&quot;/&gt;
-			&lt;label value=&quot;youpy&quot; class=&quot;text-link&quot; onclick=&quot;openURL('http://github.com/youpy')&quot; /&gt;
-			&lt;label value=&quot;cxx&quot;/&gt;
-			&lt;label value=&quot;Constellation&quot; class=&quot;text-link&quot; onclick=&quot;openURL('http://d.hatena.ne.jp/Constellation/')&quot; /&gt;
-		&lt;/vbox&gt;
-			
-		&lt;label class=&quot;sectionTitle&quot;&gt;&lt;/label&gt;
-		&lt;vbox class=&quot;boxIndent&quot;&gt;
-			&lt;description&gt;
-				Icons provided under the Creative Commons Attribution 2.5 License by 
-				&lt;hbox onclick=&quot;openURL('http://www.famfamfam.com/')&quot; &gt;
-					&lt;label class=&quot;famfamfam&quot; style=&quot;color:#FF085A;&quot;&gt;FAM&lt;/label&gt;
-					&lt;label class=&quot;famfamfam&quot; style=&quot;color:#10D3FF;&quot;&gt;FAM&lt;/label&gt;
-					&lt;label class=&quot;famfamfam&quot; style=&quot;color:#C6FF31;&quot;&gt;FAM&lt;/label&gt;
-				&lt;/hbox&gt;
-			&lt;/description&gt;
-		&lt;/vbox&gt;
-	&lt;/vbox&gt;
-		
-	&lt;separator id=&quot;groove&quot; class=&quot;groove&quot;/&gt;
-	&lt;script&gt;&lt;![CDATA[
-	// chrome://tombloo/content/about.xul
-	function init(){
-		var bundle = document.getElementById('extensionsStrings');
-		var button = document.documentElement.getButton('accept');
-		button.label = bundle.getString('aboutWindowCloseButton');
-	}
-	function openURL(url) {
-		window.opener.openURL(url);
-	}
-	]]&gt;&lt;/script&gt;
-
-&lt;/dialog&gt;
+&lt;?xml version=&quot;1.0&quot;?&gt;
+&lt;?xml-stylesheet href=&quot;chrome://global/skin/&quot; type=&quot;text/css&quot;?&gt; 
+&lt;?xml-stylesheet href=&quot;chrome://mozapps/skin/extensions/about.css&quot; type=&quot;text/css&quot;?&gt; 
+&lt;?xml-stylesheet href=&quot;data:text/css,
+.famfamfam {
+	margin  : 0;
+	padding : 0;
+	cursor  : pointer;
+}
+.sectionTitle {
+  margin-top: 10px;
+}
+&quot; type=&quot;text/css&quot;?&gt;
+
+&lt;!DOCTYPE dialog SYSTEM &quot;chrome://mozapps/locale/extensions/about.dtd&quot;&gt;
+
+&lt;dialog 
+	id=&quot;genericAbout&quot;
+	xmlns:html=&quot;http://www.w3.org/1999/xhtml&quot; 
+	xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;
+	buttons=&quot;accept&quot; onload=&quot;init();&quot; onaccept=&quot;close();&quot;&gt;
+
+	&lt;script type=&quot;application/javascript&quot; src=&quot;chrome://global/content/contentAreaUtils.js&quot;/&gt;
+	
+	&lt;stringbundleset id=&quot;aboutSet&quot;&gt;
+		&lt;stringbundle id=&quot;extensionsStrings&quot; src=&quot;chrome://mozapps/locale/extensions/extensions.properties&quot;/&gt;
+	&lt;/stringbundleset&gt;
+
+	&lt;vbox id=&quot;clientBox&quot; flex=&quot;1&quot;&gt;
+		&lt;label value=&quot;Tombloo&quot; 
+			id=&quot;extensionName&quot; 
+			onclick=&quot;openURL('http://code.google.com/p/tombloo/')&quot; 
+			class=&quot;text-link&quot; /&gt;
+		
+		&lt;label class=&quot;sectionTitle&quot;&gt;&amp;creator.label;&lt;/label&gt;
+		&lt;vbox class=&quot;boxIndent&quot; &gt;
+			&lt;label value=&quot;to&quot; 
+				onclick=&quot;openURL('http://github.com/to')&quot; 
+				class=&quot;text-link&quot; /&gt;
+		&lt;/vbox&gt;
+			
+		&lt;label class=&quot;sectionTitle&quot;&gt;&amp;contributors.label;&lt;/label&gt;
+		&lt;vbox class=&quot;boxIndent&quot;&gt;
+			&lt;label value=&quot;ku&quot;/&gt;
+			&lt;label value=&quot;mattn&quot;/&gt;
+			&lt;label value=&quot;youpy&quot; class=&quot;text-link&quot; onclick=&quot;openURL('http://github.com/youpy')&quot; /&gt;
+			&lt;label value=&quot;cxx&quot;/&gt;
+			&lt;label value=&quot;Constellation&quot; class=&quot;text-link&quot; onclick=&quot;openURL('http://d.hatena.ne.jp/Constellation/')&quot; /&gt;
+		&lt;/vbox&gt;
+			
+		&lt;label class=&quot;sectionTitle&quot;&gt;&lt;/label&gt;
+		&lt;vbox class=&quot;boxIndent&quot;&gt;
+			&lt;description&gt;
+				Icons provided under the Creative Commons Attribution 2.5 License by 
+				&lt;hbox onclick=&quot;openURL('http://www.famfamfam.com/')&quot; &gt;
+					&lt;label class=&quot;famfamfam&quot; style=&quot;color:#FF085A;&quot;&gt;FAM&lt;/label&gt;
+					&lt;label class=&quot;famfamfam&quot; style=&quot;color:#10D3FF;&quot;&gt;FAM&lt;/label&gt;
+					&lt;label class=&quot;famfamfam&quot; style=&quot;color:#C6FF31;&quot;&gt;FAM&lt;/label&gt;
+				&lt;/hbox&gt;
+			&lt;/description&gt;
+		&lt;/vbox&gt;
+	&lt;/vbox&gt;
+		
+	&lt;separator id=&quot;groove&quot; class=&quot;groove&quot;/&gt;
+	&lt;script&gt;&lt;![CDATA[
+	// chrome://tombloo/content/about.xul
+	function init(){
+		var bundle = document.getElementById('extensionsStrings');
+		var button = document.documentElement.getButton('accept');
+		button.label = bundle.getString('aboutWindowCloseButton');
+	}
+	function openURL(url) {
+		window.opener.openURL(url);
+	}
+	]]&gt;&lt;/script&gt;
+
+&lt;/dialog&gt;</diff>
      <filename>xpi/chrome/content/about.xul</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,35 @@
-&lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;overlay xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;&gt;
-	&lt;popup id=&quot;contentAreaContextMenu&quot;&gt;
-		&lt;menuitem 
-			class=&quot;menuitem-iconic&quot;
-			insertbefore=&quot;context-bookmarklink&quot; 
-			label=&quot;Share&quot; 
-			id=&quot;tombloo-menu-share&quot; 
-			accesskey=&quot;J&quot;/&gt;
-		&lt;menu 
-			class=&quot;menu-iconic&quot;
-			image=&quot;chrome://tombloo/skin/empty.png&quot;
-			insertbefore=&quot;context-bookmarklink&quot;
-			label=&quot;Share...&quot;&gt;
-			&lt;menupopup id=&quot;tombloo-menu-select&quot;/&gt;
-		&lt;/menu&gt;
-		&lt;menuseparator insertbefore=&quot;context-bookmarklink&quot; /&gt;
-	&lt;/popup&gt;
-	&lt;menupopup id=&quot;menu_ToolsPopup&quot;&gt;
-		&lt;menu label=&quot;Tombloo&quot; insertbefore=&quot;sanitizeSeparator&quot;&gt;
-			&lt;menupopup id=&quot;tombloo-menu-main&quot;/&gt;
-		&lt;/menu&gt;
-	&lt;/menupopup&gt;
-	&lt;script type=&quot;text/javascript; version=1.7&quot;&gt;&lt;![CDATA[
-	(function(){
-		var env = Cc['@brasil.to/tombloo-service;1'].getService().wrappedJSObject;
-		
-		env.signal(env, 'browser-open', window);
-		
-		window.addEventListener('load', function(e){
-			env.signal(env, 'browser-load', e);
-		}, false);
-	})();
-	]]&gt;&lt;/script&gt;
-&lt;/overlay&gt;
+&lt;?xml version=&quot;1.0&quot;?&gt;
+&lt;overlay xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;&gt;
+	&lt;popup id=&quot;contentAreaContextMenu&quot;&gt;
+		&lt;menuitem 
+			class=&quot;menuitem-iconic&quot;
+			insertbefore=&quot;context-bookmarklink&quot; 
+			label=&quot;Share&quot; 
+			id=&quot;tombloo-menu-share&quot; 
+			accesskey=&quot;J&quot;/&gt;
+		&lt;menu 
+			class=&quot;menu-iconic&quot;
+			image=&quot;chrome://tombloo/skin/empty.png&quot;
+			insertbefore=&quot;context-bookmarklink&quot;
+			label=&quot;Share...&quot;&gt;
+			&lt;menupopup id=&quot;tombloo-menu-select&quot;/&gt;
+		&lt;/menu&gt;
+		&lt;menuseparator insertbefore=&quot;context-bookmarklink&quot; /&gt;
+	&lt;/popup&gt;
+	&lt;menupopup id=&quot;menu_ToolsPopup&quot;&gt;
+		&lt;menu label=&quot;Tombloo&quot; insertbefore=&quot;sanitizeSeparator&quot;&gt;
+			&lt;menupopup id=&quot;tombloo-menu-main&quot;/&gt;
+		&lt;/menu&gt;
+	&lt;/menupopup&gt;
+	&lt;script type=&quot;text/javascript; version=1.7&quot;&gt;&lt;![CDATA[
+	(function(){
+		var env = Cc['@brasil.to/tombloo-service;1'].getService().wrappedJSObject;
+		
+		env.signal(env, 'browser-open', window);
+		
+		window.addEventListener('load', function(e){
+			env.signal(env, 'browser-load', e);
+		}, false);
+	})();
+	]]&gt;&lt;/script&gt;
+&lt;/overlay&gt;</diff>
      <filename>xpi/chrome/content/browser.xul</filename>
    </modified>
    <modified>
      <diff>@@ -1,555 +1,555 @@
-var XUL_NS  = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';
-var HTML_NS = 'http://www.w3.org/1999/xhtml';
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-
-var INTERFACES = [];
-for(var i in Ci)
-	INTERFACES.push(Ci[i]);
-
-if(typeof(update)=='undefined'){
-	function update(t, s){
-		for(var p in s)
-			t[p] = s[p];
-		return t;
-	}
-}
-
-var IWebProgressListener = Ci.nsIWebProgressListener;
-var IFile                = Ci.nsIFile;
-var ILocalFile           = Ci.nsILocalFile;
-var IURI                 = Ci.nsIURI;
-var IInputStream         = Ci.nsIInputStream;
-var ICache               = Ci.nsICache;
-var ISelectionListener   = Ci.nsISelectionListener;
-// var IAccessNode          = Ci.nsIAccessNode;
-
-
-// const AccessibilityService = getService('/accessibilityService;1', Ci.nsIAccessibilityService);
-var ExtensionManager    = getService('/extensions/manager;1', Ci.nsIExtensionManager);
-var StorageService      = getService('/storage/service;1', Ci.mozIStorageService);
-var DirectoryService    = getService('/file/directory_service;1', Ci.nsIProperties);
-var IOService           = getService('/network/io-service;1', Ci.nsIIOService);
-var AtomService         = getService('/atom-service;1', Ci.nsIAtomService);
-var ChromeRegistry      = getService('/chrome/chrome-registry;1', Ci.nsIXULChromeRegistry);
-var WindowMediator      = getService('/appshell/window-mediator;1', Ci.nsIWindowMediator);
-var ConsoleService      = getService('/consoleservice;1', Ci.nsIConsoleService);
-var AlertsService       = getService('/alerts-service;1', Ci.nsIAlertsService);
-var MIMEService         = getService('/uriloader/external-helper-app-service;1', Ci.nsIMIMEService);
-var PromptService       = getService('/embedcomp/prompt-service;1', Ci.nsIPromptService);
-var CacheService        = getService('/network/cache-service;1', Ci.nsICacheService);
-var AppShellService     = getService('/appshell/appShellService;1', Ci.nsIAppShellService);
-var DownloadManager     = getService('/download-manager;1', Ci.nsIDownloadManager);
-var AppInfo             = getService('/xre/app-info;1');
-var UnescapeHTML        = getService('/feed-unescapehtml;1', Ci.nsIScriptableUnescapeHTML);
-var CookieService       = getService('/cookieService;1', Ci.nsICookieService);
-var CookieManager       = getService('/cookiemanager;1', Ci.nsICookieManager);
-var PasswordManager     = getService('/passwordmanager;1', Ci.nsIPasswordManager);
-var LoginManager        = getService('/login-manager;1', Ci.nsILoginManager);
-var StringBundleService = getService('/intl/stringbundle;1', Ci.nsIStringBundleService);
-var NavBookmarksService = getService('/browser/nav-bookmarks-service;1', Ci.nsINavBookmarksService);
-var AnnotationService   = getService('/browser/annotation-service;1', Ci.nsIAnnotationService);
-var ObserverService     = getService('/observer-service;1', Ci.nsIObserverService);
-var WindowWatcher       = getService('/embedcomp/window-watcher;1', Ci.nsIWindowWatcher);
-var ClipboardHelper     = getService('/widget/clipboardhelper;1', Ci.nsIClipboardHelper);
-var NavHistoryService   = getService('/browser/nav-history-service;1', Ci.nsINavHistoryService);
-var FaviconService      = getService('/browser/favicon-service;1', Ci.nsIFaviconService);
-
-
-var PrefBranch = 
-	createConstructor('/preferences;1', 'nsIPrefBranch');
-
-var LocalFile = 
-	createConstructor('/file/local;1', 'nsILocalFile', 'initWithPath');
-
-var WebBrowserPersist = 
-	createConstructor('/embedding/browser/nsWebBrowserPersist;1', 'nsIWebBrowserPersist');
-
-var StorageStatementWrapper = 
-	createConstructor('/storage/statement-wrapper;1', 'mozIStorageStatementWrapper', 'initialize');
-
-var ScriptError = 
-	createConstructor('/scripterror;1', 'nsIScriptError', 'init');
-
-var Process = 
-	createConstructor('/process/util;1', 'nsIProcess', 'init');
-
-var FilePicker = 
-	createConstructor('/filepicker;1', 'nsIFilePicker', 'init');
-
-var InputStream = 
-	createConstructor('/scriptableinputstream;1', 'nsIScriptableInputStream', 'init');
-
-var BinaryInputStream = 
-	createConstructor('/binaryinputstream;1', 'nsIBinaryInputStream', 'setInputStream');
-
-var FileInputStream = 
-	createConstructor('/network/file-input-stream;1', 'nsIFileInputStream', 'init');
-
-var ConverterInputStream = 
-	createConstructor('/intl/converter-input-stream;1', 'nsIConverterInputStream', function(stream, charset, bufferSize){
-		this.init(stream, charset || 'UTF-8', bufferSize || 4096, ConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
-	});
-
-var MIMEInputStream = 
-	createConstructor('/network/mime-input-stream;1', 'nsIMIMEInputStream', function(stream){
-		this.addContentLength = true;
-		this.setData(stream);
-	});
-
-var BufferedInputStream = 
-	createConstructor('/network/buffered-input-stream;1', 'nsIBufferedInputStream', function(stream, bufferSize){
-		this.init(stream, bufferSize || 4096);
-	});
-
-var StringInputStream = 
-	createConstructor('/io/string-input-stream;1', 'nsIStringInputStream', function(str){
-		this.setData(str, str.length);
-	});
-
-var UnicodeConverter = 
-	createConstructor('/intl/scriptableunicodeconverter', 'nsIScriptableUnicodeConverter', function(charset){
-		this.charset = charset || 'UTF-8';
-	});
-
-var MultiplexInputStream = 
-	createConstructor('/io/multiplex-input-stream;1', 'nsIMultiplexInputStream', function(streams){
-		var self = this;
-		streams = streams || [];
-		streams.forEach(function(stream){
-			if(stream.join)
-				stream = stream.join('\r\n');
-			
-			if(typeof(stream)=='string')
-				stream = new StringInputStream(stream + '\r\n');
-				
-			self.appendStream(stream);
-		});
-	});
-
-var CryptoHash = 
-	createConstructor('/security/hash;1', 'nsICryptoHash', 'init');
-
-var FileOutputStream = 
-	update(createConstructor('/network/file-output-stream;1', 'nsIFileOutputStream', 'init'), {
-		PR_RDONLY : 0x01,
-		PR_WRONLY : 0x02,
-		PR_RDWR   : 0x04,
-		PR_CREATE_FILE : 0x08,
-		PR_APPEND : 0x10,
-		PR_TRUNCATE : 0x20,
-		PR_SYNC : 0x40,
-		PR_EXCL : 0x80,
-	});
-
-// ----[Utility]-------------------------------------------------
-function createMock(sample, proto){
-	var non = function(){};
-	sample = typeof(sample)=='object'? sample : Cc[sample].createInstance();
-	
-	var ifcs = getInterfaces(sample);
-	var Mock = function(){};
-	
-	for(var key in sample){
-		try{
-			var val = sample[key];
-			switch (typeof(val)){
-			case 'number':
-			case 'string':
-				Mock.prototype[key] = val;
-				continue;
-				
-			case 'function':
-				Mock.prototype[key] = non;
-				continue;
-			}
-		} catch(e){
-			// &#402;R&#402;&#8220;&#402;|*[&#402;l&#402;&#8220;&#402;g&#381;&#192;&#8216;&#8226;&#8218;&#201;&#8218;&#230;&#8218;&#232;&#8221;&#173;*&#182;&#8218;&#183;&#8218;&#233;&#402;v&#402;*&#402;p&#402;e&#402;B&#381;&#230;&#8220;&#190;&#402;G&#402;&#8240;*[&#8218;&#240;&#8211;&#179;&#381;&#8249;&#8218;&#183;&#8218;&#233;
-		}
-	}
-	
-	Mock.prototype.QueryInterface = createQueryInterface(ifcs);
-	
-	update(Mock.prototype, proto);
-	update(Mock, Mock.prototype);
-	
-	return Mock;
-}
-
-function createQueryInterface(ifcNames){
-	var ifcs = ['nsISupports'].concat(ifcNames).map(function(ifcName){
-		return Ci[''+ifcName];
-	});
-	
-	return function(iid){
-		if(ifcs.some(function(ifc){
-			return iid.equals(ifc);
-		})){
-			return this;
-		}
-		
-		throw Components.results.NS_NOINTERFACE;
-	}
-}
-
-/**
- * XPCOM&#8218;&#204;&#402;R&#402;&#8220;&#402;X&#402;g&#402;&#8240;&#402;N&#402;^&#8218;&#240;*&#182;*&#172;&#8218;&#183;&#8218;&#233;*B
- * &#402;R&#402;&#8220;&#402;X&#402;g&#402;&#8240;&#402;N&#402;^&#8218;&#205;&#381;w&#8217;&#232;&#8218;&#179;&#8218;&#234;&#8218;&#189;&#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F*[&#402;X&#8218;&#204;&#8217;&#232;*&#8221;&#8218;&#240;&#8216;S&#8218;&#196;&#381;*&#8218;&#194;*B
- *
- * @param {String} clsName &#402;N&#402;&#8240;&#402;X&#8211;&#188;(@mozilla.org&#710;&#200;*~&#8218;&#240;&#381;w&#8217;&#232;&#8218;&#183;&#8218;&#233;)*B
- * @param {String || nsIJSID} ifc &#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F&#402;C&#402;X*B
- * @param {String || Function} init 
- *        *&#8240;&#352;&#250;&#8240;&#187;&#352;&#214;*&#8221;*B
- *        &#8226;&#182;&#381;&#353;&#8212;&#241;&#8218;&#204;*&#234;*&#8225;*A&#352;Y&#8220;&#8211;&#8218;&#183;&#8218;&#233;&#402;*&#402;\&#402;b&#402;h&#8218;&#170;&#338;&#196;&#8218;&#209;*o&#8218;&#179;&#8218;&#234;&#8218;&#233;*B
- *        &#352;&#214;*&#8221;&#8218;&#204;*&#234;*&#8225;*A*&#182;*&#172;&#8218;&#179;&#8218;&#234;&#8218;&#189;&#402;C&#402;&#8220;&#402;X&#402;^&#402;&#8220;&#402;X&#8218;&#240;this&#8218;&#198;&#8218;&#181;&#8218;&#196;&#338;&#196;&#8218;&#209;*o&#8218;&#179;&#8218;&#234;&#8218;&#233;*B
- */
-function createConstructor(clsName, ifc, init){
-	var cls = Components.classes['@mozilla.org' + clsName];
-	ifc = typeof(ifc)=='string'? Components.interfaces[ifc] : ifc;
-	
-	var cons = function(){
-		var obj = cls.createInstance(ifc);
-		if(init){
-			if(typeof(init)=='string'){
-				obj[init].apply(obj, arguments);
-			} else {
-				init.apply(obj, arguments);
-			}
-		}
-		return obj;
-	};
-	
-	cons.instanceOf = function(obj){
-		return (obj instanceof ifc);
-	};
-	
-	for(var prop in ifc)
-		cons[prop] = ifc[prop];
-	
-	return cons;
-}
-
-/**
- * XPCOM&#402;T*[&#402;r&#402;X&#8218;&#240;&#381;&#230;&#8220;&#190;&#8218;&#183;&#8218;&#233;*B
- * &#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F*[&#402;X&#8218;&#170;&#381;w&#8217;&#232;&#8218;&#179;&#8218;&#234;&#8218;&#200;&#8218;&#162;*&#234;*&#8225;*A&#8212;&#732;&#8212;p&#8218;&#197;&#8218;&#171;&#8218;&#233;&#8216;S&#8218;&#196;&#8218;&#204;&#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F*[&#402;X&#8218;&#201;&#352;g&#8218;&#176;&#8218;&#231;&#8218;&#234;&#8218;&#233;*B
- *
- * @param {String} clsName &#402;N&#402;&#8240;&#402;X&#8211;&#188;(@mozilla.org&#710;&#200;*~&#8218;&#240;&#381;w&#8217;&#232;&#8218;&#183;&#8218;&#233;)*B
- * @param {nsIJSID} ifc &#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F&#402;C&#402;X*B
- */
-function getService(clsName, ifc){
-	try{
-		var cls = Components.classes['@mozilla.org' + clsName];
-		return !cls? null : 
-			ifc? cls.getService(ifc) : broad(cls.getService());
-	} catch(e) {
-		return null;
-	}
-}
-
-/**
- * XPCOM&#402;C&#402;&#8220;&#402;X&#402;^&#402;&#8220;&#402;X&#8218;&#204;&#381;&#192;&#8216;&#8226;&#8218;&#181;&#8218;&#196;&#8218;&#162;&#8218;&#233;&#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F*[&#402;X&#710;&#234;&#8212;&#8212;&#8218;&#240;&#381;&#230;&#8220;&#190;&#8218;&#183;&#8218;&#233;*B
- *
- * @param {Object} obj XPCOM&#402;C&#402;&#8220;&#402;X&#402;^&#402;&#8220;&#402;X*B
- * @return {Array} &#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F*[&#402;X&#8218;&#204;&#402;&#352;&#402;X&#402;g*B
- */
-function getInterfaces(obj){
-	var result = [];
-	
-	for(var i=0,len=INTERFACES.length ; i&lt;len ; i++){
-		var ifc = INTERFACES[i];
-		if(obj instanceof ifc)
-			result.push(ifc);
-	}
-	
-	return result;
-}
-
-/**
- * XPCOM&#402;C&#402;&#8220;&#402;X&#402;^&#402;&#8220;&#402;X&#8218;&#204;&#381;&#192;&#8216;&#8226;&#8218;&#181;&#8218;&#196;&#8218;&#162;&#8218;&#233;&#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F*[&#402;X&#8218;&#240;&#8216;S&#8218;&#196;&#8212;&#732;&#8212;p&#8218;&#197;&#8218;&#171;&#8218;&#233;&#8218;&#230;&#8218;&#164;&#8218;&#201;&#8218;&#183;&#8218;&#233;*B
- * &#402;p&#402;t&#402;H*[&#402;}&#402;&#8220;&#402;X&#8218;&#201;&#8217;*&#710;&#211;&#8218;&#183;&#8218;&#233;&#8240;&#211;*&#352;&#8218;&#197;&#8218;&#205;*A&#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F*[&#402;X&#8218;&#204;&#402;&#352;&#402;X&#402;g&#8218;&#240;&#8220;n&#8218;&#181;&#338;&#376;*&#184;&#8221;&#205;&#710;&#205;&#8218;&#240;&#338;&#192;&#8217;&#232;&#8218;&#181;&#8218;&#196;&#381;g&#8218;&#164;*B
- *
- * @param {Object} obj XPCOM&#402;C&#402;&#8220;&#402;X&#402;^&#402;&#8220;&#402;X*B
- * @param {optional Array} ifcs &#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F*[&#402;X&#8218;&#204;&#402;&#352;&#402;X&#402;g*B&#381;w&#8217;&#232;&#8218;&#179;&#8218;&#234;&#8218;&#200;&#8218;&#162;*&#234;*&#8225;*A&#8216;S&#402;C&#402;&#8220;&#402;^*[&#402;t&#402;F&#402;C&#402;X&#8218;&#170;&#338;&#376;*&#184;&#8218;&#179;&#8218;&#234;&#8218;&#233;*B
- */
-function broad(obj, ifcs){
-	ifcs = ifcs || INTERFACES;
-	for(var i=0,len=ifcs.length ; i&lt;len ; i++)
-		if(obj instanceof ifcs[i]);
-	return obj;
-};
-
-/**
- * &#8217;&#202;&#8217;m&#402;o&#402;u&#402;&#8249;&#8218;&#240;&#8226;\&#381;&#166;&#8218;&#183;&#8218;&#233;*B
- * *&#710;&#8212;*&#352;&#174;&#8212;&#185;&#8218;&#226;&#402;G&#402;&#8240;*[&#8218;&#200;&#8218;&#199;&#8218;&#240;&#8217;&#202;&#8217;m&#8218;&#183;&#8218;&#233;&#8218;&#189;&#8218;&#223;&#8218;&#201;&#8212;p&#8218;&#162;&#8218;&#233;*B
- * Mac&#8218;&#204;Firefox 3&#8218;&#197;&#8218;&#205;Growl&#8218;&#201;&#8218;&#200;&#8218;&#233;*B
- *
- * @param {String} title &#402;^&#402;C&#402;g&#402;&#8249;*B
- * @param {String} msg &#402;*&#402;b&#402;Z*[&#402;W*B
- * @param {String} icon &#402;A&#402;C&#402;R&#402;&#8220;&#381;&#237;&#8212;&#222;*B&#8217;&#232;*&#8221;&#8218;&#204;&#8217;&#8224;&#8218;&#169;&#8218;&#231;&#8216;I&#8216;&#240;&#8218;&#183;&#8218;&#233;&#8218;&#169;*A&#8220;&#198;&#381;&#169;&#8218;&#204;URL&#8218;&#240;&#8220;n&#8218;&#183;*B
- */
-function notify(title, msg, icon){
-	AlertsService &amp;&amp; AlertsService.showAlertNotification(
-		icon, title, msg, 
-		false, '', null);
-}
-notify.ICON_DOWNLOAD = 'chrome://mozapps/skin/downloads/downloadIcon.png';
-notify.ICON_INFO     = 'chrome://global/skin/console/bullet-question.png';
-notify.ICON_ERROR    = 'chrome://global/skin/console/bullet-error.png';
-notify.ICON_WORN     = 'chrome://global/skin/console/bullet-warning.png';
-
-/*
-function getElementByPosition(x, y){
-	return AccessibilityService.
-		getAccessibleFor(currentDocument()).
-		getChildAtPoint(x, y).
-		QueryInterface(IAccessNode).
-		DOMNode;
-}
-*/
-
-function convertFromUnplaceableHTML(str){
-	var arr = [];
-	for(var i=0,len=str.length ; i&lt;len ;i++)
-		arr.push(str.charCodeAt(i));
-	return convertFromByteArray(arr, str.match('charset=([^&quot;; ]+)'));
-}
-
-function convertFromByteArray(arr, charset){
-	return new UnicodeConverter(charset).convertFromByteArray(text);
-}
-
-/**
- * URI&#8218;&#240;*&#182;*&#172;&#8218;&#183;&#8218;&#233;*B
- *
- * @param {String || nsIFile || nsIURI} path URL&#8218;&#220;&#8218;&#189;&#8218;&#205;&#402;t&#402;@&#402;C&#402;&#8249;*BnsIURI&#8218;&#204;*&#234;*&#8225;*A&#8218;&#187;&#8218;&#204;&#8218;&#220;&#8218;&#220;&#8226;&#212;&#8218;&#183;*B
- */
-function createURI(path){
-	if(path instanceof IURI)
-		return path;
-	
-	try{
-		var path = (path instanceof IFile) ? path : new LocalFile(path);
-		return IOService.newFileURI(path)	;
-	}catch(e if e.name=='NS_ERROR_FILE_UNRECOGNIZED_PATH'){	}
-	return IOService.newURI(path, null, null);
-}
-
-/**
- * &#402;t&#402;@&#402;C&#402;&#8249;&#8218;&#240;&#381;&#230;&#8220;&#190;&#8218;&#183;&#8218;&#233;*B
- *
- * @param {String || nsIFile || nsIURI} uri 
- *        URI*Bfile:&#8218;&#220;&#8218;&#189;&#8218;&#205;chrome:&#8218;&#169;&#8218;&#231;&#381;n&#8218;&#220;&#8218;&#233;&#402;A&#402;h&#402;&#338;&#402;X&#8218;&#240;&#381;w&#8217;&#232;&#8218;&#183;&#8218;&#233;*B
- *        nsIFile&#8218;&#204;*&#234;*&#8225;*A&#8218;&#187;&#8218;&#204;&#8218;&#220;&#8218;&#220;&#8226;&#212;&#8218;&#183;*B
- */
-function getLocalFile(uri){
-	if(uri instanceof ILocalFile)
-		return uri;
-	
-	uri = createURI(uri);
-	if(uri.scheme=='chrome')
-		uri = ChromeRegistry.convertChromeURL(uri);
-	
-	if(uri.scheme!='file')
-		return;
-	
-	return IOService.getProtocolHandler('file').
-		QueryInterface(Ci.nsIFileProtocolHandler).
-		getFileFromURLSpec(uri.spec).
-		QueryInterface(ILocalFile);
-}
-
-/**
- * &#352;g&#8217;&#163;&#8218;&#204;&#402;C&#402;&#8220;&#402;X&#402;g*[&#402;&#8249;&#8218;&#179;&#8218;&#234;&#8218;&#196;&#8218;&#162;&#8218;&#233;&#402;f&#402;B&#402;&#338;&#402;N&#402;g&#402;&#352;&#8218;&#240;&#381;&#230;&#8220;&#190;&#8218;&#183;&#8218;&#233;*B
- *
- * @param {String} id &#352;g&#8217;&#163;ID*B 
- */
-function getExtensionDir(id){
-	return ExtensionManager.
-		getInstallLocation(id).
-		getItemLocation(id).QueryInterface(ILocalFile);
-}
-
-function getPrefType(key){
-	with(PrefBranch()){
-		switch(getPrefType(key)){
-			case PREF_STRING:
-				return 'string';
-			case PREF_BOOL:
-				return 'boolean';
-			case PREF_INT:
-				return 'number';
-			case PREF_INVALID:
-				return 'undefined';
-		}
-	}
-}
-
-function setPrefValue(){
-	var value = Array.pop(arguments);
-	var key = Array.join(arguments, '');
-	
-	var prefType = getPrefType(key);
-	with(PrefBranch()){
-		switch(prefType!='undefined'? prefType : typeof(value)){
-			case 'string':
-				return setCharPref(key, unescape(encodeURIComponent(value)));
-			case 'boolean':
-				return setBoolPref(key, value);
-			case 'number':
-				return setIntPref(key, value);
-		}
-	}
-}
-
-function getPrefValue(){
-	var key = Array.join(arguments, '');
-	
-	with(PrefBranch()){
-		switch(getPrefType(key)){
-			case PREF_STRING:
-				return decodeURIComponent(escape(getCharPref(key)));
-			case PREF_BOOL:
-				return getBoolPref(key);
-			case PREF_INT:
-				return getIntPref(key);
-		}
-	}
-}
-
-/**
- * &#402;&#8224;*[&#402;U&#8218;&#170;&#8217;&#202;*&#237;&#8212;&#732;&#8212;p&#8218;&#181;&#8218;&#196;&#8218;&#162;&#8218;&#233;&#402;_&#402;E&#402;&#8220;&#402;**[&#402;h&#402;f&#402;B&#402;&#338;&#402;N&#402;g&#402;&#352;&#8218;&#240;&#381;&#230;&#8220;&#190;&#8218;&#183;&#8218;&#233;*B
- * Firefox&#402;I&#402;v&#402;V&#402;&#8225;&#402;&#8220;&#8218;&#197;&#381;w&#8217;&#232;&#8218;&#181;&#8218;&#189;&#402;f&#402;B&#402;&#338;&#402;N&#402;g&#402;&#352;*A&#8218;&#220;&#8218;&#189;&#8218;&#205;*A*&#197;&#338;&#227;&#8218;&#201;&#402;_&#402;E&#402;&#8220;&#402;**[&#402;h&#8218;&#181;&#8218;&#189;&#402;f&#402;B&#402;&#338;&#402;N&#402;g&#402;&#352;&#8218;&#201;&#8218;&#200;&#8218;&#233;*B
- */
-function getDownloadDir(){
-	try {
-		var dir = new LocalFile(getPrefValue('browser.download.dir') || getPrefValue('browser.download.lastDir'));
-		if(dir.exists())
-			return dir
-	} catch(e) {}
-	
-	return DownloadManager.userDownloadsDirectory;
-}
-
-/**
- * &#338;&#187;*&#221;&#8212;&#732;&#8212;p&#8218;&#181;&#8218;&#196;&#8218;&#162;&#8218;&#233;&#402;v&#402;*&#402;t&#402;@&#402;C&#402;&#8249;&#402;f&#402;B&#402;&#338;&#402;N&#402;g&#402;&#352;&#8218;&#240;&#381;&#230;&#8220;&#190;&#8218;&#183;&#8218;&#233;*B
- */
-function getProfileDir(){
-	return DirectoryService.get('ProfD', IFile);
-}
-
-/**
- * &#402;e&#402;&#8220;&#402;|&#402;&#8240;&#402;&#352;&#402;f&#402;B&#402;&#338;&#402;N&#402;g&#402;&#352;&#8218;&#240;&#381;&#230;&#8220;&#190;&#8218;&#183;&#8218;&#233;*B
- */
-function getTempDir(){
-	return DirectoryService.get('TmpD', IFile);
-}
-
-/**
- * &#352;O&#8226;&#8221;&#402;G&#402;f&#402;B&#402;^&#8218;&#197;&#402;t&#402;@&#402;C&#402;&#8249;&#8218;&#240;&#352;J&#8218;&#173;*B
- * Greasemonkey&#8218;&#197;*&#221;&#8217;&#232;&#8218;&#179;&#8218;&#234;&#8218;&#196;&#8218;&#162;&#8218;&#233;&#402;G&#402;f&#402;B&#402;^*A&#8218;&#220;&#8218;&#189;&#8218;&#205;*A&#402;u&#402;&#8240;&#402;E&#402;U&#8218;&#197;&#402;\*[&#402;X&#8218;&#240;&#352;J&#8218;&#173;&#381;&#382;&#8218;&#201;&#381;g&#8218;&#237;&#8218;&#234;&#8218;&#233;&#402;G&#402;f&#402;B&#402;^&#8218;&#170;&#338;&#196;&#8218;&#209;*o&#8218;&#179;&#8218;&#234;&#8218;&#233;*B
- *
- * @param {nsIFile} file &#8216;&#206;*&#219;&#402;t&#402;@&#402;C&#402;&#8249;*B 
- */
-function openInEditor(file){
-	function getFile(path){
-		return path &amp;&amp; LocalFile(path);
-	}
-	
-	var editor = 
-		getFile(getPrefValue('greasemonkey.editor')) || 
-		getFile(getPrefValue('view_source.editor.path'));
-	if(!editor || !editor.exists())
-		return;
-	
-	var mimeInfo = MIMEService.getFromTypeAndExtension(
-		MIMEService.getTypeFromFile(file), 
-		file.leafName.split('.').pop());
-	mimeInfo.preferredAction = mimeInfo.useHelperApp;
-	mimeInfo.preferredApplicationHandler = editor;
-	mimeInfo.launchWithFile(file);
-}
-
-function getMostRecentWindow(){
-	return WindowMediator.getMostRecentWindow('navigator:browser');
-}
-
-function findCacheFile(url){
-	var entry;
-	CacheService.visitEntries({
-		visitDevice : function(deviceID, deviceInfo){
-			if(deviceID == 'disk')
-				return true;
-		},
-		visitEntry : function(deviceID, info){
-			if(info.key != url)
-				return true;
-			
-			entry = {
-				clientID    : info.clientID, 
-				key         : info.key, 
-				streamBased : info.isStreamBased(),
-			};
-		},
-	});
-	
-	if(!entry)
-		return;
-	
-	try{
-		var session = CacheService.createSession(
-			entry.clientID, 
-			ICache.STORE_ANYWHERE, 
-			entry.streamBased);
-		session.doomEntriesIfExpired = false;
-		var descriptor = session.openCacheEntry(
-			entry.key, 
-			ICache.ACCESS_READ, 
-			false);
-		
-		return descriptor.file;
-	} finally{
-		// [FIXME] copy to temp
-		// descriptor &amp;&amp; descriptor.doom();
-		descriptor &amp;&amp; descriptor.close();
-	}
-}
-
-/**
- * &#402;X&#402;g&#402;&#352;*[&#402;&#8364;&#8218;&#240;*&#710;&#8212;*&#8218;&#183;&#8218;&#233;*B
- * &#381;&#192;*s&#338;&#227;&#8218;&#201;&#8226;K&#8218;&#184;&#402;X&#402;g&#402;&#352;*[&#402;&#8364;&#8218;&#170;&#8226;&#194;&#8218;&#182;&#8218;&#231;&#8218;&#234;&#8218;&#233;*B
- *
- * @param {Object} stream &#402;X&#402;g&#402;&#352;*[&#402;&#8364;*B 
- * @param {Function} func &#402;X&#402;g&#402;&#352;*[&#402;&#8364;&#8218;&#240;&#8212;&#732;&#8212;p&#8218;&#183;&#8218;&#233;*&#710;&#8212;**B&#402;X&#402;g&#402;&#352;*[&#402;&#8364;&#8218;&#170;&#8220;n&#8218;&#179;&#8218;&#234;&#8218;&#233;*B 
- */
-function withStream(stream, func){
-	try{
-		return func(stream);
-	} finally{
-		stream &amp;&amp; stream.close &amp;&amp; stream.close();
-	}
-}
-
-/**
- * HTML&#8226;&#182;&#381;&#353;&#8212;&#241;&#8218;&#169;&#8218;&#231;object/script/body/style&#8218;&#200;&#8218;&#199;&#8218;&#204;&#8212;v&#8216;f&#8218;&#240;&#381;&#230;&#8218;&#232;*&#339;&#8218;&#173;*B
- * &#8218;&#220;&#8218;&#189;&#8226;s&#352;&#174;&#8216;S&#8218;&#200;&#402;^&#402;O&#8218;&#200;&#8218;&#199;&#8218;&#240;*&#174;&#338;`&#8218;&#181;*&#179;&#8218;&#181;&#8218;&#162;HTML&#8218;&#214;&#8226;&#207;&#352;&#183;&#8218;&#183;&#8218;&#233;*B
- * Firefox 3&#8218;&#197;&#8218;&#205;*AJavaScript&#402;v&#402;*&#402;g&#402;R&#402;&#8249;&#8218;&#204;*&#339;&#8249;&#381;&#8218;&#170;*s&#8218;&#237;&#8218;&#234;&#8218;&#200;&#8218;&#162;*B
- *
- * @param {String} html HTML*B 
- * @return {String} *&#174;&#338;`&#8218;&#179;&#8218;&#234;&#8218;&#189;HTML*B
- */
-function sanitizeHTML(html){
-	var doc = document.implementation.createDocument('', '', null);
-	var root = doc.appendChild(doc.createElement('root'));
-	
-	var fragment = UnescapeHTML.parseFragment(html, false, null, doc.documentElement);
-	doc.documentElement.appendChild(fragment);
-	
-	if(!root.childNodes.length)
-		return '';
-	return serializeToString(root).match(/^&lt;root&gt;(.*)&lt;\/root&gt;$/)[1];
-}
-
-function serializeToString(xml){
-	return (new XMLSerializer()).serializeToString(xml);
-}
+var XUL_NS  = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';
+var HTML_NS = 'http://www.w3.org/1999/xhtml';
+
+var Ci = Components.interfaces;
+var Cc = Components.classes;
+
+var INTERFACES = [];
+for(var i in Ci)
+	INTERFACES.push(Ci[i]);
+
+if(typeof(update)=='undefined'){
+	function update(t, s){
+		for(var p in s)
+			t[p] = s[p];
+		return t;
+	}
+}
+
+var IWebProgressListener = Ci.nsIWebProgressListener;
+var IFile                = Ci.nsIFile;
+var ILocalFile           = Ci.nsILocalFile;
+var IURI                 = Ci.nsIURI;
+var IInputStream         = Ci.nsIInputStream;
+var ICache               = Ci.nsICache;
+var ISelectionListener   = Ci.nsISelectionListener;
+// var IAccessNode          = Ci.nsIAccessNode;
+
+
+// const AccessibilityService = getService('/accessibilityService;1', Ci.nsIAccessibilityService);
+var ExtensionManager    = getService('/extensions/manager;1', Ci.nsIExtensionManager);
+var StorageService      = getService('/storage/service;1', Ci.mozIStorageService);
+var DirectoryService    = getService('/file/directory_service;1', Ci.nsIProperties);
+var IOService           = getService('/network/io-service;1', Ci.nsIIOService);
+var AtomService         = getService('/atom-service;1', Ci.nsIAtomService);
+var ChromeRegistry      = getService('/chrome/chrome-registry;1', Ci.nsIXULChromeRegistry);
+var WindowMediator      = getService('/appshell/window-mediator;1', Ci.nsIWindowMediator);
+var ConsoleService      = getService('/consoleservice;1', Ci.nsIConsoleService);
+var AlertsService       = getService('/alerts-service;1', Ci.nsIAlertsService);
+var MIMEService         = getService('/uriloader/external-helper-app-service;1', Ci.nsIMIMEService);
+var PromptService       = getService('/embedcomp/prompt-service;1', Ci.nsIPromptService);
+var CacheService        = getService('/network/cache-service;1', Ci.nsICacheService);
+var AppShellService     = getService('/appshell/appShellService;1', Ci.nsIAppShellService);
+var DownloadManager     = getService('/download-manager;1', Ci.nsIDownloadManager);
+var AppInfo             = getService('/xre/app-info;1');
+var UnescapeHTML        = getService('/feed-unescapehtml;1', Ci.nsIScriptableUnescapeHTML);
+var CookieService       = getService('/cookieService;1', Ci.nsICookieService);
+var CookieManager       = getService('/cookiemanager;1', Ci.nsICookieManager);
+var PasswordManager     = getService('/passwordmanager;1', Ci.nsIPasswordManager);
+var LoginManager        = getService('/login-manager;1', Ci.nsILoginManager);
+var StringBundleService = getService('/intl/stringbundle;1', Ci.nsIStringBundleService);
+var NavBookmarksService = getService('/browser/nav-bookmarks-service;1', Ci.nsINavBookmarksService);
+var AnnotationService   = getService('/browser/annotation-service;1', Ci.nsIAnnotationService);
+var ObserverService     = getService('/observer-service;1', Ci.nsIObserverService);
+var WindowWatcher       = getService('/embedcomp/window-watcher;1', Ci.nsIWindowWatcher);
+var ClipboardHelper     = getService('/widget/clipboardhelper;1', Ci.nsIClipboardHelper);
+var NavHistoryService   = getService('/browser/nav-history-service;1', Ci.nsINavHistoryService);
+var FaviconService      = getService('/browser/favicon-service;1', Ci.nsIFaviconService);
+
+
+var PrefBranch = 
+	createConstructor('/preferences;1', 'nsIPrefBranch');
+
+var LocalFile = 
+	createConstructor('/file/local;1', 'nsILocalFile', 'initWithPath');
+
+var WebBrowserPersist = 
+	createConstructor('/embedding/browser/nsWebBrowserPersist;1', 'nsIWebBrowserPersist');
+
+var StorageStatementWrapper = 
+	createConstructor('/storage/statement-wrapper;1', 'mozIStorageStatementWrapper', 'initialize');
+
+var ScriptError = 
+	createConstructor('/scripterror;1', 'nsIScriptError', 'init');
+
+var Process = 
+	createConstructor('/process/util;1', 'nsIProcess', 'init');
+
+var FilePicker = 
+	createConstructor('/filepicker;1', 'nsIFilePicker', 'init');
+
+var InputStream = 
+	createConstructor('/scriptableinputstream;1', 'nsIScriptableInputStream', 'init');
+
+var BinaryInputStream = 
+	createConstructor('/binaryinputstream;1', 'nsIBinaryInputStream', 'setInputStream');
+
+var FileInputStream = 
+	createConstructor('/network/file-input-stream;1', 'nsIFileInputStream', 'init');
+
+var ConverterInputStream = 
+	createConstructor('/intl/converter-input-stream;1', 'nsIConverterInputStream', function(stream, charset, bufferSize){
+		this.init(stream, charset || 'UTF-8', bufferSize || 4096, ConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
+	});
+
+var MIMEInputStream = 
+	createConstructor('/network/mime-input-stream;1', 'nsIMIMEInputStream', function(stream){
+		this.addContentLength = true;
+		this.setData(stream);
+	});
+
+var BufferedInputStream = 
+	createConstructor('/network/buffered-input-stream;1', 'nsIBufferedInputStream', function(stream, bufferSize){
+		this.init(stream, bufferSize || 4096);
+	});
+
+var StringInputStream = 
+	createConstructor('/io/string-input-stream;1', 'nsIStringInputStream', function(str){
+		this.setData(str, str.length);
+	});
+
+var UnicodeConverter = 
+	createConstructor('/intl/scriptableunicodeconverter', 'nsIScriptableUnicodeConverter', function(charset){
+		this.charset = charset || 'UTF-8';
+	});
+
+var MultiplexInputStream = 
+	createConstructor('/io/multiplex-input-stream;1', 'nsIMultiplexInputStream', function(streams){
+		var self = this;
+		streams = streams || [];
+		streams.forEach(function(stream){
+			if(stream.join)
+				stream = stream.join('\r\n');
+			
+			if(typeof(stream)=='string')
+				stream = new StringInputStream(stream + '\r\n');
+				
+			self.appendStream(stream);
+		});
+	});
+
+var CryptoHash = 
+	createConstructor('/security/hash;1', 'nsICryptoHash', 'init');
+
+var FileOutputStream = 
+	update(createConstructor('/network/file-output-stream;1', 'nsIFileOutputStream', 'init'), {
+		PR_RDONLY : 0x01,
+		PR_WRONLY : 0x02,
+		PR_RDWR   : 0x04,
+		PR_CREATE_FILE : 0x08,
+		PR_APPEND : 0x10,
+		PR_TRUNCATE : 0x20,
+		PR_SYNC : 0x40,
+		PR_EXCL : 0x80,
+	});
+
+// ----[Utility]-------------------------------------------------
+function createMock(sample, proto){
+	var non = function(){};
+	sample = typeof(sample)=='object'? sample : Cc[sample].createInstance();
+	
+	var ifcs = getInterfaces(sample);
+	var Mock = function(){};
+	
+	for(var key in sample){
+		try{
+			var val = sample[key];
+			switch (typeof(val)){
+			case 'number':
+			case 'string':
+				Mock.prototype[key] = val;
+				continue;
+				
+			case 'function':
+				Mock.prototype[key] = non;
+				continue;
+			}
+		} catch(e){
+			// &#227;&#8218;&#179;&#227;&#402;&#179;&#227;&#402;*&#227;&#402;&#188;&#227;&#402;*&#227;&#402;&#179;&#227;&#402;&#710;&#229;&#174;&#376;&#232;&#163;&#8230;&#227;*&#171;&#227;&#8218;&#710;&#227;&#8218;&#352;&#231;&#8482;&#186;&#231;&#8221;&#376;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#402;&#8212;&#227;&#402;&#173;&#227;&#402;&#8216;&#227;&#402;&#8224;&#227;&#8218;&#163;&#229;*&#8211;&#229;&#190;&#8212;&#227;&#8218;&#168;&#227;&#402;&#169;&#227;&#402;&#188;&#227;&#8218;&#8217;&#231;&#8222;&#161;&#232;&#166;&#8211;&#227;*&#8482;&#227;&#8218;&#8249;
+		}
+	}
+	
+	Mock.prototype.QueryInterface = createQueryInterface(ifcs);
+	
+	update(Mock.prototype, proto);
+	update(Mock, Mock.prototype);
+	
+	return Mock;
+}
+
+function createQueryInterface(ifcNames){
+	var ifcs = ['nsISupports'].concat(ifcNames).map(function(ifcName){
+		return Ci[''+ifcName];
+	});
+	
+	return function(iid){
+		if(ifcs.some(function(ifc){
+			return iid.equals(ifc);
+		})){
+			return this;
+		}
+		
+		throw Components.results.NS_NOINTERFACE;
+	}
+}
+
+/**
+ * XPCOM&#227;*&#174;&#227;&#8218;&#179;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#402;&#169;&#227;&#8218;&#175;&#227;&#8218;&#191;&#227;&#8218;&#8217;&#231;&#8221;&#376;&#230;&#710;*&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ * &#227;&#8218;&#179;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#402;&#169;&#227;&#8218;&#175;&#227;&#8218;&#191;&#227;*&#175;&#230;&#338;&#8225;&#229;&#174;&#353;&#227;*&#8226;&#227;&#8218;&#338;&#227;*&#376;&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#402;&#188;&#227;&#8218;&#185;&#227;*&#174;&#229;&#174;&#353;&#230;&#8226;&#176;&#227;&#8218;&#8217;&#229;&#8230;&#168;&#227;*&#166;&#230;&#338;*&#227;*&#164;&#227;&#8364;&#8218;
+ *
+ * @param {String} clsName &#227;&#8218;&#175;&#227;&#402;&#169;&#227;&#8218;&#185;&#229;**(@mozilla.org&#228;&#187;&#165;&#233;&#8482;*&#227;&#8218;&#8217;&#230;&#338;&#8225;&#229;&#174;&#353;&#227;*&#8482;&#227;&#8218;&#8249;)&#227;&#8364;&#8218;
+ * @param {String || nsIJSID} ifc &#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#8218;&#164;&#227;&#8218;&#185;&#227;&#8364;&#8218;
+ * @param {String || Function} init 
+ *        &#229;&#710;*&#230;&#339;&#376;&#229;&#338;&#8211;&#233;&#8211;&#162;&#230;&#8226;&#176;&#227;&#8364;&#8218;
+ *        &#230;&#8211;&#8225;&#229;&#173;&#8212;&#229;&#710;&#8212;&#227;*&#174;&#229;&#160;&#180;&#229;*&#710;&#227;&#8364;*&#232;&#169;&#178;&#229;&#189;&#8220;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#402;&#161;&#227;&#8218;&#189;&#227;&#402;&#402;&#227;&#402;&#8240;&#227;*&#338;&#229;&#8216;&#188;&#227;*&#179;&#229;&#8225;&#186;&#227;*&#8226;&#227;&#8218;&#338;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *        &#233;&#8211;&#162;&#230;&#8226;&#176;&#227;*&#174;&#229;&#160;&#180;&#229;*&#710;&#227;&#8364;*&#231;&#8221;&#376;&#230;&#710;*&#227;*&#8226;&#227;&#8218;&#338;&#227;*&#376;&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#8218;&#191;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#8218;&#8217;this&#227;*&#168;&#227;*&#8212;&#227;*&#166;&#229;&#8216;&#188;&#227;*&#179;&#229;&#8225;&#186;&#227;*&#8226;&#227;&#8218;&#338;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ */
+function createConstructor(clsName, ifc, init){
+	var cls = Components.classes['@mozilla.org' + clsName];
+	ifc = typeof(ifc)=='string'? Components.interfaces[ifc] : ifc;
+	
+	var cons = function(){
+		var obj = cls.createInstance(ifc);
+		if(init){
+			if(typeof(init)=='string'){
+				obj[init].apply(obj, arguments);
+			} else {
+				init.apply(obj, arguments);
+			}
+		}
+		return obj;
+	};
+	
+	cons.instanceOf = function(obj){
+		return (obj instanceof ifc);
+	};
+	
+	for(var prop in ifc)
+		cons[prop] = ifc[prop];
+	
+	return cons;
+}
+
+/**
+ * XPCOM&#227;&#8218;&#181;&#227;&#402;&#188;&#227;&#402;&#8220;&#227;&#8218;&#185;&#227;&#8218;&#8217;&#229;*&#8211;&#229;&#190;&#8212;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ * &#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#402;&#188;&#227;&#8218;&#185;&#227;*&#338;&#230;&#338;&#8225;&#229;&#174;&#353;&#227;*&#8226;&#227;&#8218;&#338;&#227;*&#170;&#227;*&#8222;&#229;&#160;&#180;&#229;*&#710;&#227;&#8364;*&#229;&#710;&#169;&#231;&#8221;&#168;&#227;*&#167;&#227;**&#227;&#8218;&#8249;&#229;&#8230;&#168;&#227;*&#166;&#227;*&#174;&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#402;&#188;&#227;&#8218;&#185;&#227;*&#171;&#230;&#8249;&#161;&#227;*&#8217;&#227;&#8218;&#8240;&#227;&#8218;&#338;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *
+ * @param {String} clsName &#227;&#8218;&#175;&#227;&#402;&#169;&#227;&#8218;&#185;&#229;**(@mozilla.org&#228;&#187;&#165;&#233;&#8482;*&#227;&#8218;&#8217;&#230;&#338;&#8225;&#229;&#174;&#353;&#227;*&#8482;&#227;&#8218;&#8249;)&#227;&#8364;&#8218;
+ * @param {nsIJSID} ifc &#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#8218;&#164;&#227;&#8218;&#185;&#227;&#8364;&#8218;
+ */
+function getService(clsName, ifc){
+	try{
+		var cls = Components.classes['@mozilla.org' + clsName];
+		return !cls? null : 
+			ifc? cls.getService(ifc) : broad(cls.getService());
+	} catch(e) {
+		return null;
+	}
+}
+
+/**
+ * XPCOM&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#8218;&#191;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;*&#174;&#229;&#174;&#376;&#232;&#163;&#8230;&#227;*&#8212;&#227;*&#166;&#227;*&#8222;&#227;&#8218;&#8249;&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#402;&#188;&#227;&#8218;&#185;&#228;&#184;&#8364;&#232;&#166;&#167;&#227;&#8218;&#8217;&#229;*&#8211;&#229;&#190;&#8212;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *
+ * @param {Object} obj XPCOM&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#8218;&#191;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#8364;&#8218;
+ * @return {Array} &#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#402;&#188;&#227;&#8218;&#185;&#227;*&#174;&#227;&#402;&#170;&#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#8364;&#8218;
+ */
+function getInterfaces(obj){
+	var result = [];
+	
+	for(var i=0,len=INTERFACES.length ; i&lt;len ; i++){
+		var ifc = INTERFACES[i];
+		if(obj instanceof ifc)
+			result.push(ifc);
+	}
+	
+	return result;
+}
+
+/**
+ * XPCOM&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#8218;&#191;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;*&#174;&#229;&#174;&#376;&#232;&#163;&#8230;&#227;*&#8212;&#227;*&#166;&#227;*&#8222;&#227;&#8218;&#8249;&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#402;&#188;&#227;&#8218;&#185;&#227;&#8218;&#8217;&#229;&#8230;&#168;&#227;*&#166;&#229;&#710;&#169;&#231;&#8221;&#168;&#227;*&#167;&#227;**&#227;&#8218;&#8249;&#227;&#8218;&#710;&#227;*&#8224;&#227;*&#171;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ * &#227;&#402;&#8216;&#227;&#402;&#8226;&#227;&#8218;&#169;&#227;&#402;&#188;&#227;&#402;&#382;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;*&#171;&#230;&#179;&#168;&#230;&#8222;*&#227;*&#8482;&#227;&#8218;&#8249;&#231;&#174;&#8225;&#230;&#8240;&#8364;&#227;*&#167;&#227;*&#175;&#227;&#8364;*&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#402;&#188;&#227;&#8218;&#185;&#227;*&#174;&#227;&#402;&#170;&#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#8218;&#8217;&#230;&#184;&#161;&#227;*&#8212;&#230;&#164;&#339;&#230;&#376;&#187;&#231;&#175;&#8222;&#229;&#8250;&#178;&#227;&#8218;&#8217;&#233;&#8482;*&#229;&#174;&#353;&#227;*&#8212;&#227;*&#166;&#228;&#189;&#191;&#227;*&#8224;&#227;&#8364;&#8218;
+ *
+ * @param {Object} obj XPCOM&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#8218;&#191;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#8364;&#8218;
+ * @param {optional Array} ifcs &#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#402;&#188;&#227;&#8218;&#185;&#227;*&#174;&#227;&#402;&#170;&#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#8364;&#8218;&#230;&#338;&#8225;&#229;&#174;&#353;&#227;*&#8226;&#227;&#8218;&#338;&#227;*&#170;&#227;*&#8222;&#229;&#160;&#180;&#229;*&#710;&#227;&#8364;*&#229;&#8230;&#168;&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#191;&#227;&#402;&#188;&#227;&#402;&#8226;&#227;&#8218;&#167;&#227;&#8218;&#164;&#227;&#8218;&#185;&#227;*&#338;&#230;&#164;&#339;&#230;&#376;&#187;&#227;*&#8226;&#227;&#8218;&#338;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ */
+function broad(obj, ifcs){
+	ifcs = ifcs || INTERFACES;
+	for(var i=0,len=ifcs.length ; i&lt;len ; i++)
+		if(obj instanceof ifcs[i]);
+	return obj;
+};
+
+/**
+ * &#233;&#8364;&#353;&#231;&#376;&#165;&#227;&#402;*&#227;&#402;&#8211;&#227;&#402;&#171;&#227;&#8218;&#8217;&#232;&#161;&#168;&#231;&#164;&#186;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ * &#229;&#8225;&#166;&#231;*&#8224;&#229;&#174;&#338;&#228;&#186;&#8224;&#227;&#8218;&#8222;&#227;&#8218;&#168;&#227;&#402;&#169;&#227;&#402;&#188;&#227;*&#170;&#227;*&#169;&#227;&#8218;&#8217;&#233;&#8364;&#353;&#231;&#376;&#165;&#227;*&#8482;&#227;&#8218;&#8249;&#227;*&#376;&#227;&#8218;*&#227;*&#171;&#231;&#8221;&#168;&#227;*&#8222;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ * Mac&#227;*&#174;Firefox 3&#227;*&#167;&#227;*&#175;Growl&#227;*&#171;&#227;*&#170;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *
+ * @param {String} title &#227;&#8218;&#191;&#227;&#8218;&#164;&#227;&#402;&#710;&#227;&#402;&#171;&#227;&#8364;&#8218;
+ * @param {String} msg &#227;&#402;&#161;&#227;&#402;&#402;&#227;&#8218;&#187;&#227;&#402;&#188;&#227;&#8218;&#184;&#227;&#8364;&#8218;
+ * @param {String} icon &#227;&#8218;&#162;&#227;&#8218;&#164;&#227;&#8218;&#179;&#227;&#402;&#179;&#231;&#168;&#174;&#233;&#161;&#382;&#227;&#8364;&#8218;&#229;&#174;&#353;&#230;&#8226;&#176;&#227;*&#174;&#228;&#184;&#173;&#227;*&#8249;&#227;&#8218;&#8240;&#233;*&#184;&#230;&#352;&#382;&#227;*&#8482;&#227;&#8218;&#8249;&#227;*&#8249;&#227;&#8364;*&#231;&#8249;&#172;&#232;&#8225;&#170;&#227;*&#174;URL&#227;&#8218;&#8217;&#230;&#184;&#161;&#227;*&#8482;&#227;&#8364;&#8218;
+ */
+function notify(title, msg, icon){
+	AlertsService &amp;&amp; AlertsService.showAlertNotification(
+		icon, title, msg, 
+		false, '', null);
+}
+notify.ICON_DOWNLOAD = 'chrome://mozapps/skin/downloads/downloadIcon.png';
+notify.ICON_INFO     = 'chrome://global/skin/console/bullet-question.png';
+notify.ICON_ERROR    = 'chrome://global/skin/console/bullet-error.png';
+notify.ICON_WORN     = 'chrome://global/skin/console/bullet-warning.png';
+
+/*
+function getElementByPosition(x, y){
+	return AccessibilityService.
+		getAccessibleFor(currentDocument()).
+		getChildAtPoint(x, y).
+		QueryInterface(IAccessNode).
+		DOMNode;
+}
+*/
+
+function convertFromUnplaceableHTML(str){
+	var arr = [];
+	for(var i=0,len=str.length ; i&lt;len ;i++)
+		arr.push(str.charCodeAt(i));
+	return convertFromByteArray(arr, str.match('charset=([^&quot;; ]+)'));
+}
+
+function convertFromByteArray(arr, charset){
+	return new UnicodeConverter(charset).convertFromByteArray(text);
+}
+
+/**
+ * URI&#227;&#8218;&#8217;&#231;&#8221;&#376;&#230;&#710;*&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *
+ * @param {String || nsIFile || nsIURI} path URL&#227;*&#190;&#227;*&#376;&#227;*&#175;&#227;&#402;&#8226;&#227;&#8218;&#161;&#227;&#8218;&#164;&#227;&#402;&#171;&#227;&#8364;&#8218;nsIURI&#227;*&#174;&#229;&#160;&#180;&#229;*&#710;&#227;&#8364;*&#227;**&#227;*&#174;&#227;*&#190;&#227;*&#190;&#232;&#191;&#8221;&#227;*&#8482;&#227;&#8364;&#8218;
+ */
+function createURI(path){
+	if(path instanceof IURI)
+		return path;
+	
+	try{
+		var path = (path instanceof IFile) ? path : new LocalFile(path);
+		return IOService.newFileURI(path)	;
+	}catch(e if e.name=='NS_ERROR_FILE_UNRECOGNIZED_PATH'){	}
+	return IOService.newURI(path, null, null);
+}
+
+/**
+ * &#227;&#402;&#8226;&#227;&#8218;&#161;&#227;&#8218;&#164;&#227;&#402;&#171;&#227;&#8218;&#8217;&#229;*&#8211;&#229;&#190;&#8212;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *
+ * @param {String || nsIFile || nsIURI} uri 
+ *        URI&#227;&#8364;&#8218;file:&#227;*&#190;&#227;*&#376;&#227;*&#175;chrome:&#227;*&#8249;&#227;&#8218;&#8240;&#229;&#167;&#8249;&#227;*&#190;&#227;&#8218;&#8249;&#227;&#8218;&#162;&#227;&#402;&#8240;&#227;&#402;&#172;&#227;&#8218;&#185;&#227;&#8218;&#8217;&#230;&#338;&#8225;&#229;&#174;&#353;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *        nsIFile&#227;*&#174;&#229;&#160;&#180;&#229;*&#710;&#227;&#8364;*&#227;**&#227;*&#174;&#227;*&#190;&#227;*&#190;&#232;&#191;&#8221;&#227;*&#8482;&#227;&#8364;&#8218;
+ */
+function getLocalFile(uri){
+	if(uri instanceof ILocalFile)
+		return uri;
+	
+	uri = createURI(uri);
+	if(uri.scheme=='chrome')
+		uri = ChromeRegistry.convertChromeURL(uri);
+	
+	if(uri.scheme!='file')
+		return;
+	
+	return IOService.getProtocolHandler('file').
+		QueryInterface(Ci.nsIFileProtocolHandler).
+		getFileFromURLSpec(uri.spec).
+		QueryInterface(ILocalFile);
+}
+
+/**
+ * &#230;&#8249;&#161;&#229;&#188;&#181;&#227;*&#174;&#227;&#8218;&#164;&#227;&#402;&#179;&#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#402;&#188;&#227;&#402;&#171;&#227;*&#8226;&#227;&#8218;&#338;&#227;*&#166;&#227;*&#8222;&#227;&#8218;&#8249;&#227;&#402;&#8225;&#227;&#8218;&#163;&#227;&#402;&#172;&#227;&#8218;&#175;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#8218;&#8217;&#229;*&#8211;&#229;&#190;&#8212;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *
+ * @param {String} id &#230;&#8249;&#161;&#229;&#188;&#181;ID&#227;&#8364;&#8218; 
+ */
+function getExtensionDir(id){
+	return ExtensionManager.
+		getInstallLocation(id).
+		getItemLocation(id).QueryInterface(ILocalFile);
+}
+
+function getPrefType(key){
+	with(PrefBranch()){
+		switch(getPrefType(key)){
+			case PREF_STRING:
+				return 'string';
+			case PREF_BOOL:
+				return 'boolean';
+			case PREF_INT:
+				return 'number';
+			case PREF_INVALID:
+				return 'undefined';
+		}
+	}
+}
+
+function setPrefValue(){
+	var value = Array.pop(arguments);
+	var key = Array.join(arguments, '');
+	
+	var prefType = getPrefType(key);
+	with(PrefBranch()){
+		switch(prefType!='undefined'? prefType : typeof(value)){
+			case 'string':
+				return setCharPref(key, unescape(encodeURIComponent(value)));
+			case 'boolean':
+				return setBoolPref(key, value);
+			case 'number':
+				return setIntPref(key, value);
+		}
+	}
+}
+
+function getPrefValue(){
+	var key = Array.join(arguments, '');
+	
+	with(PrefBranch()){
+		switch(getPrefType(key)){
+			case PREF_STRING:
+				return decodeURIComponent(escape(getCharPref(key)));
+			case PREF_BOOL:
+				return getBoolPref(key);
+			case PREF_INT:
+				return getIntPref(key);
+		}
+	}
+}
+
+/**
+ * &#227;&#402;&#166;&#227;&#402;&#188;&#227;&#8218;&#182;&#227;*&#338;&#233;&#8364;&#353;&#229;&#184;&#184;&#229;&#710;&#169;&#231;&#8221;&#168;&#227;*&#8212;&#227;*&#166;&#227;*&#8222;&#227;&#8218;&#8249;&#227;&#402;&#8364;&#227;&#8218;&#166;&#227;&#402;&#179;&#227;&#402;&#173;&#227;&#402;&#188;&#227;&#402;&#8240;&#227;&#402;&#8225;&#227;&#8218;&#163;&#227;&#402;&#172;&#227;&#8218;&#175;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#8218;&#8217;&#229;*&#8211;&#229;&#190;&#8212;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ * Firefox&#227;&#8218;&#170;&#227;&#402;&#8212;&#227;&#8218;&#183;&#227;&#402;&#167;&#227;&#402;&#179;&#227;*&#167;&#230;&#338;&#8225;&#229;&#174;&#353;&#227;*&#8212;&#227;*&#376;&#227;&#402;&#8225;&#227;&#8218;&#163;&#227;&#402;&#172;&#227;&#8218;&#175;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#8364;*&#227;*&#190;&#227;*&#376;&#227;*&#175;&#227;&#8364;*&#230;&#339;&#8364;&#229;&#190;&#338;&#227;*&#171;&#227;&#402;&#8364;&#227;&#8218;&#166;&#227;&#402;&#179;&#227;&#402;&#173;&#227;&#402;&#188;&#227;&#402;&#8240;&#227;*&#8212;&#227;*&#376;&#227;&#402;&#8225;&#227;&#8218;&#163;&#227;&#402;&#172;&#227;&#8218;&#175;&#227;&#402;&#710;&#227;&#402;&#170;&#227;*&#171;&#227;*&#170;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ */
+function getDownloadDir(){
+	try {
+		var dir = new LocalFile(getPrefValue('browser.download.dir') || getPrefValue('browser.download.lastDir'));
+		if(dir.exists())
+			return dir
+	} catch(e) {}
+	
+	return DownloadManager.userDownloadsDirectory;
+}
+
+/**
+ * &#231;*&#190;&#229;&#339;&#168;&#229;&#710;&#169;&#231;&#8221;&#168;&#227;*&#8212;&#227;*&#166;&#227;*&#8222;&#227;&#8218;&#8249;&#227;&#402;&#8212;&#227;&#402;&#173;&#227;&#402;&#8226;&#227;&#8218;&#161;&#227;&#8218;&#164;&#227;&#402;&#171;&#227;&#402;&#8225;&#227;&#8218;&#163;&#227;&#402;&#172;&#227;&#8218;&#175;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#8218;&#8217;&#229;*&#8211;&#229;&#190;&#8212;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ */
+function getProfileDir(){
+	return DirectoryService.get('ProfD', IFile);
+}
+
+/**
+ * &#227;&#402;&#8224;&#227;&#402;&#179;&#227;&#402;*&#227;&#402;&#169;&#227;&#402;&#170;&#227;&#402;&#8225;&#227;&#8218;&#163;&#227;&#402;&#172;&#227;&#8218;&#175;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#8218;&#8217;&#229;*&#8211;&#229;&#190;&#8212;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ */
+function getTempDir(){
+	return DirectoryService.get('TmpD', IFile);
+}
+
+/**
+ * &#229;&#164;&#8211;&#233;&#402;&#168;&#227;&#8218;&#168;&#227;&#402;&#8225;&#227;&#8218;&#163;&#227;&#8218;&#191;&#227;*&#167;&#227;&#402;&#8226;&#227;&#8218;&#161;&#227;&#8218;&#164;&#227;&#402;&#171;&#227;&#8218;&#8217;&#233;&#8211;&#8249;&#227;**&#227;&#8364;&#8218;
+ * Greasemonkey&#227;*&#167;&#232;&#168;&#173;&#229;&#174;&#353;&#227;*&#8226;&#227;&#8218;&#338;&#227;*&#166;&#227;*&#8222;&#227;&#8218;&#8249;&#227;&#8218;&#168;&#227;&#402;&#8225;&#227;&#8218;&#163;&#227;&#8218;&#191;&#227;&#8364;*&#227;*&#190;&#227;*&#376;&#227;*&#175;&#227;&#8364;*&#227;&#402;&#8211;&#227;&#402;&#169;&#227;&#8218;&#166;&#227;&#8218;&#182;&#227;*&#167;&#227;&#8218;&#189;&#227;&#402;&#188;&#227;&#8218;&#185;&#227;&#8218;&#8217;&#233;&#8211;&#8249;&#227;**&#230;&#8482;&#8218;&#227;*&#171;&#228;&#189;&#191;&#227;&#8218;*&#227;&#8218;&#338;&#227;&#8218;&#8249;&#227;&#8218;&#168;&#227;&#402;&#8225;&#227;&#8218;&#163;&#227;&#8218;&#191;&#227;*&#338;&#229;&#8216;&#188;&#227;*&#179;&#229;&#8225;&#186;&#227;*&#8226;&#227;&#8218;&#338;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *
+ * @param {nsIFile} file &#229;&#175;&#190;&#232;&#177;&#161;&#227;&#402;&#8226;&#227;&#8218;&#161;&#227;&#8218;&#164;&#227;&#402;&#171;&#227;&#8364;&#8218; 
+ */
+function openInEditor(file){
+	function getFile(path){
+		return path &amp;&amp; LocalFile(path);
+	}
+	
+	var editor = 
+		getFile(getPrefValue('greasemonkey.editor')) || 
+		getFile(getPrefValue('view_source.editor.path'));
+	if(!editor || !editor.exists())
+		return;
+	
+	var mimeInfo = MIMEService.getFromTypeAndExtension(
+		MIMEService.getTypeFromFile(file), 
+		file.leafName.split('.').pop());
+	mimeInfo.preferredAction = mimeInfo.useHelperApp;
+	mimeInfo.preferredApplicationHandler = editor;
+	mimeInfo.launchWithFile(file);
+}
+
+function getMostRecentWindow(){
+	return WindowMediator.getMostRecentWindow('navigator:browser');
+}
+
+function findCacheFile(url){
+	var entry;
+	CacheService.visitEntries({
+		visitDevice : function(deviceID, deviceInfo){
+			if(deviceID == 'disk')
+				return true;
+		},
+		visitEntry : function(deviceID, info){
+			if(info.key != url)
+				return true;
+			
+			entry = {
+				clientID    : info.clientID, 
+				key         : info.key, 
+				streamBased : info.isStreamBased(),
+			};
+		},
+	});
+	
+	if(!entry)
+		return;
+	
+	try{
+		var session = CacheService.createSession(
+			entry.clientID, 
+			ICache.STORE_ANYWHERE, 
+			entry.streamBased);
+		session.doomEntriesIfExpired = false;
+		var descriptor = session.openCacheEntry(
+			entry.key, 
+			ICache.ACCESS_READ, 
+			false);
+		
+		return descriptor.file;
+	} finally{
+		// [FIXME] copy to temp
+		// descriptor &amp;&amp; descriptor.doom();
+		descriptor &amp;&amp; descriptor.close();
+	}
+}
+
+/**
+ * &#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#402;&#188;&#227;&#402;&#160;&#227;&#8218;&#8217;&#229;&#8225;&#166;&#231;*&#8224;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ * &#229;&#174;&#376;&#232;&#161;&#338;&#229;&#190;&#338;&#227;*&#171;&#229;&#191;&#8230;&#227;*&#353;&#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#402;&#188;&#227;&#402;&#160;&#227;*&#338;&#233;&#8211;&#8240;&#227;*&#732;&#227;&#8218;&#8240;&#227;&#8218;&#338;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ *
+ * @param {Object} stream &#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#402;&#188;&#227;&#402;&#160;&#227;&#8364;&#8218; 
+ * @param {Function} func &#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#402;&#188;&#227;&#402;&#160;&#227;&#8218;&#8217;&#229;&#710;&#169;&#231;&#8221;&#168;&#227;*&#8482;&#227;&#8218;&#8249;&#229;&#8225;&#166;&#231;*&#8224;&#227;&#8364;&#8218;&#227;&#8218;&#185;&#227;&#402;&#710;&#227;&#402;&#170;&#227;&#402;&#188;&#227;&#402;&#160;&#227;*&#338;&#230;&#184;&#161;&#227;*&#8226;&#227;&#8218;&#338;&#227;&#8218;&#8249;&#227;&#8364;&#8218; 
+ */
+function withStream(stream, func){
+	try{
+		return func(stream);
+	} finally{
+		stream &amp;&amp; stream.close &amp;&amp; stream.close();
+	}
+}
+
+/**
+ * HTML&#230;&#8211;&#8225;&#229;&#173;&#8212;&#229;&#710;&#8212;&#227;*&#8249;&#227;&#8218;&#8240;object/script/body/style&#227;*&#170;&#227;*&#169;&#227;*&#174;&#232;&#166;*&#231;&#180;&#160;&#227;&#8218;&#8217;&#229;*&#8211;&#227;&#8218;&#352;&#233;&#8482;&#164;&#227;**&#227;&#8364;&#8218;
+ * &#227;*&#190;&#227;*&#376;&#228;&#184;*&#229;&#174;&#338;&#229;&#8230;&#168;&#227;*&#170;&#227;&#8218;&#191;&#227;&#8218;&#176;&#227;*&#170;&#227;*&#169;&#227;&#8218;&#8217;&#230;&#8226;&#180;&#229;&#189;&#162;&#227;*&#8212;&#230;&#173;&#163;&#227;*&#8212;&#227;*&#8222;HTML&#227;*&#184;&#229;&#164;&#8240;&#230;*&#8250;&#227;*&#8482;&#227;&#8218;&#8249;&#227;&#8364;&#8218;
+ * Firefox 3&#227;*&#167;&#227;*&#175;&#227;&#8364;*JavaScript&#227;&#402;&#8212;&#227;&#402;&#173;&#227;&#402;&#710;&#227;&#8218;&#179;&#227;&#402;&#171;&#227;*&#174;&#233;&#8482;&#164;&#229;&#381;&#187;&#227;*&#338;&#232;&#161;&#338;&#227;&#8218;*&#227;&#8218;&#338;&#227;*&#170;&#227;*&#8222;&#227;&#8364;&#8218;
+ *
+ * @param {String} html HTML&#227;&#8364;&#8218; 
+ * @return {String} &#230;&#8226;&#180;&#229;&#189;&#162;&#227;*&#8226;&#227;&#8218;&#338;&#227;*&#376;HTML&#227;&#8364;&#8218;
+ */
+function sanitizeHTML(html){
+	var doc = document.implementation.createDocument('', '', null);
+	var root = doc.appendChild(doc.createElement('root'));
+	
+	var fragment = UnescapeHTML.parseFragment(html, false, null, doc.documentElement);
+	doc.documentElement.appendChild(fragment);
+	
+	if(!root.childNodes.length)
+		return '';
+	return serializeToString(root).match(/^&lt;root&gt;(.*)&lt;\/root&gt;$/)[1];
+}
+
+function serializeToString(xml){
+	return (new XMLSerializer()).serializeToString(xml);
+}</diff>
      <filename>xpi/chrome/content/library/00_Components.js</filename>
    </modified>
    <modified>
      <filename>xpi/chrome/content/library/00_MochiKit.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,1729 +1,1729 @@
-// ----[Application]-------------------------------------------------
-var getPref = partial(getPrefValue, 'extensions.tombloo.');
-var setPref = partial(setPrefValue, 'extensions.tombloo.');
-
-var CHROME_DIR = 'chrome://tombloo';
-var CHROME_CONTENT_DIR = CHROME_DIR + '/content';
-
-var EXTENSION_ID = 'tombloo@brasil.to';
-
-var grobal = this;
-disconnectAll(grobal);
-
-// &#12522;&#12525;&#12540;&#12489;&#12395;&#12424;&#12387;&#12387;&#12390;&#22793;&#26356;&#12373;&#12428;&#12394;&#12356;&#38936;&#22495;&#12434;&#29992;&#24847;&#12377;&#12427;
-// &#12452;&#12505;&#12531;&#12488;&#12395;&#23433;&#23450;&#12375;&#12390;&#12501;&#12483;&#12463;&#12377;&#12427;&#12383;&#12417;&#12394;&#12393;&#12395;&#20351;&#12431;&#12428;&#12427;
-if(typeof(constant)=='undefined')
-	constant = {};
-
-
-// ----[XPCOM]-------------------------------------------------
-function getCookies(host, name){
-	var re = new RegExp(host + '$');
-	return filter(function(c){
-		return (c.host.search(re) != -1) &amp;&amp; 
-			(name? c.name == name : true);
-	}, CookieManager.enumerator);
-}
-
-function getCookieString(host, name){
-	return getCookies(host, name).map(function(c){
-		return c.name + '=' + c.value ;
-	}).join('; ');
-}
-
-function getPasswords(host, user){
-	if(PasswordManager){
-		return filter(function(p){
-			return (p.host == host) &amp;&amp; 
-				(user? p.user == user : true);
-		}, PasswordManager.enumerator);
-	} else {
-		return map(function(p){
-			return {
-				user : p.username,
-				usernameFieldName : p.usernameField,
-				password : p.password,
-				passwordFieldName : p.passwordField,
-			}
-		}, ifilter(function(c){
-			return (user? p.username == user : true);
-		}, LoginManager.findLogins({}, host, host, null)));
-	}
-}
-
-var stringBundle = StringBundleService.createBundle(CHROME_DIR + '/locale/messages.properties');
-function getMessage(key){
-	var ps = Array.splice(arguments, 1);
-	try{
-		if(ps){
-			return stringBundle.formatStringFromName(key, ps, ps.length);
-		} else {
-			return stringBundle.GetStringFromName(key);
-		}
-	} catch(e){
-		return '';
-	}
-}
-
-function input(form, title){
-	var pair;
-	if(some(form, function(p){
-		pair = p;
-		return isArrayLike(p[1]);
-	})){
-		var selected = {};
-		var [msg, list] = pair;
-		if(!PromptService.select(null, title || '', msg, list.length, list, selected))
-			return;
-		
-		return list[selected.value];
-	} else {
-		var args = [null, title || ''];
-		for(var msg in form){
-			var val = {value : form[msg]};
-			form[msg] = val;
-			args.push(msg);
-			args.push(val);
-		}
-		
-		if(!PromptService.prompt.apply(PromptService, args))
-			return;
-		
-		for(var msg in form)
-			form[msg] = form[msg].value;
-		
-		return form;
-	}
-}
-
-function download(sourceURL, targetFile){
-	var d = new Deferred();
-	var targetURI = IOService.newFileURI(targetFile);
-	var sourceURI = IOService.newURI(sourceURL, null, null);
-	
-	var persist = WebBrowserPersist();
-	with(persist){
-		persist.progressListener = {
-			onLocationChange : function(){},
-			onProgressChange : function(){},
-			onSecurityChange : function(){},
-			onStatusChange : function(){},
-			onStateChange : function(progress, req, state, status){
-				if (state &amp; IWebProgressListener.STATE_STOP)
-					d.callback(targetFile);
-			},
-		}
-		
-		persistFlags = PERSIST_FLAGS_FROM_CACHE;
-		saveURI(sourceURI, null, null, null, null, targetURI);
-	}
-	
-	return d;
-}
-
-function createDir(dir){
-	var dir = (dir instanceof IFile) ? dir : new LocalFile(dir);
-	if(dir.exists()){
-		if(dir.isDirectory())
-			dir.permissions = 0774;
-	} else {
-		dir.create(dir.DIRECTORY_TYPE, 0774);
-	}
-	
-	return dir;
-}
-
-function uriToFileName(uri){
-	uri = broad(createURI(uri));
-	uri = (uri.host+uri.filePath).replace(/\/$/, '');
-	return validateFileName(uri);
-}
-
-function clearCollision(file){
-	var name = file.leafName;
-	for(var count = 2 ; file.exists() ; count++)
-		file.leafName = name.replace(/(.*)\./, '$1('+count+').');
-}
-
-function getContentDir(){
-	var contentDir = getExtensionDir(EXTENSION_ID);
-	contentDir.setRelativeDescriptor(contentDir, 'chrome/content');
-	
-	return contentDir;
-}
-
-function getPatchDir(){
-	var dir = getDataDir();
-	dir.append('script');
-	
-	return createDir(dir);
-}
-
-function getDataDir(name){
-	var path = 'file:///' + getPref('dataDir').replace(/\{(.*?)\}/g, function(all, name){
-		return DirectoryService.get(name, IFile).path;
-	}).replace(/\\/g, '/')
-	
-	var dir = createDir(getLocalFile(path));
-	name &amp;&amp; dir.append(name);
-	return dir;
-}
-
-function getTempDir(name){
-	var dir = DirectoryService.get('TmpD', IFile);
-	name &amp;&amp; dir.append(name);
-	
-	return dir;
-}
-
-function getTempFile(ext){
-	var file = getTempDir();
-	file.append(joinText(['tombloo_' + (new Date()).getTime(), ext], '.'));
-	
-	return file;
-}
-
-function openProgressDialog(progress, max, value){
-	if(!(progress instanceof Progress))
-		progress = new Progress(progress, max, value);
-	
-	openDialog('chrome://tombloo/content/library/progressDialog.xul', 400, 95, 'dialog', progress);
-	
-	return progress;
-}
-
-function openDialog(url, w, h, features, value){
-	var x = (screen.width - w) / 2;
-	var y = (screen.height - h) / 2;
-	getMostRecentWindow().openDialog(url, '_blank', (features? features + ',' : '') + openParamString({
-		width : w,
-		height : h,
-		left : x,
-		top : y,
-	}), value);
-}
-
-/**
- * &#12502;&#12521;&#12454;&#12470;&#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#12522;&#12473;&#12488;&#12434;&#21462;&#24471;&#12377;&#12427;&#12290;
- */
-function getWindows(){
-	return list(WindowMediator.getEnumerator('navigator:browser'));
-}
-
-function addTab(url, background){
-	var d = new Deferred();
-	var tabbrowser = getMostRecentWindow().getBrowser();
-	var tab = tabbrowser.addTab(url);
-	var browser = tab.linkedBrowser;
-	if(!background)
-		tabbrowser.selectedTab = tab;
-	
-	browser.addEventListener('DOMContentLoaded', function(event){
-		browser.removeEventListener('DOMContentLoaded', arguments.callee, true);
-		
-		var win = event.originalTarget.defaultView;
-		d.callback(win.wrappedJSObject || win);
-	}, true);
-	
-	return d;
-}
-
-function getContents(file, charset){
-	try{
-		return withStream(new FileInputStream(file, -1, 0, false), function(fis){
-			return withStream(new ConverterInputStream(fis, charset), function(cis){
-				var out = {};
-				cis.readString(fis.available(), out);
-				return out.value;
-			});
-		});
-	} catch(e){}
-}
-
-function putContents(file, text, charset){
-	withStream(new FileOutputStream(file, 
-		FileOutputStream.PR_WRONLY | FileOutputStream.PR_CREATE_FILE | FileOutputStream.PR_TRUNCATE, 420, -1), function(stream){
-		text = text.convertFromUnicode(charset);
-		stream.write(text, text.length);
-	});
-}
-
-/**
- * POST/GET&#12398;&#36890;&#20449;&#12434;&#34892;&#12358;&#12290;
- * &#12510;&#12523;&#12481;&#12497;&#12540;&#12488;&#12434;&#20351;&#12387;&#12383;&#12450;&#12483;&#12503;&#12525;&#12540;&#12489;&#12418;&#34892;&#12360;&#12427;&#12290;
- *
- * @param {String} url &#12522;&#12463;&#12456;&#12473;&#12488;URL&#12290;
- * @param {Object} opts &#12522;&#12463;&#12456;&#12473;&#12488;&#12458;&#12503;&#12471;&#12519;&#12531;&#12290;
- * @param {String} opts.referrer &#12522;&#12501;&#12449;&#12521;URL&#12290;
- * @param {String} opts.charset &#25991;&#23383;&#12475;&#12483;&#12488;&#12290;&#25351;&#23450;&#12373;&#12428;&#12394;&#12356;&#22580;&#21512;&#12289;&#12524;&#12473;&#12509;&#12531;&#12473;&#12504;&#12483;&#12480;&#12398;&#25991;&#23383;&#12475;&#12483;&#12488;&#12364;&#20351;&#12431;&#12428;&#12427;&#12290;
- * @param {String || Object} opts.queryString &#12463;&#12456;&#12522;&#12290;
- * @param {String || Object} opts.sendContent 
- *        &#12467;&#12531;&#12486;&#12531;&#12488;&#12290;&#35373;&#23450;&#12373;&#12428;&#12390;&#12356;&#12427;&#12392;POST&#12513;&#12477;&#12483;&#12489;&#12395;&#12394;&#12427;&#12290;&#20516;&#12395;&#30452;&#25509;&#12501;&#12449;&#12452;&#12523;&#12434;&#12475;&#12483;&#12488;&#12375;&#12390;&#12418;&#12424;&#12356;&#12290;
- * @param {nsIInputStream || nsIFile} opts.KEY.file &#12450;&#12483;&#12503;&#12525;&#12540;&#12489;&#12501;&#12449;&#12452;&#12523;&#12290;
- * @param {String} opts.KEY.fileName 
- *        &#12469;&#12540;&#12496;&#12540;&#12408;&#36865;&#20449;&#12377;&#12427;&#12501;&#12449;&#12452;&#12523;&#21517;&#12290;&#25351;&#23450;&#12373;&#12428;&#12394;&#12356;&#22580;&#21512;&#12289;&#20803;&#12398;&#12501;&#12449;&#12452;&#12523;&#21517;&#12364;&#20351;&#12431;&#12428;&#12427;&#12290;
- * @param {String} opts.KEY.contentType 
- *        &#12467;&#12531;&#12486;&#12531;&#12488;&#12479;&#12452;&#12503;&#12290;&#25351;&#23450;&#12373;&#12428;&#12394;&#12356;&#22580;&#21512;&#12289;application/octet-stream&#12395;&#12394;&#12427;&#12290;
- */
-function request(url, opts){
-	var d = new Deferred();
-	
-	function setCookie(channel){
-		// &#12469;&#12540;&#12489;&#12497;&#12540;&#12486;&#12451;&#12398;&#12463;&#12483;&#12461;&#12540;&#12434;&#36865;&#20449;&#12377;&#12427;&#12363;?
-		if(getPrefValue('network.cookie.cookieBehavior') != 1)
-			return;
-		
-		channel.setRequestHeader('Cookie', getCookieString(channel.originalURI.host), true);
-	}
-	
-	opts = opts || {};
-	
-	var uri = createURI(url + queryString(opts.queryString, true));
-	var channel = broad(IOService.newChannelFromURI(uri));
-	
-	if(opts.referrer)
-		channel.referrer = createURI(opts.referrer);
-	
-	setCookie(channel);
-	
-	if(opts.sendContent){
-		var contents = opts.sendContent;
-		
-		// &#12510;&#12523;&#12481;&#12497;&#12540;&#12488;&#12481;&#12455;&#12483;&#12463;/&#12497;&#12521;&#12513;&#12540;&#12479;&#12540;&#28310;&#20633;
-		var multipart;
-		for(var name in contents){
-			// &#20516;&#12392;&#12375;&#12390;&#30452;&#25509;&#12501;&#12449;&#12452;&#12523;&#12364;&#35373;&#23450;&#12373;&#12428;&#12390;&#12356;&#12427;&#12363;?
-			var value = contents[name];
-			if(value instanceof IInputStream || value instanceof IFile)
-				value = contents[name] = {file : value};
-			
-			if(value &amp;&amp; value.file)
-				multipart = true;
-		}
-		
-		if(!multipart){
-			contents = queryString(contents);
-			channel.setUploadStream(
-				new StringInputStream(contents), 
-				'application/x-www-form-urlencoded', -1);
-		} else {
-			var boundary = '---------------------------' + (new Date().getTime());
-			var streams = [];
-			
-			for(var name in contents){
-				var value = contents[name];
-				if(value==null)
-					continue;
-				
-				if(!value.file){
-					streams.push([
-						'--' + boundary,
-						'Content-Disposition: form-data; name=&quot;' + name + '&quot;',
-						'',
-						(value.convertFromUnicode? value.convertFromUnicode() : value),
-					]);
-				} else {
-					if(value.file instanceof IFile){
-						value.fileName = value.file.leafName;
-						value.file = IOService.newChannelFromURI(createURI(value.file)).open();
-					}
-					
-					streams.push([
-						'--' + boundary,
-						'Content-Disposition: form-data; name=&quot;' + name + '&quot;; filename=&quot;' + (value.fileName || '_') + '&quot;',
-						'Content-Type: ' + (value.contentType || 'application/octet-stream'),
-						'',
-					])
-					streams.push(new BufferedInputStream(value.file));
-					streams.push('');
-				}
-			}
-			streams.push('--' + boundary + '--');
-			
-			var mimeStream = new MIMEInputStream(new MultiplexInputStream(streams));
-			mimeStream.addHeader('Content-Type', 'multipart/form-data; boundary=' + boundary);
-			channel.setUploadStream(mimeStream, null, -1);
-		}
-	}
-	
-	var redirectionCount = 0;
-	var listner = {
-		QueryInterface : createQueryInterface([
-			'nsIStreamListener', 
-			'nsIProgressEventSink', 
-			'nsIHttpEventSink', 
-			'nsIInterfaceRequestor', 
-			'nsIChannelEventSink']),
-		
-		// nsIProgressEventSink
-		onProgress : function(req, ctx, progress, progressMax){},
-		onStatus : function(req, ctx, status, statusArg){},
-		
-		// nsIInterfaceRequestor
-		getInterface : function(iid){
-			// Firefox 2&#12391;nsIPrompt&#12434;&#35201;&#27714;&#12373;&#12428;&#12456;&#12521;&#12540;&#12395;&#12394;&#12427;&#12383;&#12417;&#21028;&#23450;&#20966;&#29702;&#12434;&#22806;&#12377;
-			// &#12452;&#12531;&#12479;&#12540;&#12501;&#12455;&#12540;&#12473;&#12395;&#12394;&#12356;&#12513;&#12477;&#12483;&#12489;&#12434;&#21628;&#12400;&#12428;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12427;&#12364;&#30906;&#35469;&#31684;&#22258;&#12391;&#30330;&#29983;&#12375;&#12394;&#12363;&#12387;&#12383;
-			// http://developer.mozilla.org/ja/docs/Creating_Sandboxed_HTTP_Connections
-			return this;
-		},
-		
-		// nsIHttpEventSink
-		onRedirect : function(oldChannel, newChannel){},
-		
-		// nsIChannelEventSink
-		onChannelRedirect : function(oldChannel, newChannel, flags){
-			// channel.redirectionLimit&#12434;&#20351;&#12358;&#12392;&#12522;&#12480;&#12452;&#12524;&#12463;&#12488;&#24460;&#12398;&#12450;&#12489;&#12524;&#12473;&#12364;&#21462;&#24471;&#12391;&#12365;&#12394;&#12356;
-			redirectionCount++;
-			
-			if(opts.redirectionLimit!=null &amp;&amp; redirectionCount&gt;opts.redirectionLimit){
-				// NS_ERROR_REDIRECT_LOOP
-				newChannel.cancel(2152398879);
-				
-				var res = {
-					channel : newChannel,
-					responseText : '',
-					status : oldChannel.responseStatus,
-					statusText : oldChannel.responseStatusText,
-				};
-				d.callback(res);
-				
-				return;
-			}
-			
-			// &#12497;&#12501;&#12457;&#12540;&#12510;&#12531;&#12473;&#12434;&#32771;&#24942;&#12375;broad&#12434;&#20351;&#12431;&#12394;&#12356;
-			setCookie(newChannel.QueryInterface(Ci.nsIHttpChannel));
-		},
-		
-		// nsIStreamListener
-		onStartRequest: function(req, ctx){
-			this.data = [];
-		},
-		onDataAvailable: function(req, ctx, stream, sourceOffset, length){
-			this.data.push(new InputStream(stream).read(length));
-		},
-		onStopRequest: function (req, ctx, status){
-			// Firefox 3&#12391;&#12399;cancel&#12377;&#12427;&#12392;onStopRequest&#12399;&#21628;&#12400;&#12428;&#12394;&#12356;
-			if(opts.redirectionLimit!=null &amp;&amp; redirectionCount&gt;opts.redirectionLimit)
-				return;
-			
-			broad(req);
-			
-			var text = this.data.join('');
-			var charset = opts.charset || req.contentCharset;
-			
-			try{
-				text = charset? text.convertToUnicode(charset) : text;
-			} catch(err){
-				// [FIXME] &#35519;&#26619;&#20013;
-				error(err);
-				error(charset);
-				error(text);
-			}
-			var res = {
-				channel : req,
-				responseText : text,
-				status : req.responseStatus,
-				statusText : req.responseStatusText,
-			};
-			
-			if(Components.isSuccessCode(status) &amp;&amp; res.status &lt; 400){
-				d.callback(res);
-			}else{
-				res.message = getMessage('error.http.' + res.status);
-				d.errback(res);
-			}
-		},
-	};
-	channel.requestMethod = opts.sendContent? 'POST' : 'GET';
-	channel.notificationCallbacks = listner;
-	channel.asyncOpen(listner, null);
-	
-	// &#30906;&#23455;&#12395;&#12460;&#12505;&#12540;&#12472;&#12467;&#12524;&#12463;&#12488;&#12373;&#12428;&#12427;&#12424;&#12358;&#12395;&#35299;&#25918;&#12377;&#12427;
-	listner = null;
-	channel = null;
-	
-	return d;
-}
-
-
-// ----[MochiKit]-------------------------------------------------
-var StopProcess = {};
-
-function connected(src, sig){
-	return MochiKit.Signal._observers.some(function(o){
-		return o.source === src &amp;&amp; o.signal === sig &amp;&amp; o.connected;
-	});
-}
-
-function maybeDeferred(d) {
-	return typeof(d) == 'function'? 
-		MochiKit.Async.maybeDeferred(d) : 
-		(d==null || !d.addCallback)? 
-			succeed(d) : 
-			d;
-}
-
-MochiKit.Base.update(MochiKit.Signal.Event.prototype, {
-	// [FIXME] mouse.wheel.y&#12434;&#21033;&#29992;
-	wheelDelta : function(){
-		return 	this.event().detail;
-	},
-	isStopped : function(){
-		var evt = this.event();
-		
-		return evt.getPreventDefault ?
-			evt.getPreventDefault() :
-			evt.cancelBubble;
-	},
-	
-	// FIXME: &#32113;&#21512;&#12289;&#29694;&#22312;Strobo&#12391;&#21033;&#29992;
-	keyString : function(){
-		var keys = [];
-		
-		var mod = this.modifier();
-		mod.ctrl &amp;&amp; keys.push('CTRL');
-		mod.shift &amp;&amp; keys.push('SHIFT');
-		mod.alt &amp;&amp; keys.push('ALT');
-		
-		var key = this.key();
-		if(key){
-			key = key.string.replace(/^KEY_/, '');
-			if(!keys.some(function(i){return i==key}))
-				keys.push(key);
-		}
-		
-		return keys.join('+');
-	},
-})
-
-MochiKit.Base.update(MochiKit.Signal._specialKeys, {
-	61:  'KEY_SEMICOLON',
-	226: 'KEY_HORIZONTAL_BAR'
-});
-
-function formContents(elm){
-	if(typeof(elm)=='string')
-		elm = convertToHTMLDocument(elm);
-	
-	return reduce(function(p, a){
-		p[a[0]]=a[1];
-		return p;
-	}, zip.apply(null, MochiKit.DOM.formContents(elm)), {});
-}
-
-function queryString(params, question){
-	if(isEmpty(params))
-		return '';
-	
-	if(typeof(params)=='string')
-		return params;
-	
-	var qeries = [];
-	for(var key in params){
-		var value = params[key];
-		if(value==null)
-			continue;
-		qeries.push(encodeURIComponent(key) + '='+ encodeURIComponent(value));
-	}
-	return (question? '?' : '') + qeries.join('&amp;');
-}
-
-// FIXME: &#20114;&#25563;&#12398;&#12383;&#12417;
-function doXHR(url, opts){
-	error('deprecated: doXHR');
-	return request(url, opts);
-}
-
-registerIteratorFactory(
-	'SimpleEnumerator', 
-	function(it){
-		return it &amp;&amp; typeof(it.hasMoreElements) == &quot;function&quot;;
-	}, 
-	function(it){
-		var ifcs;
-		return {
-			next: function(){
-				if(!it.hasMoreElements())
-					throw StopIteration;
-				
-				var res = it.getNext();
-				if(!ifcs)
-					ifcs = getInterfaces(res);
-				return broad(res, ifcs);
-			}
-		};
-	});
-
-registerIteratorFactory(
-	'XML', 
-	function(it){
-		return typeof(it) == &quot;xml&quot;;
-	}, 
-	function(it){
-		var i = 0;
-		var len = it.length();
-		return {
-			next: function(){
-				if(i &gt;= len)
-					throw StopIteration;
-				
-				return it[i++];
-			}
-		};
-	});
-
-if(NavHistoryService){
-	registerIteratorFactory(
-		'nsINavHistoryContainerResultNode', 
-		function(it){
-			return it instanceof Ci.nsINavHistoryContainerResultNode;
-		}, 
-		function(it){
-			var i = 0;
-			var len = it.childCount;
-			return {
-				next: function(){
-					if(i &gt;= len)
-						throw StopIteration;
-					
-					return it.getChild(i++);
-				}
-			};
-		});
-}
-
-// &#23455;&#39443;&#30340;&#12289;items&#12398;&#21033;&#29992;&#12434;&#25512;&#22888;
-registerIteratorFactory(
-	'Object', 
-	function(it){
-		return it &amp;&amp; typeof(it) == &quot;object&quot;;
-	}, 
-	function(it){
-		var props = keys(it).filter(function(prop){
-			return it.hasOwnProperty(prop);
-		});
-		return {
-			next: function(){
-				var prop = props.shift();
-				if(!prop)
-					throw StopIteration;
-				
-				return [prop, it[prop]];
-			}
-		};
-	});
-
-/*
-function deferredForEach(it, func, index){
-	index = index || 0;
-	it = iter(it);
-	
-	var d = succeed();
-	try{
-		return d.
-			addCallback(func, it.next(), index).
-			addCallback(deferredForEach, it, func, ++index).
-			addErrback(function(e){
-				if(e.message!=StopIteration) throw e;
-			});
-	} catch (e if e==StopIteration){
-		return d;
-	}
-}
-*/
-
-// &#26283;&#23450;&#12497;&#12483;&#12481;&#12289;&#20107;&#21069;&#12395;&#12522;&#12473;&#12488;&#20316;&#25104;&#12289;&#28961;&#38480;&#12522;&#12473;&#12488;&#12395;&#26410;&#23550;&#24540;
-function deferredForEach(it, func){
-	var d = new Deferred();
-	var index = 0
-	forEach(it, function(item){
-		d.addCallback(func, item, index);
-		++index;
-	});
-	d.addErrback(function(err){
-		if(err.message==StopIteration)
-			return;
-		
-		throw err;
-	});
-	d.callback();
-	
-	return d;
-}
-
-function DeferredHash(ds){
-	var props = keys(ds);
-	
-	return new DeferredList(values(ds)).addCallback(function(results){
-		var res = {};
-		for (var i = 0; i &lt; results.length; i++)
-			res[props[i]] = results[i];
-		return res;
-	});
-};
-
-function getViewDimensions(){
-	var d = new Dimensions();
-	var doc = currentDocument();
-
-	if(doc.compatMode == 'CSS1Compat'){
-		d.h = doc.documentElement.clientHeight;
-		d.w = doc.documentElement.clientWidth;
-	} else {
-		d.h = doc.body.clientHeight;
-		d.w = doc.body.clientWidth;
-	}
-	
-	return d;
-}
-
-function getPageDimensions(){
-	var d = new Dimensions();
-	var doc = currentDocument();
-
-	if(doc.compatMode == 'CSS1Compat'){
-		d.h = doc.documentElement.scrollHeight;
-		d.w = doc.documentElement.scrollWidth;
-	} else {
-		d.h = doc.body.scrollHeight;
-		d.w = doc.body.scrollWidth;
-	}
-	
-	return d;
-}
-
-function getElementPosition(elm){
-	return withWindow(elm.ownerDocument.defaultView, function(){
-		return MochiKit.Style.getElementPosition(elm);
-	});
-}
-
-function roundPosition(p){
-	return new Coordinates(
-		Math.round(p.x), 
-		Math.round(p.y));
-}
-
-
-// ----[Prototype]-------------------------------------------------
-Math.hypot = function(x, y){
-	return Math.sqrt(x*x + y*y);
-}
-
-Number.prototype.toHexString = function(){
-	return ('0' + this.toString(16)).slice(-2);
-};
-
-
-String.prototype = update(String.prototype, {
-	pad :function(len, ch){
-		len = len-this.length;
-		if(len&lt;=0) return this;
-		return (ch || ' ').repeat(len) + this;
-	},
-	indent : function(num, c){
-		c = c || ' ';
-		return this.replace(/^/mg, c.repeat(num))
-	},
-	link: function(href){
-		return '&lt;a href=&quot;' + href + '&quot;&gt;' + this + '&lt;/a&gt;';
-	},
-	trim : function(){
-		return this.replace(/^\s+|\s+$/g, '');
-	},
-	repeat : function(n){
-		return new Array(n+1).join(this);
-	},
-	extract : function(re, group){
-		group = group==null? 1 : group;
-		var res = this.match(re);
-		return res ? res[group] : '';
-	},
-	decapitalize : function(){
-		return this.substr(0, 1).toLowerCase() + this.substr(1);
-	},
-	capitalize : function(){
-		return this.substr(0, 1).toUpperCase() + this.substr(1);
-	},
-	toByteArray : function(charset){
-		return new UnicodeConverter(charset).convertToByteArray(this, {});
-	},
-	md5 : function(charset){
-		var crypto = new CryptoHash(CryptoHash.MD5);
-		var data = this.toByteArray(charset);
-		crypto.update(data, data.length);
-		
-		return crypto.finish(false).split('').map(function(char){
-			return char.charCodeAt().toHexString();
-		}).join('');
-	},
-	extract : function(re, group){
-		group = group==null? 1 : group;
-		var res = this.match(re);
-		return res ? res[group] : '';
-	},
-	convertToUnicode : function(charset){
-		return new UnicodeConverter(charset).ConvertToUnicode(this);
-	},
-	convertFromUnicode : function(charset){
-		return new UnicodeConverter(charset).ConvertFromUnicode(this);
-	},
-	trimTag : function(){
-		return this.replace(/&lt;.*?&gt;/g, '');
-	},
-	includesFullwidth : function(){
-		return (/[^ -~&#65377;-&#65439;]/).test(this);
-	},
-	
-	// http://code.google.com/p/kanaxs/
-	toHiragana : function(){
-		var c, i = this.length, a = [];
-
-		while(i--){
-			c = this.charCodeAt(i);
-			a[i] = (0x30A1 &lt;= c &amp;&amp; c &lt;= 0x30F6) ? c - 0x0060 : c;
-		};
-
-		return String.fromCharCode.apply(null, a);
-	},
-	toKatakana : function(){
-		var c, i = this.length, a = [];
-
-		while(i--){
-			c = this.charCodeAt(i);
-			a[i] = (0x3041 &lt;= c &amp;&amp; c &lt;= 0x3096) ? c + 0x0060 : c;
-		};
-
-		return String.fromCharCode.apply(null, a);
-	},
-	
-	toRoma : function(){
-		var res = '';
-		var s = this.toKatakana();
-		for(var i = 0, kana, table = String.katakana ; i &lt; s.length ; i += kana.length){
-			kana = s.substr(i, 2);
-			roma = table[kana];
-			
-			if(!roma){
-				kana = s.substr(i, 1);
-				roma = table[kana];
-			}
-			
-			if(!roma){
-				roma = kana;
-			}
-			
-			res += roma;
-		}
-		res = res.replace(/ltu(.)/g, '$1$1');
-		
-		return res;
-	},
-});
-
-// FIXME: UTF-8&#12391;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#12525;&#12540;&#12489;&#12377;&#12427;&#12424;&#12358;&#12395;
-function isCorruptedScript(){
-	try{
-		'&#12454;&#12449;'.convertToUnicode();
-		return true;
-	} catch(e) {
-		return false;
-	}
-}
-
-String.katakana = {
-	'&#12454;&#12449;':'wha','&#12454;&#12451;':'wi','&#12454;&#12455;':'we','&#12454;&#12457;':'who',
-	'&#12461;&#12515;':'kya','&#12461;&#12451;':'kyi','&#12461;&#12517;':'kyu','&#12461;&#12455;':'kye','&#12461;&#12519;':'kyo',
-	'&#12463;&#12515;':'qya','&#12463;&#12517;':'qyu',
-	'&#12463;&#12449;':'qwa','&#12463;&#12451;':'qwi','&#12463;&#12453;':'qwu','&#12463;&#12455;':'qwe','&#12463;&#12457;':'qwo',
-	'&#12462;&#12515;':'gya','&#12462;&#12451;':'gyi','&#12462;&#12517;':'gyu','&#12462;&#12455;':'gye','&#12462;&#12519;':'gyo',
-	'&#12464;&#12449;':'gwa','&#12464;&#12451;':'gwi','&#12464;&#12453;':'gwu','&#12464;&#12455;':'gwe','&#12464;&#12457;':'gwo',
-	'&#12471;&#12515;':'sha','&#12471;&#12451;':'syi','&#12471;&#12517;':'shu','&#12471;&#12455;':'sye','&#12471;&#12519;':'sho',
-	'&#12473;&#12449;':'swa','&#12473;&#12451;':'swi','&#12473;&#12453;':'swu','&#12473;&#12455;':'swe','&#12473;&#12457;':'swo',
-	'&#12472;&#12515;':'ja','&#12472;&#12451;':'jyi','&#12472;&#12517;':'ju','&#12472;&#12455;':'jye','&#12472;&#12519;':'jo',
-	'&#12481;&#12515;':'cha','&#12481;&#12451;':'tyi','&#12481;&#12517;':'chu','&#12481;&#12455;':'tye','&#12481;&#12519;':'cho',
-	'&#12484;&#12449;':'tsa','&#12484;&#12451;':'tsi','&#12484;&#12455;':'tse','&#12484;&#12457;':'tso',
-	'&#12486;&#12515;':'tha','&#12486;&#12451;':'thi','&#12486;&#12517;':'thu','&#12486;&#12455;':'the','&#12486;&#12519;':'tho',
-	'&#12488;&#12449;':'twa','&#12488;&#12451;':'twi','&#12488;&#12453;':'twu','&#12488;&#12455;':'twe','&#12488;&#12457;':'two',
-	'&#12482;&#12515;':'dya','&#12482;&#12451;':'dyi','&#12482;&#12517;':'dyu','&#12482;&#12455;':'dye','&#12482;&#12519;':'dyo',
-	'&#12487;&#12515;':'dha','&#12487;&#12451;':'dhi','&#12487;&#12517;':'dhu','&#12487;&#12455;':'dhe','&#12487;&#12519;':'dho',
-	'&#12489;&#12449;':'dwa','&#12489;&#12451;':'dwi','&#12489;&#12453;':'dwu','&#12489;&#12455;':'dwe','&#12489;&#12457;':'dwo',
-	'&#12491;&#12515;':'nya','&#12491;&#12451;':'nyi','&#12491;&#12517;':'nyu','&#12491;&#12455;':'nye','&#12491;&#12519;':'nyo',
-	'&#12498;&#12515;':'hya','&#12498;&#12451;':'hyi','&#12498;&#12517;':'hyu','&#12498;&#12455;':'hye','&#12498;&#12519;':'hyo',
-	'&#12501;&#12515;':'fya','&#12501;&#12517;':'fyu','&#12501;&#12519;':'fyo',
-	'&#12501;&#12449;':'fa','&#12501;&#12451;':'fi','&#12501;&#12453;':'fwu','&#12501;&#12455;':'fe','&#12501;&#12457;':'fo',
-	'&#12499;&#12515;':'bya','&#12499;&#12451;':'byi','&#12499;&#12517;':'byu','&#12499;&#12455;':'bye','&#12499;&#12519;':'byo',
-	'&#12532;&#12449;':'va','&#12532;&#12451;':'vi','&#12532;':'vu','&#12532;&#12455;':'ve','&#12532;&#12457;':'vo',
-	'&#12532;&#12515;':'vya','&#12532;&#12517;':'vyu','&#12532;&#12519;':'vyo',
-	'&#12500;&#12515;':'pya','&#12500;&#12451;':'pyi','&#12500;&#12517;':'pyu','&#12500;&#12455;':'pye','&#12500;&#12519;':'pyo',
-	'&#12511;&#12515;':'mya','&#12511;&#12451;':'myi','&#12511;&#12517;':'myu','&#12511;&#12455;':'mye','&#12511;&#12519;':'myo',
-	'&#12522;&#12515;':'rya','&#12522;&#12451;':'ryi','&#12522;&#12517;':'ryu','&#12522;&#12455;':'rye','&#12522;&#12519;':'ryo',
-	
-	'&#12450;':'a','&#12452;':'i','&#12454;':'u','&#12456;':'e','&#12458;':'o',
-	'&#12459;':'ka','&#12461;':'ki','&#12463;':'ku','&#12465;':'ke','&#12467;':'ko',
-	'&#12469;':'sa','&#12471;':'shi','&#12473;':'su','&#12475;':'se','&#12477;':'so',
-	'&#12479;':'ta','&#12481;':'chi','&#12484;':'tsu','&#12486;':'te','&#12488;':'to',
-	'&#12490;':'na','&#12491;':'ni','&#12492;':'nu','&#12493;':'ne','&#12494;':'no',
-	'&#12495;':'ha','&#12498;':'hi','&#12501;':'fu','&#12504;':'he','&#12507;':'ho',
-	'&#12510;':'ma','&#12511;':'mi','&#12512;':'mu','&#12513;':'me','&#12514;':'mo',
-	'&#12516;':'ya','&#12518;':'yu','&#12520;':'yo',
-	'&#12521;':'ra','&#12522;':'ri','&#12523;':'ru','&#12524;':'re','&#12525;':'ro',
-	'&#12527;':'wa','&#12530;':'wo','&#12531;':'nn',
-	'&#12460;':'ga','&#12462;':'gi','&#12464;':'gu','&#12466;':'ge','&#12468;':'go',
-	'&#12470;':'za','&#12472;':'zi','&#12474;':'zu','&#12476;':'ze','&#12478;':'zo',
-	'&#12480;':'da','&#12482;':'di','&#12485;':'du','&#12487;':'de','&#12489;':'do',
-	'&#12496;':'ba','&#12499;':'bi','&#12502;':'bu','&#12505;':'be','&#12508;':'bo',
-	'&#12497;':'pa','&#12500;':'pi','&#12503;':'pu','&#12506;':'pe','&#12509;':'po',
-	
-	'&#12449;':'la','&#12451;':'li','&#12453;':'lu','&#12455;':'le','&#12457;':'lo',
-	'&#12533;':'lka','&#12534;':'lke','&#12483;':'ltu',
-	'&#12515;':'lya','&#12517;':'lyu','&#12519;':'lyo','&#12526;':'lwa',
-	'&#12290;':&quot;.&quot;,'&#12289;':&quot;,&quot;,'&#12540;':&quot;-&quot;,
-}
-
-if(isCorruptedScript()){
-	String.katakana = reduce(function(memo, pair){
-		memo[pair[0].convertToUnicode()] = pair[1];
-		return memo;
-	}, String.katakana, {});
-}
-
-
-
-Array.prototype = update(Array.prototype, {
-	split : function(step){
-		var res = [];
-		for(var i=0,len=this.length ; i&lt;len ;)
-			res.push(this.slice(i, i+=step));
-		
-		return res;
-	},
-});
-
-
-// ----[General]-------------------------------------------------
-function debug(msg){
-	if(!getPref('debug'))
-		return msg;
-	
-	return log(msg);
-}
-
-function log(msg){
-	firebug('log', arguments) || 
-		ConsoleService.logStringMessage(''+msg);
-	
-	return msg;
-}
-
-function error(err){
-	firebug('error', arguments) || 
-		Components.utils.reportError(err);
-	
-	return err;
-}
-
-function warn(msg){
-	firebug('warn', arguments) || 
-		ConsoleService.logMessage(new ScriptError(msg, null, null, null, null, ScriptError.warningFlag, null));
-	
-	return msg;
-}
-
-function firebug(method, args){
-	if(!getPref('useFirebug'))
-		return false;
-	
-	var win = getMostRecentWindow();
-	if(win.FirebugConsole &amp;&amp; win.FirebugContext) {
-		var console = new win.FirebugConsole(win.FirebugContext, win.content);
-		console[method].apply(console, args);
-		return true;
-	}
-	
-	// Firebug 1.2~
-	if ( win.Firebug &amp;&amp; win.Firebug.Console ) {
-		win.Firebug.Console.logFormatted.call(win.Firebug.Console, Array.slice(args), win.FirebugContext, method);
-		return true;
-	}
-	
-	return false;
-}
-
-function clearObject(obj){
-	for(var p in obj)
-		delete obj[p];
-	return obj;
-}
-
-function isEmpty(obj){
-	for(var i in obj)
-		return false;
-	return true;
-}
-
-function populateForm(form, values){
-	for(var name in values){
-		var control = $x('//*[@name=&quot;' + name + '&quot;]', form);
-		if(!control || !values[name])
-			continue;
-		
-		if(control.type == 'checkbox'){
-			if(control.value == values[name])
-				control.checked = true;
-		} else {
-			control.value = values[name];
-		}
-	}
-}
-
-function createSet(keys){
-	keys = (keys instanceof Array) ? keys : keys.split(/\s/);
-	return reduce(function(memo, val){
-		memo[val]=val;
-		return memo;
-	}, keys, {})
-}
-
-function pickUp(a, pop){
-	var i = random(a.length);
-	return pop ? a.splice(i, 1)[0] : a[i];
-}
-
-function random(max){
-	return Math.floor(Math.random() * max);
-}
-
-function absolutePath(path){
-  var e = currentDocument().createElement('span');
-  e.innerHTML = '&lt;a href=&quot;' + path + '&quot; /&gt;';
-  return e.firstChild.href;
-}
-
-// FIXME: String.prototype&#12434;&#20351;&#12358;
-function decapitalize(str){
-	return str.substr(0, 1).toLowerCase() + str.substr(1);
-}
-
-// FIXME: String.prototype&#12434;&#20351;&#12358;
-function capitalize(str){
-	return str.substr(0, 1).toUpperCase() + str.substr(1);
-}
-
-/**
- * &#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12398;&#12503;&#12525;&#12497;&#12486;&#12451;&#12434;&#12467;&#12500;&#12540;&#12377;&#12427;&#12290;
- * &#12466;&#12483;&#12479;&#12540;/&#12475;&#12483;&#12479;&#12540;&#12398;&#38306;&#25968;&#12418;&#23550;&#35937;&#12395;&#21547;&#12414;&#12428;&#12427;&#12290;
- * 
- * @param {Object} target &#12467;&#12500;&#12540;&#20808;&#12290;
- * @param {Object} source &#12467;&#12500;&#12540;&#20803;&#12290;
- * @return {Object} &#12467;&#12500;&#12540;&#20808;&#12290;
- */
-function extend(target, source){
-	for(var p in source){
-		var getter = source.__lookupGetter__(p);
-		if(getter)
-			target.__defineGetter__(p, getter);
-		
-		var setter = source.__lookupSetter__(p);
-		if(setter)
-			target.__defineSetter__(p, setter);
-		
-		if(!getter &amp;&amp; !setter)
-			target[p] = source[p];
-	}
-	
-	return target;
-}
-
-function openParamString(obj){
-	var params=[];
-	for(var p in obj)
-		params.push(p+(obj[p]? '='+obj[p] : ''));
-	return params.join(',');
-}
-
-/**
- * &#12513;&#12477;&#12483;&#12489;&#12364;&#21628;&#12400;&#12428;&#12427;&#21069;&#12395;&#20966;&#29702;&#12434;&#36861;&#21152;&#12377;&#12427;&#12290;
- * &#12424;&#12426;&#35443;&#32048;&#12394;&#12467;&#12531;&#12488;&#12525;&#12540;&#12523;&#12364;&#24517;&#35201;&#12394;&#22580;&#21512;&#12399;addAround&#12434;&#20351;&#12358;&#12371;&#12392;&#12290;
- * 
- * @param {Object} target &#23550;&#35937;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12290;
- * @param {String} name &#12513;&#12477;&#12483;&#12489;&#21517;&#12290;
- * @param {Function} before &#21069;&#20966;&#29702;&#12290;
- *        &#23550;&#35937;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12434;this&#12392;&#12375;&#12390;&#12289;&#12458;&#12522;&#12472;&#12490;&#12523;&#12398;&#24341;&#25968;&#12364;&#20840;&#12390;&#28193;&#12373;&#12428;&#12390;&#21628;&#12403;&#20986;&#12373;&#12428;&#12427;&#12290;
- */
-function addBefore(target, name, before) {
-	var original = target[name];
-	target[name] = function() {
-		before.apply(target, arguments);
-		return original.apply(target, arguments);
-	}
-}
-
-/**
- * &#12513;&#12477;&#12483;&#12489;&#12408;&#12450;&#12521;&#12454;&#12531;&#12489;&#12450;&#12489;&#12496;&#12452;&#12473;&#12434;&#36861;&#21152;&#12377;&#12427;&#12290;
- * &#20966;&#29702;&#12434;&#32622;&#12365;&#12363;&#12360;&#12289;&#24341;&#25968;&#12398;&#22793;&#24418;&#12420;&#12289;&#36820;&#12426;&#20516;&#12398;&#21152;&#24037;&#12434;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12377;&#12427;&#12290;
- * 
- * @param {Object} target &#23550;&#35937;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12290;
- * @param {String || Array} methodNames 
- *        &#12513;&#12477;&#12483;&#12489;&#21517;&#12290;&#35079;&#25968;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12427;&#12290;
- *        set*&#12398;&#12424;&#12358;&#12395;&#12527;&#12452;&#12523;&#12489;&#12459;&#12540;&#12488;&#12434;&#20351;&#12387;&#12390;&#12418;&#12424;&#12356;&#12290;
- * @param {Function} advice 
- *        &#12450;&#12489;&#12496;&#12452;&#12473;&#12290;proceed&#12289;args&#12289;target&#12289;methodName&#12398;4&#12388;&#12398;&#24341;&#25968;&#12364;&#28193;&#12373;&#12428;&#12427;&#12290;
- *        proceed&#12399;&#23550;&#35937;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12395;&#12496;&#12452;&#12531;&#12489;&#28168;&#12415;&#12398;&#12458;&#12522;&#12472;&#12490;&#12523;&#12398;&#12513;&#12477;&#12483;&#12489;&#12290;
- */
-function addAround(target, methodNames, advice){
-	methodNames = [].concat(methodNames);
-	
-	// &#12527;&#12452;&#12523;&#12489;&#12459;&#12540;&#12489;&#12398;&#23637;&#38283;
-	for(var i=0 ; i&lt;methodNames.length ; i++){
-		if(methodNames[i].indexOf('*')==-1) continue;
-		
-		var hint = methodNames.splice(i, 1)[0];
-		hint = new RegExp('^' + hint.replace(/\*/g, '.*'));
-		for(var prop in target) {
-			if(hint.test(prop) &amp;&amp; typeof(target[prop]) == 'function')
-				methodNames.push(prop);
-		}
-	}
-	
-	methodNames.forEach(function(methodName){
-		var method = target[methodName];
-		target[methodName] = function() {
-			var self = this;
-			return advice(
-				function(args){
-					return method.apply(self, args);
-				}, 
-				arguments, self, methodName);
-		};
-		target[methodName].overwrite = (method.overwrite || 0) + 1;
-	});
-}
-
-function joinText(txts, delm, trimTag){
-	if(!txts)
-		return '';
-	
-	if(delm==null)
-		delm = ',';
-	txts = flattenArray(txts.filter(operator.truth));
-	return (trimTag? txts.map(methodcaller('trimTag')) : txts).join(delm);
-}
-
-// http://mxr.mozilla.org/mozilla/source/toolkit/content/contentAreaUtils.js#811
-function validateFileName(fileName){
-	if (navigator.appVersion.indexOf(&quot;Windows&quot;) != -1) {
-		return fileName.
-			replace(/[\&quot;]+/g, &quot;'&quot;).
-			replace(/[\*\:\?]+/g, &quot; &quot;).
-			replace(/[\&lt;]+/g, &quot;(&quot;).
-			replace(/[\&gt;]+/g, &quot;)&quot;).
-			replace(/[\\\/\|]+/g, &quot;_&quot;);
-	}
-	else if (navigator.appVersion.indexOf(&quot;Macintosh&quot;) != -1){
-		return fileName.replace(/[\:\/]+/g, &quot;_&quot;);
-	}
-	
-	return fileName.replace(/[\/]+/g, &quot;_&quot;);
-}
-
-
-// ----[Repository]-------------------------------------------------
-function Repository(){
-	this.register.apply(this, arguments);
-}
-
-Repository.prototype = {
-	get size(){
-		return this.names.length;
-	},
-	
-	get names(){
-		return reduce(function(memo, i){
-			memo.push(i[0]);
-			return memo;
-		}, this, []);
-	},
-	
-	get values(){
-		return reduce(function(memo, i){
-			memo.push(i[1]);
-			return memo;
-		}, this, []);
-	},
-	
-	clear : function(){
-		this.names.forEach(function(name){
-			delete this[name];
-		}, this);
-	},
-	
-	find : function(name){
-		return this.values.filter(function(i){
-			return i.name &amp;&amp; i.name.search(name) != -1;
-		});
-	},
-	
-	copyTo : function(t){
-		forEach(this, function(m){
-			t[m[0]] = m[1];
-		});
-		return t;
-	},
-	
-	check : function(){
-		var args = arguments;
-		return reduce(function(memo, i){
-			if(i.check &amp;&amp; i.check.apply(i, args))
-				memo.push(i);
-			return memo;
-		}, this.values, []);
-	},
-	
-	register : function(defs, target){
-		if(!defs)
-			return;
-		
-		defs = [].concat(defs);
-		if(target){
-			var vals = this.values;
-			this.clear();
-			
-			for(var i=0 ; i &lt; vals.length ; i++)
-				if(vals[i].name == target)
-					break;
-			
-			vals.splice.apply(vals, [i, 0].concat(defs));
-			defs = vals;
-		}
-		
-		defs.forEach(function(d){
-			this[d.name] = d;
-		}, this);
-	},
-}
-
-// ----[DOM]-------------------------------------------------
-function unescapeHTML(s){
-	return s.replace(
-		/&amp;amp;/g, '&amp;').replace(
-		/&amp;quot;/g, '&quot;').replace(
-		/&amp;lt;/g, '&lt;').replace(
-		/&amp;gt;/g, '&gt;');
-}
-
-function clearChildren(p){
-	Array.slice(p.childNodes).forEach(p.removeChild, p);
-}
-
-function tagName(elm){
-	return elm.tagName? elm.tagName.toLowerCase() : '';
-}
-
-function $x(exp, context, multi) {
-	context = context || currentDocument();
-	
-	var doc = context.ownerDocument || context;
-	var exp = doc.createExpression(exp, {
-		lookupNamespaceURI : function(prefix){
-			switch (prefix){
-			case 'xul':
-				return XUL_NS;
-			case 'html':
-			case 'xhtml':
-				return HTML_NS;
-			default:
-				return '';
-			}
-		},
-	});
-	
-	var value = function(node){
-		if(!node)
-			return;
-		
-		switch (node.nodeType) {
-		case Node.ELEMENT_NODE:
-			return node;
-		case Node.ATTRIBUTE_NODE:
-		case Node.TEXT_NODE:
-			return node.textContent;
-		}
-	}
-	
-	var result = exp.evaluate(context, XPathResult.ANY_TYPE, null);
-	switch (result.resultType) {
-		case XPathResult.STRING_TYPE : return result.stringValue;
-		case XPathResult.NUMBER_TYPE : return result.numberValue;
-		case XPathResult.BOOLEAN_TYPE: return result.booleanValue;
-		case XPathResult.UNORDERED_NODE_ITERATOR_TYPE: {
-			if(!multi)
-				return value(result.iterateNext());
-			
-			result = exp.evaluate(context, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
-			var ret = [];
-			for (var i = 0, len = result.snapshotLength; i &lt; len ; i++) {
-				ret.push(value(result.snapshotItem(i)));
-			}
-			return ret;
-		}
-	}
-	return null;
-}
-
-function convertToDOM(xml){
-	var elm = currentDocument().createElementNS(HTML_NS, 'span');
-	elm.innerHTML = xml.toXMLString();
-	return elm.childNodes[0];
-}
-
-function convertToHTMLDocument(html, doc) {
-	html = html.replace(/&lt;!DOCTYPE.*?&gt;/, '').replace(/&lt;html.*?&gt;/, '').replace(/&lt;\/html&gt;.*/, '')
-	
-	doc = doc || currentDocument() || document;
-	var xsl = (new DOMParser()).parseFromString(
-		'&lt;?xml version=&quot;1.0&quot;?&gt;\
-			&lt;stylesheet version=&quot;1.0&quot; xmlns=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;\
-			&lt;output method=&quot;html&quot;/&gt;\
-		&lt;/stylesheet&gt;', 'text/xml');
-	
-	var xsltp = new XSLTProcessor();
-	xsltp.importStylesheet(xsl);
-	
-	doc = xsltp.transformToDocument(doc.implementation.createDocument('', '', null));
-	doc.appendChild(doc.createElement('html'));
-	
-	var range = doc.createRange();
-	range.selectNodeContents(doc.documentElement);
-	doc.documentElement.appendChild(range.createContextualFragment(html));
-	
-	return doc
-}
-
-function convertToXML(text){
-	return new XML(text.replace(/&lt;\?.*\?&gt;/gm,'').replace(/&lt;!.*?&gt;/gm, '').replace(/xmlns=&quot;.*?&quot;/,''));
-}
-
-function convertToXULElement(str){
-	str = str.toXMLString? str.toXMLString() : str;
-	var xul = (
-		'&lt;box xmlns=&quot;'+XUL_NS+'&quot; &gt;'+
-			str + 
-		'&lt;/box&gt;').replace(/^  +/gm, '').replace(/\n/g, '');
-	var parser = new DOMParser();
-	var elms = parser.parseFromString(xul, 'text/xml').documentElement.childNodes;
-	var result = currentDocument().createDocumentFragment();
-	for(var i=0 ; i&lt;elms.length ; i++)
-		result.appendChild(elms[i]);
-	
-	// Firefox 3&#12391;style&#23646;&#24615;&#12364;&#36969;&#29992;&#12373;&#12428;&#12394;&#12356;&#12383;&#12417;&#20877;&#35373;&#23450;&#12434;&#34892;&#12358;(&#26283;&#23450;&#12497;&#12483;&#12481;)
-	if(parseFloat(AppInfo.version) &gt;= 3){
-		for(var style, w = currentDocument().createTreeWalker(result, NodeFilter.SHOW_ELEMENT, null, true) ; e = w.nextNode() ; ){
-			if(style = e.getAttribute('style')){
-				e.setAttribute('style', '');
-				e.setAttribute('style', style);
-			}
-		}
-	}
-
-	return result;
-}
-
-function keyString(e){
-	// &#21021;&#22238;&#21628;&#12403;&#20986;&#12375;&#26178;&#12395;&#12461;&#12540;&#12486;&#12540;&#12502;&#12523;&#12434;&#20316;&#25104;&#12377;&#12427;
-	var table = [];
-	for(var name in KeyEvent)
-		if(name.indexOf('DOM_VK_')==0)
-			table[KeyEvent[name]] = name.substring(7);
-	
-	return (keyString = function(e){
-		var code = e.keyCode;
-		var res = [];
-		(e.ctrlKey  || code==KeyEvent.DOM_VK_CONTROL) &amp;&amp; res.push('CTRL');
-		(e.shiftKey || code==KeyEvent.DOM_VK_SHIFT)   &amp;&amp; res.push('SHIFT');
-		(e.altKey   || code==KeyEvent.DOM_VK_ALT)     &amp;&amp; res.push('ALT');
-		
-		if(code &lt; KeyEvent.DOM_VK_SHIFT || KeyEvent.DOM_VK_ALT &lt; code)
-			res.push(table[code]);
-		
-		return res.join(' + ');
-	})(e);
-}
-
-function cancel(e){
-	e.preventDefault();
-	e.stopPropagation();
-}
-
-function showNotification(fragments, animation){
-	var browser = getMostRecentWindow().getBrowser();
-	var doc = browser.ownerDocument;
-	var box = browser.getNotificationBox(browser.selectedBrowser);
-	
-	var slideSteps = box.slideSteps;
-	if(!animation)
-		box.slideSteps = 1;
-	
-	var notification = this.notification = box.appendNotification('', '', null,	box.PRIORITY_INFO_HIGH, null);
-	box.slideSteps = slideSteps;
-	
-	var outset = doc.getAnonymousNodes(notification)[0];
-	outset.setAttribute('align', 'start');
-	
-	var details = doc.getAnonymousElementByAttribute(notification, 'anonid', 'details');
-	clearChildren(details);
-	
-	notification.appendChild(fragments);
-	
-	if(!animation){
-		notification.__close = notification.close;
-		notification.close = function(){
-			box.slideSteps = 1;
-			notification.__close();
-			box.slideSteps = slideSteps;
-		}
-	}
-	
-	return notification;
-}
-
-function capture(win, pos, dim, scale){
-	// &#12487;&#12501;&#12457;&#12523;&#12488;&#12391;&#12399;AppShellService.hiddenDOMWindow&#12364;&#20351;&#12431;&#12428;&#12427;
-	var canvas = document.createElementNS(HTML_NS, 'canvas');
-	var ctx = canvas.getContext('2d');
-	canvas.width = dim.w;
-	canvas.height = dim.h;
-	
-	if(scale){
-		scale	= scale.w? scale.w/dim.w : 
-			scale.h? scale.h/dim.h : scale;
-		
-		canvas.width = dim.w * scale;
-		canvas.height = dim.h * scale;
-		ctx.scale(scale, scale);
-	}
-	
-	ctx.drawWindow(win, pos.x, pos.y, dim.w, dim.h, '#FFF');
-	return canvas.toDataURL('image/png', '');
-}
-
-function convertToDataURL(src){
-	var d = new Deferred();
-	var canvas = document.createElementNS(HTML_NS, 'canvas');
-	
-	if(src instanceof Ci.nsIDOMHTMLImageElement){
-		var img = src;
-	} else {
-		var img = document.createElementNS(HTML_NS, 'img');
-		img.src = src;
-	}
-	img.onload = function(){
-		canvas.width = img.width;
-		canvas.height = img.height;
-		canvas.getContext('2d').drawImage(img, 0, 0);
-		d.callback(canvas.toDataURL('image/png', ''));
-	}
-	return d;
-}
-
-
-// ----[UI]-------------------------------------------------
-/**
- * &#12510;&#12454;&#12473;&#12471;&#12519;&#12540;&#12488;&#12459;&#12483;&#12488;&#12434;&#30435;&#35222;&#12377;&#12427;&#12290;
- * &#12510;&#12454;&#12473;&#12480;&#12454;&#12531;&#12395;&#12424;&#12426;1&#12475;&#12483;&#12471;&#12519;&#12531;&#12364;&#12399;&#12376;&#12414;&#12426;&#12289;&#20840;&#12390;&#12398;&#12508;&#12479;&#12531;&#12398;&#12510;&#12454;&#12473;&#12450;&#12483;&#12503;&#12391;&#32066;&#12431;&#12427;&#12290;
- * 2&#37325;&#23455;&#34892;&#12434;&#38450;&#12368;&#12383;&#12417;&#12289;&#12381;&#12398;&#12475;&#12483;&#12471;&#12519;&#12531;&#12391;&#19968;&#24230;&#12391;&#12418;&#20966;&#29702;&#12364;&#34892;&#12431;&#12428;&#12427;&#12392;&#20197;&#38477;&#12399;&#23455;&#34892;&#12373;&#12428;&#12394;&#12356;&#12290;
- *
- * @param {Element} target &#30435;&#35222;&#23550;&#35937;&#12398;&#12456;&#12524;&#12513;&#12531;&#12488;
- * @param {Function} check &#12452;&#12505;&#12531;&#12488;&#20966;&#29702;&#38306;&#25968;(&#26410;&#20966;&#29702;&#12398;&#22580;&#21512;&#12399;true&#12434;&#36820;&#12377;)
- */
-function observeMouseShortcut(target, check){
-	var BUTTONS = ['LEFT_DOWN', 'CENTER_DOWN', 'RIGHT_DOWN'];
-	var downed = {};
-	var event;
-	var executed = false;
-	target.addEventListener('mousedown', function(e){
-		if(isEmpty(downed)){
-			target.addEventListener('keydown', onKeyDown, true);
-			target.addEventListener('keypress', cancelEvent, true);
-			executed = false;
-			
-			// Firefox 2&#12395;&#12362;&#12356;&#12390;&#24460;&#12391;clientX&#12394;&#12393;&#12364;&#21462;&#24471;&#12391;&#12365;&#12394;&#12367;&#12394;&#12427;&#12383;&#12417;&#12463;&#12525;&#12540;&#12531;&#12377;&#12427;
-			event = update({}, e);
-		}
-		
-		downed[BUTTONS[e.button]] = true;
-		
-		checkKey(e, [keyString(e), keys(downed)])
-	}, true);
-	
-	target.addEventListener('mouseup', function(e){
-		delete downed[BUTTONS[e.button]];
-		if(isEmpty(downed)){
-			target.removeEventListener('keydown', onKeyDown, true);
-			target.removeEventListener('keypress', cancelEvent, true);
-			event = null;
-		}
-	}, true);
-
-	target.addEventListener('contextmenu', cancelEvent, true);
-	target.addEventListener('click', cancelEvent, true);
-	
-	function cancelEvent(e){
-		// &#12463;&#12522;&#12483;&#12463;&#12395;&#12424;&#12427;&#36983;&#31227;&#12420;&#12467;&#12531;&#12486;&#12461;&#12473;&#12488;&#12513;&#12491;&#12517;&#12540;&#12289;&#12471;&#12519;&#12540;&#12488;&#12459;&#12483;&#12488;&#12461;&#12540;&#12394;&#12393;&#12434;&#25233;&#21046;&#12377;&#12427;
-		if(executed)
-			cancel(e)
-	}
-	
-	function onKeyDown(e){
-		var code = e.keyCode;
-		if(KeyEvent.DOM_VK_SHIFT &lt;= code &amp;&amp; code &lt;= KeyEvent.DOM_VK_ALT)
-			return;
-		
-		if(executed){
-			cancel(e)
-			return;
-		}
-		
-		if(checkKey(e, [keys(downed), keyString(e)]))
-			cancel(e);
-	}
-	
-	function checkKey(e, keys){
-		var hit = !check(event, joinText(keys, (' + ')));
-		if(hit)
-			executed = true;
-		
-		return hit;
-	}
-}
-
-function selectElement(doc){
-	var deferred = new Deferred();
-	doc = doc || currentDocument();
-	
-	var target;
-	function onMouseOver(e){
-		target = e.target;
-		target.originalBackground = target.style.background;
-		target.style.background = selectElement.TARGET_BACKGROUND;
-	}
-	function onMouseOut(e){
-		unpoint(e.target);
-	}
-	function onClick(e){
-		cancel(e);
-		
-		finalize();
-		deferred.callback(target);
-	}
-	function onKeyDown(e){
-		cancel(e);
-		
-		switch(keyString(e)){
-		case 'ESCAPE':
-			finalize();
-			deferred.cancel();
-			return;
-		}
-	}
-	function unpoint(elm){
-		if(elm.originalBackground!=null){
-			elm.style.background = elm.originalBackground;
-			elm.originalBackground = null;
-		}
-	}
-	function finalize(){
-		doc.removeEventListener('mouseover', onMouseOver, true);
-		doc.removeEventListener('mouseout', onMouseOut, true);
-		doc.removeEventListener('click', onClick, true);
-		doc.removeEventListener('keydown', onKeyDown, true);
-		
-		unpoint(target);
-	}
-	
-	doc.addEventListener('mouseover', onMouseOver, true);
-	doc.addEventListener('mouseout', onMouseOut, true);
-	doc.addEventListener('click', onClick, true);
-	doc.addEventListener('keydown', onKeyDown, true);
-	
-	return deferred;
-}
-selectElement.TARGET_BACKGROUND = '#888';
-
-function selectRegion(doc){
-	var deferred = new Deferred();
-	doc = doc || currentDocument();
-	
-	doc.documentElement.style.cursor = 'crosshair';
-	
-	var style = doc.createElement('style');
-	style.innerHTML = &lt;&gt;&lt;![CDATA[
-		* {
-			cursor: crosshair !important;
-			-moz-user-select: none;
-		}
-	]]&gt;&lt;/&gt;;
-	doc.body.appendChild(style);
-	
-	var region, p, d, moving, square;
-	function mouse(e){
-		return {
-			x: e.clientX, 
-			y: e.clientY
-		};
-	}
-	
-	function onMouseMove(e){
-		var to = mouse(e);
-		
-		if(moving){
-			p = {
-				x: Math.max(to.x - d.w, 0), 
-				y: Math.max(to.y - d.h, 0)
-			};
-			setElementPosition(region, p);
-		}
-		
-		d = {
-			w: to.x - p.x, 
-			h: to.y - p.y
-		};
-		if(square){
-			var s = Math.min(d.w, d.h);
-			d = {w: s, h: s};
-		}
-		setElementDimensions(region, d);
-	}
-	
-	function onMouseDown(e){
-		cancel(e);
-		
-		p = mouse(e);
-		region = doc.createElement('div');
-		region.setAttribute('style', &lt;&gt;
-			background : #888;
-			opacity    : 0.5;
-			position   : fixed;
-			z-index    : 999999999;
-			top        : {p.y}px;
-			left       : {p.x}px;
-		&lt;/&gt;);
-		doc.body.appendChild(region);
-		
-		doc.addEventListener('mousemove', onMouseMove, true);
-		doc.addEventListener('mouseup', onMouseUp, true);
-		doc.addEventListener('keydown', onKeyDown, true);
-		doc.addEventListener('keyup', onKeyUp, true);
-	}
-	
-	function onKeyDown(e){
-		cancel(e);
-		
-		switch(keyString(e)){
-		case 'SHIFT': square = true; return;
-		case 'SPACE': moving = true; return;
-		case 'ESCAPE':
-			finalize();
-			deferred.cancel();
-			return;
-		}
-	}
-	
-	function onKeyUp(e){
-		cancel(e);
-		
-		switch(keyString(e)){
-		case 'SHIFT': square = false; return;
-		case 'SPACE': moving = false; return;
-		}
-	}
-	
-	function onMouseUp(e){
-		cancel(e);
-		
-		p = getElementPosition(region);
-		finalize();
-		
-		// FIXME: &#26283;&#23450;/&#24038;&#19978;&#26041;&#21521;&#12408;&#12398;&#36984;&#25246;&#19981;&#21487;/&#12463;&#12522;&#12483;&#12463;&#12392;&#12398;&#12480;&#12502;&#12523;&#12452;&#12531;&#12479;&#12540;&#12501;&#12455;&#12540;&#12473;&#26410;&#23455;&#35013;
-		if(!d || d.w&lt;0 || d.h&lt;0){
-			deferred.cancel();
-			return;
-		}
-		
-		deferred.callback({
-			position: p,
-			dimensions: d,
-		});
-	}
-
-	function onClick(e){
-		// &#12522;&#12531;&#12463;&#12463;&#12522;&#12483;&#12463;&#12395;&#12424;&#12427;&#36983;&#31227;&#12434;&#25233;&#27490;&#12377;&#12427;
-		cancel(e);
-		
-		// mouseup&#12424;&#12426;&#12418;&#24460;&#12395;&#12452;&#12505;&#12531;&#12488;&#12364;&#30330;&#29983;&#12377;&#12427;&#12383;&#12417;&#12289;&#12371;&#12371;&#12391;&#21462;&#12426;&#38500;&#12367;
-		doc.removeEventListener('click', onClick, true);
-	}
-	
-	function finalize(){
-		doc.removeEventListener('mousedown', onMouseDown, true);
-		doc.removeEventListener('mousemove', onMouseMove, true);
-		doc.removeEventListener('mouseup', onMouseUp, true);
-		doc.removeEventListener('keydown', onKeyDown, true);
-		doc.removeEventListener('keyup', onKeyUp, true);
-		
-		doc.documentElement.style.cursor = '';
-		
-		removeElement(region);
-		removeElement(style);
-	}
-	
-	doc.addEventListener('mousedown', onMouseDown, true);
-	doc.addEventListener('click', onClick, true);
-	doc.defaultView.focus();
-	
-	return deferred;
-}
-
-function flashView(doc){
-	var d = new Deferred();
-	var doc = doc || currentDocument();
-	var flash = doc.createElement('div');
-	flash.setAttribute('style', &lt;&gt;
-		background : #EEE;
-		position   : fixed;
-		z-index    : 999999999;
-		top        : 0;
-		left       : 0;
-	&lt;/&gt;);
-	setElementDimensions(flash, getViewDimensions());
-	doc.body.appendChild(flash);
-	fade(flash, {
-		duration : 0.1,
-		afterFinish : function(){
-			removeElement(flash);
-			d.callback();
-		},
-	});
-	
-	return d;
-}
-
-// ----[Model/Service]-------------------------------------------------
-AbstractSessionService = {
-	updateSession : function(){
-		var cookie = this.getAuthCookie();
-		if(cookie &amp;&amp; this.cookie==cookie)
-			return 'same';
-		
-		delete this.cookie;
-		delete this.user;
-		delete this.token;
-		
-		if(!cookie)
-			return 'none';
-		
-		this.cookie = cookie;
-		
-		return 'changed';
-	},
-}
+// ----[Application]-------------------------------------------------
+var getPref = partial(getPrefValue, 'extensions.tombloo.');
+var setPref = partial(setPrefValue, 'extensions.tombloo.');
+
+var CHROME_DIR = 'chrome://tombloo';
+var CHROME_CONTENT_DIR = CHROME_DIR + '/content';
+
+var EXTENSION_ID = 'tombloo@brasil.to';
+
+var grobal = this;
+disconnectAll(grobal);
+
+// &#12522;&#12525;&#12540;&#12489;&#12395;&#12424;&#12387;&#12387;&#12390;&#22793;&#26356;&#12373;&#12428;&#12394;&#12356;&#38936;&#22495;&#12434;&#29992;&#24847;&#12377;&#12427;
+// &#12452;&#12505;&#12531;&#12488;&#12395;&#23433;&#23450;&#12375;&#12390;&#12501;&#12483;&#12463;&#12377;&#12427;&#12383;&#12417;&#12394;&#12393;&#12395;&#20351;&#12431;&#12428;&#12427;
+if(typeof(constant)=='undefined')
+	constant = {};
+
+
+// ----[XPCOM]-------------------------------------------------
+function getCookies(host, name){
+	var re = new RegExp(host + '$');
+	return filter(function(c){
+		return (c.host.search(re) != -1) &amp;&amp; 
+			(name? c.name == name : true);
+	}, CookieManager.enumerator);
+}
+
+function getCookieString(host, name){
+	return getCookies(host, name).map(function(c){
+		return c.name + '=' + c.value ;
+	}).join('; ');
+}
+
+function getPasswords(host, user){
+	if(PasswordManager){
+		return filter(function(p){
+			return (p.host == host) &amp;&amp; 
+				(user? p.user == user : true);
+		}, PasswordManager.enumerator);
+	} else {
+		return map(function(p){
+			return {
+				user : p.username,
+				usernameFieldName : p.usernameField,
+				password : p.password,
+				passwordFieldName : p.passwordField,
+			}
+		}, ifilter(function(c){
+			return (user? p.username == user : true);
+		}, LoginManager.findLogins({}, host, host, null)));
+	}
+}
+
+var stringBundle = StringBundleService.createBundle(CHROME_DIR + '/locale/messages.properties');
+function getMessage(key){
+	var ps = Array.splice(arguments, 1);
+	try{
+		if(ps){
+			return stringBundle.formatStringFromName(key, ps, ps.length);
+		} else {
+			return stringBundle.GetStringFromName(key);
+		}
+	} catch(e){
+		return '';
+	}
+}
+
+function input(form, title){
+	var pair;
+	if(some(form, function(p){
+		pair = p;
+		return isArrayLike(p[1]);
+	})){
+		var selected = {};
+		var [msg, list] = pair;
+		if(!PromptService.select(null, title || '', msg, list.length, list, selected))
+			return;
+		
+		return list[selected.value];
+	} else {
+		var args = [null, title || ''];
+		for(var msg in form){
+			var val = {value : form[msg]};
+			form[msg] = val;
+			args.push(msg);
+			args.push(val);
+		}
+		
+		if(!PromptService.prompt.apply(PromptService, args))
+			return;
+		
+		for(var msg in form)
+			form[msg] = form[msg].value;
+		
+		return form;
+	}
+}
+
+function download(sourceURL, targetFile){
+	var d = new Deferred();
+	var targetURI = IOService.newFileURI(targetFile);
+	var sourceURI = IOService.newURI(sourceURL, null, null);
+	
+	var persist = WebBrowserPersist();
+	with(persist){
+		persist.progressListener = {
+			onLocationChange : function(){},
+			onProgressChange : function(){},
+			onSecurityChange : function(){},
+			onStatusChange : function(){},
+			onStateChange : function(progress, req, state, status){
+				if (state &amp; IWebProgressListener.STATE_STOP)
+					d.callback(targetFile);
+			},
+		}
+		
+		persistFlags = PERSIST_FLAGS_FROM_CACHE;
+		saveURI(sourceURI, null, null, null, null, targetURI);
+	}
+	
+	return d;
+}
+
+function createDir(dir){
+	var dir = (dir instanceof IFile) ? dir : new LocalFile(dir);
+	if(dir.exists()){
+		if(dir.isDirectory())
+			dir.permissions = 0774;
+	} else {
+		dir.create(dir.DIRECTORY_TYPE, 0774);
+	}
+	
+	return dir;
+}
+
+function uriToFileName(uri){
+	uri = broad(createURI(uri));
+	uri = (uri.host+uri.filePath).replace(/\/$/, '');
+	return validateFileName(uri);
+}
+
+function clearCollision(file){
+	var name = file.leafName;
+	for(var count = 2 ; file.exists() ; count++)
+		file.leafName = name.replace(/(.*)\./, '$1('+count+').');
+}
+
+function getContentDir(){
+	var contentDir = getExtensionDir(EXTENSION_ID);
+	contentDir.setRelativeDescriptor(contentDir, 'chrome/content');
+	
+	return contentDir;
+}
+
+function getPatchDir(){
+	var dir = getDataDir();
+	dir.append('script');
+	
+	return createDir(dir);
+}
+
+function getDataDir(name){
+	var path = 'file:///' + getPref('dataDir').replace(/\{(.*?)\}/g, function(all, name){
+		return DirectoryService.get(name, IFile).path;
+	}).replace(/\\/g, '/')
+	
+	var dir = createDir(getLocalFile(path));
+	name &amp;&amp; dir.append(name);
+	return dir;
+}
+
+function getTempDir(name){
+	var dir = DirectoryService.get('TmpD', IFile);
+	name &amp;&amp; dir.append(name);
+	
+	return dir;
+}
+
+function getTempFile(ext){
+	var file = getTempDir();
+	file.append(joinText(['tombloo_' + (new Date()).getTime(), ext], '.'));
+	
+	return file;
+}
+
+function openProgressDialog(progress, max, value){
+	if(!(progress instanceof Progress))
+		progress = new Progress(progress, max, value);
+	
+	openDialog('chrome://tombloo/content/library/progressDialog.xul', 400, 95, 'dialog', progress);
+	
+	return progress;
+}
+
+function openDialog(url, w, h, features, value){
+	var x = (screen.width - w) / 2;
+	var y = (screen.height - h) / 2;
+	getMostRecentWindow().openDialog(url, '_blank', (features? features + ',' : '') + openParamString({
+		width : w,
+		height : h,
+		left : x,
+		top : y,
+	}), value);
+}
+
+/**
+ * &#12502;&#12521;&#12454;&#12470;&#12454;&#12451;&#12531;&#12489;&#12454;&#12398;&#12522;&#12473;&#12488;&#12434;&#21462;&#24471;&#12377;&#12427;&#12290;
+ */
+function getWindows(){
+	return list(WindowMediator.getEnumerator('navigator:browser'));
+}
+
+function addTab(url, background){
+	var d = new Deferred();
+	var tabbrowser = getMostRecentWindow().getBrowser();
+	var tab = tabbrowser.addTab(url);
+	var browser = tab.linkedBrowser;
+	if(!background)
+		tabbrowser.selectedTab = tab;
+	
+	browser.addEventListener('DOMContentLoaded', function(event){
+		browser.removeEventListener('DOMContentLoaded', arguments.callee, true);
+		
+		var win = event.originalTarget.defaultView;
+		d.callback(win.wrappedJSObject || win);
+	}, true);
+	
+	return d;
+}
+
+function getContents(file, charset){
+	try{
+		return withStream(new FileInputStream(file, -1, 0, false), function(fis){
+			return withStream(new ConverterInputStream(fis, charset), function(cis){
+				var out = {};
+				cis.readString(fis.available(), out);
+				return out.value;
+			});
+		});
+	} catch(e){}
+}
+
+function putContents(file, text, charset){
+	withStream(new FileOutputStream(file, 
+		FileOutputStream.PR_WRONLY | FileOutputStream.PR_CREATE_FILE | FileOutputStream.PR_TRUNCATE, 420, -1), function(stream){
+		text = text.convertFromUnicode(charset);
+		stream.write(text, text.length);
+	});
+}
+
+/**
+ * POST/GET&#12398;&#36890;&#20449;&#12434;&#34892;&#12358;&#12290;
+ * &#12510;&#12523;&#12481;&#12497;&#12540;&#12488;&#12434;&#20351;&#12387;&#12383;&#12450;&#12483;&#12503;&#12525;&#12540;&#12489;&#12418;&#34892;&#12360;&#12427;&#12290;
+ *
+ * @param {String} url &#12522;&#12463;&#12456;&#12473;&#12488;URL&#12290;
+ * @param {Object} opts &#12522;&#12463;&#12456;&#12473;&#12488;&#12458;&#12503;&#12471;&#12519;&#12531;&#12290;
+ * @param {String} opts.referrer &#12522;&#12501;&#12449;&#12521;URL&#12290;
+ * @param {String} opts.charset &#25991;&#23383;&#12475;&#12483;&#12488;&#12290;&#25351;&#23450;&#12373;&#12428;&#12394;&#12356;&#22580;&#21512;&#12289;&#12524;&#12473;&#12509;&#12531;&#12473;&#12504;&#12483;&#12480;&#12398;&#25991;&#23383;&#12475;&#12483;&#12488;&#12364;&#20351;&#12431;&#12428;&#12427;&#12290;
+ * @param {String || Object} opts.queryString &#12463;&#12456;&#12522;&#12290;
+ * @param {String || Object} opts.sendContent 
+ *        &#12467;&#12531;&#12486;&#12531;&#12488;&#12290;&#35373;&#23450;&#12373;&#12428;&#12390;&#12356;&#12427;&#12392;POST&#12513;&#12477;&#12483;&#12489;&#12395;&#12394;&#12427;&#12290;&#20516;&#12395;&#30452;&#25509;&#12501;&#12449;&#12452;&#12523;&#12434;&#12475;&#12483;&#12488;&#12375;&#12390;&#12418;&#12424;&#12356;&#12290;
+ * @param {nsIInputStream || nsIFile} opts.KEY.file &#12450;&#12483;&#12503;&#12525;&#12540;&#12489;&#12501;&#12449;&#12452;&#12523;&#12290;
+ * @param {String} opts.KEY.fileName 
+ *        &#12469;&#12540;&#12496;&#12540;&#12408;&#36865;&#20449;&#12377;&#12427;&#12501;&#12449;&#12452;&#12523;&#21517;&#12290;&#25351;&#23450;&#12373;&#12428;&#12394;&#12356;&#22580;&#21512;&#12289;&#20803;&#12398;&#12501;&#12449;&#12452;&#12523;&#21517;&#12364;&#20351;&#12431;&#12428;&#12427;&#12290;
+ * @param {String} opts.KEY.contentType 
+ *        &#12467;&#12531;&#12486;&#12531;&#12488;&#12479;&#12452;&#12503;&#12290;&#25351;&#23450;&#12373;&#12428;&#12394;&#12356;&#22580;&#21512;&#12289;application/octet-stream&#12395;&#12394;&#12427;&#12290;
+ */
+function request(url, opts){
+	var d = new Deferred();
+	
+	function setCookie(channel){
+		// &#12469;&#12540;&#12489;&#12497;&#12540;&#12486;&#12451;&#12398;&#12463;&#12483;&#12461;&#12540;&#12434;&#36865;&#20449;&#12377;&#12427;&#12363;?
+		if(getPrefValue('network.cookie.cookieBehavior') != 1)
+			return;
+		
+		channel.setRequestHeader('Cookie', getCookieString(channel.originalURI.host), true);
+	}
+	
+	opts = opts || {};
+	
+	var uri = createURI(url + queryString(opts.queryString, true));
+	var channel = broad(IOService.newChannelFromURI(uri));
+	
+	if(opts.referrer)
+		channel.referrer = createURI(opts.referrer);
+	
+	setCookie(channel);
+	
+	if(opts.sendContent){
+		var contents = opts.sendContent;
+		
+		// &#12510;&#12523;&#12481;&#12497;&#12540;&#12488;&#12481;&#12455;&#12483;&#12463;/&#12497;&#12521;&#12513;&#12540;&#12479;&#12540;&#28310;&#20633;
+		var multipart;
+		for(var name in contents){
+			// &#20516;&#12392;&#12375;&#12390;&#30452;&#25509;&#12501;&#12449;&#12452;&#12523;&#12364;&#35373;&#23450;&#12373;&#12428;&#12390;&#12356;&#12427;&#12363;?
+			var value = contents[name];
+			if(value instanceof IInputStream || value instanceof IFile)
+				value = contents[name] = {file : value};
+			
+			if(value &amp;&amp; value.file)
+				multipart = true;
+		}
+		
+		if(!multipart){
+			contents = queryString(contents);
+			channel.setUploadStream(
+				new StringInputStream(contents), 
+				'application/x-www-form-urlencoded', -1);
+		} else {
+			var boundary = '---------------------------' + (new Date().getTime());
+			var streams = [];
+			
+			for(var name in contents){
+				var value = contents[name];
+				if(value==null)
+					continue;
+				
+				if(!value.file){
+					streams.push([
+						'--' + boundary,
+						'Content-Disposition: form-data; name=&quot;' + name + '&quot;',
+						'',
+						(value.convertFromUnicode? value.convertFromUnicode() : value),
+					]);
+				} else {
+					if(value.file instanceof IFile){
+						value.fileName = value.file.leafName;
+						value.file = IOService.newChannelFromURI(createURI(value.file)).open();
+					}
+					
+					streams.push([
+						'--' + boundary,
+						'Content-Disposition: form-data; name=&quot;' + name + '&quot;; filename=&quot;' + (value.fileName || '_') + '&quot;',
+						'Content-Type: ' + (value.contentType || 'application/octet-stream'),
+						'',
+					])
+					streams.push(new BufferedInputStream(value.file));
+					streams.push('');
+				}
+			}
+			streams.push('--' + boundary + '--');
+			
+			var mimeStream = new MIMEInputStream(new MultiplexInputStream(streams));
+			mimeStream.addHeader('Content-Type', 'multipart/form-data; boundary=' + boundary);
+			channel.setUploadStream(mimeStream, null, -1);
+		}
+	}
+	
+	var redirectionCount = 0;
+	var listner = {
+		QueryInterface : createQueryInterface([
+			'nsIStreamListener', 
+			'nsIProgressEventSink', 
+			'nsIHttpEventSink', 
+			'nsIInterfaceRequestor', 
+			'nsIChannelEventSink']),
+		
+		// nsIProgressEventSink
+		onProgress : function(req, ctx, progress, progressMax){},
+		onStatus : function(req, ctx, status, statusArg){},
+		
+		// nsIInterfaceRequestor
+		getInterface : function(iid){
+			// Firefox 2&#12391;nsIPrompt&#12434;&#35201;&#27714;&#12373;&#12428;&#12456;&#12521;&#12540;&#12395;&#12394;&#12427;&#12383;&#12417;&#21028;&#23450;&#20966;&#29702;&#12434;&#22806;&#12377;
+			// &#12452;&#12531;&#12479;&#12540;&#12501;&#12455;&#12540;&#12473;&#12395;&#12394;&#12356;&#12513;&#12477;&#12483;&#12489;&#12434;&#21628;&#12400;&#12428;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12427;&#12364;&#30906;&#35469;&#31684;&#22258;&#12391;&#30330;&#29983;&#12375;&#12394;&#12363;&#12387;&#12383;
+			// http://developer.mozilla.org/ja/docs/Creating_Sandboxed_HTTP_Connections
+			return this;
+		},
+		
+		// nsIHttpEventSink
+		onRedirect : function(oldChannel, newChannel){},
+		
+		// nsIChannelEventSink
+		onChannelRedirect : function(oldChannel, newChannel, flags){
+			// channel.redirectionLimit&#12434;&#20351;&#12358;&#12392;&#12522;&#12480;&#12452;&#12524;&#12463;&#12488;&#24460;&#12398;&#12450;&#12489;&#12524;&#12473;&#12364;&#21462;&#24471;&#12391;&#12365;&#12394;&#12356;
+			redirectionCount++;
+			
+			if(opts.redirectionLimit!=null &amp;&amp; redirectionCount&gt;opts.redirectionLimit){
+				// NS_ERROR_REDIRECT_LOOP
+				newChannel.cancel(2152398879);
+				
+				var res = {
+					channel : newChannel,
+					responseText : '',
+					status : oldChannel.responseStatus,
+					statusText : oldChannel.responseStatusText,
+				};
+				d.callback(res);
+				
+				return;
+			}
+			
+			// &#12497;&#12501;&#12457;&#12540;&#12510;&#12531;&#12473;&#12434;&#32771;&#24942;&#12375;broad&#12434;&#20351;&#12431;&#12394;&#12356;
+			setCookie(newChannel.QueryInterface(Ci.nsIHttpChannel));
+		},
+		
+		// nsIStreamListener
+		onStartRequest: function(req, ctx){
+			this.data = [];
+		},
+		onDataAvailable: function(req, ctx, stream, sourceOffset, length){
+			this.data.push(new InputStream(stream).read(length));
+		},
+		onStopRequest: function (req, ctx, status){
+			// Firefox 3&#12391;&#12399;cancel&#12377;&#12427;&#12392;onStopRequest&#12399;&#21628;&#12400;&#12428;&#12394;&#12356;
+			if(opts.redirectionLimit!=null &amp;&amp; redirectionCount&gt;opts.redirectionLimit)
+				return;
+			
+			broad(req);
+			
+			var text = this.data.join('');
+			var charset = opts.charset || req.contentCharset;
+			
+			try{
+				text = charset? text.convertToUnicode(charset) : text;
+			} catch(err){
+				// [FIXME] &#35519;&#26619;&#20013;
+				error(err);
+				error(charset);
+				error(text);
+			}
+			var res = {
+				channel : req,
+				responseText : text,
+				status : req.responseStatus,
+				statusText : req.responseStatusText,
+			};
+			
+			if(Components.isSuccessCode(status) &amp;&amp; res.status &lt; 400){
+				d.callback(res);
+			}else{
+				res.message = getMessage('error.http.' + res.status);
+				d.errback(res);
+			}
+		},
+	};
+	channel.requestMethod = opts.sendContent? 'POST' : 'GET';
+	channel.notificationCallbacks = listner;
+	channel.asyncOpen(listner, null);
+	
+	// &#30906;&#23455;&#12395;&#12460;&#12505;&#12540;&#12472;&#12467;&#12524;&#12463;&#12488;&#12373;&#12428;&#12427;&#12424;&#12358;&#12395;&#35299;&#25918;&#12377;&#12427;
+	listner = null;
+	channel = null;
+	
+	return d;
+}
+
+
+// ----[MochiKit]-------------------------------------------------
+var StopProcess = {};
+
+function connected(src, sig){
+	return MochiKit.Signal._observers.some(function(o){
+		return o.source === src &amp;&amp; o.signal === sig &amp;&amp; o.connected;
+	});
+}
+
+function maybeDeferred(d) {
+	return typeof(d) == 'function'? 
+		MochiKit.Async.maybeDeferred(d) : 
+		(d==null || !d.addCallback)? 
+			succeed(d) : 
+			d;
+}
+
+MochiKit.Base.update(MochiKit.Signal.Event.prototype, {
+	// [FIXME] mouse.wheel.y&#12434;&#21033;&#29992;
+	wheelDelta : function(){
+		return 	this.event().detail;
+	},
+	isStopped : function(){
+		var evt = this.event();
+		
+		return evt.getPreventDefault ?
+			evt.getPreventDefault() :
+			evt.cancelBubble;
+	},
+	
+	// FIXME: &#32113;&#21512;&#12289;&#29694;&#22312;Strobo&#12391;&#21033;&#29992;
+	keyString : function(){
+		var keys = [];
+		
+		var mod = this.modifier();
+		mod.ctrl &amp;&amp; keys.push('CTRL');
+		mod.shift &amp;&amp; keys.push('SHIFT');
+		mod.alt &amp;&amp; keys.push('ALT');
+		
+		var key = this.key();
+		if(key){
+			key = key.string.replace(/^KEY_/, '');
+			if(!keys.some(function(i){return i==key}))
+				keys.push(key);
+		}
+		
+		return keys.join('+');
+	},
+})
+
+MochiKit.Base.update(MochiKit.Signal._specialKeys, {
+	61:  'KEY_SEMICOLON',
+	226: 'KEY_HORIZONTAL_BAR'
+});
+
+function formContents(elm){
+	if(typeof(elm)=='string')
+		elm = convertToHTMLDocument(elm);
+	
+	return reduce(function(p, a){
+		p[a[0]]=a[1];
+		return p;
+	}, zip.apply(null, MochiKit.DOM.formContents(elm)), {});
+}
+
+function queryString(params, question){
+	if(isEmpty(params))
+		return '';
+	
+	if(typeof(params)=='string')
+		return params;
+	
+	var qeries = [];
+	for(var key in params){
+		var value = params[key];
+		if(value==null)
+			continue;
+		qeries.push(encodeURIComponent(key) + '='+ encodeURIComponent(value));
+	}
+	return (question? '?' : '') + qeries.join('&amp;');
+}
+
+// FIXME: &#20114;&#25563;&#12398;&#12383;&#12417;
+function doXHR(url, opts){
+	error('deprecated: doXHR');
+	return request(url, opts);
+}
+
+registerIteratorFactory(
+	'SimpleEnumerator', 
+	function(it){
+		return it &amp;&amp; typeof(it.hasMoreElements) == &quot;function&quot;;
+	}, 
+	function(it){
+		var ifcs;
+		return {
+			next: function(){
+				if(!it.hasMoreElements())
+					throw StopIteration;
+				
+				var res = it.getNext();
+				if(!ifcs)
+					ifcs = getInterfaces(res);
+				return broad(res, ifcs);
+			}
+		};
+	});
+
+registerIteratorFactory(
+	'XML', 
+	function(it){
+		return typeof(it) == &quot;xml&quot;;
+	}, 
+	function(it){
+		var i = 0;
+		var len = it.length();
+		return {
+			next: function(){
+				if(i &gt;= len)
+					throw StopIteration;
+				
+				return it[i++];
+			}
+		};
+	});
+
+if(NavHistoryService){
+	registerIteratorFactory(
+		'nsINavHistoryContainerResultNode', 
+		function(it){
+			return it instanceof Ci.nsINavHistoryContainerResultNode;
+		}, 
+		function(it){
+			var i = 0;
+			var len = it.childCount;
+			return {
+				next: function(){
+					if(i &gt;= len)
+						throw StopIteration;
+					
+					return it.getChild(i++);
+				}
+			};
+		});
+}
+
+// &#23455;&#39443;&#30340;&#12289;items&#12398;&#21033;&#29992;&#12434;&#25512;&#22888;
+registerIteratorFactory(
+	'Object', 
+	function(it){
+		return it &amp;&amp; typeof(it) == &quot;object&quot;;
+	}, 
+	function(it){
+		var props = keys(it).filter(function(prop){
+			return it.hasOwnProperty(prop);
+		});
+		return {
+			next: function(){
+				var prop = props.shift();
+				if(!prop)
+					throw StopIteration;
+				
+				return [prop, it[prop]];
+			}
+		};
+	});
+
+/*
+function deferredForEach(it, func, index){
+	index = index || 0;
+	it = iter(it);
+	
+	var d = succeed();
+	try{
+		return d.
+			addCallback(func, it.next(), index).
+			addCallback(deferredForEach, it, func, ++index).
+			addErrback(function(e){
+				if(e.message!=StopIteration) throw e;
+			});
+	} catch (e if e==StopIteration){
+		return d;
+	}
+}
+*/
+
+// &#26283;&#23450;&#12497;&#12483;&#12481;&#12289;&#20107;&#21069;&#12395;&#12522;&#12473;&#12488;&#20316;&#25104;&#12289;&#28961;&#38480;&#12522;&#12473;&#12488;&#12395;&#26410;&#23550;&#24540;
+function deferredForEach(it, func){
+	var d = new Deferred();
+	var index = 0
+	forEach(it, function(item){
+		d.addCallback(func, item, index);
+		++index;
+	});
+	d.addErrback(function(err){
+		if(err.message==StopIteration)
+			return;
+		
+		throw err;
+	});
+	d.callback();
+	
+	return d;
+}
+
+function DeferredHash(ds){
+	var props = keys(ds);
+	
+	return new DeferredList(values(ds)).addCallback(function(results){
+		var res = {};
+		for (var i = 0; i &lt; results.length; i++)
+			res[props[i]] = results[i];
+		return res;
+	});
+};
+
+function getViewDimensions(){
+	var d = new Dimensions();
+	var doc = currentDocument();
+
+	if(doc.compatMode == 'CSS1Compat'){
+		d.h = doc.documentElement.clientHeight;
+		d.w = doc.documentElement.clientWidth;
+	} else {
+		d.h = doc.body.clientHeight;
+		d.w = doc.body.clientWidth;
+	}
+	
+	return d;
+}
+
+function getPageDimensions(){
+	var d = new Dimensions();
+	var doc = currentDocument();
+
+	if(doc.compatMode == 'CSS1Compat'){
+		d.h = doc.documentElement.scrollHeight;
+		d.w = doc.documentElement.scrollWidth;
+	} else {
+		d.h = doc.body.scrollHeight;
+		d.w = doc.body.scrollWidth;
+	}
+	
+	return d;
+}
+
+function getElementPosition(elm){
+	return withWindow(elm.ownerDocument.defaultView, function(){
+		return MochiKit.Style.getElementPosition(elm);
+	});
+}
+
+function roundPosition(p){
+	return new Coordinates(
+		Math.round(p.x), 
+		Math.round(p.y));
+}
+
+
+// ----[Prototype]-------------------------------------------------
+Math.hypot = function(x, y){
+	return Math.sqrt(x*x + y*y);
+}
+
+Number.prototype.toHexString = function(){
+	return ('0' + this.toString(16)).slice(-2);
+};
+
+
+String.prototype = update(String.prototype, {
+	pad :function(len, ch){
+		len = len-this.length;
+		if(len&lt;=0) return this;
+		return (ch || ' ').repeat(len) + this;
+	},
+	indent : function(num, c){
+		c = c || ' ';
+		return this.replace(/^/mg, c.repeat(num))
+	},
+	link: function(href){
+		return '&lt;a href=&quot;' + href + '&quot;&gt;' + this + '&lt;/a&gt;';
+	},
+	trim : function(){
+		return this.replace(/^\s+|\s+$/g, '');
+	},
+	repeat : function(n){
+		return new Array(n+1).join(this);
+	},
+	extract : function(re, group){
+		group = group==null? 1 : group;
+		var res = this.match(re);
+		return res ? res[group] : '';
+	},
+	decapitalize : function(){
+		return this.substr(0, 1).toLowerCase() + this.substr(1);
+	},
+	capitalize : function(){
+		return this.substr(0, 1).toUpperCase() + this.substr(1);
+	},
+	toByteArray : function(charset){
+		return new UnicodeConverter(charset).convertToByteArray(this, {});
+	},
+	md5 : function(charset){
+		var crypto = new CryptoHash(CryptoHash.MD5);
+		var data = this.toByteArray(charset);
+		crypto.update(data, data.length);
+		
+		return crypto.finish(false).split('').map(function(char){
+			return char.charCodeAt().toHexString();
+		}).join('');
+	},
+	extract : function(re, group){
+		group = group==null? 1 : group;
+		var res = this.match(re);
+		return res ? res[group] : '';
+	},
+	convertToUnicode : function(charset){
+		return new UnicodeConverter(charset).ConvertToUnicode(this);
+	},
+	convertFromUnicode : function(charset){
+		return new UnicodeConverter(charset).ConvertFromUnicode(this);
+	},
+	trimTag : function(){
+		return this.replace(/&lt;.*?&gt;/g, '');
+	},
+	includesFullwidth : function(){
+		return (/[^ -~&#65377;-&#65439;]/).test(this);
+	},
+	
+	// http://code.google.com/p/kanaxs/
+	toHiragana : function(){
+		var c, i = this.length, a = [];
+
+		while(i--){
+			c = this.charCodeAt(i);
+			a[i] = (0x30A1 &lt;= c &amp;&amp; c &lt;= 0x30F6) ? c - 0x0060 : c;
+		};
+
+		return String.fromCharCode.apply(null, a);
+	},
+	toKatakana : function(){
+		var c, i = this.length, a = [];
+
+		while(i--){
+			c = this.charCodeAt(i);
+			a[i] = (0x3041 &lt;= c &amp;&amp; c &lt;= 0x3096) ? c + 0x0060 : c;
+		};
+
+		return String.fromCharCode.apply(null, a);
+	},
+	
+	toRoma : function(){
+		var res = '';
+		var s = this.toKatakana();
+		for(var i = 0, kana, table = String.katakana ; i &lt; s.length ; i += kana.length){
+			kana = s.substr(i, 2);
+			roma = table[kana];
+			
+			if(!roma){
+				kana = s.substr(i, 1);
+				roma = table[kana];
+			}
+			
+			if(!roma){
+				roma = kana;
+			}
+			
+			res += roma;
+		}
+		res = res.replace(/ltu(.)/g, '$1$1');
+		
+		return res;
+	},
+});
+
+// FIXME: UTF-8&#12391;&#12473;&#12463;&#12522;&#12503;&#12488;&#12434;&#12525;&#12540;&#12489;&#12377;&#12427;&#12424;&#12358;&#12395;
+function isCorruptedScript(){
+	try{
+		'&#12454;&#12449;'.convertToUnicode();
+		return true;
+	} catch(e) {
+		return false;
+	}
+}
+
+String.katakana = {
+	'&#12454;&#12449;':'wha','&#12454;&#12451;':'wi','&#12454;&#12455;':'we','&#12454;&#12457;':'who',
+	'&#12461;&#12515;':'kya','&#12461;&#12451;':'kyi','&#12461;&#12517;':'kyu','&#12461;&#12455;':'kye','&#12461;&#12519;':'kyo',
+	'&#12463;&#12515;':'qya','&#12463;&#12517;':'qyu',
+	'&#12463;&#12449;':'qwa','&#12463;&#12451;':'qwi','&#12463;&#12453;':'qwu','&#12463;&#12455;':'qwe','&#12463;&#12457;':'qwo',
+	'&#12462;&#12515;':'gya','&#12462;&#12451;':'gyi','&#12462;&#12517;':'gyu','&#12462;&#12455;':'gye','&#12462;&#12519;':'gyo',
+	'&#12464;&#12449;':'gwa','&#12464;&#12451;':'gwi','&#12464;&#12453;':'gwu','&#12464;&#12455;':'gwe','&#12464;&#12457;':'gwo',
+	'&#12471;&#12515;':'sha','&#12471;&#12451;':'syi','&#12471;&#12517;':'shu','&#12471;&#12455;':'sye','&#12471;&#12519;':'sho',
+	'&#12473;&#12449;':'swa','&#12473;&#12451;':'swi','&#12473;&#12453;':'swu','&#12473;&#12455;':'swe','&#12473;&#12457;':'swo',
+	'&#12472;&#12515;':'ja','&#12472;&#12451;':'jyi','&#12472;&#12517;':'ju','&#12472;&#12455;':'jye','&#12472;&#12519;':'jo',
+	'&#12481;&#12515;':'cha','&#12481;&#12451;':'tyi','&#12481;&#12517;':'chu','&#12481;&#12455;':'tye','&#12481;&#12519;':'cho',
+	'&#12484;&#12449;':'tsa','&#12484;&#12451;':'tsi','&#12484;&#12455;':'tse','&#12484;&#12457;':'tso',
+	'&#12486;&#12515;':'tha','&#12486;&#12451;':'thi','&#12486;&#12517;':'thu','&#12486;&#12455;':'the','&#12486;&#12519;':'tho',
+	'&#12488;&#12449;':'twa','&#12488;&#12451;':'twi','&#12488;&#12453;':'twu','&#12488;&#12455;':'twe','&#12488;&#12457;':'two',
+	'&#12482;&#12515;':'dya','&#12482;&#12451;':'dyi','&#12482;&#12517;':'dyu','&#12482;&#12455;':'dye','&#12482;&#12519;':'dyo',
+	'&#12487;&#12515;':'dha','&#12487;&#12451;':'dhi','&#12487;&#12517;':'dhu','&#12487;&#12455;':'dhe','&#12487;&#12519;':'dho',
+	'&#12489;&#12449;':'dwa','&#12489;&#12451;':'dwi','&#12489;&#12453;':'dwu','&#12489;&#12455;':'dwe','&#12489;&#12457;':'dwo',
+	'&#12491;&#12515;':'nya','&#12491;&#12451;':'nyi','&#12491;&#12517;':'nyu','&#12491;&#12455;':'nye','&#12491;&#12519;':'nyo',
+	'&#12498;&#12515;':'hya','&#12498;&#12451;':'hyi','&#12498;&#12517;':'hyu','&#12498;&#12455;':'hye','&#12498;&#12519;':'hyo',
+	'&#12501;&#12515;':'fya','&#12501;&#12517;':'fyu','&#12501;&#12519;':'fyo',
+	'&#12501;&#12449;':'fa','&#12501;&#12451;':'fi','&#12501;&#12453;':'fwu','&#12501;&#12455;':'fe','&#12501;&#12457;':'fo',
+	'&#12499;&#12515;':'bya','&#12499;&#12451;':'byi','&#12499;&#12517;':'byu','&#12499;&#12455;':'bye','&#12499;&#12519;':'byo',
+	'&#12532;&#12449;':'va','&#12532;&#12451;':'vi','&#12532;':'vu','&#12532;&#12455;':'ve','&#12532;&#12457;':'vo',
+	'&#12532;&#12515;':'vya','&#12532;&#12517;':'vyu','&#12532;&#12519;':'vyo',
+	'&#12500;&#12515;':'pya','&#12500;&#12451;':'pyi','&#12500;&#12517;':'pyu','&#12500;&#12455;':'pye','&#12500;&#12519;':'pyo',
+	'&#12511;&#12515;':'mya','&#12511;&#12451;':'myi','&#12511;&#12517;':'myu','&#12511;&#12455;':'mye','&#12511;&#12519;':'myo',
+	'&#12522;&#12515;':'rya','&#12522;&#12451;':'ryi','&#12522;&#12517;':'ryu','&#12522;&#12455;':'rye','&#12522;&#12519;':'ryo',
+	
+	'&#12450;':'a','&#12452;':'i','&#12454;':'u','&#12456;':'e','&#12458;':'o',
+	'&#12459;':'ka','&#12461;':'ki','&#12463;':'ku','&#12465;':'ke','&#12467;':'ko',
+	'&#12469;':'sa','&#12471;':'shi','&#12473;':'su','&#12475;':'se','&#12477;':'so',
+	'&#12479;':'ta','&#12481;':'chi','&#12484;':'tsu','&#12486;':'te','&#12488;':'to',
+	'&#12490;':'na','&#12491;':'ni','&#12492;':'nu','&#12493;':'ne','&#12494;':'no',
+	'&#12495;':'ha','&#12498;':'hi','&#12501;':'fu','&#12504;':'he','&#12507;':'ho',
+	'&#12510;':'ma','&#12511;':'mi','&#12512;':'mu','&#12513;':'me','&#12514;':'mo',
+	'&#12516;':'ya','&#12518;':'yu','&#12520;':'yo',
+	'&#12521;':'ra','&#12522;':'ri','&#12523;':'ru','&#12524;':'re','&#12525;':'ro',
+	'&#12527;':'wa','&#12530;':'wo','&#12531;':'nn',
+	'&#12460;':'ga','&#12462;':'gi','&#12464;':'gu','&#12466;':'ge','&#12468;':'go',
+	'&#12470;':'za','&#12472;':'zi','&#12474;':'zu','&#12476;':'ze','&#12478;':'zo',
+	'&#12480;':'da','&#12482;':'di','&#12485;':'du','&#12487;':'de','&#12489;':'do',
+	'&#12496;':'ba','&#12499;':'bi','&#12502;':'bu','&#12505;':'be','&#12508;':'bo',
+	'&#12497;':'pa','&#12500;':'pi','&#12503;':'pu','&#12506;':'pe','&#12509;':'po',
+	
+	'&#12449;':'la','&#12451;':'li','&#12453;':'lu','&#12455;':'le','&#12457;':'lo',
+	'&#12533;':'lka','&#12534;':'lke','&#12483;':'ltu',
+	'&#12515;':'lya','&#12517;':'lyu','&#12519;':'lyo','&#12526;':'lwa',
+	'&#12290;':&quot;.&quot;,'&#12289;':&quot;,&quot;,'&#12540;':&quot;-&quot;,
+}
+
+if(isCorruptedScript()){
+	String.katakana = reduce(function(memo, pair){
+		memo[pair[0].convertToUnicode()] = pair[1];
+		return memo;
+	}, String.katakana, {});
+}
+
+
+
+Array.prototype = update(Array.prototype, {
+	split : function(step){
+		var res = [];
+		for(var i=0,len=this.length ; i&lt;len ;)
+			res.push(this.slice(i, i+=step));
+		
+		return res;
+	},
+});
+
+
+// ----[General]-------------------------------------------------
+function debug(msg){
+	if(!getPref('debug'))
+		return msg;
+	
+	return log(msg);
+}
+
+function log(msg){
+	firebug('log', arguments) || 
+		ConsoleService.logStringMessage(''+msg);
+	
+	return msg;
+}
+
+function error(err){
+	firebug('error', arguments) || 
+		Components.utils.reportError(err);
+	
+	return err;
+}
+
+function warn(msg){
+	firebug('warn', arguments) || 
+		ConsoleService.logMessage(new ScriptError(msg, null, null, null, null, ScriptError.warningFlag, null));
+	
+	return msg;
+}
+
+function firebug(method, args){
+	if(!getPref('useFirebug'))
+		return false;
+	
+	var win = getMostRecentWindow();
+	if(win.FirebugConsole &amp;&amp; win.FirebugContext) {
+		var console = new win.FirebugConsole(win.FirebugContext, win.content);
+		console[method].apply(console, args);
+		return true;
+	}
+	
+	// Firebug 1.2~
+	if ( win.Firebug &amp;&amp; win.Firebug.Console ) {
+		win.Firebug.Console.logFormatted.call(win.Firebug.Console, Array.slice(args), win.FirebugContext, method);
+		return true;
+	}
+	
+	return false;
+}
+
+function clearObject(obj){
+	for(var p in obj)
+		delete obj[p];
+	return obj;
+}
+
+function isEmpty(obj){
+	for(var i in obj)
+		return false;
+	return true;
+}
+
+function populateForm(form, values){
+	for(var name in values){
+		var control = $x('//*[@name=&quot;' + name + '&quot;]', form);
+		if(!control || !values[name])
+			continue;
+		
+		if(control.type == 'checkbox'){
+			if(control.value == values[name])
+				control.checked = true;
+		} else {
+			control.value = values[name];
+		}
+	}
+}
+
+function createSet(keys){
+	keys = (keys instanceof Array) ? keys : keys.split(/\s/);
+	return reduce(function(memo, val){
+		memo[val]=val;
+		return memo;
+	}, keys, {})
+}
+
+function pickUp(a, pop){
+	var i = random(a.length);
+	return pop ? a.splice(i, 1)[0] : a[i];
+}
+
+function random(max){
+	return Math.floor(Math.random() * max);
+}
+
+function absolutePath(path){
+  var e = currentDocument().createElement('span');
+  e.innerHTML = '&lt;a href=&quot;' + path + '&quot; /&gt;';
+  return e.firstChild.href;
+}
+
+// FIXME: String.prototype&#12434;&#20351;&#12358;
+function decapitalize(str){
+	return str.substr(0, 1).toLowerCase() + str.substr(1);
+}
+
+// FIXME: String.prototype&#12434;&#20351;&#12358;
+function capitalize(str){
+	return str.substr(0, 1).toUpperCase() + str.substr(1);
+}
+
+/**
+ * &#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12398;&#12503;&#12525;&#12497;&#12486;&#12451;&#12434;&#12467;&#12500;&#12540;&#12377;&#12427;&#12290;
+ * &#12466;&#12483;&#12479;&#12540;/&#12475;&#12483;&#12479;&#12540;&#12398;&#38306;&#25968;&#12418;&#23550;&#35937;&#12395;&#21547;&#12414;&#12428;&#12427;&#12290;
+ * 
+ * @param {Object} target &#12467;&#12500;&#12540;&#20808;&#12290;
+ * @param {Object} source &#12467;&#12500;&#12540;&#20803;&#12290;
+ * @return {Object} &#12467;&#12500;&#12540;&#20808;&#12290;
+ */
+function extend(target, source){
+	for(var p in source){
+		var getter = source.__lookupGetter__(p);
+		if(getter)
+			target.__defineGetter__(p, getter);
+		
+		var setter = source.__lookupSetter__(p);
+		if(setter)
+			target.__defineSetter__(p, setter);
+		
+		if(!getter &amp;&amp; !setter)
+			target[p] = source[p];
+	}
+	
+	return target;
+}
+
+function openParamString(obj){
+	var params=[];
+	for(var p in obj)
+		params.push(p+(obj[p]? '='+obj[p] : ''));
+	return params.join(',');
+}
+
+/**
+ * &#12513;&#12477;&#12483;&#12489;&#12364;&#21628;&#12400;&#12428;&#12427;&#21069;&#12395;&#20966;&#29702;&#12434;&#36861;&#21152;&#12377;&#12427;&#12290;
+ * &#12424;&#12426;&#35443;&#32048;&#12394;&#12467;&#12531;&#12488;&#12525;&#12540;&#12523;&#12364;&#24517;&#35201;&#12394;&#22580;&#21512;&#12399;addAround&#12434;&#20351;&#12358;&#12371;&#12392;&#12290;
+ * 
+ * @param {Object} target &#23550;&#35937;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12290;
+ * @param {String} name &#12513;&#12477;&#12483;&#12489;&#21517;&#12290;
+ * @param {Function} before &#21069;&#20966;&#29702;&#12290;
+ *        &#23550;&#35937;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12434;this&#12392;&#12375;&#12390;&#12289;&#12458;&#12522;&#12472;&#12490;&#12523;&#12398;&#24341;&#25968;&#12364;&#20840;&#12390;&#28193;&#12373;&#12428;&#12390;&#21628;&#12403;&#20986;&#12373;&#12428;&#12427;&#12290;
+ */
+function addBefore(target, name, before) {
+	var original = target[name];
+	target[name] = function() {
+		before.apply(target, arguments);
+		return original.apply(target, arguments);
+	}
+}
+
+/**
+ * &#12513;&#12477;&#12483;&#12489;&#12408;&#12450;&#12521;&#12454;&#12531;&#12489;&#12450;&#12489;&#12496;&#12452;&#12473;&#12434;&#36861;&#21152;&#12377;&#12427;&#12290;
+ * &#20966;&#29702;&#12434;&#32622;&#12365;&#12363;&#12360;&#12289;&#24341;&#25968;&#12398;&#22793;&#24418;&#12420;&#12289;&#36820;&#12426;&#20516;&#12398;&#21152;&#24037;&#12434;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12377;&#12427;&#12290;
+ * 
+ * @param {Object} target &#23550;&#35937;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12290;
+ * @param {String || Array} methodNames 
+ *        &#12513;&#12477;&#12483;&#12489;&#21517;&#12290;&#35079;&#25968;&#25351;&#23450;&#12377;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12427;&#12290;
+ *        set*&#12398;&#12424;&#12358;&#12395;&#12527;&#12452;&#12523;&#12489;&#12459;&#12540;&#12488;&#12434;&#20351;&#12387;&#12390;&#12418;&#12424;&#12356;&#12290;
+ * @param {Function} advice 
+ *        &#12450;&#12489;&#12496;&#12452;&#12473;&#12290;proceed&#12289;args&#12289;target&#12289;methodName&#12398;4&#12388;&#12398;&#24341;&#25968;&#12364;&#28193;&#12373;&#12428;&#12427;&#12290;
+ *        proceed&#12399;&#23550;&#35937;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12395;&#12496;&#12452;&#12531;&#12489;&#28168;&#12415;&#12398;&#12458;&#12522;&#12472;&#12490;&#12523;&#12398;&#12513;&#12477;&#12483;&#12489;&#12290;
+ */
+function addAround(target, methodNames, advice){
+	methodNames = [].concat(methodNames);
+	
+	// &#12527;&#12452;&#12523;&#12489;&#12459;&#12540;&#12489;&#12398;&#23637;&#38283;
+	for(var i=0 ; i&lt;methodNames.length ; i++){
+		if(methodNames[i].indexOf('*')==-1) continue;
+		
+		var hint = methodNames.splice(i, 1)[0];
+		hint = new RegExp('^' + hint.replace(/\*/g, '.*'));
+		for(var prop in target) {
+			if(hint.test(prop) &amp;&amp; typeof(target[prop]) == 'function')
+				methodNames.push(prop);
+		}
+	}
+	
+	methodNames.forEach(function(methodName){
+		var method = target[methodName];
+		target[methodName] = function() {
+			var self = this;
+			return advice(
+				function(args){
+					return method.apply(self, args);
+				}, 
+				arguments, self, methodName);
+		};
+		target[methodName].overwrite = (method.overwrite || 0) + 1;
+	});
+}
+
+function joinText(txts, delm, trimTag){
+	if(!txts)
+		return '';
+	
+	if(delm==null)
+		delm = ',';
+	txts = flattenArray(txts.filter(operator.truth));
+	return (trimTag? txts.map(methodcaller('trimTag')) : txts).join(delm);
+}
+
+// http://mxr.mozilla.org/mozilla/source/toolkit/content/contentAreaUtils.js#811
+function validateFileName(fileName){
+	if (navigator.appVersion.indexOf(&quot;Windows&quot;) != -1) {
+		return fileName.
+			replace(/[\&quot;]+/g, &quot;'&quot;).
+			replace(/[\*\:\?]+/g, &quot; &quot;).
+			replace(/[\&lt;]+/g, &quot;(&quot;).
+			replace(/[\&gt;]+/g, &quot;)&quot;).
+			replace(/[\\\/\|]+/g, &quot;_&quot;);
+	}
+	else if (navigator.appVersion.indexOf(&quot;Macintosh&quot;) != -1){
+		return fileName.replace(/[\:\/]+/g, &quot;_&quot;);
+	}
+	
+	return fileName.replace(/[\/]+/g, &quot;_&quot;);
+}
+
+
+// ----[Repository]-------------------------------------------------
+function Repository(){
+	this.register.apply(this, arguments);
+}
+
+Repository.prototype = {
+	get size(){
+		return this.names.length;
+	},
+	
+	get names(){
+		return reduce(function(memo, i){
+			memo.push(i[0]);
+			return memo;
+		}, this, []);
+	},
+	
+	get values(){
+		return reduce(function(memo, i){
+			memo.push(i[1]);
+			return memo;
+		}, this, []);
+	},
+	
+	clear : function(){
+		this.names.forEach(function(name){
+			delete this[name];
+		}, this);
+	},
+	
+	find : function(name){
+		return this.values.filter(function(i){
+			return i.name &amp;&amp; i.name.search(name) != -1;
+		});
+	},
+	
+	copyTo : function(t){
+		forEach(this, function(m){
+			t[m[0]] = m[1];
+		});
+		return t;
+	},
+	
+	check : function(){
+		var args = arguments;
+		return reduce(function(memo, i){
+			if(i.check &amp;&amp; i.check.apply(i, args))
+				memo.push(i);
+			return memo;
+		}, this.values, []);
+	},
+	
+	register : function(defs, target){
+		if(!defs)
+			return;
+		
+		defs = [].concat(defs);
+		if(target){
+			var vals = this.values;
+			this.clear();
+			
+			for(var i=0 ; i &lt; vals.length ; i++)
+				if(vals[i].name == target)
+					break;
+			
+			vals.splice.apply(vals, [i, 0].concat(defs));
+			defs = vals;
+		}
+		
+		defs.forEach(function(d){
+			this[d.name] = d;
+		}, this);
+	},
+}
+
+// ----[DOM]-------------------------------------------------
+function unescapeHTML(s){
+	return s.replace(
+		/&amp;amp;/g, '&amp;').replace(
+		/&amp;quot;/g, '&quot;').replace(
+		/&amp;lt;/g, '&lt;').replace(
+		/&amp;gt;/g, '&gt;');
+}
+
+function clearChildren(p){
+	Array.slice(p.childNodes).forEach(p.removeChild, p);
+}
+
+function tagName(elm){
+	return elm.tagName? elm.tagName.toLowerCase() : '';
+}
+
+function $x(exp, context, multi) {
+	context = context || currentDocument();
+	
+	var doc = context.ownerDocument || context;
+	var exp = doc.createExpression(exp, {
+		lookupNamespaceURI : function(prefix){
+			switch (prefix){
+			case 'xul':
+				return XUL_NS;
+			case 'html':
+			case 'xhtml':
+				return HTML_NS;
+			default:
+				return '';
+			}
+		},
+	});
+	
+	var value = function(node){
+		if(!node)
+			return;
+		
+		switch (node.nodeType) {
+		case Node.ELEMENT_NODE:
+			return node;
+		case Node.ATTRIBUTE_NODE:
+		case Node.TEXT_NODE:
+			return node.textContent;
+		}
+	}
+	
+	var result = exp.evaluate(context, XPathResult.ANY_TYPE, null);
+	switch (result.resultType) {
+		case XPathResult.STRING_TYPE : return result.stringValue;
+		case XPathResult.NUMBER_TYPE : return result.numberValue;
+		case XPathResult.BOOLEAN_TYPE: return result.booleanValue;
+		case XPathResult.UNORDERED_NODE_ITERATOR_TYPE: {
+			if(!multi)
+				return value(result.iterateNext());
+			
+			result = exp.evaluate(context, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+			var ret = [];
+			for (var i = 0, len = result.snapshotLength; i &lt; len ; i++) {
+				ret.push(value(result.snapshotItem(i)));
+			}
+			return ret;
+		}
+	}
+	return null;
+}
+
+function convertToDOM(xml){
+	var elm = currentDocument().createElementNS(HTML_NS, 'span');
+	elm.innerHTML = xml.toXMLString();
+	return elm.childNodes[0];
+}
+
+function convertToHTMLDocument(html, doc) {
+	html = html.replace(/&lt;!DOCTYPE.*?&gt;/, '').replace(/&lt;html.*?&gt;/, '').replace(/&lt;\/html&gt;.*/, '')
+	
+	doc = doc || currentDocument() || document;
+	var xsl = (new DOMParser()).parseFromString(
+		'&lt;?xml version=&quot;1.0&quot;?&gt;\
+			&lt;stylesheet version=&quot;1.0&quot; xmlns=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;\
+			&lt;output method=&quot;html&quot;/&gt;\
+		&lt;/stylesheet&gt;', 'text/xml');
+	
+	var xsltp = new XSLTProcessor();
+	xsltp.importStylesheet(xsl);
+	
+	doc = xsltp.transformToDocument(doc.implementation.createDocument('', '', null));
+	doc.appendChild(doc.createElement('html'));
+	
+	var range = doc.createRange();
+	range.selectNodeContents(doc.documentElement);
+	doc.documentElement.appendChild(range.createContextualFragment(html));
+	
+	return doc
+}
+
+function convertToXML(text){
+	return new XML(text.replace(/&lt;\?.*\?&gt;/gm,'').replace(/&lt;!.*?&gt;/gm, '').replace(/xmlns=&quot;.*?&quot;/,''));
+}
+
+function convertToXULElement(str){
+	str = str.toXMLString? str.toXMLString() : str;
+	var xul = (
+		'&lt;box xmlns=&quot;'+XUL_NS+'&quot; &gt;'+
+			str + 
+		'&lt;/box&gt;').replace(/^  +/gm, '').replace(/\n/g, '');
+	var parser = new DOMParser();
+	var elms = parser.parseFromString(xul, 'text/xml').documentElement.childNodes;
+	var result = currentDocument().createDocumentFragment();
+	for(var i=0 ; i&lt;elms.length ; i++)
+		result.appendChild(elms[i]);
+	
+	// Firefox 3&#12391;style&#23646;&#24615;&#12364;&#36969;&#29992;&#12373;&#12428;&#12394;&#12356;&#12383;&#12417;&#20877;&#35373;&#23450;&#12434;&#34892;&#12358;(&#26283;&#23450;&#12497;&#12483;&#12481;)
+	if(parseFloat(AppInfo.version) &gt;= 3){
+		for(var style, w = currentDocument().createTreeWalker(result, NodeFilter.SHOW_ELEMENT, null, true) ; e = w.nextNode() ; ){
+			if(style = e.getAttribute('style')){
+				e.setAttribute('style', '');
+				e.setAttribute('style', style);
+			}
+		}
+	}
+
+	return result;
+}
+
+function keyString(e){
+	// &#21021;&#22238;&#21628;&#12403;&#20986;&#12375;&#26178;&#12395;&#12461;&#12540;&#12486;&#12540;&#12502;&#12523;&#12434;&#20316;&#25104;&#12377;&#12427;
+	var table = [];
+	for(var name in KeyEvent)
+		if(name.indexOf('DOM_VK_')==0)
+			table[KeyEvent[name]] = name.substring(7);
+	
+	return (keyString = function(e){
+		var code = e.keyCode;
+		var res = [];
+		(e.ctrlKey  || code==KeyEvent.DOM_VK_CONTROL) &amp;&amp; res.push('CTRL');
+		(e.shiftKey || code==KeyEvent.DOM_VK_SHIFT)   &amp;&amp; res.push('SHIFT');
+		(e.altKey   || code==KeyEvent.DOM_VK_ALT)     &amp;&amp; res.push('ALT');
+		
+		if(code &lt; KeyEvent.DOM_VK_SHIFT || KeyEvent.DOM_VK_ALT &lt; code)
+			res.push(table[code]);
+		
+		return res.join(' + ');
+	})(e);
+}
+
+function cancel(e){
+	e.preventDefault();
+	e.stopPropagation();
+}
+
+function showNotification(fragments, animation){
+	var browser = getMostRecentWindow().getBrowser();
+	var doc = browser.ownerDocument;
+	var box = browser.getNotificationBox(browser.selectedBrowser);
+	
+	var slideSteps = box.slideSteps;
+	if(!animation)
+		box.slideSteps = 1;
+	
+	var notification = this.notification = box.appendNotification('', '', null,	box.PRIORITY_INFO_HIGH, null);
+	box.slideSteps = slideSteps;
+	
+	var outset = doc.getAnonymousNodes(notification)[0];
+	outset.setAttribute('align', 'start');
+	
+	var details = doc.getAnonymousElementByAttribute(notification, 'anonid', 'details');
+	clearChildren(details);
+	
+	notification.appendChild(fragments);
+	
+	if(!animation){
+		notification.__close = notification.close;
+		notification.close = function(){
+			box.slideSteps = 1;
+			notification.__close();
+			box.slideSteps = slideSteps;
+		}
+	}
+	
+	return notification;
+}
+
+function capture(win, pos, dim, scale){
+	// &#12487;&#12501;&#12457;&#12523;&#12488;&#12391;&#12399;AppShellService.hiddenDOMWindow&#12364;&#20351;&#12431;&#12428;&#12427;
+	var canvas = document.createElementNS(HTML_NS, 'canvas');
+	var ctx = canvas.getContext('2d');
+	canvas.width = dim.w;
+	canvas.height = dim.h;
+	
+	if(scale){
+		scale	= scale.w? scale.w/dim.w : 
+			scale.h? scale.h/dim.h : scale;
+		
+		canvas.width = dim.w * scale;
+		canvas.height = dim.h * scale;
+		ctx.scale(scale, scale);
+	}
+	
+	ctx.drawWindow(win, pos.x, pos.y, dim.w, dim.h, '#FFF');
+	return canvas.toDataURL('image/png', '');
+}
+
+function convertToDataURL(src){
+	var d = new Deferred();
+	var canvas = document.createElementNS(HTML_NS, 'canvas');
+	
+	if(src instanceof Ci.nsIDOMHTMLImageElement){
+		var img = src;
+	} else {
+		var img = document.createElementNS(HTML_NS, 'img');
+		img.src = src;
+	}
+	img.onload = function(){
+		canvas.width = img.width;
+		canvas.height = img.height;
+		canvas.getContext('2d').drawImage(img, 0, 0);
+		d.callback(canvas.toDataURL('image/png', ''));
+	}
+	return d;
+}
+
+
+// ----[UI]-------------------------------------------------
+/**
+ * &#12510;&#12454;&#12473;&#12471;&#12519;&#12540;&#12488;&#12459;&#12483;&#12488;&#12434;&#30435;&#35222;&#12377;&#12427;&#12290;
+ * &#12510;&#12454;&#12473;&#12480;&#12454;&#12531;&#12395;&#12424;&#12426;1&#12475;&#12483;&#12471;&#12519;&#12531;&#12364;&#12399;&#12376;&#12414;&#12426;&#12289;&#20840;&#12390;&#12398;&#12508;&#12479;&#12531;&#12398;&#12510;&#12454;&#12473;&#12450;&#12483;&#12503;&#12391;&#32066;&#12431;&#12427;&#12290;
+ * 2&#37325;&#23455;&#34892;&#12434;&#38450;&#12368;&#12383;&#12417;&#12289;&#12381;&#12398;&#12475;&#12483;&#12471;&#12519;&#12531;&#12391;&#19968;&#24230;&#12391;&#12418;&#20966;&#29702;&#12364;&#34892;&#12431;&#12428;&#12427;&#12392;&#20197;&#38477;&#12399;&#23455;&#34892;&#12373;&#12428;&#12394;&#12356;&#12290;
+ *
+ * @param {Element} target &#30435;&#35222;&#23550;&#35937;&#12398;&#12456;&#12524;&#12513;&#12531;&#12488;
+ * @param {Function} check &#12452;&#12505;&#12531;&#12488;&#20966;&#29702;&#38306;&#25968;(&#26410;&#20966;&#29702;&#12398;&#22580;&#21512;&#12399;true&#12434;&#36820;&#12377;)
+ */
+function observeMouseShortcut(target, check){
+	var BUTTONS = ['LEFT_DOWN', 'CENTER_DOWN', 'RIGHT_DOWN'];
+	var downed = {};
+	var event;
+	var executed = false;
+	target.addEventListener('mousedown', function(e){
+		if(isEmpty(downed)){
+			target.addEventListener('keydown', onKeyDown, true);
+			target.addEventListener('keypress', cancelEvent, true);
+			executed = false;
+			
+			// Firefox 2&#12395;&#12362;&#12356;&#12390;&#24460;&#12391;clientX&#12394;&#12393;&#12364;&#21462;&#24471;&#12391;&#12365;&#12394;&#12367;&#12394;&#12427;&#12383;&#12417;&#12463;&#12525;&#12540;&#12531;&#12377;&#12427;
+			event = update({}, e);
+		}
+		
+		downed[BUTTONS[e.button]] = true;
+		
+		checkKey(e, [keyString(e), keys(downed)])
+	}, true);
+	
+	target.addEventListener('mouseup', function(e){
+		delete downed[BUTTONS[e.button]];
+		if(isEmpty(downed)){
+			target.removeEventListener('keydown', onKeyDown, true);
+			target.removeEventListener('keypress', cancelEvent, true);
+			event = null;
+		}
+	}, true);
+
+	target.addEventListener('contextmenu', cancelEvent, true);
+	target.addEventListener('click', cancelEvent, true);
+	
+	function cancelEvent(e){
+		// &#12463;&#12522;&#12483;&#12463;&#12395;&#12424;&#12427;&#36983;&#31227;&#12420;&#12467;&#12531;&#12486;&#12461;&#12473;&#12488;&#12513;&#12491;&#12517;&#12540;&#12289;&#12471;&#12519;&#12540;&#12488;&#12459;&#12483;&#12488;&#12461;&#12540;&#12394;&#12393;&#12434;&#25233;&#21046;&#12377;&#12427;
+		if(executed)
+			cancel(e)
+	}
+	
+	function onKeyDown(e){
+		var code = e.keyCode;
+		if(KeyEvent.DOM_VK_SHIFT &lt;= code &amp;&amp; code &lt;= KeyEvent.DOM_VK_ALT)
+			return;
+		
+		if(executed){
+			cancel(e)
+			return;
+		}
+		
+		if(checkKey(e, [keys(downed), keyString(e)]))
+			cancel(e);
+	}
+	
+	function checkKey(e, keys){
+		var hit = !check(event, joinText(keys, (' + ')));
+		if(hit)
+			executed = true;
+		
+		return hit;
+	}
+}
+
+function selectElement(doc){
+	var deferred = new Deferred();
+	doc = doc || currentDocument();
+	
+	var target;
+	function onMouseOver(e){
+		target = e.target;
+		target.originalBackground = target.style.background;
+		target.style.background = selectElement.TARGET_BACKGROUND;
+	}
+	function onMouseOut(e){
+		unpoint(e.target);
+	}
+	function onClick(e){
+		cancel(e);
+		
+		finalize();
+		deferred.callback(target);
+	}
+	function onKeyDown(e){
+		cancel(e);
+		
+		switch(keyString(e)){
+		case 'ESCAPE':
+			finalize();
+			deferred.cancel();
+			return;
+		}
+	}
+	function unpoint(elm){
+		if(elm.originalBackground!=null){
+			elm.style.background = elm.originalBackground;
+			elm.originalBackground = null;
+		}
+	}
+	function finalize(){
+		doc.removeEventListener('mouseover', onMouseOver, true);
+		doc.removeEventListener('mouseout', onMouseOut, true);
+		doc.removeEventListener('click', onClick, true);
+		doc.removeEventListener('keydown', onKeyDown, true);
+		
+		unpoint(target);
+	}
+	
+	doc.addEventListener('mouseover', onMouseOver, true);
+	doc.addEventListener('mouseout', onMouseOut, true);
+	doc.addEventListener('click', onClick, true);
+	doc.addEventListener('keydown', onKeyDown, true);
+	
+	return deferred;
+}
+selectElement.TARGET_BACKGROUND = '#888';
+
+function selectRegion(doc){
+	var deferred = new Deferred();
+	doc = doc || currentDocument();
+	
+	doc.documentElement.style.cursor = 'crosshair';
+	
+	var style = doc.createElement('style');
+	style.innerHTML = &lt;&gt;&lt;![CDATA[
+		* {
+			cursor: crosshair !important;
+			-moz-user-select: none;
+		}
+	]]&gt;&lt;/&gt;;
+	doc.body.appendChild(style);
+	
+	var region, p, d, moving, square;
+	function mouse(e){
+		return {
+			x: e.clientX, 
+			y: e.clientY
+		};
+	}
+	
+	function onMouseMove(e){
+		var to = mouse(e);
+		
+		if(moving){
+			p = {
+				x: Math.max(to.x - d.w, 0), 
+				y: Math.max(to.y - d.h, 0)
+			};
+			setElementPosition(region, p);
+		}
+		
+		d = {
+			w: to.x - p.x, 
+			h: to.y - p.y
+		};
+		if(square){
+			var s = Math.min(d.w, d.h);
+			d = {w: s, h: s};
+		}
+		setElementDimensions(region, d);
+	}
+	
+	function onMouseDown(e){
+		cancel(e);
+		
+		p = mouse(e);
+		region = doc.createElement('div');
+		region.setAttribute('style', &lt;&gt;
+			background : #888;
+			opacity    : 0.5;
+			position   : fixed;
+			z-index    : 999999999;
+			top        : {p.y}px;
+			left       : {p.x}px;
+		&lt;/&gt;);
+		doc.body.appendChild(region);
+		
+		doc.addEventListener('mousemove', onMouseMove, true);
+		doc.addEventListener('mouseup', onMouseUp, true);
+		doc.addEventListener('keydown', onKeyDown, true);
+		doc.addEventListener('keyup', onKeyUp, true);
+	}
+	
+	function onKeyDown(e){
+		cancel(e);
+		
+		switch(keyString(e)){
+		case 'SHIFT': square = true; return;
+		case 'SPACE': moving = true; return;
+		case 'ESCAPE':
+			finalize();
+			deferred.cancel();
+			return;
+		}
+	}
+	
+	function onKeyUp(e){
+		cancel(e);
+		
+		switch(keyString(e)){
+		case 'SHIFT': square = false; return;
+		case 'SPACE': moving = false; return;
+		}
+	}
+	
+	function onMouseUp(e){
+		cancel(e);
+		
+		p = getElementPosition(region);
+		finalize();
+		
+		// FIXME: &#26283;&#23450;/&#24038;&#19978;&#26041;&#21521;&#12408;&#12398;&#36984;&#25246;&#19981;&#21487;/&#12463;&#12522;&#12483;&#12463;&#12392;&#12398;&#12480;&#12502;&#12523;&#12452;&#12531;&#12479;&#12540;&#12501;&#12455;&#12540;&#12473;&#26410;&#23455;&#35013;
+		if(!d || d.w&lt;0 || d.h&lt;0){
+			deferred.cancel();
+			return;
+		}
+		
+		deferred.callback({
+			position: p,
+			dimensions: d,
+		});
+	}
+
+	function onClick(e){
+		// &#12522;&#12531;&#12463;&#12463;&#12522;&#12483;&#12463;&#12395;&#12424;&#12427;&#36983;&#31227;&#12434;&#25233;&#27490;&#12377;&#12427;
+		cancel(e);
+		
+		// mouseup&#12424;&#12426;&#12418;&#24460;&#12395;&#12452;&#12505;&#12531;&#12488;&#12364;&#30330;&#29983;&#12377;&#12427;&#12383;&#12417;&#12289;&#12371;&#12371;&#12391;&#21462;&#12426;&#38500;&#12367;
+		doc.removeEventListener('click', onClick, true);
+	}
+	
+	function finalize(){
+		doc.removeEventListener('mousedown', onMouseDown, true);
+		doc.removeEventListener('mousemove', onMouseMove, true);
+		doc.removeEventListener('mouseup', onMouseUp, true);
+		doc.removeEventListener('keydown', onKeyDown, true);
+		doc.removeEventListener('keyup', onKeyUp, true);
+		
+		doc.documentElement.style.cursor = '';
+		
+		removeElement(region);
+		removeElement(style);
+	}
+	
+	doc.addEventListener('mousedown', onMouseDown, true);
+	doc.addEventListener('click', onClick, true);
+	doc.defaultView.focus();
+	
+	return deferred;
+}
+
+function flashView(doc){
+	var d = new Deferred();
+	var doc = doc || currentDocument();
+	var flash = doc.createElement('div');
+	flash.setAttribute('style', &lt;&gt;
+		background : #EEE;
+		position   : fixed;
+		z-index    : 999999999;
+		top        : 0;
+		left       : 0;
+	&lt;/&gt;);
+	setElementDimensions(flash, getViewDimensions());
+	doc.body.appendChild(flash);
+	fade(flash, {
+		duration : 0.1,
+		afterFinish : function(){
+			removeElement(flash);
+			d.callback();
+		},
+	});
+	
+	return d;
+}
+
+// ----[Model/Service]-------------------------------------------------
+AbstractSessionService = {
+	updateSession : function(){
+		var cookie = this.getAuthCookie();
+		if(cookie &amp;&amp; this.cookie==cookie)
+			return 'same';
+		
+		delete this.cookie;
+		delete this.user;
+		delete this.token;
+		
+		if(!cookie)
+			return 'none';
+		
+		this.cookie = cookie;
+		
+		return 'changed';
+	},
+}</diff>
      <filename>xpi/chrome/content/library/01_utility.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,61 +1,61 @@
-// &#12460;&#12505;&#12540;&#12472;&#12467;&#12524;&#12463;&#12488;&#12373;&#12428;&#12378;&#12395;&#27531;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12427;&#12398;&#12392;&#12289;&#12497;&#12501;&#12457;&#12540;&#12510;&#12531;&#12473;&#12434;&#32771;&#24942;&#12375;&#12289;&#12402;&#12392;&#12388;&#12398;&#12452;&#12531;&#12473;&#12479;&#12531;&#12473;&#12391;&#25429;&#25417;&#12377;&#12427;
-// &#20006;&#21015;&#21205;&#20316;&#12395;&#12424;&#12426;locationChanged&#12364;&#20132;&#24046;&#12377;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12427;&#12364;&#12289;&#35251;&#23519;&#12375;&#12383;&#12363;&#12366;&#12426;&#30330;&#29983;&#12375;&#12394;&#12363;&#12387;&#12383;
-var TabWatcher = createMock('@mozilla.org/appshell/component/browser-status-filter;1', {
-	
-	// nsIWebProgressListener
-	onLocationChange : function(progress ,request ,location){
-		this.locationChanged = true;
-	},
-	onStateChange : function(progress, request, flag, status){
-		// &#12506;&#12540;&#12472;&#36983;&#31227;&#24460;&#12398;&#19968;&#30058;&#12399;&#12376;&#12417;&#12398;&#26465;&#20214;&#12395;&#12510;&#12483;&#12481;&#12377;&#12427;&#12473;&#12486;&#12540;&#12488;&#12398;&#12415;&#21462;&#24471;&#12377;&#12427;
-		// layout-dummy-request&#12399;Firefox 2&#12398;&#12415;&#30330;&#29983;&#12289;document-onload-blocker&#12418;&#30330;&#29983;&#12375;&#12390;&#12356;&#12427;&#12364;&#12381;&#12398;&#26178;&#28857;&#12391;&#12399;&#36933;&#12356;
-		// Firefox 3&#12391;&#12399;document-onload-blocker&#12391;&#12424;&#12356;
-		// STATE_IS_REQUEST STATE_START
-		if(this.locationChanged &amp;&amp; flag==65537){
-			var name = this.getName(request);
-			if(name &amp;&amp; (name=='about:layout-dummy-request' || name=='about:document-onload-blocker')){
-				this.locationChanged = false;
-				
-				signal(grobal, 'content-ready', progress.DOMWindow.wrappedJSObject);
-				return;
-			}
-		}
-	},
-	
-	watchWindow : function(win){
-		var tabbrowser = win.getBrowser();
-		tabbrowser.browsers.forEach(function(browser){
-			// &#21462;&#24471;&#20197;&#21069;&#12395;&#38283;&#12363;&#12428;&#12390;&#12356;&#12427;&#12479;&#12502;&#12395;&#12501;&#12483;&#12463;&#12377;&#12427;
-			TabWatcher.addProgressListener(browser);
-		});
-		
-		win.addEventListener('TabOpen', function(e){
-			var tab = e.originalTarget;
-			var browser = tab.linkedBrowser;
-			
-			// &#31354;&#12479;&#12502;&#12434;&#38283;&#12356;&#12383;&#12392;&#12365;&#12418;&#23455;&#34892;&#12373;&#12428;&#12427;
-			TabWatcher.addProgressListener(browser);
-		}, false);
-		
-		win.addEventListener('TabClose', function(e){
-			var tab = e.originalTarget;
-			var browser = tab.linkedBrowser;
-			
-			TabWatcher.removeProgressListener(browser);
-		}, false);
-	},
-	addProgressListener : function(browser){
-		browser.webProgress.addProgressListener(this, this.NOTIFY_ALL);
-	},
-	removeProgressListener : function(browser){
-		try{
-			// &#20877;&#12525;&#12540;&#12489;&#12395;&#12424;&#12426;&#12452;&#12531;&#12473;&#12479;&#12531;&#12473;&#12364;&#22793;&#12431;&#12426;remove&#12391;&#12365;&#12394;&#12356;&#26178;&#12354;&#12426;
-			browser.webProgress.removeProgressListener(this);
-		}catch(e){}
-	},
-	getName : function(request){
-		try{
-			return request.name;
-		} catch (e){}
-	},
-});
+// &#12460;&#12505;&#12540;&#12472;&#12467;&#12524;&#12463;&#12488;&#12373;&#12428;&#12378;&#12395;&#27531;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12427;&#12398;&#12392;&#12289;&#12497;&#12501;&#12457;&#12540;&#12510;&#12531;&#12473;&#12434;&#32771;&#24942;&#12375;&#12289;&#12402;&#12392;&#12388;&#12398;&#12452;&#12531;&#12473;&#12479;&#12531;&#12473;&#12391;&#25429;&#25417;&#12377;&#12427;
+// &#20006;&#21015;&#21205;&#20316;&#12395;&#12424;&#12426;locationChanged&#12364;&#20132;&#24046;&#12377;&#12427;&#21487;&#33021;&#24615;&#12364;&#12354;&#12427;&#12364;&#12289;&#35251;&#23519;&#12375;&#12383;&#12363;&#12366;&#12426;&#30330;&#29983;&#12375;&#12394;&#12363;&#12387;&#12383;
+var TabWatcher = createMock('@mozilla.org/appshell/component/browser-status-filter;1', {
+	
+	// nsIWebProgressListener
+	onLocationChange : function(progress ,request ,location){
+		this.locationChanged = true;
+	},
+	onStateChange : function(progress, request, flag, status){
+		// &#12506;&#12540;&#12472;&#36983;&#31227;&#24460;&#12398;&#19968;&#30058;&#12399;&#12376;&#12417;&#12398;&#26465;&#20214;&#12395;&#12510;&#12483;&#12481;&#12377;&#12427;&#12473;&#12486;&#12540;&#12488;&#12398;&#12415;&#21462;&#24471;&#12377;&#12427;
+		// layout-dummy-request&#12399;Firefox 2&#12398;&#12415;&#30330;&#29983;&#12289;document-onload-blocker&#12418;&#30330;&#29983;&#12375;&#12390;&#12356;&#12427;&#12364;&#12381;&#12398;&#26178;&#28857;&#12391;&#12399;&#36933;&#12356;
+		// Firefox 3&#12391;&#12399;document-onload-blocker&#12391;&#12424;&#12356;
+		// STATE_IS_REQUEST STATE_START
+		if(this.locationChanged &amp;&amp; flag==65537){
+			var name = this.getName(request);
+			if(name &amp;&amp; (name=='about:layout-dummy-request' || name=='about:document-onload-blocker')){
+				this.locationChanged = false;
+				
+				signal(grobal, 'content-ready', progress.DOMWindow.wrappedJSObject);
+				return;
+			}
+		}
+	},
+	
+	watchWindow : function(win){
+		var tabbrowser = win.getBrowser();
+		tabbrowser.browsers.forEach(function(browser){
+			// &#21462;&#24471;&#20197;&#21069;&#12395;&#38283;&#12363;&#12428;&#12390;&#12356;&#12427;&#12479;&#12502;&#12395;&#12501;&#12483;&#12463;&#12377;&#12427;
+			TabWatcher.addProgressListener(browser);
+		});
+		
+		win.addEventListener('TabOpen', function(e){
+			var tab = e.originalTarget;
+			var browser = tab.linkedBrowser;
+			
+			// &#31354;&#12479;&#12502;&#12434;&#38283;&#12356;&#12383;&#12392;&#12365;&#12418;&#23455;&#34892;&#12373;&#12428;&#12427;
+			TabWatcher.addProgressListener(browser);
+		}, false);
+		
+		win.addEventListener('TabClose', function(e){
+			var tab = e.originalTarget;
+			var browser = tab.linkedBrowser;
+			
+			TabWatcher.removeProgressListener(browser);
+		}, false);
+	},
+	addProgressListener : function(browser){
+		browser.webProgress.addProgressListener(this, this.NOTIFY_ALL);
+	},
+	removeProgressListener : function(browser){
+		try{
+			// &#20877;&#12525;&#12540;&#12489;&#12395;&#12424;&#12426;&#12452;&#12531;&#12473;&#12479;&#12531;&#12473;&#12364;&#22793;&#12431;&#12426;remove&#12391;&#12365;&#12394;&#12356;&#26178;&#12354;&#12426;
+			browser.webProgress.removeProgressListener(this);
+		}catch(e){}
+	},
+	getName : function(request){
+		try{
+			return request.name;
+		} catch (e){}
+	},
+});</diff>
      <filename>xpi/chrome/content/library/10_TabWatcher.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,361 +1,361 @@
-var Tombloo = {
-	SCHEMA_VERSION : 1,
-	
-	get root(){
-		return (this._root || (this._root = getDataDir())).clone();
-	},
-	
-	set root(root){
-		return this._root = root;
-	},
-	
-	get db(){
-		if(this._db)
-			return this._db;
-		
-		var file = this.root;
-		file.append('tombloo.sqlite');
-		
-		return this.db = new Database(file);
-	},
-	
-	set db(db){
-		this._db = db;
-		this.root = db.connection.databaseFile.parent;
-		
-		(!db.tableExists('photos'))? this.initialize() : this.migration();
-		
-		return db;
-	},
-	
-	initialize : function(){
-		with(this){
-			Tag.initialize();
-			Regular.initialize();
-			Photo.initialize();
-			Video.initialize();
-			Link.initialize();
-			Conversation.initialize();
-			Quote.initialize();
-			
-			Post.initialize();
-			
-			db.version = SCHEMA_VERSION;
-		}
-	},
-	
-	migration : function(){
-		with(this){
-			if(db.version!=0)
-				return;
-			
-			Post.deinitialize();
-			Post.initialize();
-			
-			Tag.initialize();
-			
-			db.execute(&lt;&gt;
-				CREATE TABLE temp (
-					id        INTEGER PRIMARY KEY, 
-					user      TEXT, 
-					date      INTEGER, 
-					body      TEXT, 
-					imageId   TEXT, 
-					extension TEXT, 
-					file75    INTEGER NOT NULL, 
-					file100   INTEGER NOT NULL, 
-					file250   INTEGER NOT NULL, 
-					file400   INTEGER NOT NULL, 
-					file500   INTEGER NOT NULL);
-				INSERT INTO temp(
-					id, user, date, body, imageId, extension,
-					file75, file100, file250, file400, file500) 
-				SELECT 
-					id, user, date, body, (CASE WHEN (revision IS NULL OR revision = &quot;&quot;) THEN imageId ELSE imageId || '_' || revision END), 'jpg',
-					0, 0, 0, 0, 0 
-				FROM 
-					photos;
-				DROP TABLE photos;
-				ALTER TABLE temp RENAME TO photos;
-			&lt;/&gt;);
-			
-			db.version = SCHEMA_VERSION;
-			db.vacuum();
-		}
-	},
-	
-	Entity : function(def){
-		var Class = extend(Entity(def), {
-			get db(){
-				return Tombloo.db;
-			},
-		});
-		
-		addBefore(Class, 'insert', function(model){
-			if(!(model instanceof Class))
-				model = new Class(model);
-			
-			if(!model._tags || !model._tags.length)
-				return;
-			
-			var type = Class.definitions.name.slice(0, -1);
-			model._tags.forEach(function(tag){
-				Tombloo.Tag.insert({
-					id   : model.id,
-					type : type,
-					tag  : tag,
-				});
-			});
-		});
-		
-		Class.prototype.__defineGetter__('tags', function(){
-			if(this._tags)
-				return this._tags;
-			
-			return this._tags = Tombloo.Tag.findById(this.id);
-		});
-		
-		Class.prototype.__defineSetter__('tags', function(tags){
-			return this._tags = tags;
-		});
-		
-		return Class;
-	},
-}
-
-
-Tombloo.Tag = Tombloo.Entity({
-	name : 'tags',
-	fields : {
-		id   : 'INTEGER',
-		type : 'TEXT',
-		tag  : 'TEXT',
-	}
-});
-addAround(Tombloo.Tag, 'initialize', function(proceed, args, target){
-	proceed(args);
-	target.db.connection.executeSimpleSQL('CREATE INDEX idx_tags_id ON tags(id ASC)');
-});
-
-Tombloo.Regular = Tombloo.Entity({
-	name : 'regulars',
-	fields : {
-		id    : 'INTEGER PRIMARY KEY',
-		user  : 'TEXT',
-		date  : 'TIMESTAMP',
-		
-		title : 'TEXT',
-		body  : 'TEXT',
-	}
-});
-
-Tombloo.Photo = Tombloo.Entity({
-	name : 'photos',
-	fields : {
-		id        : 'INTEGER PRIMARY KEY',
-		user      : 'TEXT',
-		date      : 'TIMESTAMP',
-		
-		body      : 'TEXT',
-		imageId   : 'TEXT',
-		extension : 'TEXT',
-		
-		file75    : 'INTEGER NOT NULL',
-		file100   : 'INTEGER NOT NULL',
-		file250   : 'INTEGER NOT NULL',
-		file400   : 'INTEGER NOT NULL',
-		file500   : 'INTEGER NOT NULL',
-	}
-});
-
-Tombloo.Video = Tombloo.Entity({
-	name : 'videos',
-	fields : {
-		id     : 'INTEGER PRIMARY KEY',
-		user   : 'TEXT',
-		date   : 'TIMESTAMP',
-		
-		body   : 'TEXT',
-		source : 'TEXT',
-		player : 'TEXT',
-	}
-});
-
-Tombloo.Link = Tombloo.Entity({
-	name : 'links',
-	fields   : {
-		id     : 'INTEGER PRIMARY KEY',
-		user   : 'TEXT',
-		date   : 'TIMESTAMP',
-		
-		title  : 'TEXT',
-		source : 'TEXT',
-		body   : 'TEXT',
-	}
-});
-
-Tombloo.Conversation = Tombloo.Entity({
-	name : 'conversations',
-	fields : {
-		id    : 'INTEGER PRIMARY KEY',
-		user  : 'TEXT',
-		date  : 'TIMESTAMP',
-		
-		title : 'TEXT',
-		body  : 'TEXT',
-	}
-});
-
-Tombloo.Quote = Tombloo.Entity({
-	name : 'quotes',
-	fields : {
-		id     : 'INTEGER PRIMARY KEY',
-		user   : 'TEXT',
-		date   : 'TIMESTAMP',
-		
-		body   : 'TEXT',
-		source : 'TEXT',
-	}
-});
-
-
-extend(Tombloo.Photo, {
-	findUsers : function(){
-		return Tombloo.Photo.find('SELECT user FROM photos GROUP BY user ORDER BY user').map(itemgetter('user'));
-	},
-	
-	getPhotoDir : function(size){
-		var dir = Tombloo.root;
-		with(dir){
-			append('photo');
-			if(size)
-				append(size);
-			
-			if(!exists())
-				create(DIRECTORY_TYPE, 0666);
-		}
-		return dir;
-	},
-	
-	getImageInfo : function(file){
-		file = file.split('/').pop();
-		
-		var ts = (/(.*)_(.+)\.(.+)/).exec(file);
-		return {
-			id : ts[1],
-			size : ts[2],
-			extension : ts[3],
-		}
-	},
-});
-
-extend(Tombloo.Photo.prototype, {
-	file75  : 0, 
-	file100 : 0,
-	file250 : 0,
-	file400 : 0, 
-	file500 : 0, 
-	
-	get url(){
-		return 'http://' + this.user + '.tumblr.com/post/' + this.id;
-	},
-	
-	set url(){
-	},
-	
-	checkFile : function(size){
-		var file = this.getFile(size);
-		
-		// &#36890;&#20449;&#12456;&#12521;&#12540;&#12501;&#12449;&#12452;&#12523;&#12394;&#12425;&#21066;&#38500;&#12377;&#12427;(MIGRATION 0-&gt;1)
-		if(file.exists() &amp;&amp; 
-			(220 &lt; file.fileSize &amp;&amp; file.fileSize &lt; 240) &amp;&amp; 
-			getContents(file).indexOf('xml') != -1){
-			
-			file.remove(false);
-			
-			// &#25313;&#24373;&#23376;&#12434;&#31354;&#12395;&#12375;&#20877;&#12480;&#12454;&#12531;&#12525;&#12540;&#12489;&#12434;&#20419;&#12377;
-			this.extension = '';
-			this.save();
-		}
-		
-		return file.exists();
-	},
-	
-	getFile : function(size){
-		var file = Tombloo.Photo.getPhotoDir(size);
-		file.append(this.getFileName(size));
-		return file;
-	},
-	
-	getFileName : function(size){
-		return this.imageId + '_' + size + (size==75? 'sq' : '') + '.' + this.extension;
-	},
-});
-
-Tombloo.Post = Tombloo.Entity({name : 'posts'});
-extend(Tombloo.Post, {
-	insert : function(post){
-		Tombloo[capitalize(post.type)].insert(post);
-	},
-	
-	initialize : function(){
-		try{
-			return this.db.execute(&lt;&gt;
-				CREATE VIEW posts AS 
-				SELECT &quot;regular&quot; AS type, id, user, date, 
-					title, 
-					body, 
-					&quot;&quot; AS source, 
-					&quot;&quot; AS player, 
-					&quot;&quot; AS imageId 
-				FROM regulars 
-				UNION ALL 
-				SELECT &quot;photo&quot; AS type, id, user, date, 
-					&quot;&quot; AS title, 
-					body, 
-					&quot;&quot; AS source, 
-					&quot;&quot; AS player, 
-					imageId 
-				FROM photos 
-				UNION ALL 
-				SELECT &quot;video&quot; AS type, id, user, date, 
-					&quot;&quot; AS title, 
-					body, 
-					source, 
-					player, 
-					&quot;&quot; AS imageId 
-				FROM videos 
-				UNION ALL 
-				SELECT &quot;link&quot; AS type, id, user, date, 
-					title, 
-					body, 
-					source, 
-					&quot;&quot; AS player, 
-					&quot;&quot; AS imageId 
-				FROM links 
-				UNION ALL 
-				SELECT &quot;conversation&quot; AS type, id, user, date, 
-					title, 
-					body, 
-					&quot;&quot; AS source, 
-					&quot;&quot; AS player, 
-					&quot;&quot; AS imageId 
-				FROM conversations 
-				UNION ALL 
-				SELECT &quot;quote&quot; AS type, id, user, date, 
-					&quot;&quot; AS title, 
-					body, 
-					source, 
-					&quot;&quot; AS player, 
-					&quot;&quot; AS imageId 
-				FROM quotes 
-			&lt;/&gt;);
-		} catch(e if e instanceof Database.AlreadyExistsException){}
-	},
-	
-	deinitialize : function(){
-		return this.db.execute(&lt;&gt;
-			DROP VIEW posts 
-		&lt;/&gt;);
-	},
-});
+var Tombloo = {
+	SCHEMA_VERSION : 1,
+	
+	get root(){
+		return (this._root || (this._root = getDataDir())).clone();
+	},
+	
+	set root(root){
+		return this._root = root;
+	},
+	
+	get db(){
+		if(this._db)
+			return this._db;
+		
+		var file = this.root;
+		file.append('tombloo.sqlite');
+		
+		return this.db = new Database(file);
+	},
+	
+	set db(db){
+		this._db = db;
+		this.root = db.connection.databaseFile.parent;
+		
+		(!db.tableExists('photos'))? this.initialize() : this.migration();
+		
+		return db;
+	},
+	
+	initialize : function(){
+		with(this){
+			Tag.initialize();
+			Regular.initialize();
+			Photo.initialize();
+			Video.initialize();
+			Link.initialize();
+			Conversation.initialize();
+			Quote.initialize();
+			
+			Post.initialize();
+			
+			db.version = SCHEMA_VERSION;
+		}
+	},
+	
+	migration : function(){
+		with(this){
+			if(db.version!=0)
+				return;
+			
+			Post.deinitialize();
+			Post.initialize();
+			
+			Tag.initialize();
+			
+			db.execute(&lt;&gt;
+				CREATE TABLE temp (
+					id        INTEGER PRIMARY KEY, 
+					user      TEXT, 
+					date      INTEGER, 
+					body      TEXT, 
+					imageId   TEXT, 
+					extension TEXT, 
+					file75    INTEGER NOT NULL, 
+					file100   INTEGER NOT NULL, 
+					file250   INTEGER NOT NULL, 
+					file400   INTEGER NOT NULL, 
+					file500   INTEGER NOT NULL);
+				INSERT INTO temp(
+					id, user, date, body, imageId, extension,
+					file75, file100, file250, file400, file500) 
+				SELECT 
+					id, user, date, body, (CASE WHEN (revision IS NULL OR revision = &quot;&quot;) THEN imageId ELSE imageId || '_' || revision END), 'jpg',
+					0, 0, 0, 0, 0 
+				FROM 
+					photos;
+				DROP TABLE photos;
+				ALTER TABLE temp RENAME TO photos;
+			&lt;/&gt;);
+			
+			db.version = SCHEMA_VERSION;
+			db.vacuum();
+		}
+	},
+	
+	Entity : function(def){
+		var Class = extend(Entity(def), {
+			get db(){
+				return Tombloo.db;
+			},
+		});
+		
+		addBefore(Class, 'insert', function(model){
+			if(!(model instanceof Class))
+				model = new Class(model);
+			
+			if(!model._tags || !model._tags.length)
+				return;
+			
+			var type = Class.definitions.name.slice(0, -1);
+			model._tags.forEach(function(tag){
+				Tombloo.Tag.insert({
+					id   : model.id,
+					type : type,
+					tag  : tag,
+				});
+			});
+		});
+		
+		Class.prototype.__defineGetter__('tags', function(){
+			if(this._tags)
+				return this._tags;
+			
+			return this._tags = Tombloo.Tag.findById(this.id);
+		});
+		
+		Class.prototype.__defineSetter__('tags', function(tags){
+			return this._tags = tags;
+		});
+		
+		return Class;
+	},
+}
+
+
+Tombloo.Tag = Tombloo.Entity({
+	name : 'tags',
+	fields : {
+		id   : 'INTEGER',
+		type : 'TEXT',
+		tag  : 'TEXT',
+	}
+});
+addAround(Tombloo.Tag, 'initialize', function(proceed, args, target){
+	proceed(args);
+	target.db.connection.executeSimpleSQL('CREATE INDEX idx_tags_id ON tags(id ASC)');
+});
+
+Tombloo.Regular = Tombloo.Entity({
+	name : 'regulars',
+	fields : {
+		id    : 'INTEGER PRIMARY KEY',
+		user  : 'TEXT',
+		date  : 'TIMESTAMP',
+		
+		title : 'TEXT',
+		body  : 'TEXT',
+	}
+});
+
+Tombloo.Photo = Tombloo.Entity({
+	name : 'photos',
+	fields : {
+		id        : 'INTEGER PRIMARY KEY',
+		user      : 'TEXT',
+		date      : 'TIMESTAMP',
+		
+		body      : 'TEXT',
+		imageId   : 'TEXT',
+		extension : 'TEXT',
+		
+		file75    : 'INTEGER NOT NULL',
+		file100   : 'INTEGER NOT NULL',
+		file250   : 'INTEGER NOT NULL',
+		file400   : 'INTEGER NOT NULL',
+		file500   : 'INTEGER NOT NULL',
+	}
+});
+
+Tombloo.Video = Tombloo.Entity({
+	name : 'videos',
+	fields : {
+		id     : 'INTEGER PRIMARY KEY',
+		user   : 'TEXT',
+		date   : 'TIMESTAMP',
+		
+		body   : 'TEXT',
+		source : 'TEXT',
+		player : 'TEXT',
+	}
+});
+
+Tombloo.Link = Tombloo.Entity({
+	name : 'links',
+	fields   : {
+		id     : 'INTEGER PRIMARY KEY',
+		user   : 'TEXT',
+		date   : 'TIMESTAMP',
+		
+		title  : 'TEXT',
+		source : 'TEXT',
+		body   : 'TEXT',
+	}
+});
+
+Tombloo.Conversation = Tombloo.Entity({
+	name : 'conversations',
+	fields : {
+		id    : 'INTEGER PRIMARY KEY',
+		user  : 'TEXT',
+		date  : 'TIMESTAMP',
+		
+		title : 'TEXT',
+		body  : 'TEXT',
+	}
+});
+
+Tombloo.Quote = Tombloo.Entity({
+	name : 'quotes',
+	fields : {
+		id     : 'INTEGER PRIMARY KEY',
+		user   : 'TEXT',
+		date   : 'TIMESTAMP',
+		
+		body   : 'TEXT',
+		source : 'TEXT',
+	}
+});
+
+
+extend(Tombloo.Photo, {
+	findUsers : function(){
+		return Tombloo.Photo.find('SELECT user FROM photos GROUP BY user ORDER BY user').map(itemgetter('user'));
+	},
+	
+	getPhotoDir : function(size){
+		var dir = Tombloo.root;
+		with(dir){
+			append('photo');
+			if(size)
+				append(size);
+			
+			if(!exists())
+				create(DIRECTORY_TYPE, 0666);
+		}
+		return dir;
+	},
+	
+	getImageInfo : function(file){
+		file = file.split('/').pop();
+		
+		var ts = (/(.*)_(.+)\.(.+)/).exec(file);
+		return {
+			id : ts[1],
+			size : ts[2],
+			extension : ts[3],
+		}
+	},
+});
+
+extend(Tombloo.Photo.prototype, {
+	file75  : 0, 
+	file100 : 0,
+	file250 : 0,
+	file400 : 0, 
+	file500 : 0, 
+	
+	get url(){
+		return 'http://' + this.user + '.tumblr.com/post/' + this.id;
+	},
+	
+	set url(){
+	},
+	
+	checkFile : function(size){
+		var file = this.getFile(size);
+		
+		// &#36890;&#20449;&#12456;&#12521;&#12540;&#12501;&#12449;&#12452;&#12523;&#12394;&#12425;&#21066;&#38500;&#12377;&#12427;(MIGRATION 0-&gt;1)
+		if(file.exists() &amp;&amp; 
+			(220 &lt; file.fileSize &amp;&amp; file.fileSize &lt; 240) &amp;&amp; 
+			getContents(file).indexOf('xml') != -1){
+			
+			file.remove(false);
+			
+			// &#25313;&#24373;&#23376;&#12434;&#31354;&#12395;&#12375;&#20877;&#12480;&#12454;&#12531;&#12525;&#12540;&#12489;&#12434;&#20419;&#12377;
+			this.extension = '';
+			this.save();
+		}
+		
+		return file.exists();
+	},
+	
+	getFile : function(size){
+		var file = Tombloo.Photo.getPhotoDir(size);
+		file.append(this.getFileName(size));
+		return file;
+	},
+	
+	getFileName : function(size){
+		return this.imageId + '_' + size + (size==75? 'sq' : '') + '.' + this.extension;
+	},
+});
+
+Tombloo.Post = Tombloo.Entity({name : 'posts'});
+extend(Tombloo.Post, {
+	insert : function(post){
+		Tombloo[capitalize(post.type)].insert(post);
+	},
+	
+	initialize : function(){
+		try{
+			return this.db.execute(&lt;&gt;
+				CREATE VIEW posts AS 
+				SELECT &quot;regular&quot; AS type, id, user, date, 
+					title, 
+					body, 
+					&quot;&quot; AS source, 
+					&quot;&quot; AS player, 
+					&quot;&quot; AS imageId 
+				FROM regulars 
+				UNION ALL 
+				SELECT &quot;photo&quot; AS type, id, user, date, 
+					&quot;&quot; AS title, 
+					body, 
+					&quot;&quot; AS source, 
+					&quot;&quot; AS player, 
+					imageId 
+				FROM photos 
+				UNION ALL 
+				SELECT &quot;video&quot; AS type, id, user, date, 
+					&quot;&quot; AS title, 
+					body, 
+					source, 
+					player, 
+					&quot;&quot; AS imageId 
+				FROM videos 
+				UNION ALL 
+				SELECT &quot;link&quot; AS type, id, user, date, 
+					title, 
+					body, 
+					source, 
+					&quot;&quot; AS player, 
+					&quot;&quot; AS imageId 
+				FROM links 
+				UNION ALL 
+				SELECT &quot;conversation&quot; AS type, id, user, date, 
+					title, 
+					body, 
+					&quot;&quot; AS source, 
+					&quot;&quot; AS player, 
+					&quot;&quot; AS imageId 
+				FROM conversations 
+				UNION ALL 
+				SELECT &quot;quote&quot; AS type, id, user, date, 
+					&quot;&quot; AS title, 
+					body, 
+					source, 
+					&quot;&quot; AS player, 
+					&quot;&quot; AS imageId 
+				FROM quotes 
+			&lt;/&gt;);
+		} catch(e if e instanceof Database.AlreadyExistsException){}
+	},
+	
+	deinitialize : function(){
+		return this.db.execute(&lt;&gt;
+			DROP VIEW posts 
+		&lt;/&gt;);
+	},
+});</diff>
      <filename>xpi/chrome/content/library/20_Tombloo.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,1346 +1,1346 @@
-if(typeof(models)=='undefined')
-	this.models = models = new Repository();
-
-models.register({
-	name : 'FriendFeed',
-	ICON : 'http://friendfeed.com/favicon.ico',
-	check : function(ps){
-		return ps.type != 'regular' &amp;&amp; !ps.file;
-	},
-	
-	getAuthCookie : function(){
-		return getCookieString('friendfeed.com', 'U');
-	},
-	
-	getToken : function(){
-		return getCookieString('friendfeed.com', 'AT').split('=').pop();
-	},
-	
-	post : function(ps){
-		if(!this.getAuthCookie())
-			throw new Error('AUTH_FAILD');
-		
-		var self = this;
-		return request('https://friendfeed.com/share/publish', {
-			redirectionLimit : 0,
-			sendContent : {
-				at  : self.getToken(),
-				url : ps.pageUrl,
-				title : ps.page,
-				image0 : ps.type == 'photo'? ps.itemUrl : '',
-				comment : joinText([ps.body, ps.description], ' ', true),
-			},
-		});
-	},
-});
-
-
-models.register({
-	name : 'FFFFOUND',
-	ICON : 'http://ffffound.com/favicon.ico',
-	URL : 'http://FFFFOUND.com/',
-	
-	getToken : function(){
-		return request(FFFFOUND.URL + 'bookmarklet.js').addCallback(function(res){
-			return res.responseText.match(/token='(.*?)'/)[1];
-		});
-	},
-	
-	check : function(ps){
-		return ps.type == 'photo' &amp;&amp; !ps.file;
-	},
-	
-	post : function(ps){
-		if(ps.pageUrl.match('^http://ffffound.com/')){
-			var id = ps.itemUrl.split('/').pop().replace(/[_\.].+/, '');
-			return this.iLoveThis(id)
-		}
-		
-		return this.getToken().addCallback(function(token){
-			return request(FFFFOUND.URL + 'add_asset', {
-				referrer : ps.pageUrl,
-				queryString : {
-					token   : token,
-					url     : ps.itemUrl,
-					referer : ps.pageUrl,
-					title   : ps.item,
-				},
-			}).addCallback(function(res){
-				if(res.responseText.match('(FAILED:|ERROR:) (.*?)&lt;/span&gt;'))
-					throw RegExp.$2;
-				
-				if(res.responseText.match('login'))
-					throw new Error('AUTH_FAILD');
-			});
-		});
-	},
-
-	remove : function(id){
-		// 200 {&quot;success&quot;:false}
-		return request(FFFFOUND.URL + 'gateway/in/api/remove_asset', {
-			referrer : FFFFOUND.URL,
-			sendContent : {
-				collection_id : id,
-			},
-		});
-	},
-	
-	iLoveThis : function(id){
-		return request(FFFFOUND.URL + 'gateway/in/api/add_asset', {
-			referrer : FFFFOUND.URL,
-			sendContent : {
-				collection_id : 'i'+id,
-				inappropriate : false,
-			},
-		}).addCallback(function(res){
-			// NOT_FOUND / EXISTS / AUTH_FAILD
-			if(res.responseText.match(/&quot;error&quot;:&quot;(.*?)&quot;/))
-				throw RegExp.$1;
-		});
-	},
-});
-
-models.register({
-	name : 'Amazon',
-	ICON : 'http://www.amazon.co.jp/favicon.ico',
-	getItem : function(asin){
-		return request('http://webservices.amazon.co.jp/onca/xml', {
-			queryString : {
-				Service        : 'AWSECommerceService',
-				SubscriptionId : '0DCQFXHRBNT9GN9Z64R2',
-				Operation      : 'ItemLookup',
-				ResponseGroup  : 'Small,Images',
-				ItemId         : asin,
-			},
-		}).addCallback(function(res){
-			var xml = convertToXML(res.responseText);
-			if(xml.Error.length())
-				throw res;
-			
-			return new Amazon.Item(xml.Items.Item);
-		});
-	},
-	
-	normalizeUrl : function(asin){
-		return  'http://amazon.co.jp/o/ASIN/' + asin + 
-			(this.affiliateId ? '/' + this.affiliateId + '/ref=nosim' : '');
-	},
-	
-	get affiliateId(){
-		return getPref('amazonAffiliateId');
-	},
-	
-	Item : function(item){
-		return {
-			get title(){
-				return ''+item.ItemAttributes.Title;
-			},
-			get creators(){
-				var creators = [];
-				
-				// '&#21407;&#33879;'&#20197;&#22806;
-				for each(var creator in item.ItemAttributes.Creator.(@Role != '\u539F\u8457'))
-					creators.push(''+creator);
-				return creators;
-			},
-			get largestImage(){
-				return this.largeImage || this.mediumImage || this.smallImage;
-			},
-			get largeImage(){
-				return new Amazon.Image(item.LargeImage);
-			},
-			get mediumImage(){
-				return new Amazon.Image(item.MediumImage);
-			},
-			get smallImage(){
-				return new Amazon.Image(item.SmallImage);
-			},
-		}
-	},
-	
-	Image : function(img){
-		if(!img.length())
-			return;
-		
-		return {
-			get size(){
-				return (''+img.name()).slice(0, -5).toLowerCase();
-			},
-			get url(){
-				return ''+img.URL;
-			},
-			get width(){
-				return 1*img.Width;
-			},
-			get height(){
-				return 1*img.Height;
-			},
-		}
-	},
-});
-
-// Flickr API Documentation 
-// http://www.flickr.com/services/api/
-models.register(update({
-	name : 'Flickr',
-	ICON : 'http://www.flickr.com/favicon.ico',
-	API_KEY : 'ecf21e55123e4b31afa8dd344def5cc5',
-	
-	getAuthCookie : function(){
-		return getCookieString('flickr.com', 'cookie_accid');
-	},
-	
-	check : function(ps){
-		// Favorite&#12414;&#12383;&#12399;&#12461;&#12515;&#12503;&#12481;&#12515;&#12363;
-		// itemUrl&#12434;&#12481;&#12455;&#12483;&#12463;&#12375;Photo - Upload from Cache&#12434;&#36991;&#12369;&#12427;
-		return ps.type == 'photo' &amp;&amp; 
-			(ps.pageUrl.match('^http://www.flickr.com/photos/') || (!ps.itemUrl &amp;&amp; ps.file));
-	},
-	
-	post : function(ps){
-		if(ps.file){
-			return this.upload({
-				photo       : ps.file,
-				title       : ps.page || '',
-				description : ps.description || '',
-				is_public   : ps.private? 0 : 1,
-				tags        : joinText(ps.tags, ' '),
-			});
-		} else {
-			return this.addFavorite(ps.pageUrl.replace(/\/$/, '').split('/').pop());
-		}
-	},
-	
-	callMethod : function(ps){
-		return request('http://flickr.com/services/rest/', {
-			queryString : update({
-				api_key        : this.API_KEY,
-				nojsoncallback : 1,
-				format         : 'json',
-			}, ps),
-		}).addCallback(function(res){
-			eval('var json=' + res.responseText);
-			if(json.stat!='ok')
-				throw json.message;
-			return json;
-		});
-	},
-	
-	callAuthMethod : function(ps){
-		return this.getToken().addCallback(function(page){
-			if(ps.method=='flickr.photos.upload')
-				delete ps.method;
-			
-			update(ps, page.token);
-			ps.cb = new Date().getTime(),
-			ps.api_sig = (page.secret + keys(ps).sort().filter(function(key){
-				// &#12501;&#12449;&#12452;&#12523;&#12434;&#21462;&#12426;&#38500;&#12367;
-				return typeof(ps[key])!='object';
-			}).map(function(key){
-				return key + ps[key]
-			}).join('')).md5();
-			
-			return request('http://flickr.com/services/' + (ps.method? 'rest/' : 'upload/'), {
-				sendContent : ps,
-			});
-		}).addCallback(function(res){
-			res = convertToXML(res.responseText);
-			if(res.@stat!='ok'){
-				var err = new Error(''+res.err.@msg)
-				err.code = res.err.@code;
-				
-				throw err;
-			}
-			return res;
-		});
-	},
-	
-	getToken : function(){
-		var status = this.updateSession();
-		switch (status){
-		case 'none':
-			throw new Error('AUTH_FAILD');
-			
-		case 'same':
-			if(this.token)
-				return succeed(this.token);
-			
-		case 'changed':
-			var self = this;
-			return request('http://www.flickr.com/').addCallback(function(res){
-				var html = res.responseText;
-				return self.token = {
-					secret : html.extract(/global_flickr_secret[ =]+'(.*?)'/),
-					token  : {
-						api_key    : html.extract(/global_magisterLudi[ =]+'(.*?)'/),
-						auth_hash  : html.extract(/global_auth_hash[ =]+'(.*?)'/),
-						auth_token : html.extract(/global_auth_token[ =]+'(.*?)'/),
-					},
-				};
-			});
-		}
-	},
-	
-	addFavorite : function(id){
-		return this.callAuthMethod({
-			method   : 'flickr.favorites.add',
-			photo_id : id,
-		}).addErrback(function(err){
-			switch(err.message){
-			case 'Photo is already in favorites': // code = 3
-				return;
-			}
-			
-			throw err;
-		});
-	},
-	
-	removeFavorite : function(id){
-		return this.callAuthMethod({
-			method   : 'flickr.favorites.remove',
-			photo_id : id,
-		});
-	},
-	
-	getSizes : function(id){
-		return this.callMethod({
-			method   : 'flickr.photos.getSizes',
-			photo_id : id,
-		}).addCallback(function(res){
-			return res.sizes.size;
-		});
-	},
-	
-	getInfo : function(id){
-		return this.callMethod({
-			method   : 'flickr.photos.getInfo',
-			photo_id : id,
-		}).addCallback(function(res){
-			return res.photo;
-		});
-	},
-	
-	// photo
-	// title (optional)
-	// description (optional)
-	// tags (optional)
-	// is_public, is_friend, is_family (optional)
-	// safety_level (optional)
-	// content_type (optional)
-	// hidden (optional)
-	upload : function(ps){
-		return this.callAuthMethod(update({
-			method   : 'flickr.photos.upload',
-		}, ps)).addCallback(function(res){
-			return ''+res.photoid;
-		});
-	},
-}, AbstractSessionService));
-
-models.register({
-	name : 'WeHeartIt',
-	ICON : 'http://weheartit.com/img/favicon.ico',
-	URL : 'http://weheartit.com/',
-	
-	check : function(ps){
-		return ps.type == 'photo' &amp;&amp; !ps.file;
-	},
-	
-	post : function(ps){
-		if(ps.pageUrl.match('^http://weheartit.com/'))
-			return this.iHeartIt(ps.source.split('/').pop());
-		
-		return request(WeHeartIt.URL + 'add.php', {
-			referrer : ps.pageUrl,
-			queryString : {
-				via   : ps.pageUrl,
-				title : ps.item,
-				img   : ps.itemUrl,
-			},
-		}).addCallback(function(res){
-			if(!res.responseText.match('logout'))
-				throw new Error('AUTH_FAILD');
-		});
-	},
-	
-	iHeartIt : function(id){
-		return request(WeHeartIt.URL + 'inc_heartedby.php', {
-			referrer : ps.pageUrl,
-			queryString : {
-				do    : 'heart',
-				entry : id,
-			},
-		}).addCallback(function(res){
-			if(!res.responseText.match('logout'))
-				throw new Error('AUTH_FAILD');
-		});
-	},
-});
-
-models.register({
-	name : '4u',
-	ICON : 'http://www.straightline.jp/html/common/static/favicon.ico',
-	
-	URL : 'http://4u.straightline.jp/',
-	
-	check : function(ps){
-		return ps.type == 'photo' &amp;&amp; !ps.file;
-	},
-	
-	post : function(ps){
-		if(ps.pageUrl.match('^http://4u.straightline.jp/image/'))
-			return this.iLoveHer(ps);
-		
-		return request(this.URL + 'power/manage/register', {
-			referrer : ps.pageUrl,
-			queryString : {
-				site_title  : ps.page,
-				site_url    : ps.pageUrl,
-				alt         : ps.item,
-				src         : ps.itemUrl,
-				bookmarklet : 1,
-			},
-		}).addCallback(function(res){
-			if(!res.responseText.match('logout'))
-				throw new Error('AUTH_FAILD');
-		});
-	},
-
-	iLoveHer : function(ps){
-		// request(ps.pageUrl)
-		// FIXME: id
-		if(!ps.id)
-			return;
-		
-		return request(this.URL + 'user/manage/do_register', {
-			redirectionLimit : 0,
-			referrer : ps.pageUrl,
-			queryString : {
-				src : ps.id,
-			},
-		}).addCallback(function(res){
-			if(res.channel.URI.asciiSpec.match('login')){
-				throw new Error('AUTH_FAILD');
-			}
-		});
-	},
-});
-
-models.register({
-	name : 'Gyazo',
-	ICON : 'chrome://tombloo/skin/item.ico',
-	
-	check : function(ps){
-		return ps.type=='photo' &amp;&amp; ps.file;
-	},
-	
-	getId : function(){
-		var id = getPref('model.gyazo.id');
-		if(!id){
-			with(new Date()){
-				id = getFullYear() + [getMonth()+1, getDate(), getHours(), getMinutes(), getSeconds()].map(function(n){
-					return (''+n).pad(2, '0');
-				}).join('');
-			}
-			setPref('model.gyazo.id', id);
-		}
-		return id;
-	},
-	
-	post : function(ps){
-		return request('http://gyazo.com/upload.cgi', {
-			sendContent : {
-				id        : this.getId(),
-				imagedata : ps.file,
-			},
-		}).addCallback(function(res){
-			addTab(res.responseText);
-		});
-	},
-});
-
-models.register({
-	name : 'Local',
-	
-	// Mark James
-	// http://www.famfamfam.com/lab/icons/silk/
-	ICON : 'chrome://tombloo/skin/local.ico',
-	
-	check : function(ps){
-		switch (ps.type){
-		case 'photo':
-		case 'regular':
-		case 'quote':
-		case 'link':
-			return true;
-		}
-	},
-	
-	post : function(ps){
-		if(ps.type=='photo'){
-			return this.Photo.post(ps);
-		} else {
-			return Local.append(getDataDir(ps.type + '.txt'), ps);
-		}
-	},
-	
-	append : function(file, ps){
-		putContents(file, joinText([
-			joinText([joinText(ps.tags, ' '), ps.item, ps.itemUrl, ps.body, ps.description], '\n\n', true), 
-			getContents(file)
-		], '\n\n\n'));
-		
-		return succeed();
-	},
-	
-	Photo : {
-		post : function(ps){
-			var file = getDataDir('photo');
-			createDir(file);
-			
-			if(ps.file){
-				file.append(ps.file.leafName);
-			} else {
-				var uri = broad(createURI(ps.itemUrl));
-				var fileName = validateFileName(uri.fileName);
-				file.append(fileName);
-			}
-			clearCollision(file);
-			
-			return succeed().addCallback(function(){
-				if(ps.file){
-					return ps.file.copyTo(file.parent, file.leafName);
-				} else {
-					return download(ps.itemUrl, file);
-				}
-			}).addCallback(function(file){
-				if(AppInfo.OS == 'Darwin'){
-					var script = getTempDir();
-					script.append('setcomment.scpt');
-					
-					putContents(script, [
-						'set aFile to POSIX file (&quot;' + file.path + '&quot; as Unicode text)',
-						'set cmtStr to (&quot;' + ps.pageUrl + '&quot; as Unicode text)',
-						'tell application &quot;Finder&quot; to set comment of (file aFile) to cmtStr'
-					].join('\n'), 'UTF-16');
-					
-					var process = new Process(new LocalFile('/usr/bin/osascript'));
-					process.run(false, [script.path], 1);
-				}
-			});
-		},
-	},
-	
-});
-
-models.register({
-	name : 'Twitter',
-	ICON : 'http://twitter.com/favicon.ico',
-	
-	check : function(ps){
-		return !ps.file;
-	},
-	
-	getToken : function(){
-		return request('http://twitter.com/account/settings').addCallback(function(res){
-			var html = res.responseText;
-			if(html.indexOf('signin')!=-1)
-				throw new Error('AUTH_FAILD');
-			
-			return {
-				authenticity_token : html.extract(/authenticity_token.+value=&quot;(.+?)&quot;/),
-				siv                : html.extract(/logout\?siv=(.+?)&quot;/),
-			}
-		});
-	},
-	
-	post : function(ps){
-		return Twitter.getToken().addCallback(function(token){
-			// FIXME: 403&#12364;&#30330;&#29983;&#12377;&#12427;&#12371;&#12392;&#12364;&#12354;&#12387;&#12383;&#12383;&#12417; redirectionLimit:0 &#12434;&#22806;&#12377;
-			token.status = joinText([ps.item, ps.itemUrl, ps.body, ps.description], ' ', true);
-			return request('http://twitter.com/status/update', update({
-				sendContent : token,
-			}));
-		});
-	},
-	
-	remove : function(id){
-		return Twitter.getToken().addCallback(function(ps){
-			ps._method = 'delete';
-			return request('http://twitter.com/status/destroy/' + id, {
-				redirectionLimit : 0,
-				referrer : 'http://twitter.com/home',
-				sendContent : ps,
-			});
-		});
-	},
-	
-	addFavorite : function(id){
-		return Twitter.getToken().addCallback(function(ps){
-			return request('http://twitter.com/favourings/create/' + id, {
-				redirectionLimit : 0,
-				referrer : 'http://twitter.com/home',
-				sendContent : ps,
-			});
-		});
-	},
-});
-
-
-models.register({
-	name : 'Jaiku',
-	ICON : 'http://jaiku.com/favicon.ico',
-	
-	URL : 'http://jaiku.com/',
-	
-	check : function(ps){
-		return !ps.file;
-	},
-	
-	getCurrentUser : function(){
-		if(getCookieString('jaiku.com').match(/jaikuuser_.+?=(.+?);/))
-			return RegExp.$1;
-		
-		throw new Error('AUTH_FAILD');
-	},
-	
-	post : function(ps){
-		this.getCurrentUser();
-		
-		return request(Jaiku.URL).addCallback(function(res){
-			var form =  formContents(convertToHTMLDocument(res.responseText));
-			return request(Jaiku.URL, {
-				redirectionLimit : 0,
-				sendContent : {
-					_nonce : form._nonce,
-					message : joinText([ps.item, ps.itemUrl, ps.body, ps.description], ' ', true),
-				},
-			});
-		});
-	},
-});
-
-
-models.register({
-	name : 'Google',
-	ICON : 'http://www.google.com/favicon.ico',
-});
-
-// copied from http://userscripts.org/scripts/show/19741
-models.register({
-	name : 'GoogleWebHistory',
-	ICON : models.Google.ICON,
-	
-	getCh : function(url){
-		function r(x,y){
-			return Math.floor((x/y-Math.floor(x/y))*y+.1);
-		}
-		function m(c){
-			var i,j,s=[13,8,13,12,16,5,3,10,15];
-			for(i=0;i&lt;9;i+=1){
-				j=c[r(i+2,3)];
-				c[r(i,3)]=(c[r(i,3)]-c[r(i+1,3)]-j)^(r(i,3)==1?j&lt;&lt;s[i]:j&gt;&gt;&gt;s[i]);
-			}
-		}
-		
-		return (this.getCh = function(url){
-			url='info:'+url;
-			
-			var c = [0x9E3779B9,0x9E3779B9,0xE6359A60],i,j,k=0,l,f=Math.floor;
-			for(l=url.length ; l&gt;=12 ; l-=12){
-				for(i=0 ; i&lt;16 ; i+=1){
-					j=k+i;c[f(i/4)]+=url.charCodeAt(j)&lt;&lt;(r(j,4)*8);
-				}
-				m(c);
-				k+=12;
-			}
-			c[2]+=url.length;
-			
-			for(i=l;i&gt;0;i--)
-				c[f((i-1)/4)]+=url.charCodeAt(k+i-1)&lt;&lt;(r(i-1,4)+(i&gt;8?1:0))*8;
-			m(c);
-			
-			return'6'+c[2];
-		})(url);
-	},
-	
-	post : function(url){
-		return request('http://www.google.com/search?client=navclient-auto&amp;ch=' + GoogleWebHistory.getCh(url) + '&amp;features=Rank&amp;q=info:' + escape(url));
-	},
-});
-
-models.register({
-	name : 'GoogleBookmarks',
-	ICON : models.Google.ICON,
-	
-	check : function(ps){
-		return ps.type!='regular' &amp;&amp; !ps.file;
-	},
-	
-	post : function(ps){
-		return request('http://www.google.com/bookmarks/mark', {
-			queryString :	{
-				op : 'add',
-			},
-		}).addCallback(function(res){
-			var doc = convertToHTMLDocument(res.responseText);
-			if(doc.getElementById('gaia_loginform'))
-				throw new Error('AUTH_FAILD');
-			
-			var fs = formContents(doc);
-			return request('http://www.google.com'+$x('//form[@name=&quot;add_bkmk_form&quot;]/@action', doc), {
-				redirectionLimit : 0,
-				sendContent  : {
-					title      : ps.item,
-					bkmk       : ps.itemUrl,
-					annotation : joinText([ps.body, ps.description], ' ', true),
-					labels     : ps.tags? ps.tags.join(',') : '',
-					btnA       : fs.btnA,
-					sig        : fs.sig,
-				},
-			});
-		});
-	},
-});
-
-models.register({
-	name : 'Delicious',
-	ICON : 'http://delicious.com/favicon.ico',
-	
-	getUserTags : function(user){
-		// &#21516;&#26399;&#12391;&#12456;&#12521;&#12540;&#12364;&#36215;&#12365;&#12394;&#12356;&#12424;&#12358;&#12395;&#12377;&#12427;
-		return succeed().addCallback(function(){
-			return request('http://feeds.delicious.com/feeds/json/tags/' + (user || Delicious.getCurrentUser()));
-		}).addCallback(function(res){
-			var tags = Components.utils.evalInSandbox(
-				res.responseText, 
-				Components.utils.Sandbox('http://feeds.delicious.com/'));
-			return reduce(function(memo, tag){
-				memo.push({
-					name      : tag[0],
-					frequency : tag[1],
-				});
-				return memo;
-			}, tags, []);
-		});
-	},
-	
-	getCurrentUser : function(){
-		if(decodeURIComponent(getCookieString('delicious.com', '_user')).match(/user=(.*?) /))
-			return RegExp.$1;
-		
-		throw new Error('AUTH_FAILD');
-	},
-	
-	check : function(ps){
-		return ps.type!='regular' &amp;&amp; !ps.file;
-	},
-	
-	post : function(ps){
-		return request('http://delicious.com/post/', {
-			queryString :	{
-				title : ps.item,
-				url   : ps.itemUrl,
-			},
-		}).addCallback(function(res){
-			var doc = convertToHTMLDocument(res.responseText);
-			if(!doc.getElementById('saveitem'))
-				throw new Error('AUTH_FAILD');
-			
-			return request('http://delicious.com'+$x('id(&quot;saveitem&quot;)/@action', doc), {
-				redirectionLimit : 0,
-				sendContent : update(formContents(doc), {
-					description : ps.item,
-					jump        : 'no',
-					notes       : joinText([ps.body, ps.description], ' ', true),
-					tags        : ps.tags? ps.tags.join(' ') : '',
-					share       : ps.private? 'no' : '',
-				}),
-			});
-		});
-	},
-});
-
-
-if(NavBookmarksService){
-	models.register({
-		name : 'FirefoxBookmark',
-		ICON : 'chrome://tombloo/skin/firefox.ico',
-		ANNO_DESCRIPTION : 'bookmarkProperties/description',
-		
-		check : function(ps){
-			return ps.type == 'link';
-		},
-		
-		post : function(ps){
-			return succeed(this.addBookmark(ps.itemUrl, ps.item, ps.tags, ps.description));
-		},
-		
-		addBookmark : function(uri, title, tags, description){
-			uri = createURI(uri);
-			tags = tags || [];
-			
-			if(this.isBookmarked(uri))
-				return;
-			
-			var folders = [NavBookmarksService.unfiledBookmarksFolder].concat(tags.map(bind('createTag', this)));
-			folders.forEach(function(folder){
-				NavBookmarksService.insertBookmark(
-					folder, 
-					uri,
-					NavBookmarksService.DEFAULT_INDEX,
-					title);
-			});
-			
-			this.setDescription(uri, description);
-		},
-		
-		getBookmark : function(uri){
-			uri = createURI(uri);
-			var item = this.getBookmarkId(uri);
-			if(item)
-				return {
-					title       : NavBookmarksService.getItemTitle(item),
-					uri         : uri.asciiSpec,
-					description : this.getDescription(item),
-				};
-		},
-		
-		isBookmarked : function(uri){
-			return NavBookmarksService.isBookmarked(createURI(uri));
-		},
-		
-		removeBookmark : function(uri){
-			uri = createURI(uri);
-			NavBookmarksService.getBookmarkIdsForURI(uri, {}).forEach(function(item){
-				NavBookmarksService.removeItem(item);
-			});
-		},
-		
-		getBookmarkId : function(uri){
-			if(typeof(uri)=='number')
-				return uri;
-			
-			uri = createURI(uri);
-			return NavBookmarksService.getBookmarkIdsForURI(uri, {}).filter(function(item){
-				while(item = NavBookmarksService.getFolderIdForItem(item))
-					if(item == NavBookmarksService.tagsFolder)
-						return false;
-				
-				return true;
-			})[0];
-		},
-		
-		getDescription : function(uri){
-			try{
-				return AnnotationService.getItemAnnotation(this.getBookmarkId(uri), this.ANNO_DESCRIPTION);
-			} catch(e){
-				return '';
-			}
-		},
-		
-		setDescription : function(uri, description){
-			description = description || '';
-			try{
-				AnnotationService.setItemAnnotation(this.getBookmarkId(uri), this.ANNO_DESCRIPTION, description, 
-					0, AnnotationService.EXPIRE_NEVER);
-			} catch(e){}
-		},
-		
-		createTag : function(name){
-			return this.createFolder(NavBookmarksService.tagsFolder, name);
-		},
-		
-		createFolder : function(parent, name){
-			return NavBookmarksService.getChildFolder(parent, name) || 
-				NavBookmarksService.createFolder(parent, name, NavBookmarksService.DEFAULT_INDEX);
-		},
-	});
-}
-
-models.register({
-	name : 'Instapaper',
-	ICON : 'chrome://tombloo/skin/instapaper.ico',
-	
-	check : function(ps){
-		return ps.type == 'link' || ps.type == 'quote';
-	},
-	
-	post : function(ps){
-		return request('http://www.instapaper.com/edit', {
-			redirectionLimit : 0,
-			sendContent : {
-				'bookmark[title]' : ps.item, 
-				'bookmark[url]' : ps.itemUrl,
-				'bookmark[selection]' : joinText([ps.body, ps.description], '\n', true),
-			},
-		}).addCallback(function(res){
-			if(res.channel.URI.asciiSpec.match('login')){
-				throw new Error('AUTH_FAILD');
-			}
-		});
-	},
-});
-
-
-// http://www.kawa.net/works/ajax/romanize/japanese.html
-models.register({
-	name : 'Kawa',
-	
-	getRomaReadings : function(text){
-		return request('http://www.kawa.net/works/ajax/romanize/romanize.cgi', {
-			queryString : {
-				// mecab-utf8
-				// japanese
-				// kana
-				mode : 'japanese',
-				q : text,
-			},
-		}).addCallback(function(res){
-			return map(function(s){	
-				return ''+s.@title || ''+s;
-			}, convertToXML(res.responseText).li.span);
-		});
-	},
-});
-
-
-// http://developer.yahoo.co.jp/jlp/MAService/V1/parse.html
-models.register({
-	name : 'Yahoo',
-	APP_ID : '16y9Ex6xg64GBDD.tmwF.WIdXURG0iTT25NUQ72RLF_Jzt2_MfXDDZfKehYkX6dPZqk-',
-	
-	parse : function(ps){
-		ps.appid = this.APP_ID;
-		return request('http://api.jlp.yahoo.co.jp/MAService/V1/parse', {
-			charset     : 'utf-8',
-			sendContent : ps
-		}).addCallback(function(res){
-			return convertToXML(res.responseText);
-		});
-	},
-	
-	getKanaReadings : function(str){
-		return this.parse({
-			sentence : str,
-			response : 'reading',
-		}).addCallback(function(res){
-			return list(res.ma_result.word_list.word.reading);
-		});
-	},
-	
-	getRomaReadings : function(str){
-		return this.getKanaReadings(str).addCallback(function(rs){
-			return rs.join('\u0000').toRoma().split('\u0000');
-		});
-	},
-});
-
-
-models.register({
-	name : 'YahooBookmarks',
-	ICON : 'http://bookmarks.yahoo.co.jp/favicon.ico',
-	
-	check : function(ps){
-		return ps.type!='regular' &amp;&amp; !ps.file;
-	},
-	
-	post : function(ps){
-		return request('http://bookmarks.yahoo.co.jp/action/post').addCallback(function(res){
-			if(res.responseText.indexOf('login_form')!=-1)
-				throw new Error('AUTH_FAILD');
-			
-			return formContents($x('(id(&quot;addbookmark&quot;)//form)[1]', convertToHTMLDocument(res.responseText)));
-		}).addCallback(function(fs){
-			return request('http://bookmarks.yahoo.co.jp/action/post/done', {
-				redirectionLimit : 0,
-				sendContent  : {
-					title      : ps.item,
-					url        : ps.itemUrl,
-					desc       : joinText([ps.body, ps.description], ' ', true),
-					tags       : ps.tags? ps.tags.join(' ') : '',
-					crumbs     : fs.crumbs,
-					visibility : ps.private==null? fs.visibility : (ps.private? 0 : 1),
-				},
-			});
-		});
-	},
-	
-	getUserTags : function(){
-		return request('http://bookmarks.yahoo.co.jp/bookmarklet/showpopup').addCallback(function(res){
-			if(res.responseText.match(/yourtags =(.*)(;|$)/)[1]){
-				return reduce(function(memo, tag){
-					memo.push({
-						name      : tag,
-						frequency : -1,
-					});
-					return memo;
-				}, Components.utils.evalInSandbox(RegExp.$1, Components.utils.Sandbox('http://bookmarks.yahoo.co.jp/')), []);
-			}
-			
-			throw new Error('AUTH_FAILD');
-		});
-	},
-});
-
-models.register({
-	name : 'Snipshot',
-	ICON : 'http://snipshot.com/favicon.ico',
-	
-	check : function(ps){
-		return ps.type=='photo';
-	},
-	
-	post : function(ps){
-		return request('http://services.snipshot.com/', {
-			sendContent : {
-				snipshot_input : ps.file || ps.itemUrl,
-			},
-		}).addCallback(function(res){
-			return addTab(res.channel.URI.asciiSpec);
-		}).addCallback(function(win){
-			win.SnipshotImport = {
-				title : ps.page,
-				url   : ps.pageUrl,
-			};
-		});
-	},
-});
-
-models.register(update({
-	name : 'Hatena',
-	ICON : 'http://www.hatena.ne.jp/favicon.ico',
-	
-	getPasswords : function(){
-		return getPasswords('https://www.hatena.ne.jp');
-	},
-	
-	login : function(user, password){
-		var self = this;
-		return (this.getAuthCookie()? this.logout() : succeed()).addCallback(function(){
-			return request('https://www.hatena.ne.jp/login', {
-				sendContent : {
-					name : user,
-					password : password,
-					persistent : 1,
-					location : 'http://www.hatena.ne.jp/',
-				},
-			});
-		}).addCallback(function(){
-			self.updateSession();
-			self.user = user;
-		});
-	},
-	
-	logout : function(){
-		return request('http://www.hatena.ne.jp/logout');
-	},
-	
-	getAuthCookie : function(){
-		return getCookieString('.hatena.ne.jp', 'rk');
-	},
-	
-	getToken : function(){
-		switch (this.updateSession()){
-		case 'none':
-			throw new Error('AUTH_FAILD');
-			
-		case 'same':
-			if(this.token)
-				return succeed(this.token);
-			
-		case 'changed':
-			// &#30011;&#38754;&#35201;&#32032;&#12420;DB&#12450;&#12463;&#12475;&#12473;&#12364;&#23569;&#12394;&#12381;&#12358;&#12394;&#12383;&#12417;&#12502;&#12483;&#12463;&#12510;&#12540;&#12463;&#20837;&#21147;&#30011;&#38754;&#12363;&#12425;&#21462;&#24471;&#12377;&#12427;
-			var self = this;
-			return request(HatenaBookmark.POST_URL).addCallback(function(res){
-				if(res.responseText.match(/Hatena\.rkm\s*=\s*['&quot;](.+?)['&quot;]/))
-					return self.token = RegExp.$1;
-			});
-		}
-	},
-	
-	getCurrentUser : function(){
-		switch (this.updateSession()){
-		case 'none':
-			return succeed('');
-			
-		case 'same':
-			if(this.user)
-				return succeed(this.user);
-			
-		case 'changed':
-			var self = this;
-			return request('http://www.hatena.ne.jp/my').addCallback(function(res){
-				return self.user = $x(
-					'(//*[@class=&quot;username&quot;]//strong)[1]/text()', 
-					convertToHTMLDocument(res.responseText));
-			});
-		}
-	},
-	
-	reprTags: function (tags) {
-		return tags ? tags.map(function(t){
-			return '[' + t + ']';
-		}).join('') : '' ;
-	},
-}, AbstractSessionService));
-
-models.register({
-	name : 'HatenaFotolife',
-	ICON : 'http://f.hatena.ne.jp/favicon.ico',
-	
-	check : function(ps){
-		return ps.type=='photo' &amp;&amp; ps.file;
-	},
-	
-	post : function(ps){
-		return this.upload({
-			image1     : ps.file,
-			fototitle1 : ps.page,
-		});
-	},
-	
-	// image1 - image5
-	// fototitle1 - fototitle5 (optional)
-	upload : function(ps){
-		return Hatena.getToken().addCallback(function(token){
-			ps.rkm = token;
-			
-			return Hatena.getCurrentUser();
-		}).addCallback(function(user){
-			return request('http://f.hatena.ne.jp/'+user+'/up', {
-				redirectionLimit : 0,
-				sendContent : update({
-					mode : 'enter',
-				}, ps),
-			});
-		});
-	},
-});
-
-models.register({
-	name : 'HatenaBookmark',
-	ICON : 'http://b.hatena.ne.jp/favicon.ico',
-	
-	POST_URL : 'http://b.hatena.ne.jp/add',
-	
-	check : function(ps){
-		return ps.type!='regular' &amp;&amp; !ps.file;
-	},
-	
-	post : function(ps){
-		// &#12479;&#12452;&#12488;&#12523;&#12399;&#20849;&#26377;&#12373;&#12428;&#12390;&#12356;&#12427;&#12383;&#12417;&#36865;&#20449;&#12375;&#12394;&#12356;
-		return this.addBookmark(ps.itemUrl, null, ps.tags, joinText([ps.body, ps.description], ' ', true));
-	},
-	
-	addBookmark : function(url, title, tags, description){
-		return Hatena.getToken().addCallback(function(token){
-			return request(HatenaBookmark.POST_URL, {
-				redirectionLimit : 0,
-				sendContent : {
-					mode    : 'enter',
-					rkm     : token,
-					url     : url,
-					title   : title, 
-					comment : Hatena.reprTags(tags) + description.replace(/[\n\r]+/g, ' '),
-				},
-			});
-		});
-	},
-	
-	getUserTags : function(){
-		return request(HatenaBookmark.POST_URL+'?mode=confirm').addCallback(function(res){
-			if(!res.responseText.match(/var tags ?=(.*);/))
-				throw new Error('AUTH_FAILD');
-			
-			return reduce(function(memo, tag){
-				memo.push({
-					name      : tag,
-					frequency : -1,
-				});
-				return memo;
-			}, Components.utils.evalInSandbox(RegExp.$1, Components.utils.Sandbox('http://b.hatena.ne.jp/')), []);
-		});
-	},
-});
-
-models.register( {
-	name: 'HatenaDiary',
-	ICON: 'http://d.hatena.ne.jp/favicon.ico',
-	POST_URL : 'http://d.hatena.ne.jp',
-	
-	/*
-	check : function(ps){
-		return ps.type.match(/^(regular|photo|link|quote)$/);
-	},
-	*/
-	converters: {
-		getTitle: function(ps){
-			return Hatena.reprTags(ps.tags) + (ps.page || '')
-		},
-		renderingTemplates: {
-			regular: '&lt;&gt;{ps.description}&lt;/&gt;',
-			photo: '&lt;&gt;&lt;blockquote class=&quot;tombloo_photo&quot; cite={ps.pageUrl} title={ps.page}&gt;&lt;img src={ps.itemUrl} /&gt;&lt;/blockquote&gt;{ps.description}&lt;/&gt;',
-			link: '&lt;&gt;&lt;div class=&quot;tombloo_link&quot;&gt;&lt;a href={ps.pageUrl} title={ps.page}&gt;{ps.page}&lt;/a&gt;&lt;/div&gt;{ps.description}&lt;/&gt;',
-			quote: '&lt;&gt;blockquote class=&quot;tombloo_quote&quot; cite={ps.pageUrl} title={ps.page}&gt;{ps.body}&lt;/blockquote&gt;{ps.description}&lt;/&gt;',
-		},
-		__noSuchMethod__: function(name, args){
-			var ps = args[0];
-			return {
-				title: (name == 'regular') ? '' : this.getTitle(ps),
-				body: eval( this.renderingTemplates[name] ).toString()
-			};
-		},
-	},
-	post : function(params){
-		var content;
-		var self = this;
-		return models.Hatena.getToken().addCallback(function(token){
-			content = self.converters[params.type](params);
-			content.rkm = token;
-			return models.Hatena.getCurrentUser();
-		}).addCallback(function(id){
-			var endpoint = [self.POST_URL, id, ''].join('/');
-			return request( endpoint, {
-				redirectionLimit : 0,
-				referrer    : endpoint,
-				sendContent : content
-			});
-		});
-	}
-});
-
-models.register({
-	name : 'HatenaStar',
-	ICON : 'http://s.hatena.ne.jp/favicon.ico',
-	
-	getToken : function(){
-		return request('http://s.hatena.ne.jp/entries.json').addCallback(function(res){
-			if(!res.responseText.match(/&quot;rks&quot;:&quot;(.*?)&quot;/))
-				throw new Error('AUTH_FAILD');
-			return RegExp.$1;
-		})
-	},
-	
-	check : function(ps){
-		return ps.type!='regular' &amp;&amp; !ps.file;
-	},
-	
-	post : function(ps){
-		return HatenaStar.getToken().addCallback(function(token){
-			return request('http://s.hatena.ne.jp/star.add.json', {
-				redirectionLimit : 0,
-				queryString :	{
-					rks      : token,
-					title    : ps.item,
-					quote    : joinText([ps.body, ps.description], ' ', true),
-					location : ps.pageUrl,
-					uri      : ps.itemUrl,
-				},
-			});
-		});
-	},
-	
-	remove : function(ps){
-		return HatenaStar.getToken().addCallback(function(token){
-			return request('http://s.hatena.ne.jp/star.delete.json', {
-				redirectionLimit : 0,
-				queryString :	{
-					rks   : token,
-					uri   : ps.itemUrl,
-					quote : joinText([ps.body, ps.description], ' ', true),
-				},
-			});
-		});
-	},
-});
-
-models.register(update({
-	name : 'LivedoorClip',
-	ICON : 'http://clip.livedoor.com/favicon.ico',
-	POST_URL : 'http://clip.livedoor.com/clip/add',
-
-	check : function(ps){
-		return ps.type!='regular' &amp;&amp; !ps.file;
-	},
-	
-	post : function(ps){
-		return LivedoorClip.getToken().addCallback(function(token){
-			var content = {
-				rate    : ps.rate? ps.rate : '',
-				title   : ps.item,
-				postKey : token,
-				link    : ps.itemUrl,
-				tags    : ps.tags? ps.tags.join(' ') : '',
-				notes   : joinText([ps.body, ps.description], ' ', true),
-				public  : ps.private? 'off' : 'on',
-			};
-			return request(LivedoorClip.POST_URL, {
-				redirectionLimit : 0,
-				sendContent : content,
-			});
-		});
-	},
-	
-	getAuthCookie : function(){
-		return getCookieString('livedoor.com', '.LRC');
-	},
-	
-	getUserTags : function(){
-		if(!this.getAuthCookie())
-			return fail(new Error('AUTH_FAILD'));
-		
-		return request(LivedoorClip.POST_URL+'?link=http%3A%2F%2Ftombloo/').addCallback(function(res){
-			var doc = convertToHTMLDocument(res.responseText);
-			return $x('id(&quot;tag_list&quot;)/span/text()', doc, true).map(function(tag){
-				return {
-					name      : tag,
-					frequency : -1,
-				};
-			});
-		});
-	},
-	
-	getToken : function(){
-		switch (this.updateSession()){
-		case 'none':
-			throw new Error('AUTH_FAILD');
-		
-		case 'same':
-			if(this.token)
-				return succeed(this.token);
-		
-		case 'changed':
-			var self = this;
-				return request(LivedoorClip.POST_URL+'?link=http%3A%2F%2Ftombloo/').addCallback(function(res){
-					if(res.responseText.match(/&quot;postkey&quot; value=&quot;(.*)&quot;/)){
-						self.token = RegExp.$1;
-						return self.token;
-					}
-					throw new Error('AUTH_FAILD');
-				});
-		}
-	},
-}, AbstractSessionService));
-
-models.register({
-	name : 'Wassr',
-	ICON : 'http://wassr.jp/favicon.ico',
-	
-	check : function(ps){
-		return !ps.file;
-	},
-	
-	post : function(ps){
-		return request('http://wassr.jp/my/').addCallback(function(res){
-			return request('http://wassr.jp/my/status/add', {
-				redirectionLimit : 0,
-				sendContent : update(formContents(convertToHTMLDocument(res.responseText)), {
-					message : joinText([ps.item, ps.itemUrl, ps.body, ps.description], ' ', true),
-				}),
-			});
-		})
-	},
-});
-
-models.copyTo(this);
+if(typeof(models)=='undefined')
+	this.models = models = new Repository();
+
+models.register({
+	name : 'FriendFeed',
+	ICON : 'http://friendfeed.com/favicon.ico',
+	check : function(ps){
+		return ps.type != 'regular' &amp;&amp; !ps.file;
+	},
+	
+	getAuthCookie : function(){
+		return getCookieString('friendfeed.com', 'U');
+	},
+	
+	getToken : function(){
+		return getCookieString('friendfeed.com', 'AT').split('=').pop();
+	},
+	
+	post : function(ps){
+		if(!this.getAuthCookie())
+			throw new Error('AUTH_FAILD');
+		
+		var self = this;
+		return request('https://friendfeed.com/share/publish', {
+			redirectionLimit : 0,
+			sendContent : {
+				at  : self.getToken(),
+				url : ps.pageUrl,
+				title : ps.page,
+				image0 : ps.type == 'photo'? ps.itemUrl : '',
+				comment : joinText([ps.body, ps.description], ' ', true),
+			},
+		});
+	},
+});
+
+
+models.register({
+	name : 'FFFFOUND',
+	ICON : 'http://ffffound.com/favicon.ico',
+	URL : 'http://FFFFOUND.com/',
+	
+	getToken : function(){
+		return request(FFFFOUND.URL + 'bookmarklet.js').addCallback(function(res){
+			return res.responseText.match(/token='(.*?)'/)[1];
+		});
+	},
+	
+	check : function(ps){
+		return ps.type == 'photo' &amp;&amp; !ps.file;
+	},
+	
+	post : function(ps){
+		if(ps.pageUrl.match('^http://ffffound.com/')){
+			var id = ps.itemUrl.split('/').pop().replace(/[_\.].+/, '');
+			return this.iLoveThis(id)
+		}
+		
+		return this.getToken().addCallback(function(token){
+			return request(FFFFOUND.URL + 'add_asset', {
+				referrer : ps.pageUrl,
+				queryString : {
+					token   : token,
+					url     : ps.itemUrl,
+					referer : ps.pageUrl,
+					title   : ps.item,
+				},
+			}).addCallback(function(res){
+				if(res.responseText.match('(FAILED:|ERROR:) (.*?)&lt;/span&gt;'))
+					throw RegExp.$2;
+				
+				if(res.responseText.match('login'))
+					throw new Error('AUTH_FAILD');
+			});
+		});
+	},
+
+	remove : function(id){
+		// 200 {&quot;success&quot;:false}
+		return request(FFFFOUND.URL + 'gateway/in/api/remove_asset', {
+			referrer : FFFFOUND.URL,
+			sendContent : {
+				collection_id : id,
+			},
+		});
+	},
+	
+	iLoveThis : function(id){
+		return request(FFFFOUND.URL + 'gateway/in/api/add_asset', {
+			referrer : FFFFOUND.URL,
+			sendContent : {
+				collection_id : 'i'+id,
+				inappropriate : false,
+			},
+		}).addCallback(function(res){
+			// NOT_FOUND / EXISTS / AUTH_FAILD
+			if(res.responseText.match(/&quot;error&quot;:&quot;(.*?)&quot;/))
+				throw RegExp.$1;
+		});
+	},
+});
+
+models.register({
+	name : 'Amazon',
+	ICON : 'http://www.amazon.co.jp/favicon.ico',
+	getItem : function(asin){
+		return request('http://webservices.amazon.co.jp/onca/xml', {
+			queryString : {
+				Service        : 'AWSECommerceService',
+				SubscriptionId : '0DCQFXHRBNT9GN9Z64R2',
+				Operation      : 'ItemLookup',
+				ResponseGroup  : 'Small,Images',
+				ItemId         : asin,
+			},
+		}).addCallback(function(res){
+			var xml = convertToXML(res.responseText);
+			if(xml.Error.length())
+				throw res;
+			
+			return new Amazon.Item(xml.Items.Item);
+		});
+	},
+	
+	normalizeUrl : function(asin){
+		return  'http://amazon.co.jp/o/ASIN/' + asin + 
+			(this.affiliateId ? '/' + this.affiliateId + '/ref=nosim' : '');
+	},
+	
+	get affiliateId(){
+		return getPref('amazonAffiliateId');
+	},
+	
+	Item : function(item){
+		return {
+			get title(){
+				return ''+item.ItemAttributes.Title;
+			},
+			get creators(){
+				var creators = [];
+				
+				// '&#21407;&#33879;'&#20197;&#22806;
+				for each(var creator in item.ItemAttributes.Creator.(@Role != '\u539F\u8457'))
+					creators.push(''+creator);
+				return creators;
+			},
+			get largestImage(){
+				return this.largeImage || this.mediumImage || this.smallImage;
+			},
+			get largeImage(){
+				return new Amazon.Image(item.LargeImage);
+			},
+			get mediumImage(){
+				return new Amazon.Image(item.MediumImage);
+			},
+			get smallImage(){
+				return new Amazon.Image(item.SmallImage);
+			},
+		}
+	},
+	
+	Image : function(img){
+		if(!img.length())
+			return;
+		
+		return {
+			get size(){
+				return (''+img.name()).slice(0, -5).toLowerCase();
+			},
+			get url(){
+				return ''+img.URL;
+			},
+			get width(){
+				return 1*img.Width;
+			},
+			get height(){
+				return 1*img.Height;
+			},
+		}
+	},
+});
+
+// Flickr API Documentation 
+// http://www.flickr.com/services/api/
+models.register(update({
+	name : 'Flickr',
+	ICON : 'http://www.flickr.com/favicon.ico',
+	API_KEY : 'ecf21e55123e4b31afa8dd344def5cc5',
+	
+	getAuthCookie : function(){
+		return getCookieString('flickr.com', 'cookie_accid');
+	},
+	
+	check : function(ps){
+		// Favorite&#12414;&#12383;&#12399;&#12461;&#12515;&#12503;&#12481;&#12515;&#12363;
+		// itemUrl&#12434;&#12481;&#12455;&#12483;&#12463;&#12375;Photo - Upload from Cache&#12434;&#36991;&#12369;&#12427;
+		return ps.type == 'photo' &amp;&amp; 
+			(ps.pageUrl.match('^http://www.flickr.com/photos/') || (!ps.itemUrl &amp;&amp; ps.file));
+	},
+	
+	post : function(ps){
+		if(ps.file){
+			return this.upload({
+				photo       : ps.file,
+				title       : ps.page || '',
+				description : ps.description || '',
+				is_public   : ps.private? 0 : 1,
+				tags        : joinText(ps.tags, ' '),
+			});
+		} else {
+			return this.addFavorite(ps.pageUrl.replace(/\/$/, '').split('/').pop());
+		}
+	},
+	
+	callMethod : function(ps){
+		return request('http://flickr.com/services/rest/', {
+			queryString : update({
+				api_key        : this.API_KEY,
+				nojsoncallback : 1,
+				format         : 'json',
+			}, ps),
+		}).addCallback(function(res){
+			eval('var json=' + res.responseText);
+			if(json.stat!='ok')
+				throw json.message;
+			return json;
+		});
+	},
+	
+	callAuthMethod : function(ps){
+		return this.getToken().addCallback(function(page){
+			if(ps.method=='flickr.photos.upload')
+				delete ps.method;
+			
+			update(ps, page.token);
+			ps.cb = new Date().getTime(),
+			ps.api_sig = (page.secret + keys(ps).sort().filter(function(key){
+				// &#12501;&#12449;&#12452;&#12523;&#12434;&#21462;&#12426;&#38500;&#12367;
+				return typeof(ps[key])!='object';
+			}).map(function(key){
+				return key + ps[key]
+			}).join('')).md5();
+			
+			return request('http://flickr.com/services/' + (ps.method? 'rest/' : 'upload/'), {
+				sendContent : ps,
+			});
+		}).addCallback(function(res){
+			res = convertToXML(res.responseText);
+			if(res.@stat!='ok'){
+				var err = new Error(''+res.err.@msg)
+				err.code = res.err.@code;
+				
+				throw err;
+			}
+			return res;
+		});
+	},
+	
+	getToken : function(){
+		var status = this.updateSession();
+		switch (status){
+		case 'none':
+			throw new Error('AUTH_FAILD');
+			
+		case 'same':
+			if(this.token)
+				return succeed(this.token);
+			
+		case 'changed':
+			var self = this;
+			return request('http://www.flickr.com/').addCallback(function(res){
+				var html = res.responseText;
+				return self.token = {
+					secret : html.extract(/global_flickr_secret[ =]+'(.*?)'/),
+					token  : {
+						api_key    : html.extract(/global_magisterLudi[ =]+'(.*?)'/),
+						auth_hash  : html.extract(/global_auth_hash[ =]+'(.*?)'/),
+						auth_token : html.extract(/global_auth_token[ =]+'(.*?)'/),
+					},
+				};
+			});
+		}
+	},
+	
+	addFavorite : function(id){
+		return this.callAuthMethod({
+			method   : 'flickr.favorites.add',
+			photo_id : id,
+		}).addErrback(function(err){
+			switch(err.message){
+			case 'Photo is already in favorites': // code = 3
+				return;
+			}
+			
+			throw err;
+		});
+	},
+	
+	removeFavorite : function(id){
+		return this.callAuthMethod({
+			method   : 'flickr.favorites.remove',
+			photo_id : id,
+		});
+	},
+	
+	getSizes : function(id){
+		return this.callMethod({
+			method   : 'flickr.photos.getSizes',
+			photo_id : id,
+		}).addCallback(function(res){
+			return res.sizes.size;
+		});
+	},
+	
+	getInfo : function(id){
+		return this.callMethod({
+			method   : 'flickr.photos.getInfo',
+			photo_id : id,
+		}).addCallback(function(res){
+			return res.photo;
+		});
+	},
+	
+	// photo
+	// title (optional)
+	// description (optional)
+	// tags (optional)
+	// is_public, is_friend, is_family (optional)
+	// safety_level (optional)
+	// content_type (optional)
+	// hidden (optional)
+	upload : function(ps){
+		return this.callAuthMethod(update({
+			method   : 'flickr.photos.upload',
+		}, ps)).addCallback(function(res){
+			return ''+res.photoid;
+		});
+	},
+}, AbstractSessionService));
+
+models.register({
+	name : 'WeHeartIt',
+	ICON : 'http://weheartit.com/img/favicon.ico',
+	URL : 'http://weheartit.com/',
+	
+	check : function(ps){
+		return ps.type == 'photo' &amp;&amp; !ps.file;
+	},
+	
+	post : function(ps){
+		if(ps.pageUrl.match('^http://weheartit.com/'))
+			return this.iHeartIt(ps.source.split('/').pop());
+		
+		return request(WeHeartIt.URL + 'add.php', {
+			referrer : ps.pageUrl,
+			queryString : {
+				via   : ps.pageUrl,
+				title : ps.item,
+				img   : ps.itemUrl,
+			},
+		}).addCallback(function(res){
+			if(!res.responseText.match('logout'))
+				throw new Error('AUTH_FAILD');
+		});
+	},
+	
+	iHeartIt : function(id){
+		return request(WeHeartIt.URL + 'inc_heartedby.php', {
+			referrer : ps.pageUrl,
+			queryString : {
+				do    : 'heart',
+				entry : id,
+			},
+		}).addCallback(function(res){
+			if(!res.responseText.match('logout'))
+				throw new Error('AUTH_FAILD');
+		});
+	},
+});
+
+models.register({
+	name : '4u',
+	ICON : 'http://www.straightline.jp/html/common/static/favicon.ico',
+	
+	URL : 'http://4u.straightline.jp/',
+	
+	check : function(ps){
+		return ps.type == 'photo' &amp;&amp; !ps.file;
+	},
+	
+	post : function(ps){
+		if(ps.pageUrl.match('^http://4u.straightline.jp/image/'))
+			return this.iLoveHer(ps);
+		
+		return request(this.URL + 'power/manage/register', {
+			referrer : ps.pageUrl,
+			queryString : {
+				site_title  : ps.page,
+				site_url    : ps.pageUrl,
+				alt         : ps.item,
+				src         : ps.itemUrl,
+				bookmarklet : 1,
+			},
+		}).addCallback(function(res){
+			if(!res.responseText.match('logout'))
+				throw new Error('AUTH_FAILD');
+		});
+	},
+
+	iLoveHer : function(ps){
+		// request(ps.pageUrl)
+		// FIXME: id
+		if(!ps.id)
+			return;
+		
+		return request(this.URL + 'user/manage/do_register', {
+			redirectionLimit : 0,
+			referrer : ps.pageUrl,
+			queryString : {
+				src : ps.id,
+			},
+		}).addCallback(function(res){
+			if(res.channel.URI.asciiSpec.match('login')){
+				throw new Error('AUTH_FAILD');
+			}
+		});
+	},
+});
+
+models.register({
+	name : 'Gyazo',
+	ICON : 'chrome://tombloo/skin/item.ico',
+	
+	check : function(ps){
+		return ps.type=='photo' &amp;&amp; ps.file;
+	},
+	
+	getId : function(){
+		var id = getPref('model.gyazo.id');
+		if(!id){
+			with(new Date()){
+				id = getFullYear() + [getMonth()+1, getDate(), getHours(), getMinutes(), getSeconds()].map(function(n){
+					return (''+n).pad(2, '0');
+				}).join('');
+			}
+			setPref('model.gyazo.id', id);
+		}
+		return id;
+	},
+	
+	post : function(ps){
+		return request('http://gyazo.com/upload.cgi', {
+			sendContent : {
+				id        : this.getId(),
+				imagedata : ps.file,
+			},
+		}).addCallback(function(res){
+			addTab(res.responseText);
+		});
+	},
+});
+
+models.register({
+	name : 'Local',
+	
+	// Mark James
+	// http://www.famfamfam.com/lab/icons/silk/
+	ICON : 'chrome://tombloo/skin/local.ico',
+	
+	check : function(ps){
+		switch (ps.type){
+		case 'photo':
+		case 'regular':
+		case 'quote':
+		case 'link':
+			return true;
+		}
+	},
+	
+	post : function(ps){
+		if(ps.type=='photo'){
+			return this.Photo.post(ps);
+		} else {
+			return Local.append(getDataDir(ps.type + '.txt'), ps);
+		}
+	},
+	
+	append : function(file, ps){
+		putContents(file, joinText([
+			joinText([joinText(ps.tags, ' '), ps.item, ps.itemUrl, ps.body, ps.description], '\n\n', true), 
+			getContents(file)
+		], '\n\n\n'));
+		
+		return succeed();
+	},
+	
+	Photo : {
+		post : function(ps){
+			var file = getDataDir('photo');
+			createDir(file);
+			
+			if(ps.file){
+				file.append(ps.file.leafName);
+			} else {
+				var uri = broad(createURI(ps.itemUrl));
+				var fileName = validateFileName(uri.fileName);
+				file.append(fileName);
+			}
+			clearCollision(file);
+			
+			return succeed().addCallback(function(){
+				if(ps.file){
+					return ps.file.copyTo(file.parent, file.leafName);
+				} else {
+					return download(ps.itemUrl, file);
+				}
+			}).addCallback(function(file){
+				if(AppInfo.OS == 'Darwin'){
+					var script = getTempDir();
+					script.append('setcomment.scpt');
+					
+					putContents(script, [
+						'set aFile to POSIX file (&quot;' + file.path + '&quot; as Unicode text)',
+						'set cmtStr to (&quot;' + ps.pageUrl + '&quot; as Unicode text)',
+						'tell application &quot;Finder&quot; to set comment of (file aFile) to cmtStr'
+					].join('\n'), 'UTF-16');
+					
+					var process = new Process(new LocalFile('/usr/bin/osascript'));
+					process.run(false, [script.path], 1);
+				}
+			});
+		},
+	},
+	
+});
+
+models.register({
+	name : 'Twitter',
+	ICON : 'http://twitter.com/favicon.ico',
+	
+	check : function(ps){
+		return !ps.file;
+	},
+	
+	getToken : function(){
+		return request('http://twitter.com/account/settings').addCallback(function(res){
+			var html = res.responseText;
+			if(html.indexOf('signin')!=-1)
+				throw new Error('AUTH_FAILD');
+			
+			return {
+				authenticity_token : html.extract(/authenticity_token.+value=&quot;(.+?)&quot;/),
+				siv                : html.extract(/logout\?siv=(.+?)&quot;/),
+			}
+		});
+	},
+	
+	post : function(ps){
+		return Twitter.getToken().addCallback(function(token){
+			// FIXME: 403&#12364;&#30330;&#29983;&#12377;&#12427;&#12371;&#12392;&#12364;&#12354;&#12387;&#12383;&#12383;&#12417; redirectionLimit:0 &#12434;&#22806;&#12377;
+			token.status = joinText([ps.item, ps.itemUrl, ps.body, ps.description], ' ', true);
+			return request('http://twitter.com/status/update', update({
+				sendContent : token,
+			}));
+		});
+	},
+	
+	remove : function(id){
+		return Twitter.getToken().addCallback(function(ps){
+			ps._method = 'delete';
+			return request('http://twitter.com/status/destroy/' + id, {
+				redirectionLimit : 0,
+				referrer : 'http://twitter.com/home',
+				sendContent : ps,
+			});
+		});
+	},
+	
+	addFavorite : function(id){
+		return Twitter.getToken().addCallback(function(ps){
+			return request('http://twitter.com/favourings/create/' + id, {
+				redirectionLimit : 0,
+				referrer : 'http://twitter.com/home',
+				sendContent : ps,
+			});
+		});
+	},
+});
+
+
+models.register({
+	name : 'Jaiku',
+	ICON : 'http://jaiku.com/favicon.ico',
+	
+	URL : 'http://jaiku.com/',
+	
+	check : function(ps){
+		return !ps.file;
+	},
+	
+	getCurrentUser : function(){
+		if(getCookieString('jaiku.com').match(/jaikuuser_.+?=(.+?);/))
+			return RegExp.$1;
+		
+		throw new Error('AUTH_FAILD');
+	},
+	
+	post : function(ps){
+		this.getCurrentUser();
+		
+		return request(Jaiku.URL).addCallback(function(res){
+			var form =  formContents(convertToHTMLDocument(res.responseText));
+			return request(Jaiku.URL, {
+				redirectionLimit : 0,
+				sendContent : {
+					_nonce : form._nonce,
+					message : joinText([ps.item, ps.itemUrl, ps.body, ps.description], ' ', true),
+				},
+			});
+		});
+	},
+});
+
+
+models.register({
+	name : 'Google',
+	ICON : 'http://www.google.com/favicon.ico',
+});
+
+// copied from http://userscripts.org/scripts/show/19741
+models.register({
+	name : 'GoogleWebHistory',
+	ICON : models.Google.ICON,
+	
+	getCh : function(url){
+		function r(x,y){
+			return Math.floor((x/y-Math.floor(x/y))*y+.1);
+		}
+		function m(c){
+			var i,j,s=[13,8,13,12,16,5,3,10,15];
+			for(i=0;i&lt;9;i+=1){
+				j=c[r(i+2,3)];
+				c[r(i,3)]=(c[r(i,3)]-c[r(i+1,3)]-j)^(r(i,3)==1?j&lt;&lt;s[i]:j&gt;&gt;&gt;s[i]);
+			}
+		}
+		
+		return (this.getCh = function(url){
+			url='info:'+url;
+			
+			var c = [0x9E3779B9,0x9E3779B9,0xE6359A60],i,j,k=0,l,f=Math.floor;
+			for(l=url.length ; l&gt;=12 ; l-=12){
+				for(i=0 ; i&lt;16 ; i+=1){
+					j=k+i;c[f(i/4)]+=url.charCodeAt(j)&lt;&lt;(r(j,4)*8);
+				}
+				m(c);
+				k+=12;
+			}
+			c[2]+=url.length;
+			
+			for(i=l;i&gt;0;i--)
+				c[f((i-1)/4)]+=url.charCodeAt(k+i-1)&lt;&lt;(r(i-1,4)+(i&gt;8?1:0))*8;
+			m(c);
+			
+			return'6'+c[2];
+		})(url);
+	},
+	
+	post : function(url){
+		return request('http://www.google.com/search?client=navclient-auto&amp;ch=' + GoogleWebHistory.getCh(url) + '&amp;features=Rank&amp;q=info:' + escape(url));
+	},
+});
+
+models.register({
+	name : 'GoogleBookmarks',
+	ICON : models.Google.ICON,
+	
+	check : function(ps){
+		return ps.type!='regular' &amp;&amp; !ps.file;
+	},
+	
+	post : function(ps){
+		return request('http://www.google.com/bookmarks/mark', {
+			queryString :	{
+				op : 'add',
+			},
+		}).addCallback(function(res){
+			var doc = convertToHTMLDocument(res.responseText);
+			if(doc.getElementById('gaia_loginform'))
+				throw new Error('AUTH_FAILD');
+			
+			var fs = formContents(doc);
+			return request('http://www.google.com'+$x('//form[@name=&quot;add_bkmk_form&quot;]/@action', doc), {
+				redirectionLimit : 0,
+				sendContent  : {
+					title      : ps.item,
+					bkmk       : ps.itemUrl,
+					annotation : joinText([ps.body, ps.description], ' ', true),
+					labels     : ps.tags? ps.tags.join(',') : '',
+					btnA       : fs.btnA,
+					sig        : fs.sig,
+				},
+			});
+		});
+	},
+});
+
+models.register({
+	name : 'Delicious',
+	ICON : 'http://delicious.com/favicon.ico',
+	
+	getUserTags : function(user){
+		// &#21516;&#26399;&#12391;&#12456;&#12521;&#12540;&#12364;&#36215;&#12365;&#12394;&#12356;&#12424;&#12358;&#12395;&#12377;&#12427;
+		return succeed().addCallback(function(){
+			return request('http://feeds.delicious.com/feeds/json/tags/' + (user || Delicious.getCurrentUser()));
+		}).addCallback(function(res){
+			var tags = Components.utils.evalInSandbox(
+				res.responseText, 
+				Components.utils.Sandbox('http://feeds.delicious.com/'));
+			return reduce(function(memo, tag){
+				memo.push({
+					name      : tag[0],
+					frequency : tag[1],
+				});
+				return memo;
+			}, tags, []);
+		});
+	},
+	
+	getCurrentUser : function(){
+		if(decodeURIComponent(getCookieString('delicious.com', '_user')).match(/user=(.*?) /))
+			return RegExp.$1;
+		
+		throw new Error('AUTH_FAILD');
+	},
+	
+	check : function(ps){
+		return ps.type!='regular' &amp;&amp; !ps.file;
+	},
+	
+	post : function(ps){
+		return request('http://delicious.com/post/', {
+			queryString :	{
+				title : ps.item,
+				url   : ps.itemUrl,
+			},
+		}).addCallback(function(res){
+			var doc = convertToHTMLDocument(res.responseText);
+			if(!doc.getElementById('saveitem'))
+				throw new Error('AUTH_FAILD');
+			
+			return request('http://delicious.com'+$x('id(&quot;saveitem&quot;)/@action', doc), {
+				redirectionLimit : 0,
+				sendContent : update(formContents(doc), {
+					description : ps.item,
+					jump        : 'no',
+					notes       : joinText([ps.body, ps.description], ' ', true),
+					tags        : ps.tags? ps.tags.join(' ') : '',
+					share       : ps.private? 'no' : '',
+				}),
+			});
+		});
+	},
+});
+
+
+if(NavBookmarksService){
+	models.register({
+		name : 'FirefoxBookmark',
+		ICON : 'chrome://tombloo/skin/firefox.ico',
+		ANNO_DESCRIPTION : 'bookmarkProperties/description',
+		
+		check : function(ps){
+			return ps.type == 'link';
+		},
+		
+		post : function(ps){
+			return succeed(this.addBookmark(ps.itemUrl, ps.item, ps.tags, ps.description));
+		},
+		
+		addBookmark : function(uri, title, tags, description){
+			uri = createURI(uri);
+			tags = tags || [];
+			
+			if(this.isBookmarked(uri))
+				return;
+			
+			var folders = [NavBookmarksService.unfiledBookmarksFolder].concat(tags.map(bind('createTag', this)));
+			folders.forEach(function(folder){
+				NavBookmarksService.insertBookmark(
+					folder, 
+					uri,
+					NavBookmarksService.DEFAULT_INDEX,
+					title);
+			});
+			
+			this.setDescription(uri, description);
+		},
+		
+		getBookmark : function(uri){
+			uri = createURI(uri);
+			var item = this.getBookmarkId(uri);
+			if(item)
+				return {
+					title       : NavBookmarksService.getItemTitle(item),
+					uri         : uri.asciiSpec,
+					description : this.getDescription(item),
+				};
+		},
+		
+		isBookmarked : function(uri){
+			return NavBookmarksService.isBookmarked(createURI(uri));
+		},
+		
+		removeBookmark : function(uri){
+			uri = createURI(uri);
+			NavBookmarksService.getBookmarkIdsForURI(uri, {}).forEach(function(item){
+				NavBookmarksService.removeItem(item);
+			});
+		},
+		
+		getBookmarkId : function(uri){
+			if(typeof(uri)=='number')
+				return uri;
+			
+			uri = createURI(uri);
+			return NavBookmarksService.getBookmarkIdsForURI(uri, {}).filter(function(item){
+				while(item = NavBookmarksService.getFolderIdForItem(item))
+					if(item == NavBookmarksService.tagsFolder)
+						return false;
+				
+				return true;
+			})[0];
+		},
+		
+		getDescription : function(uri){
+			try{
+				return AnnotationService.getItemAnnotation(this.getBookmarkId(uri), this.ANNO_DESCRIPTION);
+			} catch(e){
+				return '';
+			}
+		},
+		
+		setDescription : function(uri, description){
+			description = description || '';
+			try{
+				AnnotationService.setItemAnnotation(this.getBookmarkId(uri), this.ANNO_DESCRIPTION, description, 
+					0, AnnotationService.EXPIRE_NEVER);
+			} catch(e){}
+		},
+		
+		createTag : function(name){
+			return this.createFolder(NavBookmarksService.tagsFolder, name);
+		},
+		
+		createFolder : function(parent, name){
+			return NavBookmarksService.getChildFolder(parent, name) || 
+				NavBookmarksService.createFolder(parent, name, NavBookmarksService.DEFAULT_INDEX);
+		},
+	});
+}
+
+models.register({
+	name : 'Instapaper',
+	ICON : 'chrome://tombloo/skin/instapaper.ico',
+	
+	check : function(ps){
+		return ps.type == 'link' || ps.type == 'quote';
+	},
+	
+	post : function(ps){
+		return request('http://www.instapaper.com/edit', {
+			redirectionLimit : 0,
+			sendContent : {
+				'bookmark[title]' : ps.item, 
+				'bookmark[url]' : ps.itemUrl,
+				'bookmark[selection]' : joinText([ps.body, ps.description], '\n', true),
+			},
+		}).addCallback(function(res){
+			if(res.channel.URI.asciiSpec.match('login')){
+				throw new Error('AUTH_FAILD');
+			}
+		});
+	},
+});
+
+
+// http://www.kawa.net/works/ajax/romanize/japanese.html
+models.register({
+	name : 'Kawa',
+	
+	getRomaReadings : function(text){
+		return request('http://www.kawa.net/works/ajax/romanize/romanize.cgi', {
+			queryString : {
+				// mecab-utf8
+				// japanese
+				// kana
+				mode : 'japanese',
+				q : text,
+			},
+		}).addCallback(function(res){
+			return map(function(s){	
+				return ''+s.@title || ''+s;
+			}, convertToXML(res.responseText).li.span);
+		});
+	},
+});
+
+
+// http://developer.yahoo.co.jp/jlp/MAService/V1/parse.html
+models.register({
+	name : 'Yahoo',
+	APP_ID : '16y9Ex6xg64GBDD.tmwF.WIdXURG0iTT25NUQ72RLF_Jzt2_MfXDDZfKehYkX6dPZqk-',
+	
+	parse : function(ps){
+		ps.appid = this.APP_ID;
+		return request('http://api.jlp.yahoo.co.jp/MAService/V1/parse', {
+			charset     : 'utf-8',
+			sendContent : ps
+		}).addCallback(function(res){
+			return convertToXML(res.responseText);
+		});
+	},
+	
+	getKanaReadings : function(str){
+		return this.parse({
+			sentence : str,
+			response : 'reading',
+		}).addCallback(function(res){
+			return list(res.ma_result.word_list.word.reading);
+		});
+	},
+	
+	getRomaReadings : function(str){
+		return this.getKanaReadings(str).addCallback(function(rs){
+			return rs.join('\u0000').toRoma().split('\u0000');
+		});
+	},
+});
+
+
+models.register({
+	name : 'YahooBookmarks',
+	ICON : 'http://bookmarks.yahoo.co.jp/favicon.ico',
+	
+	check : function(ps){
+		return ps.type!='regular' &amp;&amp; !ps.file;
+	},
+	
+	post : function(ps){
+		return request('http://bookmarks.yahoo.co.jp/action/post').addCallback(function(res){
+			if(res.responseText.indexOf('login_form')!=-1)
+				throw new Error('AUTH_FAILD');
+			
+			return formContents($x('(id(&quot;addbookmark&quot;)//form)[1]', convertToHTMLDocument(res.responseText)));
+		}).addCallback(function(fs){
+			return request('http://bookmarks.yahoo.co.jp/action/post/done', {
+				redirectionLimit : 0,
+				sendContent  : {
+					title      : ps.item,
+					url        : ps.itemUrl,
+					desc       : joinText([ps.body, ps.description], ' ', true),
+					tags       : ps.tags? ps.tags.join(' ') : '',
+					crumbs     : fs.crumbs,
+					visibility : ps.private==null? fs.visibility : (ps.private? 0 : 1),
+				},
+			});
+		});
+	},
+	
+	getUserTags : function(){
+		return request('http://bookmarks.yahoo.co.jp/bookmarklet/showpopup').addCallback(function(res){
+			if(res.responseText.match(/yourtags =(.*)(;|$)/)[1]){
+				return reduce(function(memo, tag){
+					memo.push({
+						name      : tag,
+						frequency : -1,
+					});
+					return memo;
+				}, Components.utils.evalInSandbox(RegExp.$1, Components.utils.Sandbox('http://bookmarks.yahoo.co.jp/')), []);
+			}
+			
+			throw new Error('AUTH_FAILD');
+		});
+	},
+});
+
+models.register({
+	name : 'Snipshot',
+	ICON : 'http://snipshot.com/favicon.ico',
+	
+	check : function(ps){
+		return ps.type=='photo';
+	},
+	
+	post : function(ps){
+		return request('http://services.snipshot.com/', {
+			sendContent : {
+				snipshot_input : ps.file || ps.itemUrl,
+			},
+		}).addCallback(function(res){
+			return addTab(res.channel.URI.asciiSpec);
+		}).addCallback(function(win){
+			win.SnipshotImport = {
+				title : ps.page,
+				url   : ps.pageUrl,
+			};
+		});
+	},
+});
+
+models.register(update({
+	name : 'Hatena',
+	ICON : 'http://www.hatena.ne.jp/favicon.ico',
+	
+	getPasswords : function(){
+		return getPasswords('https://www.hatena.ne.jp');
+	},
+	
+	login : function(user, password){
+		var self = this;
+		return (this.getAuthCookie()? this.logout() : succeed()).addCallback(function(){
+			return request('https://www.hatena.ne.jp/login', {
+				sendContent : {
+					name : user,
+					password : password,
+					persistent : 1,
+					location : 'http://www.hatena.ne.jp/',
+				},
+			});
+		}).addCallback(function(){
+			self.updateSession();
+			self.user = user;
+		});
+	},
+	
+	logout : function(){
+		return request('http://www.hatena.ne.jp/logout');
+	},
+	
+	getAuthCookie : function(){
+		return getCookieString('.hatena.ne.jp', 'rk');
+	},
+	
+	getToken : function(){
+		switch (this.updateSession()){
+		case 'none':
+			throw new Error('AUTH_FAILD');
+			
+		case 'same':
+			if(this.token)
+				return succeed(this.token);
+			
+		case 'changed':
+			// &#30011;&#38754;&#35201;&#32032;&#12420;DB&#12450;&#12463;&#12475;&#12473;&#12364;&#23569;&#12394;&#12381;&#12358;&#12394;&#12383;&#12417;&#12502;&#12483;&#12463;&#12510;&#12540;&#12463;&#20837;&#21147;&#30011;&#38754;&#12363;&#12425;&#21462;&#24471;&#12377;&#12427;
+			var self = this;
+			return request(HatenaBookmark.POST_URL).addCallback(function(res){
+				if(res.responseText.match(/Hatena\.rkm\s*=\s*['&quot;](.+?)['&quot;]/))
+					return self.token = RegExp.$1;
+			});
+		}
+	},
+	
+	getCurrentUser : function(){
+		switch (this.updateSession()){
+		case 'none':
+			return succeed('');
+			
+		case 'same':
+			if(this.user)
+				return succeed(this.user);
+			
+		case 'changed':
+			var self = this;
+			return request('http://www.hatena.ne.jp/my').addCallback(function(res){
+				return self.user = $x(
+					'(//*[@class=&quot;username&quot;]//strong)[1]/text()', 
+					convertToHTMLDocument(res.responseText));
+			});
+		}
+	},
+	
+	reprTags: function (tags) {
+		return tags ? tags.map(function(t){
+			return '[' + t + ']';
+		}).join('') : '' ;
+	},
+}, AbstractSessionService));
+
+models.register({
+	name : 'HatenaFotolife',
+	ICON : 'http://f.hatena.ne.jp/favicon.ico',
+	
+	check : function(ps){
+		return ps.type=='photo' &amp;&amp; ps.file;
+	},
+	
+	post : function(ps){
+		return this.upload({
+			image1     : ps.file,
+			fototitle1 : ps.page,
+		});
+	},
+	
+	// image1 - image5
+	// fototitle1 - fototitle5 (optional)
+	upload : function(ps){
+		return Hatena.getToken().addCallback(function(token){
+			ps.rkm = token;
+			
+			return Hatena.getCurrentUser();
+		}).addCallback(function(user){
+			return request('http://f.hatena.ne.jp/'+user+'/up', {
+				redirectionLimit : 0,
+				sendContent : update({
+					mode : 'enter',
+				}, ps),
+			});
+		});
+	},
+});
+
+models.register({
+	name : 'HatenaBookmark',
+	ICON : 'http://b.hatena.ne.jp/favicon.ico',
+	
+	POST_URL : 'http://b.hatena.ne.jp/add',
+	
+	check : function(ps){
+		return ps.type!='regular' &amp;&amp; !ps.file;
+	},
+	
+	post : function(ps){
+		// &#12479;&#12452;&#12488;&#12523;&#12399;&#20849;&#26377;&#12373;&#12428;&#12390;&#12356;&#12427;&#12383;&#12417;&#36865;&#20449;&#12375;&#12394;&#12356;
+		return this.addBookmark(ps.itemUrl, null, ps.tags, joinText([ps.body, ps.description], ' ', true));
+	},
+	
+	addBookmark : function(url, title, tags, description){
+		return Hatena.getToken().addCallback(function(token){
+			return request(HatenaBookmark.POST_URL, {
+				redirectionLimit : 0,
+				sendContent : {
+					mode    : 'enter',
+					rkm     : token,
+					url     : url,
+					title   : title, 
+					comment : Hatena.reprTags(tags) + description.replace(/[\n\r]+/g, ' '),
+				},
+			});
+		});
+	},
+	
+	getUserTags : function(){
+		return request(HatenaBookmark.POST_URL+'?mode=confirm').addCallback(function(res){
+			if(!res.responseText.match(/var tags ?=(.*);/))
+				throw new Error('AUTH_FAILD');
+			
+			return reduce(function(memo, tag){
+				memo.push({
+					name      : tag,
+					frequency : -1,
+				});
+				return memo;
+			}, Components.utils.evalInSandbox(RegExp.$1, Components.utils.Sandbox('http://b.hatena.ne.jp/')), []);
+		});
+	},
+});
+
+models.register( {
+	name: 'HatenaDiary',
+	ICON: 'http://d.hatena.ne.jp/favicon.ico',
+	POST_URL : 'http://d.hatena.ne.jp',
+	
+	/*
+	check : function(ps){
+		return ps.type.match(/^(regular|photo|link|quote)$/);
+	},
+	*/
+	converters: {
+		getTitle: function(ps){
+			return Hatena.reprTags(ps.tags) + (ps.page || '')
+		},
+		renderingTemplates: {
+			regular: '&lt;&gt;{ps.description}&lt;/&gt;',
+			photo: '&lt;&gt;&lt;blockquote class=&quot;tombloo_photo&quot; cite={ps.pageUrl} title={ps.page}&gt;&lt;img src={ps.itemUrl} /&gt;&lt;/blockquote&gt;{ps.description}&lt;/&gt;',
+			link: '&lt;&gt;&lt;div class=&quot;tombloo_link&quot;&gt;&lt;a href={ps.pageUrl} title={ps.page}&gt;{ps.page}&lt;/a&gt;&lt;/div&gt;{ps.description}&lt;/&gt;',
+			quote: '&lt;&gt;blockquote class=&quot;tombloo_quote&quot; cite={ps.pageUrl} title={ps.page}&gt;{ps.body}&lt;/blockquote&gt;{ps.description}&lt;/&gt;',
+		},
+		__noSuchMethod__: function(name, args){
+			var ps = args[0];
+			return {
+				title: (name == 'regular') ? '' : this.getTitle(ps),
+				body: eval( this.renderingTemplates[name] ).toString()
+			};
+		},
+	},
+	post : function(params){
+		var content;
+		var self = this;
+		return models.Hatena.getToken().addCallback(function(token){
+			content = self.converters[params.type](params);
+			content.rkm = token;
+			return models.Hatena.getCurrentUser();
+		}).addCallback(function(id){
+			var endpoint = [self.POST_URL, id, ''].join('/');
+			return request( endpoint, {
+				redirectionLimit : 0,
+				referrer    : endpoint,
+				sendContent : content
+			});
+		});
+	}
+});
+
+models.register({
+	name : 'HatenaStar',
+	ICON : 'http://s.hatena.ne.jp/favicon.ico',
+	
+	getToken : function(){
+		return request('http://s.hatena.ne.jp/entries.json').addCallback(function(res){
+			if(!res.responseText.match(/&quot;rks&quot;:&quot;(.*?)&quot;/))
+				throw new Error('AUTH_FAILD');
+			return RegExp.$1;
+		})
+	},
+	
+	check : function(ps){
+		return ps.type!='regular' &amp;&amp; !ps.file;
+	},
+	
+	post : function(ps){
+		return HatenaStar.getToken().addCallback(function(token){
+			return request('http://s.hatena.ne.jp/star.add.json', {
+				redirectionLimit : 0,
+				queryString :	{
+					rks      : token,
+					title    : ps.item,
+					quote    : joinText([ps.body, ps.description], ' ', true),
+					location : ps.pageUrl,
+					uri      : ps.itemUrl,
+				},
+			});
+		});
+	},
+	
+	remove : function(ps){
+		return HatenaStar.getToken().addCallback(function(token){
+			return request('http://s.hatena.ne.jp/star.delete.json', {
+				redirectionLimit : 0,
+				queryString :	{
+					rks   : token,
+					uri   : ps.itemUrl,
+					quote : joinText([ps.body, ps.description], ' ', true),
+				},
+			});
+		});
+	},
+});
+
+models.register(update({
+	name : 'LivedoorClip',
+	ICON : 'http://clip.livedoor.com/favicon.ico',
+	POST_URL : 'http://clip.livedoor.com/clip/add',
+
+	check : function(ps){
+		return ps.type!='regular' &amp;&amp; !ps.file;
+	},
+	
+	post : function(ps){
+		return LivedoorClip.getToken().addCallback(function(token){
+			var content = {
+				rate    : ps.rate? ps.rate : '',
+				title   : ps.item,
+				postKey : token,
+				link    : ps.itemUrl,
+				tags    : ps.tags? ps.tags.join(' ') : '',
+				notes   : joinText([ps.body, ps.description], ' ', true),
+				public  : ps.private? 'off' : 'on',
+			};
+			return request(LivedoorClip.POST_URL, {
+				redirectionLimit : 0,
+				sendContent : content,
+			});
+		});
+	},
+	
+	getAuthCookie : function(){
+		return getCookieString('livedoor.com', '.LRC');
+	},
+	
+	getUserTags : function(){
+		if(!this.getAuthCookie())
+			return fail(new Error('AUTH_FAILD'));
+		
+		return request(LivedoorClip.POST_URL+'?link=http%3A%2F%2Ftombloo/').addCallback(function(res){
+			var doc = convertToHTMLDocument(res.responseText);
+			return $x('id(&quot;tag_list&quot;)/span/text()', doc, true).map(function(tag){
+				return {
+					name      : tag,
+					frequency : -1,
+				};
+			});
+		});
+	},
+	
+	getToken : function(){
+		switch (this.updateSession()){
+		case 'none':
+			throw new Error('AUTH_FAILD');
+		
+		case 'same':
+			if(this.token)
+				return succeed(this.token);
+		
+		case 'changed':
+			var self = this;
+				return request(LivedoorClip.POST_URL+'?link=http%3A%2F%2Ftombloo/').addCallback(function(res){
+					if(res.responseText.match(/&quot;postkey&quot; value=&quot;(.*)&quot;/)){
+						self.token = RegExp.$1;
+						return self.token;
+					}
+					throw new Error('AUTH_FAILD');
+				});
+		}
+	},
+}, AbstractSessionService));
+
+models.register({
+	name : 'Wassr',
+	ICON : 'http://wassr.jp/favicon.ico',
+	
+	check : function(ps){
+		return !ps.file;
+	},
+	
+	post : function(ps){
+		return request('http://wassr.jp/my/').addCallback(function(res){
+			return request('http://wassr.jp/my/status/add', {
+				redirectionLimit : 0,
+				sendContent : update(formContents(convertToHTMLDocument(res.responseText)), {
+					message : joinText([ps.item, ps.itemUrl, ps.body, ps.description], ' ', true),
+				}),
+			});
+		})
+	},
+});
+
+models.copyTo(this);</diff>
      <filename>xpi/chrome/content/library/20_model.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,62 +1,62 @@
-Tombloo.Service.actions = new Repository([
-	{
-		name : getMessage('label.action.changeAcount'),
-		execute : function(){
-			openDialog('chrome://tombloo/content/library/login.xul', 300, 250, 'resizable');
-		},
-	},
-	{
-		name : getMessage('label.action.downloadPosts'),
-		execute : function(){
-			var users = getPref('updateUsers') || '';
-			users = prompt('Update target users:', users);
-			if(!users)
-				return;
-			
-			// FIXME: &#12450;&#12463;&#12471;&#12519;&#12531;&#29992;&#12398;pref&#12395;
-			setPref('updateUsers', users);
-			users = users.split(/[\s,]+/);
-			
-			// &#12503;&#12525;&#12464;&#12524;&#12473;&#20840;&#20307;&#12398;&#12479;&#12473;&#12463;&#37327;&#12434;&#27770;&#23450;&#12377;&#12427;&#12383;&#12417;&#12289;&#20107;&#21069;&#12395;&#12467;&#12540;&#12523;&#12496;&#12483;&#12463;&#12481;&#12455;&#12540;&#12531;&#12434;&#27083;&#25104;&#12377;&#12427;
-			var p = new Progress('Update');
-			var d = new Deferred();
-			forEach(users, function(user){
-				forEach('regular photo video link conversation quote'.split(' '), function(type){
-					d.addCallback(
-						Tombloo.Service.update, 
-						user, 
-						type,
-						p.addChild(new Progress('Updating ' + user + &quot;'s &quot; + type + ' posts.'), 20));
-				});
-				d.addCallback(
-					Tombloo.Service.Photo.download, 
-					user, 
-					75,
-					p.addChild(new Progress('Downloading ' + user + &quot;'s photos. (75 pixels)&quot;)));
-				d.addCallback(
-					Tombloo.Service.Photo.download, 
-					user, 
-					500,
-					p.addChild(new Progress('Downloading ' + user + &quot;'s photos. (500 pixels)&quot;)));
-			});
-			d.addBoth(p.complete);
-			openProgressDialog(p);
-			d.callback();
-		},
-	},
-	{
-		name : 'Mosaic',
-		execute : function(){
-			addTab('chrome://tombloo/content/library/Mosaic.html');
-		},
-	},
-	{
-		name : '----',
-	},
-	{
-		name : getMessage('label.action.tomblooOptions'),
-		execute : function(){
-			openDialog('chrome://tombloo/content/prefs.xul', 600, 500, 'resizable');
-		},
-	},
-]);
+Tombloo.Service.actions = new Repository([
+	{
+		name : getMessage('label.action.changeAcount'),
+		execute : function(){
+			openDialog('chrome://tombloo/content/library/login.xul', 300, 250, 'resizable');
+		},
+	},
+	{
+		name : getMessage('label.action.downloadPosts'),
+		execute : function(){
+			var users = getPref('updateUsers') || '';
+			users = prompt('Update target users:', users);
+			if(!users)
+				return;
+			
+			// FIXME: &#12450;&#12463;&#12471;&#12519;&#12531;&#29992;&#12398;pref&#12395;
+			setPref('updateUsers', users);
+			users = users.split(/[\s,]+/);
+			
+			// &#12503;&#12525;&#12464;&#12524;&#12473;&#20840;&#20307;&#12398;&#12479;&#12473;&#12463;&#37327;&#12434;&#27770;&#23450;&#12377;&#12427;&#12383;&#12417;&#12289;&#20107;&#21069;&#12395;&#12467;&#12540;&#12523;&#12496;&#12483;&#12463;&#12481;&#12455;&#12540;&#12531;&#12434;&#27083;&#25104;&#12377;&#12427;
+			var p = new Progress('Update');
+			var d = new Deferred();
+			forEach(users, function(user){
+				forEach('regular photo video link conversation quote'.split(' '), function(type){
+					d.addCallback(
+						Tombloo.Service.update, 
+						user, 
+						type,
+						p.addChild(new Progress('Updating ' + user + &quot;'s &quot; + type + ' posts.'), 20));
+				});
+				d.addCallback(
+					Tombloo.Service.Photo.download, 
+					user, 
+					75,
+					p.addChild(new Progress('Downloading ' + user + &quot;'s photos. (75 pixels)&quot;)));
+				d.addCallback(
+					Tombloo.Service.Photo.download, 
+					user, 
+					500,
+					p.addChild(new Progress('Downloading ' + user + &quot;'s photos. (500 pixels)&quot;)));
+			});
+			d.addBoth(p.complete);
+			openProgressDialog(p);
+			d.callback();
+		},
+	},
+	{
+		name : 'Mosaic',
+		execute : function(){
+			addTab('chrome://tombloo/content/library/Mosaic.html');
+		},
+	},
+	{
+		name : '----',
+	},
+	{
+		name : getMessage('label.action.tomblooOptions'),
+		execute : function(){
+			openDialog('chrome://tombloo/content/prefs.xul', 600, 500, 'resizable');
+		},
+	},
+]);</diff>
      <filename>xpi/chrome/content/library/31_Tombloo.Service.actions.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,946 +1,946 @@
-Tombloo.Service.extractors = new Repository([
-	{
-		name : 'LDR',
-		getItem : function(ctx, getOnly){
-			if(ctx.host != 'reader.livedoor.com' &amp;&amp; ctx.host != 'fastladder.com')
-				return;
-			
-			var item  = $x('ancestor::div[starts-with(@id, &quot;item_count&quot;)]', ctx.target);
-			if(!item)
-				return;
-			
-			var res = {
-				author : ($x('div[@class=&quot;item_info&quot;]/*[@class=&quot;author&quot;]/text()', item) || '').extract(/by (.*)/),
-				title  : $x('div[@class=&quot;item_header&quot;]//a/text()', item) || '',
-				feed   : $x('id(&quot;right_body&quot;)/div[@class=&quot;channel&quot;]//a/text()'),
-				href   : $x('(div[@class=&quot;item_info&quot;]/a)[1]/@href', item).replace(/[?&amp;;](fr?(om)?|track|ref|FM)=(r(ss(all)?|df)|atom)([&amp;;].*)?/,''),
-			};
-			
-			if(!getOnly){
-				ctx.title = res.feed + (res.title? ' - ' + res.title : '');
-				ctx.href  = res.href;
-				ctx.host  = res.href.match('http://(.*?)/')[1];
-			}
-			
-			return res
-		},
-	},
-	
-	{
-		name : 'Quote - LDR',
-		ICON : 'http://reader.livedoor.com/favicon.ico',
-		check : function(ctx){
-			return Tombloo.Service.extractors.LDR.getItem(ctx, true) &amp;&amp; 
-				ctx.selection;
-		},
-		extract : function(ctx){
-			with(Tombloo.Service.extractors){
-				LDR.getItem(ctx);
-				return Quote.extract(ctx);
-			}
-		},
-	},
-	
-	{
-		name : 'ReBlog - LDR',
-		ICON : 'http://reader.livedoor.com/favicon.ico',
-		check : function(ctx){
-			var item = Tombloo.Service.extractors.LDR.getItem(ctx, true);
-			return item &amp;&amp; (
-				item.href.match('^http://.*?\\.tumblr\\.com/') || 
-				(ctx.onImage &amp;&amp; ctx.target.src.match('^http://data\.tumblr\.com/')));
-		},
-		extract : function(ctx){
-			with(Tombloo.Service.extractors){
-				LDR.getItem(ctx);
-				return ReBlog.extract(ctx);
-			}
-		},
-	},
-		
-	{
-		name : 'Photo - LDR(FFFFOUND!)',
-		ICON : 'http://reader.livedoor.com/favicon.ico',
-		check : function(ctx){
-			var item = Tombloo.Service.extractors.LDR.getItem(ctx, true);
-			return item &amp;&amp; 
-				ctx.onImage &amp;&amp; 
-				item.href.match('^http://ffffound\\.com/');
-		},
-		extract : function(ctx){
-			var item = Tombloo.Service.extractors.LDR.getItem(ctx);
-			ctx.title = item.title;
-			
-			return {
-				type      : 'photo',	
-				item      : item.title,
-				itemUrl   : ctx.target.src.replace(/_m(\..{3})/, '$1'),
-				author    : item.author,
-				authorUrl : 'http://ffffound.com/home/' + item.author + '/found/',
-			};
-		},
-	},
-		
-	{
-		name : 'Photo - LDR',
-		ICON : 'http://reader.livedoor.com/favicon.ico',
-		check : function(ctx){
-			return Tombloo.Service.extractors.LDR.getItem(ctx, true) &amp;&amp; 
-				ctx.onImage;
-		},
-		extract : function(ctx){
-			var exts = Tombloo.Service.extractors;
-			exts.LDR.getItem(ctx);
-			return exts.check(ctx)[0].extract(ctx);
-		},
-	},
-	
-	{
-		name : 'Link - LDR',
-		ICON : 'http://reader.livedoor.com/favicon.ico',
-		check : function(ctx){
-			return Tombloo.Service.extractors.LDR.getItem(ctx, true);
-		},
-		extract : function(ctx){
-			with(Tombloo.Service.extractors){
-				LDR.getItem(ctx);
-				return Link.extract(ctx);
-			}
-		},
-	},
-	
-	{
-		name : 'Quote - Twitter',
-		ICON : models.Twitter.ICON,
-		check : function(ctx){
-			return ctx.href.match('//twitter.com/.*?/statuses/\\d+');
-		},
-		extract : function(ctx){
-			var body = ctx.selection;
-			if(!body){
-				var desc = $x('(//div[@class=&quot;desc&quot;]/p)[1]');
-				$x('.//a', desc, true).forEach(function(l){l.href = l.href;});
-				body = desc.innerHTML.replace(/ (rel|target)=&quot;.+?&quot;/g, '');
-			}
-			
-			return {
-				type    : 'quote',
-				item    : ctx.title.substring(0, ctx.title.indexOf(': ')),
-				itemUrl : ctx.href,
-				body    : body.trim(),
-			}
-		},
-	},
-	
-	{
-		name : 'Quote - inyo.jp',
-		ICON : 'chrome://tombloo/skin/quote.png',
-		check : function(ctx){
-			return ctx.href.match('//inyo.jp/quote/[a-f0-9]+');
-		},
-		extract : function(ctx){
-			return {
-				type    : 'quote',
-				item    : $x('//span[@class=&quot;title&quot;]/text()'),
-				itemUrl : ctx.href,
-				body    : escapeHTML((ctx.selection || $x('//blockquote[contains(@class, &quot;text&quot;)]/p').textContent).trim()),
-			}
-		},
-	},
-	
-	{
-		name : 'Amazon',
-		getAsin : function(ctx){
-			return $x('id(&quot;ASIN&quot;)/@value');
-		},
-		extract : function(ctx){
-			var asin = this.getAsin(ctx);
-			return  Amazon.getItem(asin).addCallback(function(item){
-				ctx.href  = Amazon.normalizeUrl(asin);
-				ctx.title = item.title + (item.creators.length? ' / ' + item.creators.join(', ') : '');
-				return item;
-			});
-		},
-	},
-	
-	{
-		name : 'Photo - Amazon',
-		ICON : models.Amazon.ICON,
-		check : function(ctx){
-			return ctx.host.match(/amazon\./) &amp;&amp; 
-				Tombloo.Service.extractors.Amazon.getAsin(ctx) &amp;&amp; 
-				ctx.target.id == 'prodImage';
-		},
-		extract : function(ctx){
-			return Tombloo.Service.extractors.Amazon.extract(ctx).addCallback(function(item){
-				var img = item.largestImage;
-				if(!img){
-					alert('Image not found.');
-					return;
-				}
-				
-				with(ctx.target){
-					src = img.url;
-					height = '';
-					width = '';
-					style.height = 'auto';
-					style.width = 'auto';
-				}
-				
-				return {
-					type    : 'photo',
-					item    : ctx.title,
-					itemUrl : img.url,
-				};
-			});
-		},
-	},
-	
-	{
-		name : 'Quote - Amazon',
-		ICON : models.Amazon.ICON,
-		check : function(ctx){
-			return ctx.host.match(/amazon\./) &amp;&amp; 
-				Tombloo.Service.extractors.Amazon.getAsin(ctx) &amp;&amp; 
-				ctx.selection;
-		},
-		extract : function(ctx){
-			var exts = Tombloo.Service.extractors;
-			return exts.Amazon.extract(ctx).addCallback(function(item){
-				return exts.Quote.extract(ctx);
-			});
-		},
-	},
-	
-	{
-		name : 'Link - Amazon',
-		ICON : models.Amazon.ICON,
-		check : function(ctx){
-			return ctx.host.match(/amazon\./) &amp;&amp; 
-				Tombloo.Service.extractors.Amazon.getAsin(ctx);
-		},
-		extract : function(ctx){
-			var exts = Tombloo.Service.extractors;
-			return exts.Amazon.extract(ctx).addCallback(function(item){
-				return exts.Link.extract(ctx);
-			});
-		},
-	},
-	
-	{
-		name : 'ReBlog - Tumblr',
-		ICON : 'chrome://tombloo/skin/reblog.ico',
-		check : function(ctx){
-			return Tumblr.getReblogToken(currentDocument());
-		},
-		extract : function(ctx){
-			return {
-				type    : 'reblog',
-				item    : ctx.title,
-				itemUrl : ctx.href,
-				token   : Tumblr.getReblogToken(currentDocument()),
-			}
-		},
-	},
-	
-	{
-		name : 'ReBlog',
-		ICON : 'chrome://tombloo/skin/reblog.ico',
-		check : function(ctx){},
-		extract : function(ctx){
-			return request(ctx.href).addCallback(function(res){
-				var doc = convertToHTMLDocument(res.responseText);
-				ctx.title = $x('//title/text()', doc) || '';
-				
-				return {
-					type    : 'reblog',
-					item    : ctx.title,
-					itemUrl : ctx.href,
-					token   : Tumblr.getReblogToken(doc),
-				}
-			});
-		},
-	},
-	
-	{
-		name : 'ReBlog - Dashboard',
-		ICON : 'chrome://tombloo/skin/reblog.ico',
-		check : function(ctx){
-			return ctx.href.match(Tumblr.TUMBLR_URL) &amp;&amp; this.getLink(ctx);
-		},
-		extract : function(ctx){
-			ctx.href = this.getLink(ctx);
-			return Tombloo.Service.extractors.ReBlog.extract(ctx);
-		},
-		getLink : function(ctx){
-			var target = ctx.target;
-			var parent = tagName(target)=='li' ? target : $x('ancestor::li', target);
-			if(!parent)
-				return;
-			
-			return $x('.//a[@title=&quot;Permalink&quot;]/@href', parent);
-		},
-	},
-	
-	{
-		name : 'ReBlog - Mosaic',
-		ICON : 'chrome://tombloo/skin/reblog.ico',
-		check : function(ctx){
-			return ctx.href.match(/mosaic.html/i) &amp;&amp; ctx.target.photo;
-		},
-		extract : function(ctx){
-			ctx.href = ctx.target.photo.url;
-			return Tombloo.Service.extractors.ReBlog.extract(ctx);
-		},
-	},
-	
-	{
-		name : 'ReBlog - Tumblr link',
-		ICON : 'chrome://tombloo/skin/reblog.ico',
-		check : function(ctx){
-			return ctx.link &amp;&amp; ctx.link.href.match(/^http:\/\/[^.]+.tumblr\.com\/post\/\d+/);
-		},
-		extract : function(ctx){
-			ctx.href = ctx.link.href;
-			return Tombloo.Service.extractors.ReBlog.extract(ctx);
-		},
-	},
-	
-	{
-		name : 'Photo - Flickr',
-		ICON : models.Flickr.ICON,
-		
-		RE : new RegExp('^http://(?:.+?.)?static.flickr.com/\\d+?/(\\d+?)_.*'),
-		getImageId : function(img){
-			if(img.src.match('spaceball.gif'))
-				img = img.previousSibling;
-			
-			if(!img || !img.src.match(this.RE))
-				return;
-			
-			return RegExp.$1;
-		},
-		check : function(ctx){
-			return ctx.onImage &amp;&amp; this.getImageId(ctx.target);
-		},
-		extract : function(ctx){
-			var id = this.getImageId(ctx.target);
-			return new DeferredHash({
-				'info'  : Flickr.getInfo(id),
-				'sizes' : Flickr.getSizes(id),
-			}).addCallback(function(r){
-				if(!r.info[0])
-					throw new Error(r.info[1].message);
-				
-				var info = r.info[1];
-				var sizes = r.sizes[1];
-				
-				var title = info.title._content;
-				ctx.title = title + ' on Flickr'
-				ctx.href  = info.urls.url[0]._content;
-				
-				return {
-					type      : 'photo',
-					item      : title,
-					itemUrl   : sizes.pop().source,
-					author    : info.owner.username,
-					authorUrl : ctx.href.extract('^(http://.*?flickr.com/photos/.+?/)'),
-				}
-			});
-		},
-	},
-	
-	{
-		name : 'Photo - 4u',
-		ICON : models['4u'].ICON,
-		check : function(ctx){
-			return ctx.onImage &amp;&amp; ctx.href.match('^http://4u.straightline.jp/image/') &amp;&amp; ctx.target.src.match('/static/upload/l/l_');
-		},
-		extract : function(ctx){
-			var author = $x('(//div[@class=&quot;entry-information&quot;]//a)[1]');
-			var iLoveHer = $x('//div[@class=&quot;entry-item fitem&quot;]//a/@href');
-			return {
-				type      : 'photo',	
-				item      : ctx.title.extract(/(.*) - 4U/i),
-				itemUrl   : ctx.target.src,
-				author    : author.textContent.trim(),
-				authorUrl : author.href,
-				id        : iLoveHer &amp;&amp; decodeURIComponent(iLoveHer.extract('src=([^&amp;]*)')),
-			};
-		},
-	},
-	
-	{
-		name : 'Photo - Snipshot',
-		ICON : models.Snipshot.ICON,
-		check : function(ctx){
-			return ctx.href.match('http://services.snipshot.com/edit/');
-		},
-		extract : function(ctx){
-			var id = ctx.window.m ? ctx.window.m.id : ctx.window.snipshot.FILE;
-			var info = ctx.window.SnipshotImport;
-			
-			if(info){
-				ctx.href  = info.url;
-				ctx.title = info.title;
-			} else {
-				ctx.href  = '';
-				ctx.title = '';
-			}
-			
-			return {
-				type    : 'photo',
-				item    : ctx.title,
-				itemUrl : 'http://services.snipshot.com/save/'+id+'/snipshot_'+id+'.jpg', 
-			}
-		},
-	},
-	
-	{
-		name : 'Photo - Fishki.Net',
-		ICON : 'http://de.fishki.net/favicon.ico',
-		check : function(ctx){
-			return ctx.onImage &amp;&amp; 
-				ctx.target.src.match('//fishki.net/');
-		},
-		extract : function(ctx){
-			return {
-				type    : 'photo',
-				item    : ctx.title,
-				itemUrl : ctx.target.src.replace('//fishki.net/', '//de.fishki.net/'),
-			}
-		},
-	},
-	
-	{
-		name : 'Photo - Google',
-		ICON : models.Google.ICON,
-		check : function(ctx){
-			return (ctx.onLink &amp;&amp; ctx.link.href.match('http://lh..(google.ca|ggpht.com)/.*(png|gif|jpe?g)$'));
-		},
-		extract : function(ctx){
-			return request(ctx.link.href).addCallback(function(res){
-				return {
-					type    : 'photo',
-					item    : ctx.title,
-					itemUrl : $x('//img[1]', convertToHTMLDocument(res.responseText)).src,
-				}
-			});
-		},
-	},
-	
-	{
-		name : 'Photo - Picasa',
-		ICON : 'http://picasaweb.google.com/favicon.ico',
-		check : function(ctx){
-			return ctx.host == 'picasaweb.google.com' &amp;&amp; ctx.onImage;
-		},
-		extract : function(ctx){
-			return {
-				type      : 'photo',
-				item      : $x('//div[@class=&quot;lhcl_albumtitle&quot;]/text()').trim(),
-				itemUrl   : ctx.target.src.replace(/\?.*/, ''), 
-				author    : $x('id(&quot;lhid_user_nickname&quot;)/text()').trim(),
-				authorUrl : $x('id(&quot;lhid_portraitlink&quot;)/@href'),
-			}
-		},
-	},
-	
-	{
-		name : 'Photo - webshots',
-		ICON : 'http://www.webshots.com/favicon.ico',
-		check : function(ctx){
-			return ctx.host.match('^.+\.webshots\.com') &amp;&amp; this.getAuthor();
-		},
-		extract : function(ctx){
-			var author = this.getAuthor();
-			return {
-				type      : 'photo',
-				item      : $x('//div[@class=&quot;media-info&quot;]/h1/text()'),
-				itemUrl   : $x('//li[@class=&quot;fullsize first&quot;]/a/@href'), 
-				author    : author.textContent.trim(),
-				authorUrl : author.href,
-			}
-		},
-		getAuthor : function(){
-			return $x('(//img[@class=&quot;user-photo&quot;])[1]/ancestor::a');
-		},
-	},
-	
-	{
-		name : 'Photo - Blogger',
-		ICON : 'https://www.blogger.com/favicon.ico',
-		check : function(ctx){
-			return ctx.onLink &amp;&amp; 
-				(''+ctx.link).match(/(png|gif|jpe?g)$/i) &amp;&amp;
-				(''+ctx.link).match(/blogger.com\/.*\/s\d{2,}-h\//);
-		},
-		extract : function(ctx){
-			return {
-				type    : 'photo',
-				item    : ctx.title,
-				itemUrl : (''+ctx.link).replace(/\/(s\d{2,})-h\//, '/$1/'), 
-			}
-		},
-	},
-	
-	{
-		name : 'Photo - Shorpy',
-		ICON : 'http://www.shorpy.com/favicon.ico',
-		check : function(ctx){
-			return ctx.onImage &amp;&amp; 
-				ctx.target.src.match(/www.shorpy.com\/.*.preview\.jpg/i);
-		},
-		extract : function(ctx){
-			return {
-				type    : 'photo',
-				item    : ctx.title,
-				itemUrl : ctx.target.src.replace('\.preview\.jpg', '.jpg'), 
-			}
-		},
-	},
-	
-	{
-		name : 'Photo - FFFFOUND!',
-		ICON : models.FFFFOUND.ICON,
-		check : function(ctx){
-			return (ctx.href.match('http://ffffound.com/image/') &amp;&amp; (/^asset/).test(ctx.target.id)) ||
-				(ctx.onLink &amp;&amp; ctx.link.href.match('http://ffffound.com/image/'));
-		},
-		extract : function(ctx){
-			if(ctx.href.match('http://ffffound.com/image/') &amp;&amp; (/^asset/).test(ctx.target.id)){
-				var d = succeed(currentDocument());
-			} else {
-				var d = request(ctx.link.href).addCallback(function(res){
-					// &#30456;&#23550;&#12497;&#12473;&#12434;&#20966;&#29702;&#12377;&#12427;&#12383;&#12417;document&#12434;&#28193;&#12377;
-					var doc =  convertToHTMLDocument(res.responseText, ctx.document);
-					
-					ctx.href = ctx.link.href;
-					ctx.target = $x('(//img[starts-with(@id, &quot;asset&quot;)])', doc);
-					
-					return doc;
-				})
-			}
-			
-			d.addCallback(function(doc){
-				var author = $x('//div[@class=&quot;saved_by&quot;]/a[1]', doc);
-				ctx.title = $x('//title/text()', doc) || '';
-				
-				return {
-					type      : 'photo',
-					item      : $x('//div[@class=&quot;title&quot;]/a/text()', doc).trim(),
-					itemUrl   : ctx.target.src.replace(/_m(\..{3})$/, '$1'),
-					author    : author.textContent,
-					authorUrl : author.href,
-				}
-			});
-			
-			return d;
-		},
-	},
-	
-	{
-		name : 'Photo - Google Image Search',
-		ICON : models.Google.ICON,
-		check : function(ctx){
-			return ctx.host == 'images.google.co.jp' &amp;&amp; 
-				ctx.onImage &amp;&amp; ctx.onLink;
-		},
-		extract : function(ctx){
-			var link  = $x('parent::a/@href', ctx.target);
-			var itemUrl = decodeURIComponent(link.match(/imgurl=([^&amp;]+)/)[1]);
-			ctx.href = decodeURIComponent(link.match(/imgrefurl=([^&amp;]+)/)[1]);
-			
-			return request(ctx.href).addCallback(function(res){
-				ctx.title = 
-					res.responseText.extract(/&lt;title.*?&gt;([\s\S]*?)&lt;\/title&gt;/im).replace(/[\n\r]/g, '').trim() || 
-					broad(createURI(itemUrl)).fileName;
-				
-				return {
-					type    : 'photo',
-					item    : ctx.title,
-					itemUrl : itemUrl,
-				}
-			});
-		},
-	},
-	
-	{
-		name : 'Photo - Share-image.com',
-		ICON : 'http://www.share-image.com/favicon.ico',
-		
-		check : function(ctx){
-			return ctx.href.match(/share-image\.com\/gallery\//) &amp;&amp; this.getImage();
-		},
-		extract : function(ctx){
-			return request(this.getImage()).addCallback(function(res){
-				return {
-					type    : 'photo',
-					item    : ctx.title,
-					itemUrl : res.channel.URI.spec, 
-				}
-			});
-		},
-		getImage : function(){
-			return $x('//img[starts-with(@src, &quot;http://www.share-image.com/pictures/big/&quot;)]/@src');
-		},
-	},
-	
-	{
-		name : 'Photo - Frostdesign.net',
-		ICON : 'http://mfrost.typepad.com/favicon.ico',
-		
-		check : function(ctx){
-			return ctx.host == 'mfrost.typepad.com' &amp;&amp; (ctx.onLink &amp;&amp; ctx.link.href.match('http://mfrost.typepad.com/.shared/image.html'));
-		},
-		extract : function(ctx){
-			return {
-				type    : 'photo',
-				item    : ctx.title,
-				itemUrl : 'http://mfrost.typepad.com' + ctx.link.href.split('?').pop(), 
-			}
-		},
-	},
-	
-	// [FIXME] firefox 3
-	/*
-	{
-		name : 'Photo - area element',
-		check : function(ctx){
-			if(tagName(ctx.target)=='area')
-				return getElementByPosition(ctx.mouse.x, ctx.mouse.y).src;
-		},
-		extract : function(ctx){
-			return {
-				type    : 'photo',
-				item    : ctx.title,
-				itemUrl : getElementByPosition(ctx.mouse.x, ctx.mouse.y).src, 
-			}
-		},
-	},
-	*/
-	
-	{
-		name : 'Photo - image link',
-		ICON : 'chrome://tombloo/skin/photo.png',
-		check : function(ctx){
-			return (ctx.onLink &amp;&amp; ctx.link.href.match(/^[^?]*/)[0].match(/(png|gif|jpe?g)$/i));
-		},
-		extract : function(ctx){
-			return {
-				type    : 'photo',
-				item    : ctx.title,
-				itemUrl : ctx.link.href, 
-			}
-		},
-	},
-	
-	{
-		name : 'Photo',
-		ICON : 'chrome://tombloo/skin/photo.png',
-		check : function(ctx){
-			return ctx.onImage;
-		},
-		extract : function(ctx){
-			var target = ctx.target;
-			var source = tagName(target)=='object'? target.data : target.src;
-			if([
-				'files.posterous.com',
-				'image.itmedia.co.jp',
-				'wretch.yimg.com/',
-				'pics.*\.blog.yam.com/',
-				'www.imgscan.com/image_c.php',
-				'keep4u.ru/imgs/',
-			].some(function(re){
-				return source.match(re);
-			})){
-				return Tombloo.Service.extractors['Photo - Upload from Cache'].extract(ctx);
-			};
-			
-			if(ctx.document.contentType.match(/^image/))
-				ctx.title = ctx.href.split('/').pop();
-			
-			return {
-				type    : 'photo',
-				item    : ctx.title,
-				itemUrl : source,
-			}
-		},
-	},
-	
-	{
-		name : 'Photo - Upload from Cache',
-		ICON : 'chrome://tombloo/skin/photo.png',
-		check : function(ctx){
-			return ctx.onImage;
-		},
-		extract : function(ctx){
-			if(ctx.document.contentType.match(/^image/))
-				ctx.title = ctx.href.split('/').pop();
-			
-			var target = ctx.target;
-			var itemUrl = tagName(target)=='object'? target.data : target.src;
-			
-			var uri = broad(createURI(itemUrl));
-			var file = getTempDir();
-			file.append(validateFileName(uri.fileName));
-			
-			return download(itemUrl, file).addCallback(function(file){
-				return {
-					type    : 'photo',
-					item    : ctx.title,
-					itemUrl : itemUrl,
-					file    : file,
-				}
-			});
-		},
-	},
-	
-	{
-		name : 'Video - Vimeo',
-		ICON : 'http://vimeo.com/favicon.ico',
-		check : function(ctx){
-			return ctx.host.match('vimeo.com');
-		},
-		extract : function(ctx){
-			var author = $x('//div[@class=&quot;byline&quot;]/a');
-			return {
-				type      : 'video',
-				item      : $x('//div[@class=&quot;title&quot;]/text()').trim(),
-				itemUrl   : ctx.href,
-				author    : author.textContent,
-				authorUrl : author.href,
-			};
-		},
-	},
-	
-	{
-		name : 'Video - YouTube',
-		ICON : 'http://youtube.com/favicon.ico',
-		check : function(ctx){
-			return ctx.host.match('youtube.com');
-		},
-		extract : function(ctx){
-			var author = $x('id(&quot;watch-channel-stats&quot;)/a');
-			return {
-				type      : 'video',
-				item      : ctx.title.extract(/ - (.*)/),
-				itemUrl   : ctx.href,
-				author    : author.textContent,
-				authorUrl : author.href,
-			};
-		},
-	},
-	
-	{
-		name : 'Video - Google Video',
-		ICON : models.Google.ICON,
-		check : function(ctx){
-			return ctx.host.match('video.google.com');
-		},
-		extract : function(ctx){
-			return {
-				type    : 'video',
-				item    : ctx.title,
-				itemUrl : ctx.href,
-				body    : $x('id(&quot;embed-video&quot;)/textarea/text()'),
-			}
-		},
-	},
-	
-	{
-		name : 'Video - MySpaceTV',
-		ICON : 'http://vids.myspace.com/favicon.ico',
-		check : function(ctx){
-			return ctx.host.match(/vids\.myspace\.com/) &amp;&amp; this.getTag();
-		},
-		extract : function(ctx){
-			var tag = $x('id(&quot;links_video_code&quot;)/@value');
-			ctx.href = tag.extract(/href=&quot;(.+?)&quot;/);
-			
-			return {
-				type    : 'video',
-				item    : tag.extract(/&gt;(.+?)&lt;\/a&gt;/),
-				itemUrl : ctx.href,
-				body    : tag.extract(/(&lt;object.+object&gt;)/),
-			};
-		},
-		getTag : function(){
-			return $x('id(&quot;links_video_code&quot;)/@value');
-		},
-	},
-	
-	{
-		name : 'Video - Dailymotion',
-		ICON : 'http://www.dailymotion.com/favicon.ico',
-		check : function(ctx){
-			return ctx.host.match('dailymotion.com') &amp;&amp; this.getTag();
-		},
-		extract : function(ctx){
-			var tag = this.getTag();
-			var author = tag.extract(/Uploaded by (&lt;a.+?a&gt;)/);
-			ctx.href = tag.extract(/href=&quot;(.+?)&quot;/);
-			
-			return {
-				type      : 'video',
-				item      : ctx.title.extract(/Dailymotion - (.*?), a video from/),
-				itemUrl   : ctx.href,
-				author    : author.extract(/&gt;([^&gt;&lt;]+?)&lt;/),
-				authorUrl : author.extract(/href=&quot;(.+?)&quot;/),
-				body      : tag.extract(/(&lt;object.+object&gt;)/),
-			};
-		},
-		getTag : function(){
-			return $x('id(&quot;video_player_embed_code_text&quot;)/text()');
-		},
-	},
-	
-	{
-		name : 'Video - Rimo',
-		ICON : 'http://rimo.tv/favicon.ico',
-		check : function(ctx){
-			return ctx.host == 'rimo.tv' &amp;&amp; this.getTag();
-		},
-		extract : function(ctx){
-			return {
-				type    : 'video',
-				item    : $x('id(&quot;play_list_title&quot;)/@value') || ctx.title.extract(/ - (.*)/),
-				itemUrl : ctx.href,
-				body    : this.getTag(),
-			};
-		},
-		getTag : function(){
-			return $x('id(&quot;player-tag-M&quot;)/@value') || $x('(//table[@class=&quot;player-embed-tags&quot;]//input)[last()]/@value');
-		},
-	},
-	
-	{
-		name : 'Video - Nico Nico Douga',
-		ICON : 'http://www.nicovideo.jp/favicon.ico',
-		check : function(ctx){
-			return ctx.href.match('^http://www\.nicovideo\.jp/watch/');
-		},
-		extract : function(ctx){
-			return {
-				type    : 'video',
-				item    : ctx.title,
-				itemUrl : ctx.href,
-				body    : $x('//form[@name=&quot;form_iframe&quot;]/input/@value'),
-			};
-		}
-	},
-	
-	{
-		name : 'Quote',
-		ICON : 'chrome://tombloo/skin/quote.png',
-		check : function(ctx){
-			return ctx.selection;
-		},
-		extract : function(ctx){
-			return {
-				type    : 'quote',
-				item    : ctx.title,
-				itemUrl : ctx.href,
-				body    : escapeHTML(ctx.selection.trim()),
-			}
-		},
-	},
-	
-	{
-		name : 'Link',
-		ICON : 'chrome://tombloo/skin/link.png',
-		check : function(ctx){
-			return true;
-		},
-		extract : function(ctx){
-			return {
-				type    : 'link',
-				item    : ctx.title,
-				itemUrl : ctx.href,
-			}
-		},
-	},
-	
-	{
-		name : 'Photo - background image',
-		ICON : 'chrome://tombloo/skin/photo.png',
-		check : function(ctx){
-			return ctx.bgImageURL;
-		},
-		extract : function(ctx){
-			return {
-				type    : 'photo',
-				item    : ctx.title,
-				itemUrl : ctx.bgImageURL,
-			}
-		}
-	},
-	
-	{
-		name : 'Photo - Capture',
-		ICON : 'chrome://tombloo/skin/photo.png',
-		check : function(ctx){
-			return true;
-		},
-		extract : function(ctx){
-			// &#12471;&#12519;&#12540;&#12488;&#12459;&#12483;&#12488;&#12461;&#12540;&#12363;&#12425;&#12509;&#12473;&#12488;&#12377;&#12427;&#12383;&#12417;captureType&#12434;&#36861;&#21152;
-			var type = ctx.captureType || input({'Capture Type' : ['Region', 'Element', 'View', 'Page']});
-			if(!type)
-				return;
-			
-			var win = ctx.window;
-			return succeed().addCallback(function(){
-				switch (type){
-				case 'Region':
-					return selectRegion().addCallback(function(region){
-						return capture(win, region.position, region.dimensions);
-					});
-					
-				case 'Element':
-					return selectElement().addCallback(function(elm){
-						// getBoundingClientRect&#12391;&#23569;&#25968;&#12364;&#36820;&#12373;&#12428;&#20999;&#12426;&#21462;&#12426;&#31684;&#22258;&#12364;&#12378;&#12428;&#12427;&#12383;&#12417;&#20024;&#12417;&#12427;
-						return capture(win, roundPosition(getElementPosition(elm)), getElementDimensions(elm));
-					});
-					
-				case 'View':
-					return capture(win, getViewportPosition(), getViewDimensions());
-					
-				case 'Page':
-					return capture(win, {x:0, y:0}, getPageDimensions());
-				}
-			}).addCallback(function(image){
-				return download(image, getTempDir(uriToFileName(ctx.href) + '.png'));
-			}).addCallback(function(file){
-				return {
-					type : 'photo',
-					item : ctx.title,
-					file : file,
-				}
-			});
-		}
-	},
-	
-	{
-		name : 'Text',
-		ICON : 'chrome://tombloo/skin/text.png',
-		check : function(ctx){
-			return true;
-		},
-		extract : function(ctx){
-			return {
-				type : 'regular',
-			}
-		}
-	},
-]);
-
-Tombloo.Service.extractors.extract = function(ctx, ext){
-	return withWindow(ctx.window, function(){
-		return maybeDeferred(ext.extract(ctx)).addCallback(function(ps){
-			return ps &amp;&amp; update({
-				page    : ctx.title,
-				pageUrl : ctx.href,
-			}, ps);
-		});
-	});
-}
+Tombloo.Service.extractors = new Repository([
+	{
+		name : 'LDR',
+		getItem : function(ctx, getOnly){
+			if(ctx.host != 'reader.livedoor.com' &amp;&amp; ctx.host != 'fastladder.com')
+				return;
+			
+			var item  = $x('ancestor::div[starts-with(@id, &quot;item_count&quot;)]', ctx.target);
+			if(!item)
+				return;
+			
+			var res = {
+				author : ($x('div[@class=&quot;item_info&quot;]/*[@class=&quot;author&quot;]/text()', item) || '').extract(/by (.*)/),
+				title  : $x('div[@class=&quot;item_header&quot;]//a/text()', item) || '',
+				feed   : $x('id(&quot;right_body&quot;)/div[@class=&quot;channel&quot;]//a/text()'),
+				href   : $x('(div[@class=&quot;item_info&quot;]/a)[1]/@href', item).replace(/[?&amp;;](fr?(om)?|track|ref|FM)=(r(ss(all)?|df)|atom)([&amp;;].*)?/,''),
+			};
+			
+			if(!getOnly){
+				ctx.title = res.feed + (res.title? ' - ' + res.title : '');
+				ctx.href  = res.href;
+				ctx.host  = res.href.match('http://(.*?)/')[1];
+			}
+			
+			return res
+		},
+	},
+	
+	{
+		name : 'Quote - LDR',
+		ICON : 'http://reader.livedoor.com/favicon.ico',
+		check : function(ctx){
+			return Tombloo.Service.extractors.LDR.getItem(ctx, true) &amp;&amp; 
+				ctx.selection;
+		},
+		extract : function(ctx){
+			with(Tombloo.Service.extractors){
+				LDR.getItem(ctx);
+				return Quote.extract(ctx);
+			}
+		},
+	},
+	
+	{
+		name : 'ReBlog - LDR',
+		ICON : 'http://reader.livedoor.com/favicon.ico',
+		check : function(ctx){
+			var item = Tombloo.Service.extractors.LDR.getItem(ctx, true);
+			return item &amp;&amp; (
+				item.href.match('^http://.*?\\.tumblr\\.com/') || 
+				(ctx.onImage &amp;&amp; ctx.target.src.match('^http://data\.tumblr\.com/')));
+		},
+		extract : function(ctx){
+			with(Tombloo.Service.extractors){
+				LDR.getItem(ctx);
+				return ReBlog.extract(ctx);
+			}
+		},
+	},
+		
+	{
+		name : 'Photo - LDR(FFFFOUND!)',
+		ICON : 'http://reader.livedoor.com/favicon.ico',
+		check : function(ctx){
+			var item = Tombloo.Service.extractors.LDR.getItem(ctx, true);
+			return item &amp;&amp; 
+				ctx.onImage &amp;&amp; 
+				item.href.match('^http://ffffound\\.com/');
+		},
+		extract : function(ctx){
+			var item = Tombloo.Service.extractors.LDR.getItem(ctx);
+			ctx.title = item.title;
+			
+			return {
+				type      : 'photo',	
+				item      : item.title,
+				itemUrl   : ctx.target.src.replace(/_m(\..{3})/, '$1'),
+				author    : item.author,
+				authorUrl : 'http://ffffound.com/home/' + item.author + '/found/',
+			};
+		},
+	},
+		
+	{
+		name : 'Photo - LDR',
+		ICON : 'http://reader.livedoor.com/favicon.ico',
+		check : function(ctx){
+			return Tombloo.Service.extractors.LDR.getItem(ctx, true) &amp;&amp; 
+				ctx.onImage;
+		},
+		extract : function(ctx){
+			var exts = Tombloo.Service.extractors;
+			exts.LDR.getItem(ctx);
+			return exts.check(ctx)[0].extract(ctx);
+		},
+	},
+	
+	{
+		name : 'Link - LDR',
+		ICON : 'http://reader.livedoor.com/favicon.ico',
+		check : function(ctx){
+			return Tombloo.Service.extractors.LDR.getItem(ctx, true);
+		},
+		extract : function(ctx){
+			with(Tombloo.Service.extractors){
+				LDR.getItem(ctx);
+				return Link.extract(ctx);
+			}
+		},
+	},
+	
+	{
+		name : 'Quote - Twitter',
+		ICON : models.Twitter.ICON,
+		check : function(ctx){
+			return ctx.href.match('//twitter.com/.*?/statuses/\\d+');
+		},
+		extract : function(ctx){
+			var body = ctx.selection;
+			if(!body){
+				var desc = $x('(//div[@class=&quot;desc&quot;]/p)[1]');
+				$x('.//a', desc, true).forEach(function(l){l.href = l.href;});
+				body = desc.innerHTML.replace(/ (rel|target)=&quot;.+?&quot;/g, '');
+			}
+			
+			return {
+				type    : 'quote',
+				item    : ctx.title.substring(0, ctx.title.indexOf(': ')),
+				itemUrl : ctx.href,
+				body    : body.trim(),
+			}
+		},
+	},
+	
+	{
+		name : 'Quote - inyo.jp',
+		ICON : 'chrome://tombloo/skin/quote.png',
+		check : function(ctx){
+			return ctx.href.match('//inyo.jp/quote/[a-f0-9]+');
+		},
+		extract : function(ctx){
+			return {
+				type    : 'quote',
+				item    : $x('//span[@class=&quot;title&quot;]/text()'),
+				itemUrl : ctx.href,
+				body    : escapeHTML((ctx.selection || $x('//blockquote[contains(@class, &quot;text&quot;)]/p').textContent).trim()),
+			}
+		},
+	},
+	
+	{
+		name : 'Amazon',
+		getAsin : function(ctx){
+			return $x('id(&quot;ASIN&quot;)/@value');
+		},
+		extract : function(ctx){
+			var asin = this.getAsin(ctx);
+			return  Amazon.getItem(asin).addCallback(function(item){
+				ctx.href  = Amazon.normalizeUrl(asin);
+				ctx.title = item.title + (item.creators.length? ' / ' + item.creators.join(', ') : '');
+				return item;
+			});
+		},
+	},
+	
+	{
+		name : 'Photo - Amazon',
+		ICON : models.Amazon.ICON,
+		check : function(ctx){
+			return ctx.host.match(/amazon\./) &amp;&amp; 
+				Tombloo.Service.extractors.Amazon.getAsin(ctx) &amp;&amp; 
+				ctx.target.id == 'prodImage';
+		},
+		extract : function(ctx){
+			return Tombloo.Service.extractors.Amazon.extract(ctx).addCallback(function(item){
+				var img = item.largestImage;
+				if(!img){
+					alert('Image not found.');
+					return;
+				}
+				
+				with(ctx.target){
+					src = img.url;
+					height = '';
+					width = '';
+					style.height = 'auto';
+					style.width = 'auto';
+				}
+				
+				return {
+					type    : 'photo',
+					item    : ctx.title,
+					itemUrl : img.url,
+				};
+			});
+		},
+	},
+	
+	{
+		name : 'Quote - Amazon',
+		ICON : models.Amazon.ICON,
+		check : function(ctx){
+			return ctx.host.match(/amazon\./) &amp;&amp; 
+				Tombloo.Service.extractors.Amazon.getAsin(ctx) &amp;&amp; 
+				ctx.selection;
+		},
+		extract : function(ctx){
+			var exts = Tombloo.Service.extractors;
+			return exts.Amazon.extract(ctx).addCallback(function(item){
+				return exts.Quote.extract(ctx);
+			});
+		},
+	},
+	
+	{
+		name : 'Link - Amazon',
+		ICON : models.Amazon.ICON,
+		check : function(ctx){
+			return ctx.host.match(/amazon\./) &amp;&amp; 
+				Tombloo.Service.extractors.Amazon.getAsin(ctx);
+		},
+		extract : function(ctx){
+			var exts = Tombloo.Service.extractors;
+			return exts.Amazon.extract(ctx).addCallback(function(item){
+				return exts.Link.extract(ctx);
+			});
+		},
+	},
+	
+	{
+		name : 'ReBlog - Tumblr',
+		ICON : 'chrome://tombloo/skin/reblog.ico',
+		check : function(ctx){
+			return Tumblr.getReblogToken(currentDocument());
+		},
+		extract : function(ctx){
+			return {
+				type    : 'reblog',
+				item    : ctx.title,
+				itemUrl : ctx.href,
+				token   : Tumblr.getReblogToken(currentDocument()),
+			}
+		},
+	},
+	
+	{
+		name : 'ReBlog',
+		ICON : 'chrome://tombloo/skin/reblog.ico',
+		check : function(ctx){},
+		extract : function(ctx){
+			return request(ctx.href).addCallback(function(res){
+				var doc = convertToHTMLDocument(res.responseText);
+				ctx.title = $x('//title/text()', doc) || '';
+				
+				return {
+					type    : 'reblog',
+					item    : ctx.title,
+					itemUrl : ctx.href,
+					token   : Tumblr.getReblogToken(doc),
+				}
+			});
+		},
+	},
+	
+	{
+		name : 'ReBlog - Dashboard',
+		ICON : 'chrome://tombloo/skin/reblog.ico',
+		check : function(ctx){
+			return ctx.href.match(Tumblr.TUMBLR_URL) &amp;&amp; this.getLink(ctx);
+		},
+		extract : function(ctx){
+			ctx.href = this.getLink(ctx);
+			return Tombloo.Service.extractors.ReBlog.extract(ctx);
+		},
+		getLink : function(ctx){
+			var target = ctx.target;
+			var parent = tagName(target)=='li' ? target : $x('ancestor::li', target);
+			if(!parent)
+				return;
+			
+			return $x('.//a[@title=&quot;Permalink&quot;]/@href', parent);
+		},
+	},
+	
+	{
+		name : 'ReBlog - Mosaic',
+		ICON : 'chrome://tombloo/skin/reblog.ico',
+		check : function(ctx){
+			return ctx.href.match(/mosaic.html/i) &amp;&amp; ctx.target.photo;
+		},
+		extract : function(ctx){
+			ctx.href = ctx.target.photo.url;
+			return Tombloo.Service.extractors.ReBlog.extract(ctx);
+		},
+	},
+	
+	{
+		name : 'ReBlog - Tumblr link',
+		ICON : 'chrome://tombloo/skin/reblog.ico',
+		check : function(ctx){
+			return ctx.link &amp;&amp; ctx.link.href.match(/^http:\/\/[^.]+.tumblr\.com\/post\/\d+/);
+		},
+		extract : function(ctx){
+			ctx.href = ctx.link.href;
+			return Tombloo.Service.extractors.ReBlog.extract(ctx);
+		},
+	},
+	
+	{
+		name : 'Photo - Flickr',
+		ICON : models.Flickr.ICON,
+		
+		RE : new RegExp('^http://(?:.+?.)?static.flickr.com/\\d+?/(\\d+?)_.*'),
+		getImageId : function(img){
+			if(img.src.match('spaceball.gif'))
+				img = img.previousSibling;
+			
+			if(!img || !img.src.match(this.RE))
+				return;
+			
+			return RegExp.$1;
+		},
+		check : function(ctx){
+			return ctx.onImage &amp;&amp; this.getImageId(ctx.target);
+		},
+		extract : function(ctx){
+			var id = this.getImageId(ctx.target);
+			return new DeferredHash({
+				'info'  : Flickr.getInfo(id),
+				'sizes' : Flickr.getSizes(id),
+			}).addCallback(function(r){
+				if(!r.info[0])
+					throw new Error(r.info[1].message);
+				
+				var info = r.info[1];
+				var sizes = r.sizes[1];
+				
+				var title = info.title._content;
+				ctx.title = title + ' on Flickr'
+				ctx.href  = info.urls.url[0]._content;
+				
+				return {
+					type      : 'photo',
+					item      : title,
+					itemUrl   : sizes.pop().source,
+					author    : info.owner.username,
+					authorUrl : ctx.href.extract('^(http://.*?flickr.com/photos/.+?/)'),
+				}
+			});
+		},
+	},
+	
+	{
+		name : 'Photo - 4u',
+		ICON : models['4u'].ICON,
+		check : function(ctx){
+			return ctx.onImage &amp;&amp; ctx.href.match('^http://4u.straightline.jp/image/') &amp;&amp; ctx.target.src.match('/static/upload/l/l_');
+		},
+		extract : function(ctx){
+			var author = $x('(//div[@class=&quot;entry-information&quot;]//a)[1]');
+			var iLoveHer = $x('//div[@class=&quot;entry-item fitem&quot;]//a/@href');
+			return {
+				type      : 'photo',	
+				item      : ctx.title.extract(/(.*) - 4U/i),
+				itemUrl   : ctx.target.src,
+				author    : author.textContent.trim(),
+				authorUrl : author.href,
+				id        : iLoveHer &amp;&amp; decodeURIComponent(iLoveHer.extract('src=([^&amp;]*)')),
+			};
+		},
+	},
+	
+	{
+		name : 'Photo - Snipshot',
+		ICON : models.Snipshot.ICON,
+		check : function(ctx){
+			return ctx.href.match('http://services.snipshot.com/edit/');
+		},
+		extract : function(ctx){
+			var id = ctx.window.m ? ctx.window.m.id : ctx.window.snipshot.FILE;
+			var info = ctx.window.SnipshotImport;
+			
+			if(info){
+				ctx.href  = info.url;
+				ctx.title = info.title;
+			} else {
+				ctx.href  = '';
+				ctx.title = '';
+			}
+			
+			return {
+				type    : 'photo',
+				item    : ctx.title,
+				itemUrl : 'http://services.snipshot.com/save/'+id+'/snipshot_'+id+'.jpg', 
+			}
+		},
+	},
+	
+	{
+		name : 'Photo - Fishki.Net',
+		ICON : 'http://de.fishki.net/favicon.ico',
+		check : function(ctx){
+			return ctx.onImage &amp;&amp; 
+				ctx.target.src.match('//fishki.net/');
+		},
+		extract : function(ctx){
+			return {
+				type    : 'photo',
+				item    : ctx.title,
+				itemUrl : ctx.target.src.replace('//fishki.net/', '//de.fishki.net/'),
+			}
+		},
+	},
+	
+	{
+		name : 'Photo - Google',
+		ICON : models.Google.ICON,
+		check : function(ctx){
+			return (ctx.onLink &amp;&amp; ctx.link.href.match('http://lh..(google.ca|ggpht.com)/.*(png|gif|jpe?g)$'));
+		},
+		extract : function(ctx){
+			return request(ctx.link.href).addCallback(function(res){
+				return {
+					type    : 'photo',
+					item    : ctx.title,
+					itemUrl : $x('//img[1]', convertToHTMLDocument(res.responseText)).src,
+				}
+			});
+		},
+	},
+	
+	{
+		name : 'Photo - Picasa',
+		ICON : 'http://picasaweb.google.com/favicon.ico',
+		check : function(ctx){
+			return ctx.host == 'picasaweb.google.com' &amp;&amp; ctx.onImage;
+		},
+		extract : function(ctx){
+			return {
+				type      : 'photo',
+				item      : $x('//div[@class=&quot;lhcl_albumtitle&quot;]/text()').trim(),
+				itemUrl   : ctx.target.src.replace(/\?.*/, ''), 
+				author    : $x('id(&quot;lhid_user_nickname&quot;)/text()').trim(),
+				authorUrl : $x('id(&quot;lhid_portraitlink&quot;)/@href'),
+			}
+		},
+	},
+	
+	{
+		name : 'Photo - webshots',
+		ICON : 'http://www.webshots.com/favicon.ico',
+		check : function(ctx){
+			return ctx.host.match('^.+\.webshots\.com') &amp;&amp; this.getAuthor();
+		},
+		extract : function(ctx){
+			var author = this.getAuthor();
+			return {
+				type      : 'photo',
+				item      : $x('//div[@class=&quot;media-info&quot;]/h1/text()'),
+				itemUrl   : $x('//li[@class=&quot;fullsize first&quot;]/a/@href'), 
+				author    : author.textContent.trim(),
+				authorUrl : author.href,
+			}
+		},
+		getAuthor : function(){
+			return $x('(//img[@class=&quot;user-photo&quot;])[1]/ancestor::a');
+		},
+	},
+	
+	{
+		name : 'Photo - Blogger',
+		ICON : 'https://www.blogger.com/favicon.ico',
+		check : function(ctx){
+			return ctx.onLink &amp;&amp; 
+				(''+ctx.link).match(/(png|gif|jpe?g)$/i) &amp;&amp;
+				(''+ctx.link).match(/blogger.com\/.*\/s\d{2,}-h\//);
+		},
+		extract : function(ctx){
+			return {
+				type    : 'photo',
+				item    : ctx.title,
+				itemUrl : (''+ctx.link).replace(/\/(s\d{2,})-h\//, '/$1/'), 
+			}
+		},
+	},
+	
+	{
+		name : 'Photo - Shorpy',
+		ICON : 'http://www.shorpy.com/favicon.ico',
+		check : function(ctx){
+			return ctx.onImage &amp;&amp; 
+				ctx.target.src.match(/www.shorpy.com\/.*.preview\.jpg/i);
+		},
+		extract : function(ctx){
+			return {
+				type    : 'photo',
+				item    : ctx.title,
+				itemUrl : ctx.target.src.replace('\.preview\.jpg', '.jpg'), 
+			}
+		},
+	},
+	
+	{
+		name : 'Photo - FFFFOUND!',
+		ICON : models.FFFFOUND.ICON,
+		check : function(ctx){
+			return (ctx.href.match('http://ffffound.com/image/') &amp;&amp; (/^asset/).test(ctx.target.id)) ||
+				(ctx.onLink &amp;&amp; ctx.link.href.match('http://ffffound.com/image/'));
+		},
+		extract : function(ctx){
+			if(ctx.href.match('http://ffffound.com/image/') &amp;&amp; (/^asset/).test(ctx.target.id)){
+				var d = succeed(currentDocument());
+			} else {
+				var d = request(ctx.link.href).addCallback(function(res){
+					// &#30456;&#23550;&#12497;&#12473;&#12434;&#20966;&#29702;&#12377;&#12427;&#12383;&#12417;document&#12434;&#28193;&#12377;
+					var doc =  convertToHTMLDocument(res.responseText, ctx.document);
+					
+					ctx.href = ctx.link.href;
+					ctx.target = $x('(//img[starts-with(@id, &quot;asset&quot;)])', doc);
+					
+					return doc;
+				})
+			}
+			
+			d.addCallback(function(doc){
+				var author = $x('//div[@class=&quot;saved_by&quot;]/a[1]', doc);
+				ctx.title = $x('//title/text()', doc) || '';
+				
+				return {
+					type      : 'photo',
+					item      : $x('//div[@class=&quot;title&quot;]/a/text()', doc).trim(),
+					itemUrl   : ctx.target.src.replace(/_m(\..{3})$/, '$1'),
+					author    : author.textContent,
+					authorUrl : author.href,
+				}
+			});
+			
+			return d;
+		},
+	},
+	
+	{
+		name : 'Photo - Google Image Search',
+		ICON : models.Google.ICON,
+		check : function(ctx){
+			return ctx.host == 'images.google.co.jp' &amp;&amp; 
+				ctx.onImage &amp;&amp; ctx.onLink;
+		},
+		extract : function(ctx){
+			var link  = $x('parent::a/@href', ctx.target);
+			var itemUrl = decodeURIComponent(link.match(/imgurl=([^&amp;]+)/)[1]);
+			ctx.href = decodeURIComponent(link.match(/imgrefurl=([^&amp;]+)/)[1]);
+			
+			return request(ctx.href).addCallback(function(res){
+				ctx.title = 
+					res.responseText.extract(/&lt;title.*?&gt;([\s\S]*?)&lt;\/title&gt;/im).replace(/[\n\r]/g, '').trim() || 
+					broad(createURI(itemUrl)).fileName;
+				
+				return {
+					type    : 'photo',
+					item    : ctx.title,
+					itemUrl : itemUrl,
+				}
+			});
+		},
+	},
+	
+	{
+		name : 'Photo - Share-image.com',
+		ICON : 'http://www.share-image.com/favicon.ico',
+		
+		check : function(ctx){
+			return ctx.href.match(/share-image\.com\/gallery\//) &amp;&amp; this.getImage();
+		},
+		extract : function(ctx){
+			return request(this.getImage()).addCallback(function(res){
+				return {
+					type    : 'photo',
+					item    : ctx.title,
+					itemUrl : res.channel.URI.spec, 
+				}
+			});
+		},
+		getImage : function(){
+			return $x('//img[starts-with(@src, &quot;http://www.share-image.com/pictures/big/&quot;)]/@src');
+		},
+	},
+	
+	{
+		name : 'Photo - Frostdesign.net',
+		ICON : 'http://mfrost.typepad.com/favicon.ico',
+		
+		check : function(ctx){
+			return ctx.host == 'mfrost.typepad.com' &amp;&amp; (ctx.onLink &amp;&amp; ctx.link.href.match('http://mfrost.typepad.com/.shared/image.html'));
+		},
+		extract : function(ctx){
+			return {
+				type    : 'photo',
+				item    : ctx.title,
+				itemUrl : 'http://mfrost.typepad.com' + ctx.link.href.split('?').pop(), 
+			}
+		},
+	},
+	
+	// [FIXME] firefox 3
+	/*
+	{
+		name : 'Photo - area element',
+		check : function(ctx){
+			if(tagName(ctx.target)=='area')
+				return getElementByPosition(ctx.mouse.x, ctx.mouse.y).src;
+		},
+		extract : function(ctx){
+			return {
+				type    : 'photo',
+				item    : ctx.title,
+				itemUrl : getElementByPosition(ctx.mouse.x, ctx.mouse.y).src, 
+			}
+		},
+	},
+	*/
+	
+	{
+		name : 'Photo - image link',
+		ICON : 'chrome://tombloo/skin/photo.png',
+		check : function(ctx){
+			return (ctx.onLink &amp;&amp; ctx.link.href.match(/^[^?]*/)[0].match(/(png|gif|jpe?g)$/i));
+		},
+		extract : function(ctx){
+			return {
+				type    : 'photo',
+				item    : ctx.title,
+				itemUrl : ctx.link.href, 
+			}
+		},
+	},
+	
+	{
+		name : 'Photo',
+		ICON : 'chrome://tombloo/skin/photo.png',
+		check : function(ctx){
+			return ctx.onImage;
+		},
+		extract : function(ctx){
+			var target = ctx.target;
+			var source = tagName(target)=='object'? target.data : target.src;
+			if([
+				'files.posterous.com',
+				'image.itmedia.co.jp',
+				'wretch.yimg.com/',
+				'pics.*\.blog.yam.com/',
+				'www.imgscan.com/image_c.php',
+				'keep4u.ru/imgs/',
+			].some(function(re){
+				return source.match(re);
+			})){
+				return Tombloo.Service.extractors['Photo - Upload from Cache'].extract(ctx);
+			};
+			
+			if(ctx.document.contentType.match(/^image/))
+				ctx.title = ctx.href.split('/').pop();
+			
+			return {
+				type    : 'photo',
+				item    : ctx.title,
+				itemUrl : source,
+			}
+		},
+	},
+	
+	{
+		name : 'Photo - Upload from Cache',
+		ICON : 'chrome://tombloo/skin/photo.png',
+		check : function(ctx){
+			return ctx.onImage;
+		},
+		extract : function(ctx){
+			if(ctx.document.contentType.match(/^image/))
+				ctx.title = ctx.href.split('/').pop();
+			
+			var target = ctx.target;
+			var itemUrl = tagName(target)=='object'? target.data : target.src;
+			
+			var uri = broad(createURI(itemUrl));
+			var file = getTempDir();
+			file.append(validateFileName(uri.fileName));
+			
+			return download(itemUrl, file).addCallback(function(file){
+				return {
+					type    : 'photo',
+					item    : ctx.title,
+					itemUrl : itemUrl,
+					file    : file,
+				}
+			});
+		},
+	},
+	
+	{
+		name : 'Video - Vimeo',
+		ICON : 'http://vimeo.com/favicon.ico',
+		check : function(ctx){
+			return ctx.host.match('vimeo.com');
+		},
+		extract : function(ctx){
+			var author = $x('//div[@class=&quot;byline&quot;]/a');
+			return {
+				type      : 'video',
+				item      : $x('//div[@class=&quot;title&quot;]/text()').trim(),
+				itemUrl   : ctx.href,
+				author    : author.textContent,
+				authorUrl : author.href,
+			};
+		},
+	},
+	
+	{
+		name : 'Video - YouTube',
+		ICON : 'http://youtube.com/favicon.ico',
+		check : function(ctx){
+			return ctx.host.match('youtube.com');
+		},
+		extract : function(ctx){
+			var author = $x('id(&quot;watch-channel-stats&quot;)/a');
+			return {
+				type      : 'video',
+				item      : ctx.title.extract(/ - (.*)/),
+				itemUrl   : ctx.href,
+				author    : author.textContent,
+				authorUrl : author.href,
+			};
+		},
+	},
+	
+	{
+		name : 'Video - Google Video',
+		ICON : models.Google.ICON,
+		check : function(ctx){
+			return ctx.host.match('video.google.com');
+		},
+		extract : function(ctx){
+			return {
+				type    : 'video',
+				item    : ctx.title,
+				itemUrl : ctx.href,
+				body    : $x('id(&quot;embed-video&quot;)/textarea/text()'),
+			}
+		},
+	},
+	
+	{
+		name : 'Video - MySpaceTV',
+		ICON : 'http://vids.myspace.com/favicon.ico',
+		check : function(ctx){
+			return ctx.host.match(/vids\.myspace\.com/) &amp;&amp; this.getTag();
+		},
+		extract : function(ctx){
+			var tag = $x('id(&quot;links_video_code&quot;)/@value');
+			ctx.href = tag.extract(/href=&quot;(.+?)&quot;/);
+			
+			return {
+				type    : 'video',
+				item    : tag.extract(/&gt;(.+?)&lt;\/a&gt;/),
+				itemUrl : ctx.href,
+				body    : tag.extract(/(&lt;object.+object&gt;)/),
+			};
+		},
+		getTag : function(){
+			return $x('id(&quot;links_video_code&quot;)/@value');
+		},
+	},
+	
+	{
+		name : 'Video - Dailymotion',
+		ICON : 'http://www.dailymotion.com/favicon.ico',
+		check : function(ctx){
+			return ctx.host.match('dailymotion.com') &amp;&amp; this.getTag();
+		},
+		extract : function(ctx){
+			var tag = this.getTag();
+			var author = tag.extract(/Uploaded by (&lt;a.+?a&gt;)/);
+			ctx.href = tag.extract(/href=&quot;(.+?)&quot;/);
+			
+			return {
+				type      : 'video',
+				item      : ctx.title.extract(/Dailymotion - (.*?), a video from/),
+				itemUrl   : ctx.href,
+				author    : author.extract(/&gt;([^&gt;&lt;]+?)&lt;/),
+				authorUrl : author.extract(/href=&quot;(.+?)&quot;/),
+				body      : tag.extract(/(&lt;object.+object&gt;)/),
+			};
+		},
+		getTag : function(){
+			return $x('id(&quot;video_player_embed_code_text&quot;)/text()');
+		},
+	},
+	
+	{
+		name : 'Video - Rimo',
+		ICON : 'http://rimo.tv/favicon.ico',
+		check : function(ctx){
+			return ctx.host == 'rimo.tv' &amp;&amp; this.getTag();
+		},
+		extract : function(ctx){
+			return {
+				type    : 'video',
+				item    : $x('id(&quot;play_list_title&quot;)/@value') || ctx.title.extract(/ - (.*)/),
+				itemUrl : ctx.href,
+				body    : this.getTag(),
+			};
+		},
+		getTag : function(){
+			return $x('id(&quot;player-tag-M&quot;)/@value') || $x('(//table[@class=&quot;player-embed-tags&quot;]//input)[last()]/@value');
+		},
+	},
+	
+	{
+		name : 'Video - Nico Nico Douga',
+		ICON : 'http://www.nicovideo.jp/favicon.ico',
+		check : function(ctx){
+			return ctx.href.match('^http://www\.nicovideo\.jp/watch/');
+		},
+		extract : function(ctx){
+			return {
+				type    : 'video',
+				item    : ctx.title,
+				itemUrl : ctx.href,
+				body    : $x('//form[@name=&quot;form_iframe&quot;]/input/@value'),
+			};
+		}
+	},
+	
+	{
+		name : 'Quote',
+		ICON : 'chrome://tombloo/skin/quote.png',
+		check : function(ctx){
+			return ctx.selection;
+		},
+		extract : function(ctx){
+			return {
+				type    : 'quote',
+				item    : ctx.title,
+				itemUrl : ctx.href,
+				body    : escapeHTML(ctx.selection.trim()),
+			}
+		},
+	},
+	
+	{
+		name : 'Link',
+		ICON : 'chrome://tombloo/skin/link.png',
+		check : function(ctx){
+			return true;
+		},
+		extract : function(ctx){
+			return {
+				type    : 'link',
+				item    : ctx.title,
+				itemUrl : ctx.href,
+			}
+		},
+	},
+	
+	{
+		name : 'Photo - background image',
+		ICON : 'chrome://tombloo/skin/photo.png',
+		check : function(ctx){
+			return ctx.bgImageURL;
+		},
+		extract : function(ctx){
+			return {
+				type    : 'photo',
+				item    : ctx.title,
+				itemUrl : ctx.bgImageURL,
+			}
+		}
+	},
+	
+	{
+		name : 'Photo - Capture',
+		ICON : 'chrome://tombloo/skin/photo.png',
+		check : function(ctx){
+			return true;
+		},
+		extract : function(ctx){
+			// &#12471;&#12519;&#12540;&#12488;&#12459;&#12483;&#12488;&#12461;&#12540;&#12363;&#12425;&#12509;&#12473;&#12488;&#12377;&#12427;&#12383;&#12417;captureType&#12434;&#36861;&#21152;
+			var type = ctx.captureType || input({'Capture Type' : ['Region', 'Element', 'View', 'Page']});
+			if(!type)
+				return;
+			
+			var win = ctx.window;
+			return succeed().addCallback(function(){
+				switch (type){
+				case 'Region':
+					return selectRegion().addCallback(function(region){
+						return capture(win, region.position, region.dimensions);
+					});
+					
+				case 'Element':
+					return selectElement().addCallback(function(elm){
+						// getBoundingClientRect&#12391;&#23569;&#25968;&#12364;&#36820;&#12373;&#12428;&#20999;&#12426;&#21462;&#12426;&#31684;&#22258;&#12364;&#12378;&#12428;&#12427;&#12383;&#12417;&#20024;&#12417;&#12427;
+						return capture(win, roundPosition(getElementPosition(elm)), getElementDimensions(elm));
+					});
+					
+				case 'View':
+					return capture(win, getViewportPosition(), getViewDimensions());
+					
+				case 'Page':
+					return capture(win, {x:0, y:0}, getPageDimensions());
+				}
+			}).addCallback(function(image){
+				return download(image, getTempDir(uriToFileName(ctx.href) + '.png'));
+			}).addCallback(function(file){
+				return {
+					type : 'photo',
+					item : ctx.title,
+					file : file,
+				}
+			});
+		}
+	},
+	
+	{
+		name : 'Text',
+		ICON : 'chrome://tombloo/skin/text.png',
+		check : function(ctx){
+			return true;
+		},
+		extract : function(ctx){
+			return {
+				type : 'regular',
+			}
+		}
+	},
+]);
+
+Tombloo.Service.extractors.extract = function(ctx, ext){
+	return withWindow(ctx.window, function(){
+		return maybeDeferred(ext.extract(ctx)).addCallback(function(ps){
+			return ps &amp;&amp; update({
+				page    : ctx.title,
+				pageUrl : ctx.href,
+			}, ps);
+		});
+	});
+}</diff>
      <filename>xpi/chrome/content/library/31_Tombloo.Service.extractors.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,677 +1,677 @@
-function QueryForm(elmForm, params){
-	// &#12518;&#12540;&#12470;&#12540;&#36984;&#25246;&#12508;&#12483;&#12463;&#12473;&#12398;&#20316;&#25104;
-	var elmUser = $x('//select[@name=&quot;user&quot;]', elmForm);
-	appendChildNodes(elmUser,
-		Tombloo.Photo.findUsers().map(function(user){
-			return OPTION({value:user}, user);
-		}))
-	
-	populateForm(elmForm, params);
-	
-	// &#12452;&#12505;&#12531;&#12488;&#20966;&#29702;
-	var submit = bind('submit', elmForm);
-	$x('//input[@name=&quot;random&quot;]', elmForm).onchange = submit;
-	elmUser.onchange = submit;
-	
-	// &#12506;&#12540;&#12472;&#12496;&#12540;&#12398;&#20316;&#25104;
-	var entries = params.random? 0 : Tombloo.Photo.countByUser(params);
-	if(entries){
-		var pagebar = Pagebar({
-			current : params.offset/PER+1,
-			entries : entries,
-			per : PER,
-			max : 10,
-		});
-		insertSiblingNodesBefore(elmForm.childNodes[0], pagebar);
-		
-		var elmOffset = $x('//input[@name=&quot;offset&quot;]', elmForm);
-		elmOffset.value=0;
-		connect(pagebar, 'onChange', function(e){
-			elmOffset.value = (e.event()-1) * PER;
-			submit();
-		})
-	}
-}
-
-// ---- [Widget] -------------------------------------------
-function SlidePanel(elmPanel){
-	var focusing = false;
-	var hovering = false;
-	var panel = {
-		show : function(){
-			elmPanel.style.display = '';
-			removeElementClass(elmPanel, 'hidden');
-		},
-		hide : function(){
-			elmPanel.style.display = 'none';
-		},
-		drawBack : function(){
-			addElementClass(elmPanel, 'hidden');
-		},
-	};
-	elmPanel.addEventListener('focus', function(e){
-		focusing = true;
-		panel.show();
-	}, true);
-	elmPanel.addEventListener('blur', function(e){
-		focusing = false;
-		hovering || panel.drawBack();
-	}, true);
-	elmPanel.addEventListener('mouseover', function(e){
-		hovering = true;
-		panel.show();
-	}, true);
-	elmPanel.addEventListener('mouseout', function(e){
-		hovering = false;
-		focusing || panel.drawBack();
-	}, true);
-	
-	return panel;
-}
-
-// current / entries / per / max
-function Pagebar(opt){
-	var total = Math.ceil(opt.entries/opt.per);
-	opt.max = opt.max || opt.entries;
-	var step = total &lt;= opt.max ? 1 : total/opt.max;
-	
-	var tds = &lt;&gt;&lt;/&gt;;
-	var pages = {};
-	for(var i=1 ; i&lt;total ; i+=step)
-		pages[Math.ceil(i)]=true;
-	pages[opt.current] = pages[total] = true;
-	
-	if(opt.current!=1)
-		tds+=&lt;td class=&quot;pagination&quot; value={opt.current-1}&gt;&lt;/td&gt;
-	
-	keys(pages).sort(function(a,b){return a-b}).forEach(function(page){
-		tds+=&lt;td class={(page==opt.current)? 'current' : ''} value={page}&gt;{page}&lt;/td&gt;
-	})
-	
-	if(opt.current!=total)
-		tds+=&lt;td class=&quot;pagination&quot; value={opt.current+1}&gt;&lt;/td&gt;
-	
-	var elmPagebar = convertToDOM(&lt;table id=&quot;pagebar&quot;&gt;&lt;tr&gt;{tds}&lt;/tr&gt;&lt;/table&gt;);
-	connect(elmPagebar, 'onclick', function(e){
-		var target = e.target();
-		if(hasElementClass(target, 'current')) return;
-		
-		signal(elmPagebar, 'onChange', target.getAttribute('value'));
-	})
-	return elmPagebar;
-}
-
-function QuickPostForm(ps){
-	this.params = ps;
-	this.posters = new Repository(models.check(ps));
-}
-
-QuickPostForm.refreshCache = true;
-QuickPostForm.candidates = [];
-QuickPostForm.prototype = {
-	get checked(){
-		var checked = [];
-		var posters = this.posters;
-		forEach(this.notification.getElementsByTagName('checkbox'), function(c){
-			if(c.checked)
-				checked.push(posters[c.getAttribute('label')]);
-		});
-		return checked;
-	},
-	
-	post : function(){
-		var ps = this.params;
-		$x('.//*[@name]', this.notification, true).forEach(function(elm){
-			ps[elm.getAttribute('name')] = elm.values || elm.value;
-		});
-		
-		if(!this.checked.length)
-			return;
-		
-		Tombloo.Service.post(ps, this.checked);
-		if(this.elmTags)
-			QuickPostForm.refreshCache = this.elmTags.includesNewTag;
-		this.notification.close();
-	},
-	
-	onKeydown : function(e){
-		switch(keyString(e)) {
-		case 'CTRL + RETURN':
-			cancel(e);
-			this.post();
-			break;
-			
-		case 'CTRL + W':
-			cancel(e);
-			this.notification.close();
-			break;
-		}
-	},
-	
-	checkPostable : function(){
-		this.elmPost.disabled = !this.checked.length;
-	},
-	
-	show : function(){
-		// FIXME: &#26283;&#23450;&#20966;&#29702;(reblog/favorites/star&#12398;&#25972;&#29702;)
-		if(this.params.type == 'reblog')
-			return Tumblr.openTab(this.params);
-		
-		var self = this;
-		var contentWindow = getMostRecentWindow().getBrowser().contentWindow;
-		var selection = broad(contentWindow.getSelection());
-		
-		var notification = this.notification = showNotification(this.createForm());
-		notification.addEventListener('keydown', bind('onKeydown', this), true);
-		notification.persistence = 1000;
-		addBefore(notification, 'close', function(){
-			selection.removeSelectionListener(self);
-			contentWindow.focus();
-		});
-		
-		// FIXME: &#22806;&#37096;css&#12395;
-		notification.style.color = '-moz-DialogText';
-		notification.style.backgroundImage = 'none';
-		notification.style.backgroundColor = '-moz-Dialog';
-		
-		this.notification.addEventListener('command', function(e){
-			if(e.target.nodeName == 'checkbox')
-				self.checkPostable();
-		}, true);
-		
-		this.elmPost = notification.getElementsByTagName('button')[0];
-		this.elmPost.addEventListener('command', bind('post', this), true);
-		this.checkPostable();
-		
-		this.elmTags = this.prepareTags();
-		
-		setTimeout(function(){
-			$x('.//*[@tabindex=&quot;0&quot;]', notification).focus();
-		}, 50);
-		
-		this.elmDescription = $x('.//xul:textbox[@name=&quot;description&quot;]', this.notification);
-		if(this.elmDescription)
-			selection.addSelectionListener(this);
-	},
-	
-	prepareTags : function(){
-		var elmTags = $x('.//xul:textbox[@name=&quot;tags&quot;]', this.notification);
-		if(!elmTags)
-			return;
-		
-		elmTags.autoComplete = getPref('tagAutoComplete');
-		elmTags.candidates = QuickPostForm.candidates;
-		
-		var tagProvider = getPref('tagProvider');
-		if(!tagProvider || (tagProvider==QuickPostForm.tagProvider &amp;&amp; !QuickPostForm.refreshCache))
-			return elmTags;
-		
-		models[tagProvider].getUserTags().addCallback(function(tags){
-			if(!tags || !tags.length)
-				return;
-			
-			if(QuickPostForm.candidates.length==tags.length){
-				elmTags.candidates = QuickPostForm.candidates
-				return;
-			}
-			
-			tags = tags.sort(function(a, b){
-				return b.frequency != a.frequency ? compare(b.frequency, a.frequency) : compare(a.name, b.name);
-			}).map(itemgetter('name'));
-			
-			var d = succeed();
-			var readings = tags;
-			var source = tags.join(' [');
-			if(source.includesFullwidth()){
-				d = Yahoo.getRomaReadings(source).addCallback(function(rs){
-					readings = rs.join('').split(' [');
-				});
-			}
-			
-			d.addCallback(function(){
-				// &#27425;&#22238;&#12377;&#12368;&#12395;&#21033;&#29992;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12461;&#12515;&#12483;&#12471;&#12517;&#12377;&#12427;
-				QuickPostForm.refreshCache = false;
-				QuickPostForm.tagProvider = tagProvider;
-				elmTags.candidates = QuickPostForm.candidates = zip(readings, tags).map(function(cand){
-					return {
-						reading : cand[0],
-						value : cand[1],
-					}
-				});
-			});
-		});
-		
-		return elmTags;
-	},
-	
-	// nsISelectionListener
-	notifySelectionChanged : function(doc, sel, reason){
-		if(!sel.isCollapsed &amp;&amp; reason == ISelectionListener.MOUSEUP_REASON){
-			var elm = this.elmDescription;
-			var value = elm.value;
-			var start = elm.selectionStart;
-			sel = sel.toString().trim();
-			
-			this.elmDescription.value = 
-				value.substr(0, elm.selectionStart) + 
-				sel + 
-				value.substr(elm.selectionEnd);
-			elm.selectionStart = elm.selectionEnd = start + sel.length;
-			elm.focus();
-			
-			// value&#12434;&#22793;&#12360;&#12427;&#12392;&#20808;&#38957;&#12395;&#25147;&#12387;&#12390;&#12375;&#12414;&#12358;&#12383;&#12417;&#26368;&#24460;&#12395;&#31227;&#21205;&#12375;&#30452;&#12377;
-			var input = elm.ownerDocument.getAnonymousElementByAttribute(this.elmDescription, 'anonid', 'input');
-			input.scrollTop = input.scrollHeight;
-		}
-	},
-	
-	createForm : function(){
-		var ps = update({
-			description : '',
-		}, this.params);
-		var tags = joinText(ps.tags, ' ');
-		var config = eval(getPref('postConfig'));
-		
-		var form = convertToXULElement(&lt;vbox style=&quot;margin-bottom: 4px; padding: 7px 1px&quot;  flex=&quot;1000&quot;&gt;
-			&lt;hbox&gt;
-				&lt;grid flex=&quot;1&quot; &gt;
-					&lt;columns&gt;
-						&lt;column/&gt;
-						&lt;column flex=&quot;1&quot;/&gt;
-					&lt;/columns&gt;
-					{(function(){
-						switch(ps.type){
-						case 'regular':
-							return &lt;rows&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Type&quot;/&gt;
-									&lt;label value={ps.type.capitalize()} /&gt;
-								&lt;/row&gt;
-								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Description&quot;/&gt;
-									&lt;textbox name=&quot;description&quot; tabindex=&quot;0&quot; multiline=&quot;true&quot; rows=&quot;6&quot; value={ps.description}/&gt;
-								&lt;/row&gt;
-							&lt;/rows&gt;
-							
-						case 'link':
-							return &lt;rows&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Type&quot;/&gt;
-									&lt;label value={ps.type.capitalize()} /&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Title&quot;/&gt;
-									&lt;textbox name=&quot;item&quot; value={ps.item}/&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;URL&quot;/&gt;
-									&lt;textbox name=&quot;itemUrl&quot; value={ps.itemUrl}/&gt;
-								&lt;/row&gt;
-								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Tag&quot;/&gt;
-									&lt;textbox name=&quot;tags&quot; tabindex=&quot;0&quot; flex=&quot;1&quot; value={tags} style=&quot;-moz-binding: url(chrome://tombloo/content/library/completion.xml#container);&quot;/&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Description&quot;/&gt;
-									&lt;textbox name=&quot;description&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.description}/&gt;
-								&lt;/row&gt;
-							&lt;/rows&gt;
-							
-						case 'quote':
-							return &lt;rows&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Type&quot;/&gt;
-									&lt;label value={ps.type.capitalize()} /&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Title&quot;/&gt;
-									&lt;textbox name=&quot;item&quot; value={ps.item}/&gt;
-								&lt;/row&gt;
-								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Tag&quot;/&gt;
-									&lt;textbox name=&quot;tags&quot; tabindex=&quot;0&quot; flex=&quot;1&quot; value={tags} style=&quot;-moz-binding: url(chrome://tombloo/content/library/completion.xml#container)&quot;/&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Quote&quot;/&gt;
-									&lt;textbox name=&quot;body&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.body}/&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Description&quot;/&gt;
-									&lt;textbox name=&quot;description&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.description}/&gt;
-								&lt;/row&gt;
-							&lt;/rows&gt;
-							
-						case 'photo':
-							return &lt;rows xmlns:html={HTML_NS}&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Type&quot;/&gt;
-									&lt;label value={ps.type.capitalize()} /&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Title&quot;/&gt;
-									&lt;textbox name=&quot;item&quot; value={ps.item}/&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Photo&quot;/&gt;
-									&lt;html:div&gt;
-										&lt;html:img src={ps.itemUrl || (createURI(ps.file).spec + '?' + Date.now())} style=&quot;max-height:80px; margin: 2px 4px;&quot;/&gt;
-									&lt;/html:div&gt;
-								&lt;/row&gt;
-								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Tag&quot;/&gt;
-									&lt;textbox name=&quot;tags&quot; tabindex=&quot;0&quot; flex=&quot;1&quot; value={tags} style=&quot;-moz-binding: url(chrome://tombloo/content/library/completion.xml#container)&quot;/&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Description&quot;/&gt;
-									&lt;textbox name=&quot;description&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.description}/&gt;
-								&lt;/row&gt;
-							&lt;/rows&gt;
-							
-						case 'video':
-							return &lt;rows&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Type&quot;/&gt;
-									&lt;label value={ps.type.capitalize()} /&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Title&quot;/&gt;
-									&lt;textbox name=&quot;item&quot; value={ps.item}/&gt;
-								&lt;/row&gt;
-								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Tag&quot;/&gt;
-									&lt;textbox name=&quot;tags&quot; tabindex=&quot;0&quot; flex=&quot;1&quot; value={tags} style=&quot;-moz-binding: url(chrome://tombloo/content/library/completion.xml#container)&quot;/&gt;
-								&lt;/row&gt;
-								&lt;row&gt;
-									&lt;label value=&quot;Description&quot;/&gt;
-									&lt;textbox name=&quot;description&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.description} /&gt;
-								&lt;/row&gt;
-							&lt;/rows&gt;
-						}
-					})()}
-				&lt;/grid&gt;
-				&lt;separator orient=&quot;vertical&quot; class=&quot;groove-thin&quot; width=&quot;1&quot; style=&quot;margin: 0 5px 0 9px;&quot; /&gt;
-				&lt;vbox&gt;
-					{
-						reduce(function(memo, name){
-							var c = config[name] || {};
-							if(c[ps.type] !== ''){
-								memo.checkbox += &lt;checkbox label={name} src={models[name].ICON} checked={!!c[ps.type]} /&gt;
-							}
-							return memo;
-						}, this.posters.names, &lt;vbox/&gt;)
-					}
-					&lt;spacer flex=&quot;1&quot; style=&quot;margin-top: 7px;&quot; /&gt;
-					&lt;button label=&quot;Post&quot; disabled=&quot;true&quot;/&gt;
-				&lt;/vbox&gt;
-			&lt;/hbox&gt;
-		&lt;/vbox&gt;);
-		
-		return form;
-	},
-}
-
-// ----[Shortcutkey]-------------------------------------------------
-var shortcutkeys = {};
-forEach({
-	'shortcutkey.quickPost.link' : function(e){
-		cancel(e);
-		
-		var win = e.currentTarget.content;
-		var doc = win.document;
-		win = win.wrappedJSObject || win;
-		
-		new QuickPostForm({
-			type    : 'link',
-			page    : doc.title,
-			pageUrl : win.location.href,
-			item    : doc.title,
-			itemUrl : win.location.href,
-		}).show();
-	},
-	'shortcutkey.quickPost.regular' : function(e){
-		cancel(e);
-		
-		var win = e.currentTarget.content;
-		var doc = win.document;
-		win = win.wrappedJSObject || win;
-		
-		new QuickPostForm({
-			type    : 'regular',
-			page    : doc.title,
-			pageUrl : win.location.href,
-		}).show();
-	},
-	
-	// &#20966;&#29702;&#12434;&#34892;&#12431;&#12394;&#12363;&#12387;&#12383;&#22580;&#21512;&#12399;true&#12434;&#36820;&#12377;
-	'shortcutkey.checkAndPost' : function(e){
-		var doc = e.originalTarget.ownerDocument;
-		var win = doc.defaultView;
-		win = win.wrappedJSObject || win;
-		
-		// XUL&#12399;&#20966;&#29702;&#12375;&#12394;&#12356;
-		if(!doc.body)
-			return true;
-		
-		var ctx = update({
-			document  : doc,
-			window    : win,
-			title     : doc.title,
-			selection : ''+win.getSelection(),
-			event     : e,
-			target    : e.originalTarget,
-			mouse     : {
-				x : e.pageX,
-				y : e.pageY,
-			},
-		}, win.location);
-		
-		var ext = Tombloo.Service.check(ctx)[0];
-		
-		// FIXME: xul:popup&#35201;&#32032;&#12398;&#20351;&#29992;&#12434;&#26908;&#35342;
-		var tip = doc.createElement('div');
-		tip.setAttribute('style', &lt;&gt;
-			font-family        : 'Arial Black', Arial, sans-serif;
-			font-size          : 12px;
-
-			color              : #666;
-			background         : #EEEEEE no-repeat;
-			position           : fixed;
-			z-index            : 999999999;
-			width              : auto; 
-			height             : 16px;
-			overflow           : hidden; 
-			
-			-moz-border-radius : 4px;
-			border             : 4px solid #EEE;
-			padding-left       : 20px;
-			padding-right      : 2px;
-		&lt;/&gt;);
-		tip.textContent = ext.name;
-		convertToDataURL(ext.ICON).addCallback(function(dataUrl){
-			tip.style.backgroundImage = 'url(' + dataUrl + ')';
-		});
-		setElementPosition(tip, {x: e.clientX - 24, y: e.clientY - 24});
-		doc.body.appendChild(tip);
-		setTimeout(function(){
-			fade(tip, {
-				duration : 0.8,
-				afterFinish : function(){
-					removeElement(tip);
-				},
-			});
-		}, 250);
-		
-		Tombloo.Service.share(ctx, ext, ext.name.match(/^Link/));
-	},
-}, function(pair){
-	var key = getPref(pair[0]);
-	if(key)
-		shortcutkeys[key] = {
-			execute : pair[1],
-		};
-});
-
-
-// ----[browser]-------------------------------------------------
-connect(grobal, 'browser-load', function(e){
-	var cwin = e.target.defaultView;
-	var doc = cwin.document;
-	
-	connectToBrowser(cwin);
-		
-	var context;
-	var menuContext = doc.getElementById('contentAreaContextMenu');
-	var menuShare = doc.getElementById('tombloo-menu-share');
-	var menuSelect = doc.getElementById('tombloo-menu-select');
-	
-	menuShare.setAttribute('accesskey', getPref('accesskey.share'));
-	
-	// Menu Editor&#25313;&#24373;&#12395;&#12424;&#12387;&#12390;&#20491;&#21029;&#12513;&#12491;&#12517;&#12540;&#12398;&#12452;&#12505;&#12531;&#12488;&#12434;&#21462;&#24471;&#12391;&#12365;&#12394;&#12367;&#12394;&#12427;&#29694;&#35937;&#12434;&#22238;&#36991;
-	menuContext.addEventListener('popupshowing', function(e){
-		if(e.eventPhase != Event.AT_TARGET || (context &amp;&amp; context.target == cwin.gContextMenu.target))
-			return;
-		
-		var doc = cwin.gContextMenu.target.ownerDocument;
-		var win = doc.defaultView;
-		win = win.wrappedJSObject || win;
-		
-		try{
-			// about:config &#12394;&#12393;&#12391;&#28961;&#21177;&#12395;&#12377;&#12427;
-			win.location.host;
-			
-			menuShare.disabled = false;
-			menuSelect.parentNode.disabled = false;
-		}catch(e){
-			menuShare.disabled = true;
-			menuSelect.parentNode.disabled = true;
-			
-			return;
-		}
-		
-		// [FIXME] selection&#25991;&#23383;&#21015;&#21270;&#20877;&#26908;&#35342;
-		// command&#26178;&#12395;&#12399;&#12463;&#12522;&#12483;&#12463;&#31623;&#25152;&#12394;&#12393;&#12398;&#24773;&#22577;&#12364;&#22833;&#12431;&#12428;&#12427;&#12383;&#12417;&#12467;&#12531;&#12486;&#12461;&#12473;&#12488;&#12434;&#20445;&#25345;&#12375;&#12390;&#12362;&#12367;
-		context = update({
-			document  : doc,
-			window    : win,
-			title     : ''+doc.title || '',
-			selection : ''+win.getSelection(),
-			event     : e,
-			mouse     : {
-				x : e.pageX,
-				y : e.pageY,
-			},
-			menu      : cwin.gContextMenu,
-		}, cwin.gContextMenu, win.location);
-		
-		var exts = Tombloo.Service.check(context);
-		menuShare.label = 'Share - ' + exts[0].name;
-		menuShare.extractor = exts[0].name;
-		menuShare.setAttribute('image', exts[0].ICON || 'chrome://tombloo/skin/empty.png');
-		
-		if(exts.length&lt;=1){
-			menuSelect.parentNode.disabled = true;
-		} else {
-			menuSelect.parentNode.disabled = false;
-			
-			for(var i=0 ; i&lt;exts.length ; i++){
-				var ext = exts[i];
-				var item = appendMenuItem(menuSelect, ext.name, ext.ICON || 'chrome://tombloo/skin/empty.png');
-				item.extractor = ext.name;
-				item.showForm = true;
-			}
-		}
-	}, true);
-	
-	menuContext.addEventListener('popuphidden', function(e){
-		if(e.eventPhase != Event.AT_TARGET)
-			return;
-		
-		context = null;
-		
-		clearChildren(menuSelect);
-	}, true);
-	
-	menuContext.addEventListener('command', function(e){
-		if(!e.target.extractor)
-			return;
-		
-		context.event = e;
-		
-		var svc = Tombloo.Service;
-		svc.share(context, svc.extractors[e.target.extractor], e.target.showForm);
-	}, true);
-	
-	var menuAction = doc.getElementById('tombloo-menu-main');
-	Tombloo.Service.actions.names.forEach(function(name){
-		appendMenuItem(menuAction, name);
-	});
-	
-	menuAction.addEventListener('command', function(e){
-		Tombloo.Service.actions[e.originalTarget.label].execute();
-	}, true);
-	
-	
-	// FIXME: doc&#12434;&#35299;&#27770;&#12375;&#27726;&#29992;&#12395;
-	function appendMenuItem(menu, label, image){
-		if((/^----/).test(label))
-			return menu.appendChild(doc.createElement('menuseparator'));
-		
-		var item = menu.appendChild(doc.createElement('menuitem'));
-		item.setAttribute('label', label);
-		
-		if(image){
-			item.setAttribute('class', 'menuitem-iconic');
-			item.setAttribute('image', image);
-		}
-		
-		return item;
-	}
-});
-
-function reload(){
-	loadAllSubScripts();
-	getWindows().forEach(connectToBrowser);
-}
-
-function connectToBrowser(win){
-	// &#12497;&#12501;&#12457;&#12540;&#12510;&#12531;&#12473;&#12434;&#32771;&#24942;&#12375;connect&#12375;&#12390;&#12356;&#12427;&#12418;&#12398;&#12364;&#12356;&#12394;&#12369;&#12428;&#12400;&#12454;&#12457;&#12483;&#12481;&#12375;&#12394;&#12356;
-	// &#12522;&#12525;&#12540;&#12489;&#12420;&#35373;&#23450;&#22793;&#26356;&#12395;&#12424;&#12426;&#32368;&#12426;&#36820;&#12375;&#21628;&#12400;&#12428;&#12383;&#12392;&#12365;&#12395;&#22810;&#37325;&#12501;&#12483;&#12463;&#12375;&#12394;&#12356;&#12424;&#12358;&#12395;&#12481;&#12455;&#12483;&#12463;
-	// &#12481;&#12455;&#12483;&#12463;&#29366;&#27841;&#12434;&#12464;&#12525;&#12540;&#12496;&#12523;&#29872;&#22659;&#12395;&#25345;&#12388;&#12398;&#12399;&#35079;&#38609;&#12395;&#12394;&#12426;&#12522;&#12540;&#12463;&#12434;&#25307;&#12367;&#12383;&#12417;window&#12395;&#32622;&#12367;
-	var Tombloo = win.Tombloo = (win.Tombloo || {});
-	var hooked = Tombloo.hooked = (Tombloo.hooked || {});
-	var tabbrowser = win.getBrowser();
-	var version = parseFloat(AppInfo.version);
-	
-	if(!hooked.contentReady &amp;&amp; connected(grobal, 'content-ready')){
-		constant.tabWatcher = constant.tabWatcher || new TabWatcher();
-		constant.tabWatcher.watchWindow(win);
-		hooked.contentReady = true;
-	}
-	
-	if(!hooked.shortcutkey &amp;&amp; !isEmpty(shortcutkeys)){
-		win.addEventListener('keydown', function(e){
-			var key = shortcutkeys[keyString(e)];
-			if(!key)
-				return;
-			
-			key.execute(e);
-		}, true);
-		hooked.shortcutkey = true;
-	}
-	
-	if(!hooked.mouseShortcut &amp;&amp; keys(shortcutkeys).some(function(key){return key.indexOf('_DOWN')!=-1})){
-		observeMouseShortcut(win, function(e, key){
-			key = shortcutkeys[key];
-			if(!key)
-				return true;
-			
-			return key.execute(e);
-		});
-		hooked.mouseShortcut = true;
-	}
-}
+function QueryForm(elmForm, params){
+	// &#12518;&#12540;&#12470;&#12540;&#36984;&#25246;&#12508;&#12483;&#12463;&#12473;&#12398;&#20316;&#25104;
+	var elmUser = $x('//select[@name=&quot;user&quot;]', elmForm);
+	appendChildNodes(elmUser,
+		Tombloo.Photo.findUsers().map(function(user){
+			return OPTION({value:user}, user);
+		}))
+	
+	populateForm(elmForm, params);
+	
+	// &#12452;&#12505;&#12531;&#12488;&#20966;&#29702;
+	var submit = bind('submit', elmForm);
+	$x('//input[@name=&quot;random&quot;]', elmForm).onchange = submit;
+	elmUser.onchange = submit;
+	
+	// &#12506;&#12540;&#12472;&#12496;&#12540;&#12398;&#20316;&#25104;
+	var entries = params.random? 0 : Tombloo.Photo.countByUser(params);
+	if(entries){
+		var pagebar = Pagebar({
+			current : params.offset/PER+1,
+			entries : entries,
+			per : PER,
+			max : 10,
+		});
+		insertSiblingNodesBefore(elmForm.childNodes[0], pagebar);
+		
+		var elmOffset = $x('//input[@name=&quot;offset&quot;]', elmForm);
+		elmOffset.value=0;
+		connect(pagebar, 'onChange', function(e){
+			elmOffset.value = (e.event()-1) * PER;
+			submit();
+		})
+	}
+}
+
+// ---- [Widget] -------------------------------------------
+function SlidePanel(elmPanel){
+	var focusing = false;
+	var hovering = false;
+	var panel = {
+		show : function(){
+			elmPanel.style.display = '';
+			removeElementClass(elmPanel, 'hidden');
+		},
+		hide : function(){
+			elmPanel.style.display = 'none';
+		},
+		drawBack : function(){
+			addElementClass(elmPanel, 'hidden');
+		},
+	};
+	elmPanel.addEventListener('focus', function(e){
+		focusing = true;
+		panel.show();
+	}, true);
+	elmPanel.addEventListener('blur', function(e){
+		focusing = false;
+		hovering || panel.drawBack();
+	}, true);
+	elmPanel.addEventListener('mouseover', function(e){
+		hovering = true;
+		panel.show();
+	}, true);
+	elmPanel.addEventListener('mouseout', function(e){
+		hovering = false;
+		focusing || panel.drawBack();
+	}, true);
+	
+	return panel;
+}
+
+// current / entries / per / max
+function Pagebar(opt){
+	var total = Math.ceil(opt.entries/opt.per);
+	opt.max = opt.max || opt.entries;
+	var step = total &lt;= opt.max ? 1 : total/opt.max;
+	
+	var tds = &lt;&gt;&lt;/&gt;;
+	var pages = {};
+	for(var i=1 ; i&lt;total ; i+=step)
+		pages[Math.ceil(i)]=true;
+	pages[opt.current] = pages[total] = true;
+	
+	if(opt.current!=1)
+		tds+=&lt;td class=&quot;pagination&quot; value={opt.current-1}&gt;&lt;/td&gt;
+	
+	keys(pages).sort(function(a,b){return a-b}).forEach(function(page){
+		tds+=&lt;td class={(page==opt.current)? 'current' : ''} value={page}&gt;{page}&lt;/td&gt;
+	})
+	
+	if(opt.current!=total)
+		tds+=&lt;td class=&quot;pagination&quot; value={opt.current+1}&gt;&lt;/td&gt;
+	
+	var elmPagebar = convertToDOM(&lt;table id=&quot;pagebar&quot;&gt;&lt;tr&gt;{tds}&lt;/tr&gt;&lt;/table&gt;);
+	connect(elmPagebar, 'onclick', function(e){
+		var target = e.target();
+		if(hasElementClass(target, 'current')) return;
+		
+		signal(elmPagebar, 'onChange', target.getAttribute('value'));
+	})
+	return elmPagebar;
+}
+
+function QuickPostForm(ps){
+	this.params = ps;
+	this.posters = new Repository(models.check(ps));
+}
+
+QuickPostForm.refreshCache = true;
+QuickPostForm.candidates = [];
+QuickPostForm.prototype = {
+	get checked(){
+		var checked = [];
+		var posters = this.posters;
+		forEach(this.notification.getElementsByTagName('checkbox'), function(c){
+			if(c.checked)
+				checked.push(posters[c.getAttribute('label')]);
+		});
+		return checked;
+	},
+	
+	post : function(){
+		var ps = this.params;
+		$x('.//*[@name]', this.notification, true).forEach(function(elm){
+			ps[elm.getAttribute('name')] = elm.values || elm.value;
+		});
+		
+		if(!this.checked.length)
+			return;
+		
+		Tombloo.Service.post(ps, this.checked);
+		if(this.elmTags)
+			QuickPostForm.refreshCache = this.elmTags.includesNewTag;
+		this.notification.close();
+	},
+	
+	onKeydown : function(e){
+		switch(keyString(e)) {
+		case 'CTRL + RETURN':
+			cancel(e);
+			this.post();
+			break;
+			
+		case 'CTRL + W':
+			cancel(e);
+			this.notification.close();
+			break;
+		}
+	},
+	
+	checkPostable : function(){
+		this.elmPost.disabled = !this.checked.length;
+	},
+	
+	show : function(){
+		// FIXME: &#26283;&#23450;&#20966;&#29702;(reblog/favorites/star&#12398;&#25972;&#29702;)
+		if(this.params.type == 'reblog')
+			return Tumblr.openTab(this.params);
+		
+		var self = this;
+		var contentWindow = getMostRecentWindow().getBrowser().contentWindow;
+		var selection = broad(contentWindow.getSelection());
+		
+		var notification = this.notification = showNotification(this.createForm());
+		notification.addEventListener('keydown', bind('onKeydown', this), true);
+		notification.persistence = 1000;
+		addBefore(notification, 'close', function(){
+			selection.removeSelectionListener(self);
+			contentWindow.focus();
+		});
+		
+		// FIXME: &#22806;&#37096;css&#12395;
+		notification.style.color = '-moz-DialogText';
+		notification.style.backgroundImage = 'none';
+		notification.style.backgroundColor = '-moz-Dialog';
+		
+		this.notification.addEventListener('command', function(e){
+			if(e.target.nodeName == 'checkbox')
+				self.checkPostable();
+		}, true);
+		
+		this.elmPost = notification.getElementsByTagName('button')[0];
+		this.elmPost.addEventListener('command', bind('post', this), true);
+		this.checkPostable();
+		
+		this.elmTags = this.prepareTags();
+		
+		setTimeout(function(){
+			$x('.//*[@tabindex=&quot;0&quot;]', notification).focus();
+		}, 50);
+		
+		this.elmDescription = $x('.//xul:textbox[@name=&quot;description&quot;]', this.notification);
+		if(this.elmDescription)
+			selection.addSelectionListener(this);
+	},
+	
+	prepareTags : function(){
+		var elmTags = $x('.//xul:textbox[@name=&quot;tags&quot;]', this.notification);
+		if(!elmTags)
+			return;
+		
+		elmTags.autoComplete = getPref('tagAutoComplete');
+		elmTags.candidates = QuickPostForm.candidates;
+		
+		var tagProvider = getPref('tagProvider');
+		if(!tagProvider || (tagProvider==QuickPostForm.tagProvider &amp;&amp; !QuickPostForm.refreshCache))
+			return elmTags;
+		
+		models[tagProvider].getUserTags().addCallback(function(tags){
+			if(!tags || !tags.length)
+				return;
+			
+			if(QuickPostForm.candidates.length==tags.length){
+				elmTags.candidates = QuickPostForm.candidates
+				return;
+			}
+			
+			tags = tags.sort(function(a, b){
+				return b.frequency != a.frequency ? compare(b.frequency, a.frequency) : compare(a.name, b.name);
+			}).map(itemgetter('name'));
+			
+			var d = succeed();
+			var readings = tags;
+			var source = tags.join(' [');
+			if(source.includesFullwidth()){
+				d = Yahoo.getRomaReadings(source).addCallback(function(rs){
+					readings = rs.join('').split(' [');
+				});
+			}
+			
+			d.addCallback(function(){
+				// &#27425;&#22238;&#12377;&#12368;&#12395;&#21033;&#29992;&#12391;&#12365;&#12427;&#12424;&#12358;&#12395;&#12461;&#12515;&#12483;&#12471;&#12517;&#12377;&#12427;
+				QuickPostForm.refreshCache = false;
+				QuickPostForm.tagProvider = tagProvider;
+				elmTags.candidates = QuickPostForm.candidates = zip(readings, tags).map(function(cand){
+					return {
+						reading : cand[0],
+						value : cand[1],
+					}
+				});
+			});
+		});
+		
+		return elmTags;
+	},
+	
+	// nsISelectionListener
+	notifySelectionChanged : function(doc, sel, reason){
+		if(!sel.isCollapsed &amp;&amp; reason == ISelectionListener.MOUSEUP_REASON){
+			var elm = this.elmDescription;
+			var value = elm.value;
+			var start = elm.selectionStart;
+			sel = sel.toString().trim();
+			
+			this.elmDescription.value = 
+				value.substr(0, elm.selectionStart) + 
+				sel + 
+				value.substr(elm.selectionEnd);
+			elm.selectionStart = elm.selectionEnd = start + sel.length;
+			elm.focus();
+			
+			// value&#12434;&#22793;&#12360;&#12427;&#12392;&#20808;&#38957;&#12395;&#25147;&#12387;&#12390;&#12375;&#12414;&#12358;&#12383;&#12417;&#26368;&#24460;&#12395;&#31227;&#21205;&#12375;&#30452;&#12377;
+			var input = elm.ownerDocument.getAnonymousElementByAttribute(this.elmDescription, 'anonid', 'input');
+			input.scrollTop = input.scrollHeight;
+		}
+	},
+	
+	createForm : function(){
+		var ps = update({
+			description : '',
+		}, this.params);
+		var tags = joinText(ps.tags, ' ');
+		var config = eval(getPref('postConfig'));
+		
+		var form = convertToXULElement(&lt;vbox style=&quot;margin-bottom: 4px; padding: 7px 1px&quot;  flex=&quot;1000&quot;&gt;
+			&lt;hbox&gt;
+				&lt;grid flex=&quot;1&quot; &gt;
+					&lt;columns&gt;
+						&lt;column/&gt;
+						&lt;column flex=&quot;1&quot;/&gt;
+					&lt;/columns&gt;
+					{(function(){
+						switch(ps.type){
+						case 'regular':
+							return &lt;rows&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Type&quot;/&gt;
+									&lt;label value={ps.type.capitalize()} /&gt;
+								&lt;/row&gt;
+								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Description&quot;/&gt;
+									&lt;textbox name=&quot;description&quot; tabindex=&quot;0&quot; multiline=&quot;true&quot; rows=&quot;6&quot; value={ps.description}/&gt;
+								&lt;/row&gt;
+							&lt;/rows&gt;
+							
+						case 'link':
+							return &lt;rows&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Type&quot;/&gt;
+									&lt;label value={ps.type.capitalize()} /&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Title&quot;/&gt;
+									&lt;textbox name=&quot;item&quot; value={ps.item}/&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;URL&quot;/&gt;
+									&lt;textbox name=&quot;itemUrl&quot; value={ps.itemUrl}/&gt;
+								&lt;/row&gt;
+								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Tag&quot;/&gt;
+									&lt;textbox name=&quot;tags&quot; tabindex=&quot;0&quot; flex=&quot;1&quot; value={tags} style=&quot;-moz-binding: url(chrome://tombloo/content/library/completion.xml#container);&quot;/&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Description&quot;/&gt;
+									&lt;textbox name=&quot;description&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.description}/&gt;
+								&lt;/row&gt;
+							&lt;/rows&gt;
+							
+						case 'quote':
+							return &lt;rows&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Type&quot;/&gt;
+									&lt;label value={ps.type.capitalize()} /&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Title&quot;/&gt;
+									&lt;textbox name=&quot;item&quot; value={ps.item}/&gt;
+								&lt;/row&gt;
+								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Tag&quot;/&gt;
+									&lt;textbox name=&quot;tags&quot; tabindex=&quot;0&quot; flex=&quot;1&quot; value={tags} style=&quot;-moz-binding: url(chrome://tombloo/content/library/completion.xml#container)&quot;/&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Quote&quot;/&gt;
+									&lt;textbox name=&quot;body&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.body}/&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Description&quot;/&gt;
+									&lt;textbox name=&quot;description&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.description}/&gt;
+								&lt;/row&gt;
+							&lt;/rows&gt;
+							
+						case 'photo':
+							return &lt;rows xmlns:html={HTML_NS}&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Type&quot;/&gt;
+									&lt;label value={ps.type.capitalize()} /&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Title&quot;/&gt;
+									&lt;textbox name=&quot;item&quot; value={ps.item}/&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Photo&quot;/&gt;
+									&lt;html:div&gt;
+										&lt;html:img src={ps.itemUrl || (createURI(ps.file).spec + '?' + Date.now())} style=&quot;max-height:80px; margin: 2px 4px;&quot;/&gt;
+									&lt;/html:div&gt;
+								&lt;/row&gt;
+								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Tag&quot;/&gt;
+									&lt;textbox name=&quot;tags&quot; tabindex=&quot;0&quot; flex=&quot;1&quot; value={tags} style=&quot;-moz-binding: url(chrome://tombloo/content/library/completion.xml#container)&quot;/&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Description&quot;/&gt;
+									&lt;textbox name=&quot;description&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.description}/&gt;
+								&lt;/row&gt;
+							&lt;/rows&gt;
+							
+						case 'video':
+							return &lt;rows&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Type&quot;/&gt;
+									&lt;label value={ps.type.capitalize()} /&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Title&quot;/&gt;
+									&lt;textbox name=&quot;item&quot; value={ps.item}/&gt;
+								&lt;/row&gt;
+								&lt;spacer style=&quot;margin-top: 1em;&quot;/&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Tag&quot;/&gt;
+									&lt;textbox name=&quot;tags&quot; tabindex=&quot;0&quot; flex=&quot;1&quot; value={tags} style=&quot;-moz-binding: url(chrome://tombloo/content/library/completion.xml#container)&quot;/&gt;
+								&lt;/row&gt;
+								&lt;row&gt;
+									&lt;label value=&quot;Description&quot;/&gt;
+									&lt;textbox name=&quot;description&quot; multiline=&quot;true&quot; rows=&quot;3&quot; value={ps.description} /&gt;
+								&lt;/row&gt;
+							&lt;/rows&gt;
+						}
+					})()}
+				&lt;/grid&gt;
+				&lt;separator orient=&quot;vertical&quot; class=&quot;groove-thin&quot; width=&quot;1&quot; style=&quot;margin: 0 5px 0 9px;&quot; /&gt;
+				&lt;vbox&gt;
+					{
+						reduce(function(memo, name){
+							var c = config[name] || {};
+							if(c[ps.type] !== ''){
+								memo.checkbox += &lt;checkbox label={name} src={models[name].ICON} checked={!!c[ps.type]} /&gt;
+							}
+							return memo;
+						}, this.posters.names, &lt;vbox/&gt;)
+					}
+					&lt;spacer flex=&quot;1&quot; style=&quot;margin-top: 7px;&quot; /&gt;
+					&lt;button label=&quot;Post&quot; disabled=&quot;true&quot;/&gt;
+				&lt;/vbox&gt;
+			&lt;/hbox&gt;
+		&lt;/vbox&gt;);
+		
+		return form;
+	},
+}
+
+// ----[Shortcutkey]-------------------------------------------------
+var shortcutkeys = {};
+forEach({
+	'shortcutkey.quickPost.link' : function(e){
+		cancel(e);
+		
+		var win = e.currentTarget.content;
+		var doc = win.document;
+		win = win.wrappedJSObject || win;
+		
+		new QuickPostForm({
+			type    : 'link',
+			page    : doc.title,
+			pageUrl : win.location.href,
+			item    : doc.title,
+			itemUrl : win.location.href,
+		}).show();
+	},
+	'shortcutkey.quickPost.regular' : function(e){
+		cancel(e);
+		
+		var win = e.currentTarget.content;
+		var doc = win.document;
+		win = win.wrappedJSObject || win;
+		
+		new QuickPostForm({
+			type    : 'regular',
+			page    : doc.title,
+			pageUrl : win.location.href,
+		}).show();
+	},
+	
+	// &#20966;&#29702;&#12434;&#34892;&#12431;&#12394;&#12363;&#12387;&#12383;&#22580;&#21512;&#12399;true&#12434;&#36820;&#12377;
+	'shortcutkey.checkAndPost' : function(e){
+		var doc = e.originalTarget.ownerDocument;
+		var win = doc.defaultView;
+		win = win.wrappedJSObject || win;
+		
+		// XUL&#12399;&#20966;&#29702;&#12375;&#12394;&#12356;
+		if(!doc.body)
+			return true;
+		
+		var ctx = update({
+			document  : doc,
+			window    : win,
+			title     : doc.title,
+			selection : ''+win.getSelection(),
+			event     : e,
+			target    : e.originalTarget,
+			mouse     : {
+				x : e.pageX,
+				y : e.pageY,
+			},
+		}, win.location);
+		
+		var ext = Tombloo.Service.check(ctx)[0];
+		
+		// FIXME: xul:popup&#35201;&#32032;&#12398;&#20351;&#29992;&#12434;&#26908;&#35342;
+		var tip = doc.createElement('div');
+		tip.setAttribute('style', &lt;&gt;
+			font-family        : 'Arial Black', Arial, sans-serif;
+			font-size          : 12px;
+
+			color              : #666;
+			background         : #EEEEEE no-repeat;
+			position           : fixed;
+			z-index            : 999999999;
+			width              : auto; 
+			height             : 16px;
+			overflow           : hidden; 
+			
+			-moz-border-radius : 4px;
+			border             : 4px solid #EEE;
+			padding-left       : 20px;
+			padding-right      : 2px;
+		&lt;/&gt;);
+		tip.textContent = ext.name;
+		convertToDataURL(ext.ICON).addCallback(function(dataUrl){
+			tip.style.backgroundImage = 'url(' + dataUrl + ')';
+		});
+		setElementPosition(tip, {x: e.clientX - 24, y: e.clientY - 24});
+		doc.body.appendChild(tip);
+		setTimeout(function(){
+			fade(tip, {
+				duration : 0.8,
+				afterFinish : function(){
+					removeElement(tip);
+				},
+			});
+		}, 250);
+		
+		Tombloo.Service.share(ctx, ext, ext.name.match(/^Link/));
+	},
+}, function(pair){
+	var key = getPref(pair[0]);
+	if(key)
+		shortcutkeys[key] = {
+			execute : pair[1],
+		};
+});
+
+
+// ----[browser]-------------------------------------------------
+connect(grobal, 'browser-load', function(e){
+	var cwin = e.target.defaultView;
+	var doc = cwin.document;
+	
+	connectToBrowser(cwin);
+		
+	var context;
+	var menuContext = doc.getElementById('contentAreaContextMenu');
+	var menuShare = doc.getElementById('tombloo-menu-share');
+	var menuSelect = doc.getElementById('tombloo-menu-select');
+	
+	menuShare.setAttribute('accesskey', getPref('accesskey.share'));
+	
+	// Menu Editor&#25313;&#24373;&#12395;&#12424;&#12387;&#12390;&#20491;&#21029;&#12513;&#12491;&#12517;&#12540;&#12398;&#12452;&#12505;&#12531;&#12488;&#12434;&#21462;&#24471;&#12391;&#12365;&#12394;&#12367;&#12394;&#12427;&#29694;&#35937;&#12434;&#22238;&#36991;
+	menuContext.addEventListener('popupshowing', function(e){
+		if(e.eventPhase != Event.AT_TARGET || (context &amp;&amp; context.target == cwin.gContextMenu.target))
+			return;
+		
+		var doc = cwin.gContextMenu.target.ownerDocument;
+		var win = doc.defaultView;
+		win = win.wrappedJSObject || win;
+		
+		try{
+			// about:config &#12394;&#12393;&#12391;&#28961;&#21177;&#12395;&#12377;&#12427;
+			win.location.host;
+			
+			menuShare.disabled = false;
+			menuSelect.parentNode.disabled = false;
+		}catch(e){
+			menuShare.disabled = true;
+			menuSelect.parentNode.disabled = true;
+			
+			return;
+		}
+		
+		// [FIXME] selection&#25991;&#23383;&#21015;&#21270;&#20877;&#26908;&#35342;
+		// command&#26178;&#12395;&#12399;&#12463;&#12522;&#12483;&#12463;&#31623;&#25152;&#12394;&#12393;&#12398;&#24773;&#22577;&#12364;&#22833;&#12431;&#12428;&#12427;&#12383;&#12417;&#12467;&#12531;&#12486;&#12461;&#12473;&#12488;&#12434;&#20445;&#25345;&#12375;&#12390;&#12362;&#12367;
+		context = update({
+			document  : doc,
+			window    : win,
+			title     : ''+doc.title || '',
+			selection : ''+win.getSelection(),
+			event     : e,
+			mouse     : {
+				x : e.pageX,
+				y : e.pageY,
+			},
+			menu      : cwin.gContextMenu,
+		}, cwin.gContextMenu, win.location);
+		
+		var exts = Tombloo.Service.check(context);
+		menuShare.label = 'Share - ' + exts[0].name;
+		menuShare.extractor = exts[0].name;
+		menuShare.setAttribute('image', exts[0].ICON || 'chrome://tombloo/skin/empty.png');
+		
+		if(exts.length&lt;=1){
+			menuSelect.parentNode.disabled = true;
+		} else {
+			menuSelect.parentNode.disabled = false;
+			
+			for(var i=0 ; i&lt;exts.length ; i++){
+				var ext = exts[i];
+				var item = appendMenuItem(menuSelect, ext.name, ext.ICON || 'chrome://tombloo/skin/empty.png');
+				item.extractor = ext.name;
+				item.showForm = true;
+			}
+		}
+	}, true);
+	
+	menuContext.addEventListener('popuphidden', function(e){
+		if(e.eventPhase != Event.AT_TARGET)
+			return;
+		
+		context = null;
+		
+		clearChildren(menuSelect);
+	}, true);
+	
+	menuContext.addEventListener('command', function(e){
+		if(!e.target.extractor)
+			return;
+		
+		context.event = e;
+		
+		var svc = Tombloo.Service;
+		svc.share(context, svc.extractors[e.target.extractor], e.target.showForm);
+	}, true);
+	
+	var menuAction = doc.getElementById('tombloo-menu-main');
+	Tombloo.Service.actions.names.forEach(function(name){
+		appendMenuItem(menuAction, name);
+	});
+	
+	menuAction.addEventListener('command', function(e){
+		Tombloo.Service.actions[e.originalTarget.label].execute();
+	}, true);
+	
+	
+	// FIXME: doc&#12434;&#35299;&#27770;&#12375;&#27726;&#29992;&#12395;
+	function appendMenuItem(menu, label, image){
+		if((/^----/).test(label))
+			return menu.appendChild(doc.createElement('menuseparator'));
+		
+		var item = menu.appendChild(doc.createElement('menuitem'));
+		item.setAttribute('label', label);
+		
+		if(image){
+			item.setAttribute('class', 'menuitem-iconic');
+			item.setAttribute('image', image);
+		}
+		
+		return item;
+	}
+});
+
+function reload(){
+	loadAllSubScripts();
+	getWindows().forEach(connectToBrowser);
+}
+
+function connectToBrowser(win){
+	// &#12497;&#12501;&#12457;&#12540;&#12510;&#12531;&#12473;&#12434;&#32771;&#24942;&#12375;connect&#12375;&#12390;&#12356;&#12427;&#12418;&#12398;&#12364;&#12356;&#12394;&#12369;&#12428;&#12400;&#12454;&#12457;&#12483;&#12481;&#12375;&#12394;&#12356;
+	// &#12522;&#12525;&#12540;&#12489;&#12420;&#35373;&#23450;&#22793;&#26356;&#12395;&#12424;&#12426;&#32368;&#12426;&#36820;&#12375;&#21628;&#12400;&#12428;&#12383;&#12392;&#12365;&#12395;&#22810;&#37325;&#12501;&#12483;&#12463;&#12375;&#12394;&#12356;&#12424;&#12358;&#12395;&#12481;&#12455;&#12483;&#12463;
+	// &#12481;&#12455;&#12483;&#12463;&#29366;&#27841;&#12434;&#12464;&#12525;&#12540;&#12496;&#12523;&#29872;&#22659;&#12395;&#25345;&#12388;&#12398;&#12399;&#35079;&#38609;&#12395;&#12394;&#12426;&#12522;&#12540;&#12463;&#12434;&#25307;&#12367;&#12383;&#12417;window&#12395;&#32622;&#12367;
+	var Tombloo = win.Tombloo = (win.Tombloo || {});
+	var hooked = Tombloo.hooked = (Tombloo.hooked || {});
+	var tabbrowser = win.getBrowser();
+	var version = parseFloat(AppInfo.version);
+	
+	if(!hooked.contentReady &amp;&amp; connected(grobal, 'content-ready')){
+		constant.tabWatcher = constant.tabWatcher || new TabWatcher();
+		constant.tabWatcher.watchWindow(win);
+		hooked.contentReady = true;
+	}
+	
+	if(!hooked.shortcutkey &amp;&amp; !isEmpty(shortcutkeys)){
+		win.addEventListener('keydown', function(e){
+			var key = shortcutkeys[keyString(e)];
+			if(!key)
+				return;
+			
+			key.execute(e);
+		}, true);
+		hooked.shortcutkey = true;
+	}
+	
+	if(!hooked.mouseShortcut &amp;&amp; keys(shortcutkeys).some(function(key){return key.indexOf('_DOWN')!=-1})){
+		observeMouseShortcut(win, function(e, key){
+			key = shortcutkeys[key];
+			if(!key)
+				return true;
+			
+			return key.execute(e);
+		});
+		hooked.mouseShortcut = true;
+	}
+}</diff>
      <filename>xpi/chrome/content/library/40_ui.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,325 +1,325 @@
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/30_Tombloo.Service.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/40_ui.js&quot;&gt;&lt;/script&gt;
-&lt;style&gt;
-body{
-	background-color : #000;
-	margin : 0;
-	padding : 0;
-	overflow-x : hidden;
-	overflow-y : scroll;
-}
-body *{
-	-moz-user-select: none;
-}
-
-#control{
-	position : fixed;
-	background-color : #333;
-	left : 0;
-	right : 0;
-	padding : 1em 1.5em;
-	font-size : 80%;
-}
-#control *{
-	vertical-align : middle;
-	font-weight : bold;
-}
-#control.hidden{
-	height : 15px;
-	padding : 0;
-}
-#control.hidden *{
-	display : none !important;
-}
-#control form{
-	display : inline;
-}
-#control label{
-	color : white;
-}
-#control input, 
-#control select {
-	margin-right : 2em;
-}
-
-#pagebar{
-	cursor : pointer;
-	vertical-align : middle;
-	float : right;
-	border-collapse : collapse;
-	background-color : white;
-	color : white;
-}
-#pagebar td{
-	padding : 0 0.3em;
-	text-align : center;
-}
-#pagebar td.current{
-	cursor : default;
-	color : #fff;
-	background-color : #333;
-}
-
-#pagebar td.pagination{
-	color : #333;
-	border : solid #333;
-	border-width : 0 0.2em;
-}
-#pagebar td:hover{
-	color : white;
-	background-color : #333;
-}
-
-
-#mosaic{
-	color : white;
-	padding : 25px 0;
-}
-#mosaic img{
-	vertical-align : top;
-	width : 3em;
-	border : 0.5em solid black;
-}
-
-#magnify{
-	position : absolute;
-	display : none;
-	top : 0;
-	left : 0;
-	border : 10px solid black;
-	z-index : 100;
-}
-
-&lt;/style&gt;
-&lt;/head&gt;
-&lt;body&gt;
-	&lt;div id=&quot;control&quot; class=&quot;hidden&quot;&gt;
-		&lt;form method=&quot;get&quot;&gt;
-			&lt;label&gt;USER
-				&lt;select name=&quot;user&quot;&gt;
-					&lt;option value=&quot;&quot;&gt;&lt;/option&gt;
-				&lt;/select&gt;
-			&lt;/label&gt;
-			&lt;label&gt;RANDOM
-				&lt;input name=&quot;random&quot; type=&quot;checkbox&quot; /&gt;
-			&lt;/label&gt;
-			&lt;input type=&quot;hidden&quot; name=&quot;offset&quot; value=&quot;0&quot; /&gt;
-		&lt;/form&gt;
-	&lt;/div&gt;
-	&lt;div id=&quot;mosaic&quot;&gt;
-	&lt;/div&gt;
-	&lt;img id=&quot;magnify&quot;/&gt;
-&lt;/body&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
-	const PER = 1000;
-	
-	
-	// ---- [Main] ------------------------------------------------------
-	var params = parseQueryString(location.search);
-	
-	MosaicPanel($('mosaic'), params);
-	
-	var control = SlidePanel($('control'));
-	if(params.query){
-		control.hide();
-	} else if(!params.user){
-		control.show();
-	}
-	QueryForm($x('id(&quot;control&quot;)//form'), params);
-	
-	
-	// ---- [Application] ------------------------------------------------
-	function MosaicPanel(elmMosaic, params){
-		if(!params.user &amp;&amp; !params.query)
-			return;
-		
-		var photos;
-		if(params.user){
-			photos = Tombloo.Photo.findByUser({
-				user : params.user, 
-				limit : (params.limit || PER), 
-				offset : (params.offset || 0), 
-				order : (params.random? 'random()' : 'date DESC')});
-		} else {
-			// .split(',')
-			photos = Tombloo.Photo.find(params.query, params.args);
-		}
-		
-		deferredForEach(photos.split(25), function(photos){
-			photos.forEach(function(photo){
-				var file = photo.getFile(75);
-				
-				if(!file.exists())
-					return;
-				
-				var img = new Image();
-				img.src = createURI(file).spec;
-				img.photo = photo;
-				img.onload = function(){
-					elmMosaic.appendChild(img);
-				}
-			})
-			
-			return wait(0);
-		});
-		
-		var magnifyPanel = MagnifyPanel(elmMosaic);
-		var style = elmMosaic.style;
-		
-		// &#12469;&#12512;&#12493;&#12452;&#12523;&#21336;&#20301;&#12398;&#12473;&#12463;&#12525;&#12540;&#12523;
-		var thmbs = elmMosaic.getElementsByTagName('img');
-		function scroll(next){
-			var op = next? operator.gt : operator.lt;
-			var len = thmbs.length;
-			var top = thmbs[0].offsetTop;
-			var borderWidth = parseInt(getStyle(thmbs[0], 'borderTopWidth'));
-			var margin = top - borderWidth;
-			for(
-				var columns=0; 
-				columns&lt;len &amp;&amp; top == thmbs[columns].offsetTop ;
-				columns++);
-			
-			var border = document.body.scrollTop + margin;
-			for(var i=len ; i&gt;=0 ; i-=columns){
-				var elm = thmbs[next ? len-i : i-1];
-				if(op(elm.offsetTop, border))
-					break;
-			}
-			document.body.scrollTop = elm.offsetTop - margin;
-		}
-		
-		// &#12474;&#12540;&#12512;
-		elmMosaic.style.fontSize='60%';
-		function Zoomer(target, base){
-			var margin = target.offsetTop - document.body.scrollTop;
-			style.cursor='e-resize';
-			
-			return {
-				terminate : function(){
-					style.cursor='';
-				},
-				zoom : function(current){
-					// &#25313;&#22823;&#32302;&#23567;
-					var direction = current.x&gt;base.x? 1 : -1;
-					var fontSize = 
-						parseInt(style.fontSize) + 
-						Math.floor(Math.hypot(current.x - base.x, current.y - base.y) / 5) * direction;
-					fontSize = Math.min(Math.max(fontSize, 20), 200);
-					style.fontSize = fontSize + '%';
-					
-					// &#12473;&#12463;&#12525;&#12540;&#12523;&#20301;&#32622;&#12434;&#25147;&#12377;
-					document.body.scrollTop = target.offsetTop - margin;
-					
-					base = current;
-				},
-			}
-		}
-		
-		// &#12452;&#12505;&#12531;&#12488;&#20966;&#29702;
-		var pushing = 0;
-		var zoomer;
-		elmMosaic.style.cursor='-moz-magnify-in';
-		connect(elmMosaic, 'onmousewheel', function(e){
-			e.stop();
-			scroll(e.wheelDelta() &gt; 0);
-		});
-		connect(elmMosaic, 'ondblclick', function(e){
-			addTab(e.target().photo.url);
-		});
-		connect(elmMosaic, 'onmousedown', function(e){
-			var button = 1&lt;&lt;e.event().button;
-			pushing = pushing | button;
-			
-			if(button == 1){
-				magnifyPanel.show(e);
-				e.stop();
-			} else if(button == 4){
-				zoomer = Zoomer(e.target(), e.mouse().client);
-			}
-		});
-		connect(document, 'onmouseup', function(e){
-			var button = 1&lt;&lt;e.event().button;
-			pushing -= pushing &amp; button;
-			
-			if(button == 1){
-				magnifyPanel.hide();
-			} else if(button == 4){
-				zoomer.terminate();
-				e.stop();
-			}
-		});
-		connect(elmMosaic, 'onmousemove', function(e){
-			if(pushing == 1){
-				magnifyPanel.show(e);
-			} else if(pushing == 4){
-				zoomer.zoom(e.mouse().client);
-			}
-		});
-	}
-	
-	function MagnifyPanel(elmParent){
-		var elmMagnify = getElement('magnify');
-		var elmPhoto;
-		var border = parseInt(getStyle(elmMagnify, 'borderTopWidth')) * 2;
-		var style = elmMagnify.style;
-		var body = document.body;
-		
-		var panel = {
-			get visible(){
-				return style.display = 'block';
-			},
-			show : function(e){
-				var target = e.target();
-				if(!target.photo)
-					return;
-				
-				// [FIXME] &#21028;&#23450;
-				elmMagnify.src = createURI(target.photo.getFile(500)).spec;
-				style.display = 'block';
-				elmParent.style.cursor='-moz-zoom-in';
-				
-				var mouse = e.mouse();
-				var vp = getViewportPosition();
-				var vd = getViewportDimensions();
-				var mp = mouse.page;
-				
-				var zh = elmMagnify.height;
-				
-				// &#12510;&#12454;&#12473;&#12364;&#30011;&#38754;&#21491;&#21322;&#20998;&#12395;&#12354;&#12427;&#12363;?
-				if(vd.w/2 &lt; mp.x){
-					style.left = 'auto';
-					style.right = vd.w - mp.x + border;
-				} else {
-					style.left = mp.x + border;
-					style.right = '';
-				}
-				
-				style.top = mp.y - zh - border &lt; vp.y ? vp.y : mp.y - zh - border;
-			},
-			hide : function(){
-				style.display = 'none';
-				elmParent.style.cursor='';
-			},
-			limitSize : function(){
-				style.maxHeight = (body.clientHeight - border) + 'px';
-			}
-		}
-		panel.limitSize();
-		
-		// &#12452;&#12505;&#12531;&#12488;&#20966;&#29702;
-		connect(window,     'onresize',    panel, 'limitSize');
-		connect(elmMagnify, 'onmouseover', panel, 'hide');
-		
-		return panel;
-	}
-&lt;/script&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/30_Tombloo.Service.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/40_ui.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+body{
+	background-color : #000;
+	margin : 0;
+	padding : 0;
+	overflow-x : hidden;
+	overflow-y : scroll;
+}
+body *{
+	-moz-user-select: none;
+}
+
+#control{
+	position : fixed;
+	background-color : #333;
+	left : 0;
+	right : 0;
+	padding : 1em 1.5em;
+	font-size : 80%;
+}
+#control *{
+	vertical-align : middle;
+	font-weight : bold;
+}
+#control.hidden{
+	height : 15px;
+	padding : 0;
+}
+#control.hidden *{
+	display : none !important;
+}
+#control form{
+	display : inline;
+}
+#control label{
+	color : white;
+}
+#control input, 
+#control select {
+	margin-right : 2em;
+}
+
+#pagebar{
+	cursor : pointer;
+	vertical-align : middle;
+	float : right;
+	border-collapse : collapse;
+	background-color : white;
+	color : white;
+}
+#pagebar td{
+	padding : 0 0.3em;
+	text-align : center;
+}
+#pagebar td.current{
+	cursor : default;
+	color : #fff;
+	background-color : #333;
+}
+
+#pagebar td.pagination{
+	color : #333;
+	border : solid #333;
+	border-width : 0 0.2em;
+}
+#pagebar td:hover{
+	color : white;
+	background-color : #333;
+}
+
+
+#mosaic{
+	color : white;
+	padding : 25px 0;
+}
+#mosaic img{
+	vertical-align : top;
+	width : 3em;
+	border : 0.5em solid black;
+}
+
+#magnify{
+	position : absolute;
+	display : none;
+	top : 0;
+	left : 0;
+	border : 10px solid black;
+	z-index : 100;
+}
+
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+	&lt;div id=&quot;control&quot; class=&quot;hidden&quot;&gt;
+		&lt;form method=&quot;get&quot;&gt;
+			&lt;label&gt;USER
+				&lt;select name=&quot;user&quot;&gt;
+					&lt;option value=&quot;&quot;&gt;&lt;/option&gt;
+				&lt;/select&gt;
+			&lt;/label&gt;
+			&lt;label&gt;RANDOM
+				&lt;input name=&quot;random&quot; type=&quot;checkbox&quot; /&gt;
+			&lt;/label&gt;
+			&lt;input type=&quot;hidden&quot; name=&quot;offset&quot; value=&quot;0&quot; /&gt;
+		&lt;/form&gt;
+	&lt;/div&gt;
+	&lt;div id=&quot;mosaic&quot;&gt;
+	&lt;/div&gt;
+	&lt;img id=&quot;magnify&quot;/&gt;
+&lt;/body&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+	const PER = 1000;
+	
+	
+	// ---- [Main] ------------------------------------------------------
+	var params = parseQueryString(location.search);
+	
+	MosaicPanel($('mosaic'), params);
+	
+	var control = SlidePanel($('control'));
+	if(params.query){
+		control.hide();
+	} else if(!params.user){
+		control.show();
+	}
+	QueryForm($x('id(&quot;control&quot;)//form'), params);
+	
+	
+	// ---- [Application] ------------------------------------------------
+	function MosaicPanel(elmMosaic, params){
+		if(!params.user &amp;&amp; !params.query)
+			return;
+		
+		var photos;
+		if(params.user){
+			photos = Tombloo.Photo.findByUser({
+				user : params.user, 
+				limit : (params.limit || PER), 
+				offset : (params.offset || 0), 
+				order : (params.random? 'random()' : 'date DESC')});
+		} else {
+			// .split(',')
+			photos = Tombloo.Photo.find(params.query, params.args);
+		}
+		
+		deferredForEach(photos.split(25), function(photos){
+			photos.forEach(function(photo){
+				var file = photo.getFile(75);
+				
+				if(!file.exists())
+					return;
+				
+				var img = new Image();
+				img.src = createURI(file).spec;
+				img.photo = photo;
+				img.onload = function(){
+					elmMosaic.appendChild(img);
+				}
+			})
+			
+			return wait(0);
+		});
+		
+		var magnifyPanel = MagnifyPanel(elmMosaic);
+		var style = elmMosaic.style;
+		
+		// &#12469;&#12512;&#12493;&#12452;&#12523;&#21336;&#20301;&#12398;&#12473;&#12463;&#12525;&#12540;&#12523;
+		var thmbs = elmMosaic.getElementsByTagName('img');
+		function scroll(next){
+			var op = next? operator.gt : operator.lt;
+			var len = thmbs.length;
+			var top = thmbs[0].offsetTop;
+			var borderWidth = parseInt(getStyle(thmbs[0], 'borderTopWidth'));
+			var margin = top - borderWidth;
+			for(
+				var columns=0; 
+				columns&lt;len &amp;&amp; top == thmbs[columns].offsetTop ;
+				columns++);
+			
+			var border = document.body.scrollTop + margin;
+			for(var i=len ; i&gt;=0 ; i-=columns){
+				var elm = thmbs[next ? len-i : i-1];
+				if(op(elm.offsetTop, border))
+					break;
+			}
+			document.body.scrollTop = elm.offsetTop - margin;
+		}
+		
+		// &#12474;&#12540;&#12512;
+		elmMosaic.style.fontSize='60%';
+		function Zoomer(target, base){
+			var margin = target.offsetTop - document.body.scrollTop;
+			style.cursor='e-resize';
+			
+			return {
+				terminate : function(){
+					style.cursor='';
+				},
+				zoom : function(current){
+					// &#25313;&#22823;&#32302;&#23567;
+					var direction = current.x&gt;base.x? 1 : -1;
+					var fontSize = 
+						parseInt(style.fontSize) + 
+						Math.floor(Math.hypot(current.x - base.x, current.y - base.y) / 5) * direction;
+					fontSize = Math.min(Math.max(fontSize, 20), 200);
+					style.fontSize = fontSize + '%';
+					
+					// &#12473;&#12463;&#12525;&#12540;&#12523;&#20301;&#32622;&#12434;&#25147;&#12377;
+					document.body.scrollTop = target.offsetTop - margin;
+					
+					base = current;
+				},
+			}
+		}
+		
+		// &#12452;&#12505;&#12531;&#12488;&#20966;&#29702;
+		var pushing = 0;
+		var zoomer;
+		elmMosaic.style.cursor='-moz-magnify-in';
+		connect(elmMosaic, 'onmousewheel', function(e){
+			e.stop();
+			scroll(e.wheelDelta() &gt; 0);
+		});
+		connect(elmMosaic, 'ondblclick', function(e){
+			addTab(e.target().photo.url);
+		});
+		connect(elmMosaic, 'onmousedown', function(e){
+			var button = 1&lt;&lt;e.event().button;
+			pushing = pushing | button;
+			
+			if(button == 1){
+				magnifyPanel.show(e);
+				e.stop();
+			} else if(button == 4){
+				zoomer = Zoomer(e.target(), e.mouse().client);
+			}
+		});
+		connect(document, 'onmouseup', function(e){
+			var button = 1&lt;&lt;e.event().button;
+			pushing -= pushing &amp; button;
+			
+			if(button == 1){
+				magnifyPanel.hide();
+			} else if(button == 4){
+				zoomer.terminate();
+				e.stop();
+			}
+		});
+		connect(elmMosaic, 'onmousemove', function(e){
+			if(pushing == 1){
+				magnifyPanel.show(e);
+			} else if(pushing == 4){
+				zoomer.zoom(e.mouse().client);
+			}
+		});
+	}
+	
+	function MagnifyPanel(elmParent){
+		var elmMagnify = getElement('magnify');
+		var elmPhoto;
+		var border = parseInt(getStyle(elmMagnify, 'borderTopWidth')) * 2;
+		var style = elmMagnify.style;
+		var body = document.body;
+		
+		var panel = {
+			get visible(){
+				return style.display = 'block';
+			},
+			show : function(e){
+				var target = e.target();
+				if(!target.photo)
+					return;
+				
+				// [FIXME] &#21028;&#23450;
+				elmMagnify.src = createURI(target.photo.getFile(500)).spec;
+				style.display = 'block';
+				elmParent.style.cursor='-moz-zoom-in';
+				
+				var mouse = e.mouse();
+				var vp = getViewportPosition();
+				var vd = getViewportDimensions();
+				var mp = mouse.page;
+				
+				var zh = elmMagnify.height;
+				
+				// &#12510;&#12454;&#12473;&#12364;&#30011;&#38754;&#21491;&#21322;&#20998;&#12395;&#12354;&#12427;&#12363;?
+				if(vd.w/2 &lt; mp.x){
+					style.left = 'auto';
+					style.right = vd.w - mp.x + border;
+				} else {
+					style.left = mp.x + border;
+					style.right = '';
+				}
+				
+				style.top = mp.y - zh - border &lt; vp.y ? vp.y : mp.y - zh - border;
+			},
+			hide : function(){
+				style.display = 'none';
+				elmParent.style.cursor='';
+			},
+			limitSize : function(){
+				style.maxHeight = (body.clientHeight - border) + 'px';
+			}
+		}
+		panel.limitSize();
+		
+		// &#12452;&#12505;&#12531;&#12488;&#20966;&#29702;
+		connect(window,     'onresize',    panel, 'limitSize');
+		connect(elmMagnify, 'onmouseover', panel, 'hide');
+		
+		return panel;
+	}
+&lt;/script&gt;
+&lt;/html&gt;</diff>
      <filename>xpi/chrome/content/library/Mosaic.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,305 +1,305 @@
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/30_Tombloo.Service.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/40_ui.js&quot;&gt;&lt;/script&gt;
-&lt;style&gt;
-body{
-	background-color : #000;
-	margin : 0;
-	padding : 0;
-	overflow : hidden;
-}
-body *{
-	-moz-user-select: none;
-}
-
-#control{
-	position : fixed;
-	background-color : #333;
-	left : 0;
-	right : 0;
-	padding : 1em 1.5em;
-	font-size : 80%;
-}
-#control *{
-	vertical-align : middle;
-	font-weight : bold;
-}
-#control.hidden{
-	height : 15px;
-	padding : 0;
-}
-#control.hidden *{
-	display : none !important;
-}
-#control form{
-	display : inline;
-}
-#control label{
-	color : white;
-}
-#control input, 
-#control select {
-	margin-right : 2em;
-}
-
-#pagebar{
-	cursor : pointer;
-	vertical-align : middle;
-	float : right;
-	border-collapse : collapse;
-	background-color : white;
-	color : white;
-}
-#pagebar td{
-	padding : 0 0.3em;
-	text-align : center;
-}
-#pagebar td.current{
-	cursor : default;
-	color : #fff;
-	background-color : #333;
-}
-
-#pagebar td.pagination{
-	color : #333;
-	border : solid #333;
-	border-width : 0 0.2em;
-}
-#pagebar td:hover{
-	color : white;
-	background-color : #333;
-}
-
-
-#strobo{
-	padding-top : 60px;
-	text-align : center;
-}
-
-#strobo #photo{
-	display : none;
-}
-
-
-#strobo #interval{
-	display : block;
-	
-	position:absolute;
-	top : 0pt;
-	left : 50%;
-	height : 15px;
-	margin-left : -250px;
-	margin-top : 30px;
-	width : 500px;
-}
-
-#strobo #meter{
-	background-color : white;
-	
-	position : relative;
-	height : 15px;
-}
-
-#magnify{
-	position : absolute;
-	display : none;
-	top : 0;
-	left : 0;
-	border : 10px solid black;
-	z-index : 100;
-}
-
-&lt;/style&gt;
-&lt;/head&gt;
-&lt;body&gt;
-	&lt;div id=&quot;control&quot; class=&quot;hidden&quot;&gt;
-		&lt;form method=&quot;get&quot;&gt;
-			&lt;label&gt;USER
-				&lt;select name=&quot;user&quot;&gt;
-					&lt;option value=&quot;&quot;&gt;&lt;/option&gt;
-				&lt;/select&gt;
-			&lt;/label&gt;
-			&lt;label&gt;RANDOM
-				&lt;input name=&quot;random&quot; type=&quot;checkbox&quot; /&gt;
-			&lt;/label&gt;
-			&lt;input type=&quot;hidden&quot; name=&quot;offset&quot; value=&quot;0&quot; /&gt;
-		&lt;/form&gt;
-	&lt;/div&gt;
-	&lt;div id=&quot;strobo&quot;&gt;
-		&lt;img id=&quot;photo&quot; /&gt;
-		&lt;span id=&quot;interval&quot;&gt;&lt;span id=&quot;meter&quot; &gt;&lt;/span&gt;&lt;/span&gt;
-	&lt;/div&gt;
-&lt;/body&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
-	const PER = 1000;
-	
-	
-	// ---- [Application] ------------------------------------------------
-	function StroboPanel(elmPhoto, elmMeter, params){
-		if(!params.user &amp;&amp; !params.query)
-			return;
-		
-		this.loaded = [];
-		this.elmMeter = elmMeter;
-		this.elmPhoto = elmPhoto;
-		this.nextPhoto = bind('nextPhoto', this);
-		this.start = bind('start', this);
-		
-		if(params.user){
-			this.photos = Tombloo.Photo.findByUser({
-				user : params.user, 
-				limit : (params.limit || PER), 
-				offset : (params.offset || 0), 
-				order : (params.random? 'random()' : 'date DESC')});
-		} else {
-			this.photos = Tombloo.Photo.find(params.query, params.args);
-		}
-		this.photos = this.photos.filter(function(photo){
-			var file = photo.getFile(500);
-			return file &amp;&amp; file.exists() &amp;&amp; file.fileSizeOfLink &gt; 300;
-		});
-		
-		this.nextPhoto();
-		this.show();
-	}
-	
-	StroboPanel.prototype = {
-		photos : null,
-		pointer : 0,
-		elmPhoto : null,
-		interval : 1000,
-		
-		show : function(){
-			connect(document, 'onkeydown', this, 'onKeyDown');
-			this.elmPhoto.style.display = 'inline';
-		},
-		onKeyDown : function(evt){
-			switch(evt.keyString()){
-			case 'ARROW_RIGHT':
-				evt.stop();
-				if(this.isPlaying())
-					return this.changeInterval(false);
-				
-				this.nextPhoto();
-				return;
-				
-			case 'ARROW_LEFT':
-				evt.stop();
-				if(this.isPlaying())
-					return this.changeInterval(true);
-				
-				this.previousPhoto();
-				return;
-				
-			case 'ARROW_UP':
-			case 'ENTER':
-				evt.stop();
-				if(this.isPlaying()){
-					this.stop();
-					return;
-				}
-				
-				addTab(this.photos[this.pointer].url);
-				return;
-				
-			case 'ARROW_DOWN':
-				evt.stop();
-				this.toggle();
-				return;
-				
-			case 'ESC':
-				evt.stop();
-				this.hide();
-				return;
-			}
-		},
-		start : function(){
-			this.nextPhoto();
-			this.intervalId = setTimeout(this.start, this.interval);
-		},
-		stop : function(){
-			clearTimeout(this.intervalId);
-			this.intervalId = null;
-		},
-		toggle : function(){
-			this.isPlaying() ? this.stop() : this.start();
-		},
-		isPlaying : function(){
-			return this.intervalId;
-		},
-		nextPhoto : function(){
-			if(this.wait())
-				return;
-			
-			if(this.pointer==this.photos.length-1)
-				this.pointer=-1;
-			this.changePhoto(this.photos[++this.pointer]);
-		},
-		previousPhoto : function(){
-			if(this.wait())
-				return;
-			
-			if(this.pointer==0)
-				this.pointer=this.photos.length;
-			this.changePhoto(this.photos[--this.pointer]);
-		},
-		changePhoto : function(photo){
-			this.elmPhoto.src = createURI(photo.getFile(500)).spec;
-		},
-		changeInterval : function(up){
-			if(up){
-				this.interval = Math.min(this.interval * 1.03, 3000);
-			} else {
-				this.interval = Math.max(this.interval / 1.03, 50);
-			}
-			this.elmMeter.style.width = 100 * (1-((this.interval-50)/2950)) + '%';
-			
-			appear(this.elmMeter, {
-				duration : 0, 
-				queue : {
-					position: 'break', 
-					scope : 'interval'}});
-			fade(this.elmMeter, {
-				delay : 0.5,
-				duration : 0.5, 
-				queue : {
-					position: 'break', 
-					scope : 'interval'}})
-		},
-		wait : function(){
-			if(!this.isPlaying())
-				return false;
-			
-			var caller = arguments.callee.caller; 
-			var now = (new Date()).getTime();
-			if(caller.lastCall &amp;&amp; (caller.lastCall+this.interval)&gt;now)
-				return true;
-			
-			caller.lastCall = now;
-			return false;
-		},
-	}
-	
-	
-	// ---- [Main] ------------------------------------------------------
-	var params = parseQueryString(location.search);
-	
-	var control = SlidePanel($('control'));
-	if(params.query){
-		control.hide();
-	} else if(!params.user){
-		control.show();
-	}
-	QueryForm($x('id(&quot;control&quot;)//form'), params);
-	
-	new StroboPanel($('photo'), $('meter'), params);
-&lt;/script&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/30_Tombloo.Service.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/40_ui.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+body{
+	background-color : #000;
+	margin : 0;
+	padding : 0;
+	overflow : hidden;
+}
+body *{
+	-moz-user-select: none;
+}
+
+#control{
+	position : fixed;
+	background-color : #333;
+	left : 0;
+	right : 0;
+	padding : 1em 1.5em;
+	font-size : 80%;
+}
+#control *{
+	vertical-align : middle;
+	font-weight : bold;
+}
+#control.hidden{
+	height : 15px;
+	padding : 0;
+}
+#control.hidden *{
+	display : none !important;
+}
+#control form{
+	display : inline;
+}
+#control label{
+	color : white;
+}
+#control input, 
+#control select {
+	margin-right : 2em;
+}
+
+#pagebar{
+	cursor : pointer;
+	vertical-align : middle;
+	float : right;
+	border-collapse : collapse;
+	background-color : white;
+	color : white;
+}
+#pagebar td{
+	padding : 0 0.3em;
+	text-align : center;
+}
+#pagebar td.current{
+	cursor : default;
+	color : #fff;
+	background-color : #333;
+}
+
+#pagebar td.pagination{
+	color : #333;
+	border : solid #333;
+	border-width : 0 0.2em;
+}
+#pagebar td:hover{
+	color : white;
+	background-color : #333;
+}
+
+
+#strobo{
+	padding-top : 60px;
+	text-align : center;
+}
+
+#strobo #photo{
+	display : none;
+}
+
+
+#strobo #interval{
+	display : block;
+	
+	position:absolute;
+	top : 0pt;
+	left : 50%;
+	height : 15px;
+	margin-left : -250px;
+	margin-top : 30px;
+	width : 500px;
+}
+
+#strobo #meter{
+	background-color : white;
+	
+	position : relative;
+	height : 15px;
+}
+
+#magnify{
+	position : absolute;
+	display : none;
+	top : 0;
+	left : 0;
+	border : 10px solid black;
+	z-index : 100;
+}
+
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+	&lt;div id=&quot;control&quot; class=&quot;hidden&quot;&gt;
+		&lt;form method=&quot;get&quot;&gt;
+			&lt;label&gt;USER
+				&lt;select name=&quot;user&quot;&gt;
+					&lt;option value=&quot;&quot;&gt;&lt;/option&gt;
+				&lt;/select&gt;
+			&lt;/label&gt;
+			&lt;label&gt;RANDOM
+				&lt;input name=&quot;random&quot; type=&quot;checkbox&quot; /&gt;
+			&lt;/label&gt;
+			&lt;input type=&quot;hidden&quot; name=&quot;offset&quot; value=&quot;0&quot; /&gt;
+		&lt;/form&gt;
+	&lt;/div&gt;
+	&lt;div id=&quot;strobo&quot;&gt;
+		&lt;img id=&quot;photo&quot; /&gt;
+		&lt;span id=&quot;interval&quot;&gt;&lt;span id=&quot;meter&quot; &gt;&lt;/span&gt;&lt;/span&gt;
+	&lt;/div&gt;
+&lt;/body&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+	const PER = 1000;
+	
+	
+	// ---- [Application] ------------------------------------------------
+	function StroboPanel(elmPhoto, elmMeter, params){
+		if(!params.user &amp;&amp; !params.query)
+			return;
+		
+		this.loaded = [];
+		this.elmMeter = elmMeter;
+		this.elmPhoto = elmPhoto;
+		this.nextPhoto = bind('nextPhoto', this);
+		this.start = bind('start', this);
+		
+		if(params.user){
+			this.photos = Tombloo.Photo.findByUser({
+				user : params.user, 
+				limit : (params.limit || PER), 
+				offset : (params.offset || 0), 
+				order : (params.random? 'random()' : 'date DESC')});
+		} else {
+			this.photos = Tombloo.Photo.find(params.query, params.args);
+		}
+		this.photos = this.photos.filter(function(photo){
+			var file = photo.getFile(500);
+			return file &amp;&amp; file.exists() &amp;&amp; file.fileSizeOfLink &gt; 300;
+		});
+		
+		this.nextPhoto();
+		this.show();
+	}
+	
+	StroboPanel.prototype = {
+		photos : null,
+		pointer : 0,
+		elmPhoto : null,
+		interval : 1000,
+		
+		show : function(){
+			connect(document, 'onkeydown', this, 'onKeyDown');
+			this.elmPhoto.style.display = 'inline';
+		},
+		onKeyDown : function(evt){
+			switch(evt.keyString()){
+			case 'ARROW_RIGHT':
+				evt.stop();
+				if(this.isPlaying())
+					return this.changeInterval(false);
+				
+				this.nextPhoto();
+				return;
+				
+			case 'ARROW_LEFT':
+				evt.stop();
+				if(this.isPlaying())
+					return this.changeInterval(true);
+				
+				this.previousPhoto();
+				return;
+				
+			case 'ARROW_UP':
+			case 'ENTER':
+				evt.stop();
+				if(this.isPlaying()){
+					this.stop();
+					return;
+				}
+				
+				addTab(this.photos[this.pointer].url);
+				return;
+				
+			case 'ARROW_DOWN':
+				evt.stop();
+				this.toggle();
+				return;
+				
+			case 'ESC':
+				evt.stop();
+				this.hide();
+				return;
+			}
+		},
+		start : function(){
+			this.nextPhoto();
+			this.intervalId = setTimeout(this.start, this.interval);
+		},
+		stop : function(){
+			clearTimeout(this.intervalId);
+			this.intervalId = null;
+		},
+		toggle : function(){
+			this.isPlaying() ? this.stop() : this.start();
+		},
+		isPlaying : function(){
+			return this.intervalId;
+		},
+		nextPhoto : function(){
+			if(this.wait())
+				return;
+			
+			if(this.pointer==this.photos.length-1)
+				this.pointer=-1;
+			this.changePhoto(this.photos[++this.pointer]);
+		},
+		previousPhoto : function(){
+			if(this.wait())
+				return;
+			
+			if(this.pointer==0)
+				this.pointer=this.photos.length;
+			this.changePhoto(this.photos[--this.pointer]);
+		},
+		changePhoto : function(photo){
+			this.elmPhoto.src = createURI(photo.getFile(500)).spec;
+		},
+		changeInterval : function(up){
+			if(up){
+				this.interval = Math.min(this.interval * 1.03, 3000);
+			} else {
+				this.interval = Math.max(this.interval / 1.03, 50);
+			}
+			this.elmMeter.style.width = 100 * (1-((this.interval-50)/2950)) + '%';
+			
+			appear(this.elmMeter, {
+				duration : 0, 
+				queue : {
+					position: 'break', 
+					scope : 'interval'}});
+			fade(this.elmMeter, {
+				delay : 0.5,
+				duration : 0.5, 
+				queue : {
+					position: 'break', 
+					scope : 'interval'}})
+		},
+		wait : function(){
+			if(!this.isPlaying())
+				return false;
+			
+			var caller = arguments.callee.caller; 
+			var now = (new Date()).getTime();
+			if(caller.lastCall &amp;&amp; (caller.lastCall+this.interval)&gt;now)
+				return true;
+			
+			caller.lastCall = now;
+			return false;
+		},
+	}
+	
+	
+	// ---- [Main] ------------------------------------------------------
+	var params = parseQueryString(location.search);
+	
+	var control = SlidePanel($('control'));
+	if(params.query){
+		control.hide();
+	} else if(!params.user){
+		control.show();
+	}
+	QueryForm($x('id(&quot;control&quot;)//form'), params);
+	
+	new StroboPanel($('photo'), $('meter'), params);
+&lt;/script&gt;
+&lt;/html&gt;</diff>
      <filename>xpi/chrome/content/library/Strobo.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,37 +1,37 @@
-textbox {
-	-moz-binding: url(&quot;chrome://tombloo/content/library/completion.xml#textbox&quot;);
-}
-
-textbox *|input {
-  ime-mode: inactive !important;
-}
-
-popup {
-	-moz-binding: url(&quot;chrome://tombloo/content/library/completion.xml#popup&quot;);
-	padding: 0;
-	
-	border: 1px solid ThreeDShadow;
-	-moz-border-top-colors: ThreeDShadow;
-	-moz-border-right-colors: ThreeDShadow;
-	-moz-border-bottom-colors: ThreeDShadow;
-	-moz-border-left-colors: ThreeDShadow;
-}
-
-listbox {
-	-moz-binding: url(&quot;chrome://tombloo/content/library/completion.xml#listbox&quot;);
-	-moz-appearance: none !important;
-	border: none !important;
-	margin: 0;
-	width : auto !important;
-}
-
-listitem {
-	-moz-binding: url(&quot;chrome://tombloo/content/library/completion.xml#listitem&quot;);
-	outline: none !important;
-	padding-right : 4px;
-}
-
-listitem[selected=&quot;true&quot;] {
-	background-color: Highlight;
-	color: HighlightText;
-}
+textbox {
+	-moz-binding: url(&quot;chrome://tombloo/content/library/completion.xml#textbox&quot;);
+}
+
+textbox *|input {
+  ime-mode: inactive !important;
+}
+
+popup {
+	-moz-binding: url(&quot;chrome://tombloo/content/library/completion.xml#popup&quot;);
+	padding: 0;
+	
+	border: 1px solid ThreeDShadow;
+	-moz-border-top-colors: ThreeDShadow;
+	-moz-border-right-colors: ThreeDShadow;
+	-moz-border-bottom-colors: ThreeDShadow;
+	-moz-border-left-colors: ThreeDShadow;
+}
+
+listbox {
+	-moz-binding: url(&quot;chrome://tombloo/content/library/completion.xml#listbox&quot;);
+	-moz-appearance: none !important;
+	border: none !important;
+	margin: 0;
+	width : auto !important;
+}
+
+listitem {
+	-moz-binding: url(&quot;chrome://tombloo/content/library/completion.xml#listitem&quot;);
+	outline: none !important;
+	padding-right : 4px;
+}
+
+listitem[selected=&quot;true&quot;] {
+	background-color: Highlight;
+	color: HighlightText;
+}</diff>
      <filename>xpi/chrome/content/library/completion.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,537 +1,537 @@
-&lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;bindings id=&quot;tombloo-completion-bindings&quot;
-	xmlns=&quot;http://www.mozilla.org/xbl&quot; 
-	xmlns:html=&quot;http://www.w3.org/1999/xhtml&quot;
-	xmlns:xbl=&quot;http://www.mozilla.org/xbl&quot; 
-	xmlns:xul=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;&gt;
-	
-	
-	&lt;binding id=&quot;container&quot;&gt;
-		&lt;resources&gt;
-			&lt;stylesheet src=&quot;chrome://tombloo/content/library/completion.css&quot;/&gt;
-		&lt;/resources&gt;
-		
-		&lt;content&gt;
-			&lt;xul:textbox anonid=&quot;textbox&quot; xbl:inherits=&quot;tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,userAction,flex&quot;/&gt;
-			&lt;xul:popup anonid=&quot;popup&quot; ignorekeys=&quot;true&quot;&gt;
-				&lt;xul:listbox anonid=&quot;listbox&quot; style=&quot;height:auto&quot;/&gt;
-			&lt;/xul:popup&gt;
-			&lt;xul:box&gt;
-				&lt;xul:label anonid=&quot;measure&quot; hidden=&quot;true&quot;/&gt;
-			&lt;/xul:box&gt;
-		&lt;/content&gt;
-		
-		&lt;implementation&gt;
-			&lt;constructor&gt;&lt;![CDATA[
-			function _log(msg){
-				Components.classes['@mozilla.org/consoleservice;1'].getService(Components.interfaces.nsIConsoleService).logStringMessage(''+msg);
-			}
-			]]&gt;&lt;/constructor&gt;
-			
-			&lt;field name=&quot;textbox&quot;&gt;
-				document.getAnonymousElementByAttribute(this, 'anonid', 'textbox');
-			&lt;/field&gt;
-			
-			&lt;property name=&quot;value&quot;
-				onset=&quot;return this.textbox.value = val;&quot;
-				onget=&quot;return this.textbox.value;&quot;/&gt;
-			&lt;property name=&quot;values&quot;
-				onget=&quot;return this.textbox.values;&quot;/&gt;
-			&lt;property name=&quot;candidates&quot;
-				onset=&quot;return this.textbox.candidates = val;&quot;/&gt;
-			&lt;property name=&quot;autoComplete&quot;
-				onget=&quot;return this.textbox.autoComplete;&quot;
-				onset=&quot;return this.textbox.autoComplete = val;&quot;/&gt;
-			&lt;property name=&quot;includesNewTag&quot;
-				onget=&quot;return this.textbox.includesNewTag;&quot;/&gt;
-			
-			&lt;method name=&quot;focus&quot;&gt;
-				&lt;body&gt;&lt;![CDATA[
-					this.textbox.focus();
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-		&lt;/implementation&gt;
-	&lt;/binding&gt;
-	
-	
-	&lt;binding id=&quot;textbox&quot; extends=&quot;chrome://global/content/bindings/textbox.xml#textbox&quot;&gt;
-		&lt;implementation&gt;
-			&lt;field name=&quot;delay&quot;&gt;
-				230;
-			&lt;/field&gt;
-			&lt;field name=&quot;delimiter&quot;&gt;
-				' ';
-			&lt;/field&gt;
-			&lt;field name=&quot;container&quot;&gt;
-				this.parentNode;
-			&lt;/field&gt;
-			&lt;field name=&quot;popup&quot;&gt;
-				document.getAnonymousElementByAttribute(this.container, 'anonid', 'popup');
-			&lt;/field&gt;
-			&lt;field name=&quot;listbox&quot;&gt;
-				document.getAnonymousElementByAttribute(this.container, 'anonid', 'listbox');
-			&lt;/field&gt;
-			&lt;field name=&quot;measure&quot;&gt;
-				document.getAnonymousElementByAttribute(this.container, 'anonid', 'measure');
-			&lt;/field&gt;
-			&lt;field name=&quot;input&quot;&gt;
-				document.getAnonymousElementByAttribute(this, 'anonid', 'input')
-					.QueryInterface(Components.interfaces.nsIDOMNSEditableElement);
-			&lt;/field&gt;
-			&lt;field name=&quot;autoComplete&quot;&gt;
-				false;
-			&lt;/field&gt;
-			&lt;property name=&quot;values&quot;
-				onget=&quot;return this.value.split(this.delimiter).filter(function(i){return i});&quot;/&gt;
-			&lt;property name=&quot;includesNewTag&quot;&gt;
-				&lt;getter&gt;&lt;![CDATA[
-					var check = {};
-					this.values.forEach(function(val){
-						check[val] = true;
-					});
-					
-					this.candidates.forEach(function(cand){
-						delete check[cand.value];
-					});
-					
-					for(var k in check)
-						return true;
-					
-					return false;
-				]]&gt;&lt;/getter&gt;
-			&lt;/property&gt;
-			
-			&lt;method name=&quot;notify&quot;&gt;
-				&lt;body&gt;&lt;![CDATA[
-					function tween(func, span, count, callback){
-						count = (count || 20);
-						var interval = span / count;
-						var value = 0;
-						var calls = 0;
-						var intervalId = setInterval(function(){
-							func(calls / count);
-							
-							if(count == calls){
-								canceler();
-								return;
-							}
-							calls++;
-						}, interval);
-						var canceler = function(){
-							callback &amp;&amp; callback();
-							callback = null;
-							clearInterval(intervalId)
-						}
-						
-						return canceler;
-					}
-					
-					function toHexString(c){
-						return  '' + 
-							toColorPart(255 * c.r) +
-							toColorPart(255 * c.g) +
-							toColorPart(255 * c.b);
-					}
-					
-					function toColorPart(num) {
-						num = Math.round(num);
-						var res = num.toString(16);
-						if (num &lt; 16)
-							return '0' + res;
-						
-						return res;
-					}
-					
-					function hsvToRGB(h, s, v) {
-						var r, g, b;
-						if (s === 0) {
-							r = g = b = v;
-						} else {
-							var i = Math.floor(h * 6);
-							var f = (h * 6) - i;
-							var p = v * (1 - s);
-							var q = v * (1 - (s * f));
-							var t = v * (1 - (s * (1 - f)));
-							switch (i) {
-								case 1: r = q; g = v; b = p; break;
-								case 2: r = p; g = v; b = t; break;
-								case 3: r = p; g = q; b = v; break;
-								case 4: r = t; g = p; b = v; break;
-								case 5: r = v; g = p; b = q; break;
-								case 6: // fall through
-								case 0: r = v; g = t; b = p; break;
-							}
-						}
-						return {r: r, g: g, b: b,};
-					}
-					
-					function hslToRGB(h, s, l){
-						var r, g, b;
-						if (s === 0) {
-							r = g = b = l;
-						} else {
-							var m2;
-							if (l &lt;= 0.5) {
-								m2 = l * (1.0 + s);
-							} else {
-								m2 = l + s - (l * s);
-							}
-							var m1 = (2.0 * l) - m2;
-							var hsl = function(n1, n2, h){
-								if (h &gt; 6.0){
-									h -= 6.0;
-								} else if (h &lt; 0.0){
-									h += 6.0;
-								}
-								
-								var val;
-								if (h &lt; 1.0) {
-									val = n1 + (n2 - n1) * h;
-								} else if (h &lt; 3.0) {
-									val = n2;
-								} else if (h &lt; 4.0) {
-									val = n1 + (n2 - n1) * (4.0 - h);
-								} else {
-									val = n1;
-								}
-								return val;
-							};
-							
-							var h6 = h * 6.0;
-							r = hsl(m1, m2, h6 + 2);
-							g = hsl(m1, m2, h6);
-							b = hsl(m1, m2, h6 - 2);
-						}
-						return {r: r, g: g, b: b,};
-					}
-					
-					var self = this;
-					return (this.notify = function(){
-						// &#35492;&#20837;&#21147;&#12434;&#38450;&#27490;&#12377;&#12427;&#12383;&#12417;&#12289;&#12479;&#12464;&#27770;&#23450;&#24460;&#19968;&#23450;&#26178;&#38291;&#12461;&#12540;&#20837;&#21147;&#12434;&#21463;&#12369;&#12388;&#12369;&#12394;&#12356;
-						self.sleeping = true;
-						self.canceler &amp;&amp; self.canceler();
-						self.canceler = tween(function(ratio){
-							// #ccf0ff
-							self.input.style.backgroundColor = '#' + toHexString(hslToRGB(0.55, 1, 0.9 + (0.1*ratio)));
-						}, self.delay, 10, function(){
-							self.sleeping = false;
-						});
-					})();
-					
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-			
-			&lt;method name=&quot;injectCandidate&quot;&gt;
-				&lt;parameter name=&quot;cand&quot;/&gt;
-				&lt;parameter name=&quot;terminate&quot;/&gt;
-				&lt;body&gt;&lt;![CDATA[
-					var text = this.value;
-					var word = this.getCurrentWord();
-					
-					var suffix = text.substr(word.end);
-					var delimiter = (terminate &amp;&amp; suffix.charAt(0) != this.delimiter) ? this.delimiter : '';
-					this.value = text.substring(0, word.start) + cand + delimiter + suffix;
-					this.selectionStart = this.selectionEnd = word.start + cand.length + delimiter.length;
-					
-					if(terminate)
-						this.notify();
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-			
-			&lt;method name=&quot;getCurrentWord&quot;&gt;
-				&lt;body&gt;&lt;![CDATA[
-					var text = this.value;
-					var caret = this.selectionStart;
-					var start = text.lastIndexOf(this.delimiter, caret - 1) + 1;
-					var end = text.indexOf(this.delimiter, caret);
-					if(end == -1)
-						end = text.length;
-					
-					return {
-						start : start,
-						end : end,
-						word : text.slice(start, end),
-					};
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-			
-			&lt;method name=&quot;getCandidates&quot;&gt;
-				&lt;parameter name=&quot;hint&quot;/&gt;
-				&lt;parameter name=&quot;used&quot;/&gt;
-				&lt;body&gt;&lt;![CDATA[
-					var cands = [];
-					var reStrict = new RegExp('^' + hint, 'i');
-					var reLoose = new RegExp('^' + hint.split('').join('.*'), 'i');
-					
-					this.candidates.forEach(function(cand){
-						if(reStrict.test(cand.reading))
-							cands.push(cand.value);
-					});
-					
-					if(!cands.length)
-						this.candidates.forEach(function(cand){
-							if(reLoose.test(cand.reading))
-								cands.push(cand.value);
-						});
-					
-					return cands.filter(function(cand){
-						return !used.some(function(u){return u==cand})
-					});
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-			
-			&lt;method name=&quot;complete&quot;&gt;
-				&lt;parameter name=&quot;denyEmpty&quot;/&gt;
-				&lt;body&gt;&lt;![CDATA[
-					var text = this.value;
-					var word = this.getCurrentWord();
-					var hint = word.word;
-					
-					if(!hint &amp;&amp; denyEmpty){
-						this.popup.hidePopup();
-						return;
-					}
-					
-					var cands = this.getCandidates(hint, text.substring(0, word.start).split(this.delimiter));
-					if(this.autoComplete &amp;&amp; cands.length==1 &amp;&amp; (hint.length &gt;=2 || cands[0].length == 1)){
-						if(!this.deleting)
-							this.injectCandidate(cands[0], true);
-						this.popup.hidePopup();
-						return;
-					}
-					
-					if(cands.length){
-						this.measure.value = text.substr(0, word.start);
-						this.measure.hidden = false;
-						var x = this.measure.boxObject.width;
-						this.measure.hidden = true;
-						
-						this.popup.show(this, x, -2, cands);
-					} else {
-						this.popup.hidePopup();
-					}
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-		&lt;/implementation&gt;
-		
-		&lt;handlers&gt;
-			&lt;handler event=&quot;input&quot; action=&quot;this.complete(true)&quot; /&gt;
-			&lt;handler event=&quot;keyup&quot;&gt;&lt;![CDATA[
-				switch (event.keyCode) {
-					case KeyEvent.DOM_VK_DELETE:
-					case KeyEvent.DOM_VK_BACK_SPACE:
-						this.deleting = false;
-						return;
-				}
-			]]&gt;&lt;/handler&gt;
-			&lt;handler event=&quot;keydown&quot;&gt;&lt;![CDATA[
-				switch (event.keyCode) {
-					case KeyEvent.DOM_VK_DELETE:
-					case KeyEvent.DOM_VK_BACK_SPACE:
-						this.deleting = true;
-						return;
-				}
-			]]&gt;&lt;/handler&gt;
-			&lt;handler event=&quot;keypress&quot;&gt;&lt;![CDATA[
-				// &#12501;&#12457;&#12540;&#12459;&#12473;&#31227;&#21205;&#12399;&#20309;&#12418;&#20966;&#29702;&#12434;&#34892;&#12431;&#12394;&#12356;/&#36974;&#12425;&#12394;&#12356;
-				if(event.keyCode==KeyEvent.DOM_VK_TAB &amp;&amp; !this.popup.visible)
-					return;
-				
-				if(this.sleeping){
-					event.preventDefault();
-					return;
-				}
-				
-				switch (event.keyCode) {
-					case KeyEvent.DOM_VK_TAB:
-					case KeyEvent.DOM_VK_DOWN:
-						event.preventDefault();
-						
-						if(!this.popup.visible)
-							this.complete();
-						
-						if(this.listbox.rowCount==1){
-							this.listbox.enter(true)
-						} else {
-							this.listbox.moveCursor(1);
-						}
-						return;
-						
-					case KeyEvent.DOM_VK_UP:
-						event.preventDefault();
-						this.listbox.moveCursor(-1);
-						return;
-						
-					case KeyEvent.DOM_VK_RETURN:
-						if(this.popup.visible){
-							this.listbox.enter(true)
-						} else {
-							// FIXME
-						}
-						return;
-						
-					case KeyEvent.DOM_VK_ESCAPE:
-						// FIXME &#20837;&#21147;&#36884;&#20013;&#12398;&#20505;&#35036;&#12434;&#12463;&#12522;&#12450;
-						this.popup.hidePopup();
-						return;
-				}
-			]]&gt;&lt;/handler&gt;
-		&lt;/handlers&gt;
-	&lt;/binding&gt;
-	
-	
-	&lt;binding id=&quot;popup&quot; extends=&quot;chrome://global/content/bindings/popup.xml#popup&quot;&gt;
-		&lt;implementation&gt;
-			&lt;field name=&quot;container&quot;&gt;
-				this.parentNode;
-			&lt;/field&gt;
-			&lt;field name=&quot;listbox&quot;&gt;
-				document.getAnonymousElementByAttribute(this.container, 'anonid', 'listbox');
-			&lt;/field&gt;
-			&lt;field name=&quot;textbox&quot;&gt;
-				document.getAnonymousElementByAttribute(this.container, 'anonid', 'textbox');
-			&lt;/field&gt;
-			
-			&lt;property name=&quot;visible&quot;
-				onget=&quot;return this.state? (this.state != 'closed') : (!!this.boxObject.height);&quot; /&gt;
-			
-			&lt;method name=&quot;show&quot;&gt;
-				&lt;parameter name=&quot;anchor&quot;/&gt;
-				&lt;parameter name=&quot;x&quot;/&gt;
-				&lt;parameter name=&quot;y&quot;/&gt;
-				&lt;parameter name=&quot;cands&quot;/&gt;
-				&lt;body&gt;&lt;![CDATA[
-					if(this.openPopup){
-						this.openPopup(anchor, 'after_start', x, y, false);
-					} else {
-						anchor = anchor.boxObject;
-						
-						// &#12509;&#12483;&#12503;&#12450;&#12483;&#12503;&#20301;&#32622;&#12398;&#22522;&#28857;&#12434;&#35373;&#23450;&#12377;&#12427;
-						var doc = this.ownerDocument;
-						doc.popupNode = doc.documentElement;
-						this.showPopup(doc.documentElement, anchor.x + x, anchor.y + anchor.height + y, 'popup');
-					}
-					
-					if(cands){
-						this.listbox.removeAll();
-						this.listbox.appendItems(cands);
-					}
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-		&lt;/implementation&gt;
-		
-		&lt;handlers&gt;
-			&lt;handler event=&quot;blur&quot; action=&quot;this.hidePopup()&quot; /&gt;
-		&lt;/handlers&gt;
-	&lt;/binding&gt;
-	
-	
-	&lt;binding id=&quot;listbox&quot; extends=&quot;chrome://global/content/bindings/listbox.xml#listbox&quot;&gt;
-		&lt;implementation&gt;
-			&lt;field name=&quot;container&quot;&gt;
-				this.parentNode.parentNode;
-			&lt;/field&gt;
-			&lt;field name=&quot;popup&quot;&gt;
-				document.getAnonymousElementByAttribute(this.container, 'anonid', 'popup');
-			&lt;/field&gt;
-			&lt;field name=&quot;textbox&quot;&gt;
-				document.getAnonymousElementByAttribute(this.container, 'anonid', 'textbox');
-			&lt;/field&gt;
-			
-			&lt;field name=&quot;maxRows&quot;&gt;
-				20
-			&lt;/field&gt;
-			&lt;field name=&quot;rowCount&quot; /&gt;
-			
-			&lt;property name=&quot;rowHeight&quot;
-				onget=&quot;return this._rowHeight || (this._rowHeight = this.childNodes[0].boxObject.height)&quot; /&gt;
-			
-			&lt;method name=&quot;removeAll&quot;&gt;
-				&lt;body&gt;&lt;![CDATA[
-					while(this.lastChild)
-						this.removeChild(this.lastChild);
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-			&lt;method name=&quot;appendItems&quot;&gt;
-				&lt;parameter name=&quot;items&quot;/&gt;
-				&lt;body&gt;&lt;![CDATA[
-					for(var i=0 ; i&lt;items.length; i++)
-						this.appendItem(items[i]);
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-			&lt;method name=&quot;adjustSize&quot;&gt;
-				&lt;body&gt;&lt;![CDATA[
-					if(!this.rowHeight){
-						this.rows = Math.min(this.rowCount, this.maxRows);
-					} else {
-						// rows&#12398;&#22793;&#26356;&#12420;height:auto&#12384;&#12369;&#12391;&#12399;&#20313;&#30333;&#12364;&#29983;&#12376;&#12427;&#12371;&#12392;&#12364;&#12354;&#12427;&#12383;&#12417;&#25163;&#21205;&#12391;&#39640;&#12373;&#12434;&#35336;&#31639;&#12377;&#12427;
-						this.height = Math.min(this.rowCount, this.maxRows) * this.rowHeight;
-					}
-					
-					if(this.rowCount == 1){
-						this.style.backgroundColor = '#ccf0ff';
-					} else {
-						this.style.backgroundColor = '#ffffff';
-					}
-					
-					// &#12473;&#12463;&#12525;&#12540;&#12523;&#12496;&#12540;&#12364;&#34920;&#31034;&#12373;&#12428;&#12427;&#12392;&#20999;&#12428;&#12427;&#12383;&#12417;&#25163;&#21205;&#12391;&#24133;&#12434;&#35336;&#31639;&#12377;&#12427;
-					if(this.rowCount &gt; this.maxRows){
-						this.width = null;
-						this.width = this.boxObject.width + 20;
-					} else {
-						this.width = null;
-					}
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-			
-			&lt;method name=&quot;moveCursor&quot;&gt;
-				&lt;parameter name=&quot;offset&quot;/&gt;
-				&lt;body&gt;&lt;![CDATA[
-					var index = this.selectedIndex + offset;
-					index = 
-						index &gt;= this.rowCount ? 0 : 
-						index &lt; 0 ? (this.rowCount - 1) : 
-						index;
-					
-					// &#12522;&#12473;&#12488;&#12508;&#12483;&#12463;&#12473;&#34920;&#31034;&#30452;&#24460;&#12395;&#12459;&#12540;&#12477;&#12523;&#12434;&#21205;&#12363;&#12377;&#12392;&#34920;&#31034;&#12373;&#12428;&#12394;&#12356;&#26178;&#12364;&#12354;&#12427;&#12383;&#12417;&#20877;&#25551;&#30011;&#12434;&#20419;&#12377;
-					if(index==0)
-						this.boxObject.height;
-					
-					this.selectedIndex = index;
-					this.ensureIndexIsVisible(index);
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-			&lt;method name=&quot;enter&quot;&gt;
-				&lt;parameter name=&quot;terminate&quot;/&gt;
-				&lt;body&gt;&lt;![CDATA[
-					var item = this.selectedItem || (this.rowCount==1 &amp;&amp; this.firstChild);
-					if(!item)
-						return;
-					
-					this.textbox.injectCandidate(item.getAttribute('label'), terminate);
-					
-					if(terminate){
-						this.popup.hidePopup();
-						// this.textbox.focus();
-					}
-				]]&gt;&lt;/body&gt;
-			&lt;/method&gt;
-		&lt;/implementation&gt;
-		
-		&lt;handlers&gt;
-			&lt;handler event=&quot;select&quot; action=&quot;this.enter()&quot; /&gt;
-			&lt;handler event=&quot;DOMNodeInserted&quot;&gt;&lt;![CDATA[
-				// getRowCount&#12513;&#12477;&#12483;&#12489;&#12399;&#19981;&#27491;&#30906;&#12394;&#22580;&#21512;&#12364;&#12354;&#12427;&#12383;&#12417;&#23376;&#35201;&#32032;&#12434;&#21462;&#24471;&#12375;&#12461;&#12515;&#12483;&#12471;&#12517;&#12377;&#12427;
-				this.rowCount = this.getElementsByTagName('listitem').length;
-				
-				this.adjustSize();
-			]]&gt;&lt;/handler&gt;
-		&lt;/handlers&gt;
-	&lt;/binding&gt;
-	
-	&lt;binding id=&quot;listitem&quot; extends=&quot;chrome://global/content/bindings/listbox.xml#listitem&quot;&gt;
-		&lt;handlers&gt;
-			&lt;handler event=&quot;click&quot; action=&quot;this.control.enter(true)&quot; /&gt;
-		&lt;/handlers&gt;
-	&lt;/binding&gt;
-&lt;/bindings&gt;
+&lt;?xml version=&quot;1.0&quot;?&gt;
+&lt;bindings id=&quot;tombloo-completion-bindings&quot;
+	xmlns=&quot;http://www.mozilla.org/xbl&quot; 
+	xmlns:html=&quot;http://www.w3.org/1999/xhtml&quot;
+	xmlns:xbl=&quot;http://www.mozilla.org/xbl&quot; 
+	xmlns:xul=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;&gt;
+	
+	
+	&lt;binding id=&quot;container&quot;&gt;
+		&lt;resources&gt;
+			&lt;stylesheet src=&quot;chrome://tombloo/content/library/completion.css&quot;/&gt;
+		&lt;/resources&gt;
+		
+		&lt;content&gt;
+			&lt;xul:textbox anonid=&quot;textbox&quot; xbl:inherits=&quot;tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,userAction,flex&quot;/&gt;
+			&lt;xul:popup anonid=&quot;popup&quot; ignorekeys=&quot;true&quot;&gt;
+				&lt;xul:listbox anonid=&quot;listbox&quot; style=&quot;height:auto&quot;/&gt;
+			&lt;/xul:popup&gt;
+			&lt;xul:box&gt;
+				&lt;xul:label anonid=&quot;measure&quot; hidden=&quot;true&quot;/&gt;
+			&lt;/xul:box&gt;
+		&lt;/content&gt;
+		
+		&lt;implementation&gt;
+			&lt;constructor&gt;&lt;![CDATA[
+			function _log(msg){
+				Components.classes['@mozilla.org/consoleservice;1'].getService(Components.interfaces.nsIConsoleService).logStringMessage(''+msg);
+			}
+			]]&gt;&lt;/constructor&gt;
+			
+			&lt;field name=&quot;textbox&quot;&gt;
+				document.getAnonymousElementByAttribute(this, 'anonid', 'textbox');
+			&lt;/field&gt;
+			
+			&lt;property name=&quot;value&quot;
+				onset=&quot;return this.textbox.value = val;&quot;
+				onget=&quot;return this.textbox.value;&quot;/&gt;
+			&lt;property name=&quot;values&quot;
+				onget=&quot;return this.textbox.values;&quot;/&gt;
+			&lt;property name=&quot;candidates&quot;
+				onset=&quot;return this.textbox.candidates = val;&quot;/&gt;
+			&lt;property name=&quot;autoComplete&quot;
+				onget=&quot;return this.textbox.autoComplete;&quot;
+				onset=&quot;return this.textbox.autoComplete = val;&quot;/&gt;
+			&lt;property name=&quot;includesNewTag&quot;
+				onget=&quot;return this.textbox.includesNewTag;&quot;/&gt;
+			
+			&lt;method name=&quot;focus&quot;&gt;
+				&lt;body&gt;&lt;![CDATA[
+					this.textbox.focus();
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+		&lt;/implementation&gt;
+	&lt;/binding&gt;
+	
+	
+	&lt;binding id=&quot;textbox&quot; extends=&quot;chrome://global/content/bindings/textbox.xml#textbox&quot;&gt;
+		&lt;implementation&gt;
+			&lt;field name=&quot;delay&quot;&gt;
+				230;
+			&lt;/field&gt;
+			&lt;field name=&quot;delimiter&quot;&gt;
+				' ';
+			&lt;/field&gt;
+			&lt;field name=&quot;container&quot;&gt;
+				this.parentNode;
+			&lt;/field&gt;
+			&lt;field name=&quot;popup&quot;&gt;
+				document.getAnonymousElementByAttribute(this.container, 'anonid', 'popup');
+			&lt;/field&gt;
+			&lt;field name=&quot;listbox&quot;&gt;
+				document.getAnonymousElementByAttribute(this.container, 'anonid', 'listbox');
+			&lt;/field&gt;
+			&lt;field name=&quot;measure&quot;&gt;
+				document.getAnonymousElementByAttribute(this.container, 'anonid', 'measure');
+			&lt;/field&gt;
+			&lt;field name=&quot;input&quot;&gt;
+				document.getAnonymousElementByAttribute(this, 'anonid', 'input')
+					.QueryInterface(Components.interfaces.nsIDOMNSEditableElement);
+			&lt;/field&gt;
+			&lt;field name=&quot;autoComplete&quot;&gt;
+				false;
+			&lt;/field&gt;
+			&lt;property name=&quot;values&quot;
+				onget=&quot;return this.value.split(this.delimiter).filter(function(i){return i});&quot;/&gt;
+			&lt;property name=&quot;includesNewTag&quot;&gt;
+				&lt;getter&gt;&lt;![CDATA[
+					var check = {};
+					this.values.forEach(function(val){
+						check[val] = true;
+					});
+					
+					this.candidates.forEach(function(cand){
+						delete check[cand.value];
+					});
+					
+					for(var k in check)
+						return true;
+					
+					return false;
+				]]&gt;&lt;/getter&gt;
+			&lt;/property&gt;
+			
+			&lt;method name=&quot;notify&quot;&gt;
+				&lt;body&gt;&lt;![CDATA[
+					function tween(func, span, count, callback){
+						count = (count || 20);
+						var interval = span / count;
+						var value = 0;
+						var calls = 0;
+						var intervalId = setInterval(function(){
+							func(calls / count);
+							
+							if(count == calls){
+								canceler();
+								return;
+							}
+							calls++;
+						}, interval);
+						var canceler = function(){
+							callback &amp;&amp; callback();
+							callback = null;
+							clearInterval(intervalId)
+						}
+						
+						return canceler;
+					}
+					
+					function toHexString(c){
+						return  '' + 
+							toColorPart(255 * c.r) +
+							toColorPart(255 * c.g) +
+							toColorPart(255 * c.b);
+					}
+					
+					function toColorPart(num) {
+						num = Math.round(num);
+						var res = num.toString(16);
+						if (num &lt; 16)
+							return '0' + res;
+						
+						return res;
+					}
+					
+					function hsvToRGB(h, s, v) {
+						var r, g, b;
+						if (s === 0) {
+							r = g = b = v;
+						} else {
+							var i = Math.floor(h * 6);
+							var f = (h * 6) - i;
+							var p = v * (1 - s);
+							var q = v * (1 - (s * f));
+							var t = v * (1 - (s * (1 - f)));
+							switch (i) {
+								case 1: r = q; g = v; b = p; break;
+								case 2: r = p; g = v; b = t; break;
+								case 3: r = p; g = q; b = v; break;
+								case 4: r = t; g = p; b = v; break;
+								case 5: r = v; g = p; b = q; break;
+								case 6: // fall through
+								case 0: r = v; g = t; b = p; break;
+							}
+						}
+						return {r: r, g: g, b: b,};
+					}
+					
+					function hslToRGB(h, s, l){
+						var r, g, b;
+						if (s === 0) {
+							r = g = b = l;
+						} else {
+							var m2;
+							if (l &lt;= 0.5) {
+								m2 = l * (1.0 + s);
+							} else {
+								m2 = l + s - (l * s);
+							}
+							var m1 = (2.0 * l) - m2;
+							var hsl = function(n1, n2, h){
+								if (h &gt; 6.0){
+									h -= 6.0;
+								} else if (h &lt; 0.0){
+									h += 6.0;
+								}
+								
+								var val;
+								if (h &lt; 1.0) {
+									val = n1 + (n2 - n1) * h;
+								} else if (h &lt; 3.0) {
+									val = n2;
+								} else if (h &lt; 4.0) {
+									val = n1 + (n2 - n1) * (4.0 - h);
+								} else {
+									val = n1;
+								}
+								return val;
+							};
+							
+							var h6 = h * 6.0;
+							r = hsl(m1, m2, h6 + 2);
+							g = hsl(m1, m2, h6);
+							b = hsl(m1, m2, h6 - 2);
+						}
+						return {r: r, g: g, b: b,};
+					}
+					
+					var self = this;
+					return (this.notify = function(){
+						// &#35492;&#20837;&#21147;&#12434;&#38450;&#27490;&#12377;&#12427;&#12383;&#12417;&#12289;&#12479;&#12464;&#27770;&#23450;&#24460;&#19968;&#23450;&#26178;&#38291;&#12461;&#12540;&#20837;&#21147;&#12434;&#21463;&#12369;&#12388;&#12369;&#12394;&#12356;
+						self.sleeping = true;
+						self.canceler &amp;&amp; self.canceler();
+						self.canceler = tween(function(ratio){
+							// #ccf0ff
+							self.input.style.backgroundColor = '#' + toHexString(hslToRGB(0.55, 1, 0.9 + (0.1*ratio)));
+						}, self.delay, 10, function(){
+							self.sleeping = false;
+						});
+					})();
+					
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+			
+			&lt;method name=&quot;injectCandidate&quot;&gt;
+				&lt;parameter name=&quot;cand&quot;/&gt;
+				&lt;parameter name=&quot;terminate&quot;/&gt;
+				&lt;body&gt;&lt;![CDATA[
+					var text = this.value;
+					var word = this.getCurrentWord();
+					
+					var suffix = text.substr(word.end);
+					var delimiter = (terminate &amp;&amp; suffix.charAt(0) != this.delimiter) ? this.delimiter : '';
+					this.value = text.substring(0, word.start) + cand + delimiter + suffix;
+					this.selectionStart = this.selectionEnd = word.start + cand.length + delimiter.length;
+					
+					if(terminate)
+						this.notify();
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+			
+			&lt;method name=&quot;getCurrentWord&quot;&gt;
+				&lt;body&gt;&lt;![CDATA[
+					var text = this.value;
+					var caret = this.selectionStart;
+					var start = text.lastIndexOf(this.delimiter, caret - 1) + 1;
+					var end = text.indexOf(this.delimiter, caret);
+					if(end == -1)
+						end = text.length;
+					
+					return {
+						start : start,
+						end : end,
+						word : text.slice(start, end),
+					};
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+			
+			&lt;method name=&quot;getCandidates&quot;&gt;
+				&lt;parameter name=&quot;hint&quot;/&gt;
+				&lt;parameter name=&quot;used&quot;/&gt;
+				&lt;body&gt;&lt;![CDATA[
+					var cands = [];
+					var reStrict = new RegExp('^' + hint, 'i');
+					var reLoose = new RegExp('^' + hint.split('').join('.*'), 'i');
+					
+					this.candidates.forEach(function(cand){
+						if(reStrict.test(cand.reading))
+							cands.push(cand.value);
+					});
+					
+					if(!cands.length)
+						this.candidates.forEach(function(cand){
+							if(reLoose.test(cand.reading))
+								cands.push(cand.value);
+						});
+					
+					return cands.filter(function(cand){
+						return !used.some(function(u){return u==cand})
+					});
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+			
+			&lt;method name=&quot;complete&quot;&gt;
+				&lt;parameter name=&quot;denyEmpty&quot;/&gt;
+				&lt;body&gt;&lt;![CDATA[
+					var text = this.value;
+					var word = this.getCurrentWord();
+					var hint = word.word;
+					
+					if(!hint &amp;&amp; denyEmpty){
+						this.popup.hidePopup();
+						return;
+					}
+					
+					var cands = this.getCandidates(hint, text.substring(0, word.start).split(this.delimiter));
+					if(this.autoComplete &amp;&amp; cands.length==1 &amp;&amp; (hint.length &gt;=2 || cands[0].length == 1)){
+						if(!this.deleting)
+							this.injectCandidate(cands[0], true);
+						this.popup.hidePopup();
+						return;
+					}
+					
+					if(cands.length){
+						this.measure.value = text.substr(0, word.start);
+						this.measure.hidden = false;
+						var x = this.measure.boxObject.width;
+						this.measure.hidden = true;
+						
+						this.popup.show(this, x, -2, cands);
+					} else {
+						this.popup.hidePopup();
+					}
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+		&lt;/implementation&gt;
+		
+		&lt;handlers&gt;
+			&lt;handler event=&quot;input&quot; action=&quot;this.complete(true)&quot; /&gt;
+			&lt;handler event=&quot;keyup&quot;&gt;&lt;![CDATA[
+				switch (event.keyCode) {
+					case KeyEvent.DOM_VK_DELETE:
+					case KeyEvent.DOM_VK_BACK_SPACE:
+						this.deleting = false;
+						return;
+				}
+			]]&gt;&lt;/handler&gt;
+			&lt;handler event=&quot;keydown&quot;&gt;&lt;![CDATA[
+				switch (event.keyCode) {
+					case KeyEvent.DOM_VK_DELETE:
+					case KeyEvent.DOM_VK_BACK_SPACE:
+						this.deleting = true;
+						return;
+				}
+			]]&gt;&lt;/handler&gt;
+			&lt;handler event=&quot;keypress&quot;&gt;&lt;![CDATA[
+				// &#12501;&#12457;&#12540;&#12459;&#12473;&#31227;&#21205;&#12399;&#20309;&#12418;&#20966;&#29702;&#12434;&#34892;&#12431;&#12394;&#12356;/&#36974;&#12425;&#12394;&#12356;
+				if(event.keyCode==KeyEvent.DOM_VK_TAB &amp;&amp; !this.popup.visible)
+					return;
+				
+				if(this.sleeping){
+					event.preventDefault();
+					return;
+				}
+				
+				switch (event.keyCode) {
+					case KeyEvent.DOM_VK_TAB:
+					case KeyEvent.DOM_VK_DOWN:
+						event.preventDefault();
+						
+						if(!this.popup.visible)
+							this.complete();
+						
+						if(this.listbox.rowCount==1){
+							this.listbox.enter(true)
+						} else {
+							this.listbox.moveCursor(1);
+						}
+						return;
+						
+					case KeyEvent.DOM_VK_UP:
+						event.preventDefault();
+						this.listbox.moveCursor(-1);
+						return;
+						
+					case KeyEvent.DOM_VK_RETURN:
+						if(this.popup.visible){
+							this.listbox.enter(true)
+						} else {
+							// FIXME
+						}
+						return;
+						
+					case KeyEvent.DOM_VK_ESCAPE:
+						// FIXME &#20837;&#21147;&#36884;&#20013;&#12398;&#20505;&#35036;&#12434;&#12463;&#12522;&#12450;
+						this.popup.hidePopup();
+						return;
+				}
+			]]&gt;&lt;/handler&gt;
+		&lt;/handlers&gt;
+	&lt;/binding&gt;
+	
+	
+	&lt;binding id=&quot;popup&quot; extends=&quot;chrome://global/content/bindings/popup.xml#popup&quot;&gt;
+		&lt;implementation&gt;
+			&lt;field name=&quot;container&quot;&gt;
+				this.parentNode;
+			&lt;/field&gt;
+			&lt;field name=&quot;listbox&quot;&gt;
+				document.getAnonymousElementByAttribute(this.container, 'anonid', 'listbox');
+			&lt;/field&gt;
+			&lt;field name=&quot;textbox&quot;&gt;
+				document.getAnonymousElementByAttribute(this.container, 'anonid', 'textbox');
+			&lt;/field&gt;
+			
+			&lt;property name=&quot;visible&quot;
+				onget=&quot;return this.state? (this.state != 'closed') : (!!this.boxObject.height);&quot; /&gt;
+			
+			&lt;method name=&quot;show&quot;&gt;
+				&lt;parameter name=&quot;anchor&quot;/&gt;
+				&lt;parameter name=&quot;x&quot;/&gt;
+				&lt;parameter name=&quot;y&quot;/&gt;
+				&lt;parameter name=&quot;cands&quot;/&gt;
+				&lt;body&gt;&lt;![CDATA[
+					if(this.openPopup){
+						this.openPopup(anchor, 'after_start', x, y, false);
+					} else {
+						anchor = anchor.boxObject;
+						
+						// &#12509;&#12483;&#12503;&#12450;&#12483;&#12503;&#20301;&#32622;&#12398;&#22522;&#28857;&#12434;&#35373;&#23450;&#12377;&#12427;
+						var doc = this.ownerDocument;
+						doc.popupNode = doc.documentElement;
+						this.showPopup(doc.documentElement, anchor.x + x, anchor.y + anchor.height + y, 'popup');
+					}
+					
+					if(cands){
+						this.listbox.removeAll();
+						this.listbox.appendItems(cands);
+					}
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+		&lt;/implementation&gt;
+		
+		&lt;handlers&gt;
+			&lt;handler event=&quot;blur&quot; action=&quot;this.hidePopup()&quot; /&gt;
+		&lt;/handlers&gt;
+	&lt;/binding&gt;
+	
+	
+	&lt;binding id=&quot;listbox&quot; extends=&quot;chrome://global/content/bindings/listbox.xml#listbox&quot;&gt;
+		&lt;implementation&gt;
+			&lt;field name=&quot;container&quot;&gt;
+				this.parentNode.parentNode;
+			&lt;/field&gt;
+			&lt;field name=&quot;popup&quot;&gt;
+				document.getAnonymousElementByAttribute(this.container, 'anonid', 'popup');
+			&lt;/field&gt;
+			&lt;field name=&quot;textbox&quot;&gt;
+				document.getAnonymousElementByAttribute(this.container, 'anonid', 'textbox');
+			&lt;/field&gt;
+			
+			&lt;field name=&quot;maxRows&quot;&gt;
+				20
+			&lt;/field&gt;
+			&lt;field name=&quot;rowCount&quot; /&gt;
+			
+			&lt;property name=&quot;rowHeight&quot;
+				onget=&quot;return this._rowHeight || (this._rowHeight = this.childNodes[0].boxObject.height)&quot; /&gt;
+			
+			&lt;method name=&quot;removeAll&quot;&gt;
+				&lt;body&gt;&lt;![CDATA[
+					while(this.lastChild)
+						this.removeChild(this.lastChild);
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+			&lt;method name=&quot;appendItems&quot;&gt;
+				&lt;parameter name=&quot;items&quot;/&gt;
+				&lt;body&gt;&lt;![CDATA[
+					for(var i=0 ; i&lt;items.length; i++)
+						this.appendItem(items[i]);
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+			&lt;method name=&quot;adjustSize&quot;&gt;
+				&lt;body&gt;&lt;![CDATA[
+					if(!this.rowHeight){
+						this.rows = Math.min(this.rowCount, this.maxRows);
+					} else {
+						// rows&#12398;&#22793;&#26356;&#12420;height:auto&#12384;&#12369;&#12391;&#12399;&#20313;&#30333;&#12364;&#29983;&#12376;&#12427;&#12371;&#12392;&#12364;&#12354;&#12427;&#12383;&#12417;&#25163;&#21205;&#12391;&#39640;&#12373;&#12434;&#35336;&#31639;&#12377;&#12427;
+						this.height = Math.min(this.rowCount, this.maxRows) * this.rowHeight;
+					}
+					
+					if(this.rowCount == 1){
+						this.style.backgroundColor = '#ccf0ff';
+					} else {
+						this.style.backgroundColor = '#ffffff';
+					}
+					
+					// &#12473;&#12463;&#12525;&#12540;&#12523;&#12496;&#12540;&#12364;&#34920;&#31034;&#12373;&#12428;&#12427;&#12392;&#20999;&#12428;&#12427;&#12383;&#12417;&#25163;&#21205;&#12391;&#24133;&#12434;&#35336;&#31639;&#12377;&#12427;
+					if(this.rowCount &gt; this.maxRows){
+						this.width = null;
+						this.width = this.boxObject.width + 20;
+					} else {
+						this.width = null;
+					}
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+			
+			&lt;method name=&quot;moveCursor&quot;&gt;
+				&lt;parameter name=&quot;offset&quot;/&gt;
+				&lt;body&gt;&lt;![CDATA[
+					var index = this.selectedIndex + offset;
+					index = 
+						index &gt;= this.rowCount ? 0 : 
+						index &lt; 0 ? (this.rowCount - 1) : 
+						index;
+					
+					// &#12522;&#12473;&#12488;&#12508;&#12483;&#12463;&#12473;&#34920;&#31034;&#30452;&#24460;&#12395;&#12459;&#12540;&#12477;&#12523;&#12434;&#21205;&#12363;&#12377;&#12392;&#34920;&#31034;&#12373;&#12428;&#12394;&#12356;&#26178;&#12364;&#12354;&#12427;&#12383;&#12417;&#20877;&#25551;&#30011;&#12434;&#20419;&#12377;
+					if(index==0)
+						this.boxObject.height;
+					
+					this.selectedIndex = index;
+					this.ensureIndexIsVisible(index);
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+			&lt;method name=&quot;enter&quot;&gt;
+				&lt;parameter name=&quot;terminate&quot;/&gt;
+				&lt;body&gt;&lt;![CDATA[
+					var item = this.selectedItem || (this.rowCount==1 &amp;&amp; this.firstChild);
+					if(!item)
+						return;
+					
+					this.textbox.injectCandidate(item.getAttribute('label'), terminate);
+					
+					if(terminate){
+						this.popup.hidePopup();
+						// this.textbox.focus();
+					}
+				]]&gt;&lt;/body&gt;
+			&lt;/method&gt;
+		&lt;/implementation&gt;
+		
+		&lt;handlers&gt;
+			&lt;handler event=&quot;select&quot; action=&quot;this.enter()&quot; /&gt;
+			&lt;handler event=&quot;DOMNodeInserted&quot;&gt;&lt;![CDATA[
+				// getRowCount&#12513;&#12477;&#12483;&#12489;&#12399;&#19981;&#27491;&#30906;&#12394;&#22580;&#21512;&#12364;&#12354;&#12427;&#12383;&#12417;&#23376;&#35201;&#32032;&#12434;&#21462;&#24471;&#12375;&#12461;&#12515;&#12483;&#12471;&#12517;&#12377;&#12427;
+				this.rowCount = this.getElementsByTagName('listitem').length;
+				
+				this.adjustSize();
+			]]&gt;&lt;/handler&gt;
+		&lt;/handlers&gt;
+	&lt;/binding&gt;
+	
+	&lt;binding id=&quot;listitem&quot; extends=&quot;chrome://global/content/bindings/listbox.xml#listitem&quot;&gt;
+		&lt;handlers&gt;
+			&lt;handler event=&quot;click&quot; action=&quot;this.control.enter(true)&quot; /&gt;
+		&lt;/handlers&gt;
+	&lt;/binding&gt;
+&lt;/bindings&gt;</diff>
      <filename>xpi/chrome/content/library/completion.xml</filename>
    </modified>
    <modified>
      <diff>@@ -1,78 +1,78 @@
-&lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;?xml-stylesheet href=&quot;chrome://global/skin/&quot; type=&quot;text/css&quot;?&gt;
-&lt;?xml-stylesheet href=&quot;data:text/css,
-window {
-	margin : 0.7em 0.5em;
-}
-button, radio, listitem {
-	cursor : pointer;
-}
-.button-icon{
-	margin-right : 0.5em;
-}
-listitem {
-	outline: none !important;
-	padding: 0.5em 0.2em;
-}
-&quot; type=&quot;text/css&quot;?&gt;
-&lt;dialog buttons=&quot;accept&quot; xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot; title=&quot;Change Acount&quot;&gt;
-	&lt;hbox flex=&quot;1&quot;&gt;
-		&lt;radiogroup id=&quot;models&quot;&gt;
-		&lt;/radiogroup&gt;
-		&lt;vbox style=&quot;margin-left: 0.7em;&quot; flex=&quot;1&quot;&gt;
-			&lt;listbox id=&quot;users&quot; flex=&quot;1&quot; &gt;
-			&lt;/listbox&gt;
-			&lt;button dlgtype=&quot;accept&quot; image=&quot;chrome://tombloo/skin/accept.png&quot; label=&quot;Login&quot; style=&quot;margin-top: 0.7em;padding: 0.5em 0;&quot;/&gt;
-		&lt;/vbox&gt;
-	&lt;/hbox&gt;
-	&lt;script&gt;&lt;![CDATA[
-	// chrome://tombloo/content/library/login.xul
-	var env = Components.classes['@brasil.to/tombloo-service;1'].getService().wrappedJSObject;
-	
-	var elmModels = document.getElementById('models');
-	var elmUsers = document.getElementById('users');
-	
-	elmModels.addEventListener('select', function(e){
-		// &#12518;&#12540;&#12470;&#12540;&#21517;&#12398;&#21462;&#24471;&#12391;&#38750;&#21516;&#26399;&#20966;&#29702;&#12434;&#25375;&#12416;&#12383;&#12417;&#12289;&#12381;&#12398;&#38291;&#20877;&#25551;&#30011;&#12434;&#27490;&#12417;&#12427;
-		if(elmUsers.refreshing)
-			return;
-		
-		var model = env.models[elmModels.value];
-		elmUsers.refreshing = true;
-		(model.getCurrentUser? model.getCurrentUser() : succeed()).addCallback(function(user){
-			env.clearChildren(elmUsers);
-			
-			model.getPasswords().forEach(function(pw){
-				var item = elmUsers.appendItem(pw.user, pw.password);
-				item.setAttribute('class', 'listitem-iconic');
-				if(pw.user == user){
-					elmUsers.selectedItem = item;
-					item.setAttribute('image', 'chrome://tombloo/skin/tick.png');
-					item.disabled = true;
-				} else {
-					item.setAttribute('image', 'chrome://tombloo/skin/empty.png');
-				}
-			});
-			elmUsers.refreshing = false;
-		});
-	}, true);
-	
-	env.forEach(env.models.values, function(m){
-		if(!m.login || !m.getPasswords || !m.getPasswords().length)
-			return;
-		
-		elmModels.appendItem(m.name, m.name).setAttribute('src', m.ICON);
-	});
-	
-	window.addEventListener('load', function(){
-		elmModels.selectedIndex = 0;
-	}, true);
-	
-	window.addEventListener('dialogaccept', function(){
-		var item = elmUsers.selectedItem;
-		env.models[elmModels.value].login(item.label, item.value);
-	}, true);
-	
-	]]&gt;&lt;/script&gt;
-&lt;/dialog&gt;
- 
+&lt;?xml version=&quot;1.0&quot;?&gt;
+&lt;?xml-stylesheet href=&quot;chrome://global/skin/&quot; type=&quot;text/css&quot;?&gt;
+&lt;?xml-stylesheet href=&quot;data:text/css,
+window {
+	margin : 0.7em 0.5em;
+}
+button, radio, listitem {
+	cursor : pointer;
+}
+.button-icon{
+	margin-right : 0.5em;
+}
+listitem {
+	outline: none !important;
+	padding: 0.5em 0.2em;
+}
+&quot; type=&quot;text/css&quot;?&gt;
+&lt;dialog buttons=&quot;accept&quot; xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot; title=&quot;Change Acount&quot;&gt;
+	&lt;hbox flex=&quot;1&quot;&gt;
+		&lt;radiogroup id=&quot;models&quot;&gt;
+		&lt;/radiogroup&gt;
+		&lt;vbox style=&quot;margin-left: 0.7em;&quot; flex=&quot;1&quot;&gt;
+			&lt;listbox id=&quot;users&quot; flex=&quot;1&quot; &gt;
+			&lt;/listbox&gt;
+			&lt;button dlgtype=&quot;accept&quot; image=&quot;chrome://tombloo/skin/accept.png&quot; label=&quot;Login&quot; style=&quot;margin-top: 0.7em;padding: 0.5em 0;&quot;/&gt;
+		&lt;/vbox&gt;
+	&lt;/hbox&gt;
+	&lt;script&gt;&lt;![CDATA[
+	// chrome://tombloo/content/library/login.xul
+	var env = Components.classes['@brasil.to/tombloo-service;1'].getService().wrappedJSObject;
+	
+	var elmModels = document.getElementById('models');
+	var elmUsers = document.getElementById('users');
+	
+	elmModels.addEventListener('select', function(e){
+		// &#12518;&#12540;&#12470;&#12540;&#21517;&#12398;&#21462;&#24471;&#12391;&#38750;&#21516;&#26399;&#20966;&#29702;&#12434;&#25375;&#12416;&#12383;&#12417;&#12289;&#12381;&#12398;&#38291;&#20877;&#25551;&#30011;&#12434;&#27490;&#12417;&#12427;
+		if(elmUsers.refreshing)
+			return;
+		
+		var model = env.models[elmModels.value];
+		elmUsers.refreshing = true;
+		(model.getCurrentUser? model.getCurrentUser() : succeed()).addCallback(function(user){
+			env.clearChildren(elmUsers);
+			
+			model.getPasswords().forEach(function(pw){
+				var item = elmUsers.appendItem(pw.user, pw.password);
+				item.setAttribute('class', 'listitem-iconic');
+				if(pw.user == user){
+					elmUsers.selectedItem = item;
+					item.setAttribute('image', 'chrome://tombloo/skin/tick.png');
+					item.disabled = true;
+				} else {
+					item.setAttribute('image', 'chrome://tombloo/skin/empty.png');
+				}
+			});
+			elmUsers.refreshing = false;
+		});
+	}, true);
+	
+	env.forEach(env.models.values, function(m){
+		if(!m.login || !m.getPasswords || !m.getPasswords().length)
+			return;
+		
+		elmModels.appendItem(m.name, m.name).setAttribute('src', m.ICON);
+	});
+	
+	window.addEventListener('load', function(){
+		elmModels.selectedIndex = 0;
+	}, true);
+	
+	window.addEventListener('dialogaccept', function(){
+		var item = elmUsers.selectedItem;
+		env.models[elmModels.value].login(item.label, item.value);
+	}, true);
+	
+	]]&gt;&lt;/script&gt;
+&lt;/dialog&gt;
+ </diff>
      <filename>xpi/chrome/content/library/login.xul</filename>
    </modified>
    <modified>
      <diff>@@ -1,39 +1,39 @@
-&lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;?xml-stylesheet href=&quot;chrome://global/skin/global.css&quot; type=&quot;text/css&quot;?&gt;
-&lt;dialog xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;
-	id=&quot;main&quot; 
-	buttons=&quot;cancel&quot; 
-	buttonlabelcancel=&quot;Cancel&quot; 
-	ondialogcancel=&quot;return onCancel()&quot; &gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;chrome://tombloo/content/library/00_Components.js&quot;&gt;&lt;/script&gt;
-	&lt;script&gt;&lt;![CDATA[
-	var p = window.arguments[0];
-	p.addProgressListener(onProsessChange);
-	window.addEventListener('load', function(){
-		onProsessChange(p, p);
-	}, false);
-	
-	function onProsessChange(target, trigger){
-		if(target.ended){
-			notify(p.name, 'finished', notify.ICON_INFO);
-			window.close();
-			return;
-		}
-		
-		document.title = target.percentage + '% - ' + p.name;
-		
-		var elmProgress = document.getElementById('progress');
-		if(elmProgress)
-			elmProgress.value = target.percentage;
-		
-		var elmStatus = document.getElementById('status');
-		elmStatus.value = trigger;
-	}
-	
-	function onCancel(){
-		p.cancel();
-	}
-	]]&gt;&lt;/script&gt;
-	&lt;label id=&quot;status&quot;/&gt;
-	&lt;progressmeter id=&quot;progress&quot; /&gt;
-&lt;/dialog&gt;
+&lt;?xml version=&quot;1.0&quot;?&gt;
+&lt;?xml-stylesheet href=&quot;chrome://global/skin/global.css&quot; type=&quot;text/css&quot;?&gt;
+&lt;dialog xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;
+	id=&quot;main&quot; 
+	buttons=&quot;cancel&quot; 
+	buttonlabelcancel=&quot;Cancel&quot; 
+	ondialogcancel=&quot;return onCancel()&quot; &gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;chrome://tombloo/content/library/00_Components.js&quot;&gt;&lt;/script&gt;
+	&lt;script&gt;&lt;![CDATA[
+	var p = window.arguments[0];
+	p.addProgressListener(onProsessChange);
+	window.addEventListener('load', function(){
+		onProsessChange(p, p);
+	}, false);
+	
+	function onProsessChange(target, trigger){
+		if(target.ended){
+			notify(p.name, 'finished', notify.ICON_INFO);
+			window.close();
+			return;
+		}
+		
+		document.title = target.percentage + '% - ' + p.name;
+		
+		var elmProgress = document.getElementById('progress');
+		if(elmProgress)
+			elmProgress.value = target.percentage;
+		
+		var elmStatus = document.getElementById('status');
+		elmStatus.value = trigger;
+	}
+	
+	function onCancel(){
+		p.cancel();
+	}
+	]]&gt;&lt;/script&gt;
+	&lt;label id=&quot;status&quot;/&gt;
+	&lt;progressmeter id=&quot;progress&quot; /&gt;
+&lt;/dialog&gt;</diff>
      <filename>xpi/chrome/content/library/progressDialog.xul</filename>
    </modified>
    <modified>
      <diff>@@ -1,462 +1,462 @@
-&lt;?xml version=&quot;1.0&quot;?&gt;
-&lt;?xml-stylesheet href=&quot;chrome://global/skin/&quot; type=&quot;text/css&quot; ?&gt;
-&lt;?xml-stylesheet href=&quot;data:text/css,
-textbox[readonly=true] {
-	-moz-appearance: none;
-	-moz-user-focus: ignore !important;
-	-moz-border-bottom-colors: transparent;
-	-moz-border-left-colors: transparent;
-	-moz-border-right-colors: transparent;
-	-moz-border-top-colors: transparent;
-}
-tab {
-	padding: 0.4em 0.8em 0.1em 0.8em;
-}
-tabpanel {
-	padding: 1.2em 0.7em;
-}
-checkbox, radio, button, tab {
-	cursor: pointer;
-	-moz-outline: none !important;
-}
-
-checkbox:focus .checkbox-label-box {
-	border: none !important;
-	-moz-outline: none !important;
-}
-
-#postConfig checkbox hbox{
-	-moz-appearance: none;
-	-moz-outline: none !important;
-	border: none !important;
-	background: transparent !important;
-}
-
-#postConfig .checkbox-check{
-	-moz-appearance: none;
-	border: none !important;
-	background: url('chrome://tombloo/skin/disabled.png') no-repeat !important;
-	min-width: 16px;
-	min-height: 16px;
-	-moz-opacity: .3;
-}
-
-#postConfig checkbox[checked='true'] .checkbox-check{
-	background: url('chrome://tombloo/skin/tick.png') no-repeat !important;
-	list-style-image: none !important;
-	-moz-opacity: 1;
-}
-
-#postConfig checkbox[disabled='true'] .checkbox-check{
-	background: url('chrome://tombloo/skin/cross.png') no-repeat !important;
-	-moz-opacity: .5;
-}
-
-/*
-Windows Firefox 2&#12395;&#12390;png&#12434;&#12510;&#12454;&#12473;&#12459;&#12540;&#12477;&#12523;&#12395;&#12377;&#12427;&#12392;&#36879;&#36942;&#12391;&#12365;&#12394;&#12363;&#12387;&#12383;&#12383;&#12417;ico&#12434;&#29992;&#24847;
-*/
-#postConfig.copyChecked * {
-	cursor: url(chrome://tombloo/skin/tick.ico), pointer !important;
-}
-
-#postConfig.copyDisabled * {
-	cursor: url(chrome://tombloo/skin/cross.ico), pointer !important;
-}
-
-#postConfig.copyNormal * {
-	cursor: url(chrome://tombloo/skin/disabled.ico), pointer !important;
-}
-&quot; type=&quot;text/css&quot;?&gt;
-
-&lt;!DOCTYPE prefwindow SYSTEM &quot;chrome://tombloo/locale/tombloo.dtd&quot; &gt;
-
-&lt;prefwindow 
-	style=&quot;width: 50em;&quot; 
-	xmlns:html=&quot;http://www.w3.org/1999/xhtml&quot; 
-	xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot; 
-	title=&quot;&amp;label.tomblooOptions;&quot; &gt;
-	
-	&lt;hbox flex=&quot;1&quot; pack=&quot;end&quot;&gt;
-		&lt;resizer dir=&quot;bottomright&quot; style=&quot;cursor: se-resize;&quot; /&gt;
-	&lt;/hbox&gt;
-	
-	&lt;prefpane flex=&quot;1&quot; id=&quot;main&quot;&gt;
-		&lt;preferences&gt;
-			&lt;preference 
-				id=&quot;trimReblogInfo&quot; 
-				name=&quot;extensions.tombloo.trimReblogInfo&quot; 
-				type=&quot;bool&quot;/&gt;
-			&lt;preference 
-				id=&quot;amazonAffiliateId&quot; 
-				name=&quot;extensions.tombloo.amazonAffiliateId&quot; 
-				type=&quot;string&quot;/&gt;
-			&lt;preference 
-				id=&quot;thumbnailTemplate&quot; 
-				name=&quot;extensions.tombloo.thumbnailTemplate&quot; 
-				type=&quot;string&quot;/&gt;
-			&lt;preference 
-				id=&quot;ignoreError&quot; 
-				name=&quot;extensions.tombloo.ignoreError&quot; 
-				type=&quot;string&quot;/&gt;
-			&lt;preference 
-				id=&quot;accesskey.share&quot; 
-				name=&quot;extensions.tombloo.accesskey.share&quot; 
-				type=&quot;string&quot;/&gt;
-			&lt;preference 
-				id=&quot;shortcutkey.quickPost.link&quot; 
-				name=&quot;extensions.tombloo.shortcutkey.quickPost.link&quot; 
-				type=&quot;string&quot;/&gt;
-			&lt;preference 
-				id=&quot;shortcutkey.quickPost.regular&quot; 
-				name=&quot;extensions.tombloo.shortcutkey.quickPost.regular&quot; 
-				type=&quot;string&quot;/&gt;
-			&lt;preference 
-				id=&quot;shortcutkey.checkAndPost&quot; 
-				name=&quot;extensions.tombloo.shortcutkey.checkAndPost&quot; 
-				type=&quot;string&quot;/&gt;
-			&lt;preference 
-				id=&quot;tagProvider&quot; 
-				name=&quot;extensions.tombloo.tagProvider&quot; 
-				type=&quot;string&quot;/&gt;
-			&lt;preference 
-				id=&quot;tagAutoComplete&quot; 
-				name=&quot;extensions.tombloo.tagAutoComplete&quot; 
-				type=&quot;bool&quot;/&gt;
-			&lt;preference 
-				id=&quot;dataDir&quot; 
-				name=&quot;extensions.tombloo.dataDir&quot; 
-				type=&quot;string&quot;/&gt;
-		&lt;/preferences&gt;
-		
-		&lt;tabbox flex=&quot;1&quot;&gt;
-			&lt;tabs&gt;
-				&lt;tab label=&quot;&amp;label.postConfig;&quot;/&gt;
-				&lt;tab label=&quot;&amp;label.post;&quot;/&gt;
-				&lt;tab label=&quot;&amp;label.entry;&quot;/&gt;
-			&lt;/tabs&gt;
-			&lt;tabpanels flex=&quot;1&quot;&gt;
-				&lt;tabpanel id=&quot;postConfig&quot;&gt;
-					&lt;vbox flex=&quot;1&quot; style=&quot;overflow:auto&quot;&gt;
-						&lt;grid flex=&quot;1&quot;&gt;
-							&lt;columns&gt;
-								&lt;column/&gt;
-								&lt;column/&gt;
-								&lt;column/&gt;
-								&lt;column/&gt;
-								&lt;column/&gt;
-								&lt;column/&gt;
-								&lt;column/&gt;
-								&lt;column/&gt;
-								&lt;column/&gt;
-							&lt;/columns&gt;
-							&lt;rows id=&quot;posters&quot;&gt;
-								&lt;row&gt;
-									&lt;spacer /&gt;
-									&lt;spacer /&gt;
-									&lt;label value=&quot;Text&quot;/&gt;
-									&lt;label value=&quot;Photo&quot;/&gt;
-									&lt;label value=&quot;Quote&quot;/&gt;
-									&lt;label value=&quot;Link&quot;/&gt;
-									&lt;label value=&quot;Video&quot;/&gt;
-									&lt;label value=&quot;Chat&quot;/&gt;
-									&lt;label value=&quot;Reblog&quot;/&gt;
-								&lt;/row&gt;
-							&lt;/rows&gt;
-						&lt;/grid&gt;
-					&lt;/vbox&gt;
-				&lt;/tabpanel&gt;
-				&lt;tabpanel&gt;
-					&lt;grid flex=&quot;1&quot;&gt;
-						&lt;columns&gt;
-							&lt;column pack=&quot;end&quot; align=&quot;end&quot;/&gt;
-							&lt;column flex=&quot;1&quot;/&gt;
-						&lt;/columns&gt;
-						&lt;rows&gt;
-							&lt;row align=&quot;center&quot;&gt;
-								&lt;label value=&quot;&amp;label.accesskey.share;&quot;/&gt;
-								&lt;hbox&gt;
-									&lt;textbox preference=&quot;accesskey.share&quot; maxlength=&quot;1&quot; size=&quot;3&quot; /&gt;
-								&lt;/hbox&gt;
-							&lt;/row&gt;
-							&lt;separator class=&quot;groove-thin&quot; width=&quot;1&quot; style=&quot;margin: 0.6em 0 1.5em 0;&quot; /&gt;
-							&lt;row align=&quot;center&quot;&gt;
-								&lt;label value=&quot;&amp;label.shortcutkey.quickPost.regular;&quot; /&gt;
-								&lt;hbox&gt;
-									&lt;textbox preference=&quot;shortcutkey.quickPost.regular&quot; size=&quot;35&quot;/&gt;
-								&lt;/hbox&gt;
-							&lt;/row&gt;
-							&lt;row align=&quot;center&quot;&gt;
-								&lt;label value=&quot;&amp;label.shortcutkey.quickPost.link;&quot; /&gt;
-								&lt;hbox&gt;
-									&lt;textbox preference=&quot;shortcutkey.quickPost.link&quot; size=&quot;35&quot;/&gt;
-								&lt;/hbox&gt;
-							&lt;/row&gt;
-							&lt;row align=&quot;center&quot;&gt;
-								&lt;label value=&quot;&amp;label.shortcutkey.checkAndPost;&quot; /&gt;
-								&lt;hbox&gt;
-									&lt;textbox preference=&quot;shortcutkey.checkAndPost&quot; size=&quot;35&quot;/&gt;
-								&lt;/hbox&gt;
-							&lt;/row&gt;
-							&lt;row align=&quot;center&quot; style=&quot;margin-top: 0.6em;&quot;&gt;
-								&lt;label value=&quot;&amp;label.tagProvider;&quot; /&gt;
-								&lt;radiogroup preference=&quot;tagProvider&quot; /&gt;
-							&lt;/row&gt;
-							&lt;row align=&quot;center&quot; style=&quot;margin: 0.4em 0 0.5em 0;&quot;&gt;
-								&lt;label value=&quot;&amp;label.tagAutoComplete;&quot; /&gt;
-								&lt;checkbox preference=&quot;tagAutoComplete&quot; /&gt;
-							&lt;/row&gt;
-							&lt;separator class=&quot;groove-thin&quot; width=&quot;1&quot; style=&quot;margin: 0.6em 0 1.5em 0;&quot; /&gt;
-							&lt;row align=&quot;center&quot;&gt;
-								&lt;label value=&quot;&amp;label.ignoreError;&quot;/&gt;
-								&lt;textbox preference=&quot;ignoreError&quot; /&gt;
-							&lt;/row&gt;
-							&lt;row align=&quot;center&quot; style=&quot;margin-top: -0.3em;&quot;&gt;
-								&lt;spacer /&gt;
-								&lt;textbox readonly=&quot;true&quot; value=&quot;&amp;label.example; (ffffound: (?!auth)|already)&quot; /&gt;
-							&lt;/row&gt;
-						&lt;/rows&gt;
-					&lt;/grid&gt;
-				&lt;/tabpanel&gt;
-				&lt;tabpanel&gt;
-					&lt;grid flex=&quot;1&quot;&gt;
-						&lt;columns&gt;
-							&lt;column pack=&quot;end&quot; align=&quot;end&quot; orient=&quot;horizontal&quot;/&gt;
-							&lt;column flex=&quot;1&quot;/&gt;
-						&lt;/columns&gt;
-						&lt;rows&gt;
-							&lt;row align=&quot;center&quot;&gt;
-								&lt;label value=&quot;&amp;label.amazonAffiliateId;&quot;/&gt;
-								&lt;hbox&gt;
-									&lt;textbox preference=&quot;amazonAffiliateId&quot; size=&quot;35&quot; /&gt;
-								&lt;/hbox&gt;
-							&lt;/row&gt;
-							&lt;row align=&quot;center&quot;&gt;
-								&lt;label value=&quot;&amp;label.thumbnailTemplate;&quot;/&gt;
-								&lt;textbox preference=&quot;thumbnailTemplate&quot; /&gt;
-							&lt;/row&gt;
-							&lt;row align=&quot;center&quot; style=&quot;margin-top: -0.3em;&quot;&gt;
-								&lt;spacer /&gt;
-								&lt;textbox readonly=&quot;true&quot; value=&quot;&amp;label.example; &amp;lt;img src=&amp;quot;http://mozshot.nemui.org/shot?{url}&amp;quot; /&amp;gt;&quot; /&gt;
-							&lt;/row&gt;
-							&lt;row align=&quot;center&quot;&gt;
-								&lt;label value=&quot;&amp;label.trimReblogInfo;&quot;/&gt;
-								&lt;checkbox preference=&quot;trimReblogInfo&quot; /&gt;
-							&lt;/row&gt;
-							&lt;separator class=&quot;groove-thin&quot; width=&quot;1&quot; style=&quot;margin: 1em 0 1em 0;&quot; /&gt;
-							&lt;row align=&quot;center&quot;&gt;
-								&lt;label value=&quot;&amp;label.dataDir;&quot;/&gt;
-								&lt;hbox&gt;
-									&lt;textbox preference=&quot;dataDir&quot; flex=&quot;1&quot;/&gt;&lt;button label=&quot;&amp;label.browse;&quot;/&gt;
-								&lt;/hbox&gt;
-							&lt;/row&gt;
-							&lt;row align=&quot;center&quot; style=&quot;margin-top: -0.3em;&quot;&gt;
-								&lt;spacer /&gt;
-								&lt;textbox readonly=&quot;true&quot; value=&quot;&amp;label.example; {ProfD}/tombloo&quot; /&gt;
-							&lt;/row&gt;
-						&lt;/rows&gt;
-					&lt;/grid&gt;
-				&lt;/tabpanel&gt;
-			&lt;/tabpanels&gt;
-		&lt;/tabbox&gt;
-		
-		&lt;script&gt;&lt;![CDATA[
-		// chrome://tombloo/content/prefs.xul
-		var env = Components.classes['@brasil.to/tombloo-service;1'].getService().wrappedJSObject;
-		
-		var prefpane = document.getElementsByTagName('prefpane')[0];
-		function getField(name){
-			return document.getElementsByAttribute('preference', name)[0];
-		}
-		
-		function keyStringField(name, meta){
-			var elm = getField(name);
-			elm.addEventListener('keydown', function(e){
-				var key = env.keyString(e);
-				switch(key) {
-				case 'TAB':
-				case 'SHIFT + TAB':
-					return;
-					
-				}
-				
-				env.cancel(e);
-				elm.value = (key=='ESCAPE')? '' : 
-					(meta)? key : key.split(' + ').pop();
-				prefpane.userChangedValue(elm);
-			}, true);
-		}
-		
-		function mouseStringField(name){
-			var elm = getField(name);
-			env.observeMouseShortcut(elm, function(e, key){
-				elm.value = key;
-				prefpane.userChangedValue(elm);
-				
-				// &#20840;&#12390;&#12398;&#12461;&#12540;&#12434;&#20966;&#29702;&#12375;&#12394;&#12363;&#12387;&#12383;&#12371;&#12392;&#12395;&#12375;&#12390;&#12452;&#12505;&#12531;&#12488;&#12364;&#20572;&#27490;&#12377;&#12427;&#12398;&#12434;&#36991;&#12369;&#12427;
-				return true;
-			});
-			elm.addEventListener('keydown', function(e){
-				switch(env.keyString(e)) {
-				case 'TAB':
-				case 'SHIFT + TAB':
-					return;
-					
-				case 'ESCAPE':
-					elm.value = '';
-					prefpane.userChangedValue(elm);
-				}
-				
-				env.cancel(e);
-			}, false);
-			elm.addEventListener('contextmenu', env.cancel, true);
-		}
-		
-		mouseStringField('shortcutkey.checkAndPost');
-		keyStringField('shortcutkey.quickPost.link', true);
-		keyStringField('shortcutkey.quickPost.regular', true);
-		keyStringField('accesskey.share', false);
-		
-		
-		var tagProvider = document.getElementsByAttribute('preference', 'tagProvider')[0];
-		var ms = env.models;
-		for(var n in ms)
-			if(ms[n].getUserTags)
-				tagProvider.appendItem(n, n).setAttribute('src', ms[n].ICON);
-		window.addEventListener('load', function(){
-			// &#12473;&#12463;&#12522;&#12503;&#12488;&#23455;&#34892;&#26178;&#28857;&#12391;prefpane&#12398;&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;&#12540;&#12363;&#12425;value&#12364;&#20808;&#12395;&#19982;&#12360;&#12425;&#12428;&#12390;&#12356;&#12427;&#12383;&#12417;&#12289;
-			// &#24460;&#12363;&#12425;&#36861;&#21152;&#12375;&#12383;radio&#12398;&#12481;&#12455;&#12483;&#12463;&#12434;&#12388;&#12369;&#12427;&#12371;&#12392;&#12399;&#12391;&#12365;&#12394;&#12356;&#12290;
-			// &#12414;&#12383;&#12525;&#12540;&#12489;&#20013;&#12399;radiogroup._getRadioChildren&#12395;&#21453;&#26144;&#12373;&#12428;&#12390;&#12356;&#12394;&#12356;&#12383;&#12417;&#12289;
-			// value&#12398;&#22793;&#26356;&#12391;&#12481;&#12455;&#12483;&#12463;&#12434;&#12388;&#12369;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12394;&#12356;&#12290;
-			tagProvider.value = tagProvider.value;
-		}, true)
-		
-		var models = document.getElementById('posters');
-		var config = eval(env.getPref('postConfig'));
-		env.values(env.models).forEach(function(model){
-			if(!model.check)
-				return;
-			
-			var conf = config[model.name] || {};
-			var row = &lt;row style=&quot;margin: 0.1em 0; height: 1.7em;&quot; xmlns:html={env.HTML_NS}&gt;
-				&lt;vbox&gt;
-					&lt;html:img src={model.ICON} /&gt;
-				&lt;/vbox&gt;
-				&lt;hbox&gt;
-					&lt;label value={model.name} flex=&quot;1&quot;/&gt;
-				&lt;/hbox&gt;
-			&lt;/row&gt;;
-			
-			env.reduce(function(memo, type){
-				var elm = memo.appendChild(model.check({
-					type : type,
-					pageUrl : {
-						match: function(){
-							return true
-						}
-					},
-				})? &lt;checkbox 
-					type={type} model={model.name} 
-					checked={conf[type] === true} disabled={conf[type] === ''}/&gt; : &lt;spacer/&gt;);
-				
-				return memo;
-			}, ['regular', 'photo', 'quote', 'link', 'video', 'conversation', 'reblog'], row);
-			models.appendChild(env.convertToXULElement(row));
-		});
-		
-		
-		var elmPostConfig = document.getElementById('postConfig');
-		var elmSource;
-		
-		elmPostConfig.addEventListener('mousedown', function(e){
-			var target = e.target;
-			if(target.tagName != 'checkbox')
-				return;
-			
-			elmSource = target;
-		}, true);
-		
-		elmPostConfig.addEventListener('click', function(e){
-			var target = e.target;
-			if(target.tagName != 'checkbox')
-				return;
-			
-			env.cancel(e);
-			
-			if(target.disabled) {
-				target.disabled = false;
-				target.checked = false;
-				return;
-			}
-			if(target.checked){
-				target.disabled = true;
-				target.checked = false;
-				return;
-			}
-			
-			target.disabled = false;
-			target.checked = true;
-		}, true);
-		
-		elmPostConfig.addEventListener('mouseover', function(e){
-			var target = e.target;
-			if(!elmSource)
-				return;
-			
-			// Firefox 2&#12391;&#12463;&#12521;&#12473;&#12434;&#22793;&#12360;&#12427;&#20966;&#29702;&#12395;&#26178;&#38291;&#12364;&#25499;&#12363;&#12427;&#12383;&#12417;mousedown&#12391;&#12399;&#12394;&#12367;&#12371;&#12371;&#12391;&#34892;&#12358;
-			if(!elmPostConfig.className)
-				elmPostConfig.className = elmSource.checked? 'copyChecked' : elmSource.disabled? 'copyDisabled' : 'copyNormal';
-			
-			if(target.tagName != 'checkbox')
-				return;
-			
-			target.disabled = elmSource.disabled;
-			target.checked = elmSource.checked;
-		}, true);
-		
-		elmPostConfig.addEventListener('mouseout', function(e){
-			if(e.target != elmPostConfig)
-				return;
-			
-			elmSource = null;
-			elmPostConfig.className = '';
-		}, false);
-		
-		elmPostConfig.addEventListener('mouseup', function(e){
-			elmSource = null;
-			elmPostConfig.className = '';
-		}, true);
-		
-		
-		var elmDataDir = getField('dataDir');
-		elmDataDir.nextSibling.addEventListener('command', function(){
-			var fp = new env.FilePicker(window, env.getMessage('label.dataDir'), env.FilePicker.modeGetFolder);
-			fp.displayDirectory = env.getDataDir();
-			if(fp.show() == fp.returnOK){
-				elmDataDir.value = fp.file.path.replace(env.getProfileDir().path, '{ProfD}');
-				prefpane.userChangedValue(elmDataDir);
-			}
-		}, true)
-		
-		// Mac&#12391;&#12399;OK/&#12461;&#12515;&#12531;&#12475;&#12523;&#12364;&#34920;&#31034;&#12373;&#12428;&#12394;&#12356;&#12383;&#12417;&#28961;&#26465;&#20214;&#12395;unload&#12391;&#20445;&#23384;&#12377;&#12427;
-		window.addEventListener(env.AppInfo.OS.indexOf('WIN') == 0? 'beforeaccept' : 'unload', function(e){
-			var posters = {};
-			env.$x('.//*[@model]', document, true).forEach(function(checkbox){
-				var name = checkbox.getAttribute('model');
-				if(!posters[name])
-					posters[name] = {};
-				posters[name][checkbox.getAttribute('type')] = 
-					checkbox.disabled? '' : checkbox.checked;
-			});
-			
-			env.setPref('postConfig', uneval(posters));
-		}, true);
-		
-		// beforeaccept&#26178;&#28857;&#12391;&#12399;preference&#12364;&#26356;&#26032;&#12373;&#12428;&#12390;&#12356;&#12394;&#12356;&#12383;&#12417;unload&#12434;&#20351;&#12358;
-		window.addEventListener('unload', function(e){
-			// &#12471;&#12519;&#12540;&#12488;&#12459;&#12483;&#12488;&#12461;&#12540;&#12398;&#22793;&#26356;&#12434;&#21453;&#26144;&#12373;&#12379;&#12427;
-			env.reload();
-		}, true);
-		
-		]]&gt;&lt;/script&gt;
-	&lt;/prefpane&gt;
-&lt;/prefwindow&gt;
+&lt;?xml version=&quot;1.0&quot;?&gt;
+&lt;?xml-stylesheet href=&quot;chrome://global/skin/&quot; type=&quot;text/css&quot; ?&gt;
+&lt;?xml-stylesheet href=&quot;data:text/css,
+textbox[readonly=true] {
+	-moz-appearance: none;
+	-moz-user-focus: ignore !important;
+	-moz-border-bottom-colors: transparent;
+	-moz-border-left-colors: transparent;
+	-moz-border-right-colors: transparent;
+	-moz-border-top-colors: transparent;
+}
+tab {
+	padding: 0.4em 0.8em 0.1em 0.8em;
+}
+tabpanel {
+	padding: 1.2em 0.7em;
+}
+checkbox, radio, button, tab {
+	cursor: pointer;
+	-moz-outline: none !important;
+}
+
+checkbox:focus .checkbox-label-box {
+	border: none !important;
+	-moz-outline: none !important;
+}
+
+#postConfig checkbox hbox{
+	-moz-appearance: none;
+	-moz-outline: none !important;
+	border: none !important;
+	background: transparent !important;
+}
+
+#postConfig .checkbox-check{
+	-moz-appearance: none;
+	border: none !important;
+	background: url('chrome://tombloo/skin/disabled.png') no-repeat !important;
+	min-width: 16px;
+	min-height: 16px;
+	-moz-opacity: .3;
+}
+
+#postConfig checkbox[checked='true'] .checkbox-check{
+	background: url('chrome://tombloo/skin/tick.png') no-repeat !important;
+	list-style-image: none !important;
+	-moz-opacity: 1;
+}
+
+#postConfig checkbox[disabled='true'] .checkbox-check{
+	background: url('chrome://tombloo/skin/cross.png') no-repeat !important;
+	-moz-opacity: .5;
+}
+
+/*
+Windows Firefox 2&#12395;&#12390;png&#12434;&#12510;&#12454;&#12473;&#12459;&#12540;&#12477;&#12523;&#12395;&#12377;&#12427;&#12392;&#36879;&#36942;&#12391;&#12365;&#12394;&#12363;&#12387;&#12383;&#12383;&#12417;ico&#12434;&#29992;&#24847;
+*/
+#postConfig.copyChecked * {
+	cursor: url(chrome://tombloo/skin/tick.ico), pointer !important;
+}
+
+#postConfig.copyDisabled * {
+	cursor: url(chrome://tombloo/skin/cross.ico), pointer !important;
+}
+
+#postConfig.copyNormal * {
+	cursor: url(chrome://tombloo/skin/disabled.ico), pointer !important;
+}
+&quot; type=&quot;text/css&quot;?&gt;
+
+&lt;!DOCTYPE prefwindow SYSTEM &quot;chrome://tombloo/locale/tombloo.dtd&quot; &gt;
+
+&lt;prefwindow 
+	style=&quot;width: 50em;&quot; 
+	xmlns:html=&quot;http://www.w3.org/1999/xhtml&quot; 
+	xmlns=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot; 
+	title=&quot;&amp;label.tomblooOptions;&quot; &gt;
+	
+	&lt;hbox flex=&quot;1&quot; pack=&quot;end&quot;&gt;
+		&lt;resizer dir=&quot;bottomright&quot; style=&quot;cursor: se-resize;&quot; /&gt;
+	&lt;/hbox&gt;
+	
+	&lt;prefpane flex=&quot;1&quot; id=&quot;main&quot;&gt;
+		&lt;preferences&gt;
+			&lt;preference 
+				id=&quot;trimReblogInfo&quot; 
+				name=&quot;extensions.tombloo.trimReblogInfo&quot; 
+				type=&quot;bool&quot;/&gt;
+			&lt;preference 
+				id=&quot;amazonAffiliateId&quot; 
+				name=&quot;extensions.tombloo.amazonAffiliateId&quot; 
+				type=&quot;string&quot;/&gt;
+			&lt;preference 
+				id=&quot;thumbnailTemplate&quot; 
+				name=&quot;extensions.tombloo.thumbnailTemplate&quot; 
+				type=&quot;string&quot;/&gt;
+			&lt;preference 
+				id=&quot;ignoreError&quot; 
+				name=&quot;extensions.tombloo.ignoreError&quot; 
+				type=&quot;string&quot;/&gt;
+			&lt;preference 
+				id=&quot;accesskey.share&quot; 
+				name=&quot;extensions.tombloo.accesskey.share&quot; 
+				type=&quot;string&quot;/&gt;
+			&lt;preference 
+				id=&quot;shortcutkey.quickPost.link&quot; 
+				name=&quot;extensions.tombloo.shortcutkey.quickPost.link&quot; 
+				type=&quot;string&quot;/&gt;
+			&lt;preference 
+				id=&quot;shortcutkey.quickPost.regular&quot; 
+				name=&quot;extensions.tombloo.shortcutkey.quickPost.regular&quot; 
+				type=&quot;string&quot;/&gt;
+			&lt;preference 
+				id=&quot;shortcutkey.checkAndPost&quot; 
+				name=&quot;extensions.tombloo.shortcutkey.checkAndPost&quot; 
+				type=&quot;string&quot;/&gt;
+			&lt;preference 
+				id=&quot;tagProvider&quot; 
+				name=&quot;extensions.tombloo.tagProvider&quot; 
+				type=&quot;string&quot;/&gt;
+			&lt;preference 
+				id=&quot;tagAutoComplete&quot; 
+				name=&quot;extensions.tombloo.tagAutoComplete&quot; 
+				type=&quot;bool&quot;/&gt;
+			&lt;preference 
+				id=&quot;dataDir&quot; 
+				name=&quot;extensions.tombloo.dataDir&quot; 
+				type=&quot;string&quot;/&gt;
+		&lt;/preferences&gt;
+		
+		&lt;tabbox flex=&quot;1&quot;&gt;
+			&lt;tabs&gt;
+				&lt;tab label=&quot;&amp;label.postConfig;&quot;/&gt;
+				&lt;tab label=&quot;&amp;label.post;&quot;/&gt;
+				&lt;tab label=&quot;&amp;label.entry;&quot;/&gt;
+			&lt;/tabs&gt;
+			&lt;tabpanels flex=&quot;1&quot;&gt;
+				&lt;tabpanel id=&quot;postConfig&quot;&gt;
+					&lt;vbox flex=&quot;1&quot; style=&quot;overflow:auto&quot;&gt;
+						&lt;grid flex=&quot;1&quot;&gt;
+							&lt;columns&gt;
+								&lt;column/&gt;
+								&lt;column/&gt;
+								&lt;column/&gt;
+								&lt;column/&gt;
+								&lt;column/&gt;
+								&lt;column/&gt;
+								&lt;column/&gt;
+								&lt;column/&gt;
+								&lt;column/&gt;
+							&lt;/columns&gt;
+							&lt;rows id=&quot;posters&quot;&gt;
+								&lt;row&gt;
+									&lt;spacer /&gt;
+									&lt;spacer /&gt;
+									&lt;label value=&quot;Text&quot;/&gt;
+									&lt;label value=&quot;Photo&quot;/&gt;
+									&lt;label value=&quot;Quote&quot;/&gt;
+									&lt;label value=&quot;Link&quot;/&gt;
+									&lt;label value=&quot;Video&quot;/&gt;
+									&lt;label value=&quot;Chat&quot;/&gt;
+									&lt;label value=&quot;Reblog&quot;/&gt;
+								&lt;/row&gt;
+							&lt;/rows&gt;
+						&lt;/grid&gt;
+					&lt;/vbox&gt;
+				&lt;/tabpanel&gt;
+				&lt;tabpanel&gt;
+					&lt;grid flex=&quot;1&quot;&gt;
+						&lt;columns&gt;
+							&lt;column pack=&quot;end&quot; align=&quot;end&quot;/&gt;
+							&lt;column flex=&quot;1&quot;/&gt;
+						&lt;/columns&gt;
+						&lt;rows&gt;
+							&lt;row align=&quot;center&quot;&gt;
+								&lt;label value=&quot;&amp;label.accesskey.share;&quot;/&gt;
+								&lt;hbox&gt;
+									&lt;textbox preference=&quot;accesskey.share&quot; maxlength=&quot;1&quot; size=&quot;3&quot; /&gt;
+								&lt;/hbox&gt;
+							&lt;/row&gt;
+							&lt;separator class=&quot;groove-thin&quot; width=&quot;1&quot; style=&quot;margin: 0.6em 0 1.5em 0;&quot; /&gt;
+							&lt;row align=&quot;center&quot;&gt;
+								&lt;label value=&quot;&amp;label.shortcutkey.quickPost.regular;&quot; /&gt;
+								&lt;hbox&gt;
+									&lt;textbox preference=&quot;shortcutkey.quickPost.regular&quot; size=&quot;35&quot;/&gt;
+								&lt;/hbox&gt;
+							&lt;/row&gt;
+							&lt;row align=&quot;center&quot;&gt;
+								&lt;label value=&quot;&amp;label.shortcutkey.quickPost.link;&quot; /&gt;
+								&lt;hbox&gt;
+									&lt;textbox preference=&quot;shortcutkey.quickPost.link&quot; size=&quot;35&quot;/&gt;
+								&lt;/hbox&gt;
+							&lt;/row&gt;
+							&lt;row align=&quot;center&quot;&gt;
+								&lt;label value=&quot;&amp;label.shortcutkey.checkAndPost;&quot; /&gt;
+								&lt;hbox&gt;
+									&lt;textbox preference=&quot;shortcutkey.checkAndPost&quot; size=&quot;35&quot;/&gt;
+								&lt;/hbox&gt;
+							&lt;/row&gt;
+							&lt;row align=&quot;center&quot; style=&quot;margin-top: 0.6em;&quot;&gt;
+								&lt;label value=&quot;&amp;label.tagProvider;&quot; /&gt;
+								&lt;radiogroup preference=&quot;tagProvider&quot; /&gt;
+							&lt;/row&gt;
+							&lt;row align=&quot;center&quot; style=&quot;margin: 0.4em 0 0.5em 0;&quot;&gt;
+								&lt;label value=&quot;&amp;label.tagAutoComplete;&quot; /&gt;
+								&lt;checkbox preference=&quot;tagAutoComplete&quot; /&gt;
+							&lt;/row&gt;
+							&lt;separator class=&quot;groove-thin&quot; width=&quot;1&quot; style=&quot;margin: 0.6em 0 1.5em 0;&quot; /&gt;
+							&lt;row align=&quot;center&quot;&gt;
+								&lt;label value=&quot;&amp;label.ignoreError;&quot;/&gt;
+								&lt;textbox preference=&quot;ignoreError&quot; /&gt;
+							&lt;/row&gt;
+							&lt;row align=&quot;center&quot; style=&quot;margin-top: -0.3em;&quot;&gt;
+								&lt;spacer /&gt;
+								&lt;textbox readonly=&quot;true&quot; value=&quot;&amp;label.example; (ffffound: (?!auth)|already)&quot; /&gt;
+							&lt;/row&gt;
+						&lt;/rows&gt;
+					&lt;/grid&gt;
+				&lt;/tabpanel&gt;
+				&lt;tabpanel&gt;
+					&lt;grid flex=&quot;1&quot;&gt;
+						&lt;columns&gt;
+							&lt;column pack=&quot;end&quot; align=&quot;end&quot; orient=&quot;horizontal&quot;/&gt;
+							&lt;column flex=&quot;1&quot;/&gt;
+						&lt;/columns&gt;
+						&lt;rows&gt;
+							&lt;row align=&quot;center&quot;&gt;
+								&lt;label value=&quot;&amp;label.amazonAffiliateId;&quot;/&gt;
+								&lt;hbox&gt;
+									&lt;textbox preference=&quot;amazonAffiliateId&quot; size=&quot;35&quot; /&gt;
+								&lt;/hbox&gt;
+							&lt;/row&gt;
+							&lt;row align=&quot;center&quot;&gt;
+								&lt;label value=&quot;&amp;label.thumbnailTemplate;&quot;/&gt;
+								&lt;textbox preference=&quot;thumbnailTemplate&quot; /&gt;
+							&lt;/row&gt;
+							&lt;row align=&quot;center&quot; style=&quot;margin-top: -0.3em;&quot;&gt;
+								&lt;spacer /&gt;
+								&lt;textbox readonly=&quot;true&quot; value=&quot;&amp;label.example; &amp;lt;img src=&amp;quot;http://mozshot.nemui.org/shot?{url}&amp;quot; /&amp;gt;&quot; /&gt;
+							&lt;/row&gt;
+							&lt;row align=&quot;center&quot;&gt;
+								&lt;label value=&quot;&amp;label.trimReblogInfo;&quot;/&gt;
+								&lt;checkbox preference=&quot;trimReblogInfo&quot; /&gt;
+							&lt;/row&gt;
+							&lt;separator class=&quot;groove-thin&quot; width=&quot;1&quot; style=&quot;margin: 1em 0 1em 0;&quot; /&gt;
+							&lt;row align=&quot;center&quot;&gt;
+								&lt;label value=&quot;&amp;label.dataDir;&quot;/&gt;
+								&lt;hbox&gt;
+									&lt;textbox preference=&quot;dataDir&quot; flex=&quot;1&quot;/&gt;&lt;button label=&quot;&amp;label.browse;&quot;/&gt;
+								&lt;/hbox&gt;
+							&lt;/row&gt;
+							&lt;row align=&quot;center&quot; style=&quot;margin-top: -0.3em;&quot;&gt;
+								&lt;spacer /&gt;
+								&lt;textbox readonly=&quot;true&quot; value=&quot;&amp;label.example; {ProfD}/tombloo&quot; /&gt;
+							&lt;/row&gt;
+						&lt;/rows&gt;
+					&lt;/grid&gt;
+				&lt;/tabpanel&gt;
+			&lt;/tabpanels&gt;
+		&lt;/tabbox&gt;
+		
+		&lt;script&gt;&lt;![CDATA[
+		// chrome://tombloo/content/prefs.xul
+		var env = Components.classes['@brasil.to/tombloo-service;1'].getService().wrappedJSObject;
+		
+		var prefpane = document.getElementsByTagName('prefpane')[0];
+		function getField(name){
+			return document.getElementsByAttribute('preference', name)[0];
+		}
+		
+		function keyStringField(name, meta){
+			var elm = getField(name);
+			elm.addEventListener('keydown', function(e){
+				var key = env.keyString(e);
+				switch(key) {
+				case 'TAB':
+				case 'SHIFT + TAB':
+					return;
+					
+				}
+				
+				env.cancel(e);
+				elm.value = (key=='ESCAPE')? '' : 
+					(meta)? key : key.split(' + ').pop();
+				prefpane.userChangedValue(elm);
+			}, true);
+		}
+		
+		function mouseStringField(name){
+			var elm = getField(name);
+			env.observeMouseShortcut(elm, function(e, key){
+				elm.value = key;
+				prefpane.userChangedValue(elm);
+				
+				// &#20840;&#12390;&#12398;&#12461;&#12540;&#12434;&#20966;&#29702;&#12375;&#12394;&#12363;&#12387;&#12383;&#12371;&#12392;&#12395;&#12375;&#12390;&#12452;&#12505;&#12531;&#12488;&#12364;&#20572;&#27490;&#12377;&#12427;&#12398;&#12434;&#36991;&#12369;&#12427;
+				return true;
+			});
+			elm.addEventListener('keydown', function(e){
+				switch(env.keyString(e)) {
+				case 'TAB':
+				case 'SHIFT + TAB':
+					return;
+					
+				case 'ESCAPE':
+					elm.value = '';
+					prefpane.userChangedValue(elm);
+				}
+				
+				env.cancel(e);
+			}, false);
+			elm.addEventListener('contextmenu', env.cancel, true);
+		}
+		
+		mouseStringField('shortcutkey.checkAndPost');
+		keyStringField('shortcutkey.quickPost.link', true);
+		keyStringField('shortcutkey.quickPost.regular', true);
+		keyStringField('accesskey.share', false);
+		
+		
+		var tagProvider = document.getElementsByAttribute('preference', 'tagProvider')[0];
+		var ms = env.models;
+		for(var n in ms)
+			if(ms[n].getUserTags)
+				tagProvider.appendItem(n, n).setAttribute('src', ms[n].ICON);
+		window.addEventListener('load', function(){
+			// &#12473;&#12463;&#12522;&#12503;&#12488;&#23455;&#34892;&#26178;&#28857;&#12391;prefpane&#12398;&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;&#12540;&#12363;&#12425;value&#12364;&#20808;&#12395;&#19982;&#12360;&#12425;&#12428;&#12390;&#12356;&#12427;&#12383;&#12417;&#12289;
+			// &#24460;&#12363;&#12425;&#36861;&#21152;&#12375;&#12383;radio&#12398;&#12481;&#12455;&#12483;&#12463;&#12434;&#12388;&#12369;&#12427;&#12371;&#12392;&#12399;&#12391;&#12365;&#12394;&#12356;&#12290;
+			// &#12414;&#12383;&#12525;&#12540;&#12489;&#20013;&#12399;radiogroup._getRadioChildren&#12395;&#21453;&#26144;&#12373;&#12428;&#12390;&#12356;&#12394;&#12356;&#12383;&#12417;&#12289;
+			// value&#12398;&#22793;&#26356;&#12391;&#12481;&#12455;&#12483;&#12463;&#12434;&#12388;&#12369;&#12427;&#12371;&#12392;&#12418;&#12391;&#12365;&#12394;&#12356;&#12290;
+			tagProvider.value = tagProvider.value;
+		}, true)
+		
+		var models = document.getElementById('posters');
+		var config = eval(env.getPref('postConfig'));
+		env.values(env.models).forEach(function(model){
+			if(!model.check)
+				return;
+			
+			var conf = config[model.name] || {};
+			var row = &lt;row style=&quot;margin: 0.1em 0; height: 1.7em;&quot; xmlns:html={env.HTML_NS}&gt;
+				&lt;vbox&gt;
+					&lt;html:img src={model.ICON} /&gt;
+				&lt;/vbox&gt;
+				&lt;hbox&gt;
+					&lt;label value={model.name} flex=&quot;1&quot;/&gt;
+				&lt;/hbox&gt;
+			&lt;/row&gt;;
+			
+			env.reduce(function(memo, type){
+				var elm = memo.appendChild(model.check({
+					type : type,
+					pageUrl : {
+						match: function(){
+							return true
+						}
+					},
+				})? &lt;checkbox 
+					type={type} model={model.name} 
+					checked={conf[type] === true} disabled={conf[type] === ''}/&gt; : &lt;spacer/&gt;);
+				
+				return memo;
+			}, ['regular', 'photo', 'quote', 'link', 'video', 'conversation', 'reblog'], row);
+			models.appendChild(env.convertToXULElement(row));
+		});
+		
+		
+		var elmPostConfig = document.getElementById('postConfig');
+		var elmSource;
+		
+		elmPostConfig.addEventListener('mousedown', function(e){
+			var target = e.target;
+			if(target.tagName != 'checkbox')
+				return;
+			
+			elmSource = target;
+		}, true);
+		
+		elmPostConfig.addEventListener('click', function(e){
+			var target = e.target;
+			if(target.tagName != 'checkbox')
+				return;
+			
+			env.cancel(e);
+			
+			if(target.disabled) {
+				target.disabled = false;
+				target.checked = false;
+				return;
+			}
+			if(target.checked){
+				target.disabled = true;
+				target.checked = false;
+				return;
+			}
+			
+			target.disabled = false;
+			target.checked = true;
+		}, true);
+		
+		elmPostConfig.addEventListener('mouseover', function(e){
+			var target = e.target;
+			if(!elmSource)
+				return;
+			
+			// Firefox 2&#12391;&#12463;&#12521;&#12473;&#12434;&#22793;&#12360;&#12427;&#20966;&#29702;&#12395;&#26178;&#38291;&#12364;&#25499;&#12363;&#12427;&#12383;&#12417;mousedown&#12391;&#12399;&#12394;&#12367;&#12371;&#12371;&#12391;&#34892;&#12358;
+			if(!elmPostConfig.className)
+				elmPostConfig.className = elmSource.checked? 'copyChecked' : elmSource.disabled? 'copyDisabled' : 'copyNormal';
+			
+			if(target.tagName != 'checkbox')
+				return;
+			
+			target.disabled = elmSource.disabled;
+			target.checked = elmSource.checked;
+		}, true);
+		
+		elmPostConfig.addEventListener('mouseout', function(e){
+			if(e.target != elmPostConfig)
+				return;
+			
+			elmSource = null;
+			elmPostConfig.className = '';
+		}, false);
+		
+		elmPostConfig.addEventListener('mouseup', function(e){
+			elmSource = null;
+			elmPostConfig.className = '';
+		}, true);
+		
+		
+		var elmDataDir = getField('dataDir');
+		elmDataDir.nextSibling.addEventListener('command', function(){
+			var fp = new env.FilePicker(window, env.getMessage('label.dataDir'), env.FilePicker.modeGetFolder);
+			fp.displayDirectory = env.getDataDir();
+			if(fp.show() == fp.returnOK){
+				elmDataDir.value = fp.file.path.replace(env.getProfileDir().path, '{ProfD}');
+				prefpane.userChangedValue(elmDataDir);
+			}
+		}, true)
+		
+		// Mac&#12391;&#12399;OK/&#12461;&#12515;&#12531;&#12475;&#12523;&#12364;&#34920;&#31034;&#12373;&#12428;&#12394;&#12356;&#12383;&#12417;&#28961;&#26465;&#20214;&#12395;unload&#12391;&#20445;&#23384;&#12377;&#12427;
+		window.addEventListener(env.AppInfo.OS.indexOf('WIN') == 0? 'beforeaccept' : 'unload', function(e){
+			var posters = {};
+			env.$x('.//*[@model]', document, true).forEach(function(checkbox){
+				var name = checkbox.getAttribute('model');
+				if(!posters[name])
+					posters[name] = {};
+				posters[name][checkbox.getAttribute('type')] = 
+					checkbox.disabled? '' : checkbox.checked;
+			});
+			
+			env.setPref('postConfig', uneval(posters));
+		}, true);
+		
+		// beforeaccept&#26178;&#28857;&#12391;&#12399;preference&#12364;&#26356;&#26032;&#12373;&#12428;&#12390;&#12356;&#12394;&#12356;&#12383;&#12417;unload&#12434;&#20351;&#12358;
+		window.addEventListener('unload', function(e){
+			// &#12471;&#12519;&#12540;&#12488;&#12459;&#12483;&#12488;&#12461;&#12540;&#12398;&#22793;&#26356;&#12434;&#21453;&#26144;&#12373;&#12379;&#12427;
+			env.reload();
+		}, true);
+		
+		]]&gt;&lt;/script&gt;
+	&lt;/prefpane&gt;
+&lt;/prefwindow&gt;</diff>
      <filename>xpi/chrome/content/prefs.xul</filename>
    </modified>
    <modified>
      <diff>@@ -1,25 +1,25 @@
-&lt;html&gt;
-&lt;head&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/TestRunner.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
-	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
-	// chrome://tombloo/content/test/index.html
-	TestRunner.runTests(
-		'test_Components.html',
-		'test_utility.html',
-		'test_Database.html',
-		'test_Progress.html',
-		'test_model.html',
-		'test_Tumblr.html',
-		'test_Tombloo.html',
-		'test_Tombloo.Service.html',
-		'test_Tombloo.Service.extractors.html'
-	);
-&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/TestRunner.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
+	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+	// chrome://tombloo/content/test/index.html
+	TestRunner.runTests(
+		'test_Components.html',
+		'test_utility.html',
+		'test_Database.html',
+		'test_Progress.html',
+		'test_model.html',
+		'test_Tumblr.html',
+		'test_Tombloo.html',
+		'test_Tombloo.Service.html',
+		'test_Tombloo.Service.extractors.html'
+	);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>xpi/chrome/content/test/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,6926 +1,6926 @@
-/***
-
-    MochiKit.MochiKit 1.4 : PACKED VERSION
-
-    THIS FILE IS AUTOMATICALLY GENERATED.  If creating patches, please
-    diff against the source tree, not this file.
-
-    See &lt;http://mochikit.com/&gt; for documentation, downloads, license, etc.
-
-    (c) 2005 Bob Ippolito.  All rights Reserved.
-
-***/
-
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Base&quot;);
-}
-if(typeof (MochiKit)==&quot;undefined&quot;){
-MochiKit={};
-}
-if(typeof (MochiKit.Base)==&quot;undefined&quot;){
-MochiKit.Base={};
-}
-if(typeof (MochiKit.__export__)==&quot;undefined&quot;){
-MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)==&quot;undefined&quot;&amp;&amp;typeof (dojo)==&quot;undefined&quot;));
-}
-MochiKit.Base.VERSION=&quot;1.4&quot;;
-MochiKit.Base.NAME=&quot;MochiKit.Base&quot;;
-MochiKit.Base.update=function(_1,_2){
-if(_1===null||_1===undefined){
-_1={};
-}
-for(var i=1;i&lt;arguments.length;i++){
-var o=arguments[i];
-if(typeof (o)!=&quot;undefined&quot;&amp;&amp;o!==null){
-for(var k in o){
-_1[k]=o[k];
-}
-}
-}
-return _1;
-};
-MochiKit.Base.update(MochiKit.Base,{__repr__:function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-},toString:function(){
-return this.__repr__();
-},camelize:function(_6){
-var _7=_6.split(&quot;-&quot;);
-var cc=_7[0];
-for(var i=1;i&lt;_7.length;i++){
-cc+=_7[i].charAt(0).toUpperCase()+_7[i].substring(1);
-}
-return cc;
-},counter:function(n){
-if(arguments.length===0){
-n=1;
-}
-return function(){
-return n++;
-};
-},clone:function(_b){
-var me=arguments.callee;
-if(arguments.length==1){
-me.prototype=_b;
-return new me();
-}
-},_flattenArray:function(_d,_e){
-for(var i=0;i&lt;_e.length;i++){
-var o=_e[i];
-if(o instanceof Array){
-arguments.callee(_d,o);
-}else{
-_d.push(o);
-}
-}
-return _d;
-},flattenArray:function(lst){
-return MochiKit.Base._flattenArray([],lst);
-},flattenArguments:function(lst){
-var res=[];
-var m=MochiKit.Base;
-var _15=m.extend(null,arguments);
-while(_15.length){
-var o=_15.shift();
-if(o&amp;&amp;typeof (o)==&quot;object&quot;&amp;&amp;typeof (o.length)==&quot;number&quot;){
-for(var i=o.length-1;i&gt;=0;i--){
-_15.unshift(o[i]);
-}
-}else{
-res.push(o);
-}
-}
-return res;
-},extend:function(_18,obj,_1a){
-if(!_1a){
-_1a=0;
-}
-if(obj){
-var l=obj.length;
-if(typeof (l)!=&quot;number&quot;){
-if(typeof (MochiKit.Iter)!=&quot;undefined&quot;){
-obj=MochiKit.Iter.list(obj);
-l=obj.length;
-}else{
-throw new TypeError(&quot;Argument not an array-like and MochiKit.Iter not present&quot;);
-}
-}
-if(!_18){
-_18=[];
-}
-for(var i=_1a;i&lt;l;i++){
-_18.push(obj[i]);
-}
-}
-return _18;
-},updatetree:function(_1d,obj){
-if(_1d===null||_1d===undefined){
-_1d={};
-}
-for(var i=1;i&lt;arguments.length;i++){
-var o=arguments[i];
-if(typeof (o)!=&quot;undefined&quot;&amp;&amp;o!==null){
-for(var k in o){
-var v=o[k];
-if(typeof (_1d[k])==&quot;object&quot;&amp;&amp;typeof (v)==&quot;object&quot;){
-arguments.callee(_1d[k],v);
-}else{
-_1d[k]=v;
-}
-}
-}
-}
-return _1d;
-},setdefault:function(_23,obj){
-if(_23===null||_23===undefined){
-_23={};
-}
-for(var i=1;i&lt;arguments.length;i++){
-var o=arguments[i];
-for(var k in o){
-if(!(k in _23)){
-_23[k]=o[k];
-}
-}
-}
-return _23;
-},keys:function(obj){
-var _29=[];
-for(var _2a in obj){
-_29.push(_2a);
-}
-return _29;
-},values:function(obj){
-var _2c=[];
-for(var _2d in obj){
-_2c.push(obj[_2d]);
-}
-return _2c;
-},items:function(obj){
-var _2f=[];
-var e;
-for(var _31 in obj){
-var v;
-try{
-v=obj[_31];
-}
-catch(e){
-continue;
-}
-_2f.push([_31,v]);
-}
-return _2f;
-},_newNamedError:function(_33,_34,_35){
-_35.prototype=new MochiKit.Base.NamedError(_33.NAME+&quot;.&quot;+_34);
-_33[_34]=_35;
-},operator:{truth:function(a){
-return !!a;
-},lognot:function(a){
-return !a;
-},identity:function(a){
-return a;
-},not:function(a){
-return ~a;
-},neg:function(a){
-return -a;
-},add:function(a,b){
-return a+b;
-},sub:function(a,b){
-return a-b;
-},div:function(a,b){
-return a/b;
-},mod:function(a,b){
-return a%b;
-},mul:function(a,b){
-return a*b;
-},and:function(a,b){
-return a&amp;b;
-},or:function(a,b){
-return a|b;
-},xor:function(a,b){
-return a^b;
-},lshift:function(a,b){
-return a&lt;&lt;b;
-},rshift:function(a,b){
-return a&gt;&gt;b;
-},zrshift:function(a,b){
-return a&gt;&gt;&gt;b;
-},eq:function(a,b){
-return a==b;
-},ne:function(a,b){
-return a!=b;
-},gt:function(a,b){
-return a&gt;b;
-},ge:function(a,b){
-return a&gt;=b;
-},lt:function(a,b){
-return a&lt;b;
-},le:function(a,b){
-return a&lt;=b;
-},seq:function(a,b){
-return a===b;
-},sne:function(a,b){
-return a!==b;
-},ceq:function(a,b){
-return MochiKit.Base.compare(a,b)===0;
-},cne:function(a,b){
-return MochiKit.Base.compare(a,b)!==0;
-},cgt:function(a,b){
-return MochiKit.Base.compare(a,b)==1;
-},cge:function(a,b){
-return MochiKit.Base.compare(a,b)!=-1;
-},clt:function(a,b){
-return MochiKit.Base.compare(a,b)==-1;
-},cle:function(a,b){
-return MochiKit.Base.compare(a,b)!=1;
-},logand:function(a,b){
-return a&amp;&amp;b;
-},logor:function(a,b){
-return a||b;
-},contains:function(a,b){
-return b in a;
-}},forwardCall:function(_73){
-return function(){
-return this[_73].apply(this,arguments);
-};
-},itemgetter:function(_74){
-return function(arg){
-return arg[_74];
-};
-},typeMatcher:function(){
-var _76={};
-for(var i=0;i&lt;arguments.length;i++){
-var typ=arguments[i];
-_76[typ]=typ;
-}
-return function(){
-for(var i=0;i&lt;arguments.length;i++){
-if(!(typeof (arguments[i]) in _76)){
-return false;
-}
-}
-return true;
-};
-},isNull:function(){
-for(var i=0;i&lt;arguments.length;i++){
-if(arguments[i]!==null){
-return false;
-}
-}
-return true;
-},isUndefinedOrNull:function(){
-for(var i=0;i&lt;arguments.length;i++){
-var o=arguments[i];
-if(!(typeof (o)==&quot;undefined&quot;||o===null)){
-return false;
-}
-}
-return true;
-},isEmpty:function(obj){
-return !MochiKit.Base.isNotEmpty.apply(this,arguments);
-},isNotEmpty:function(obj){
-for(var i=0;i&lt;arguments.length;i++){
-var o=arguments[i];
-if(!(o&amp;&amp;o.length)){
-return false;
-}
-}
-return true;
-},isArrayLike:function(){
-for(var i=0;i&lt;arguments.length;i++){
-var o=arguments[i];
-var typ=typeof (o);
-if((typ!=&quot;object&quot;&amp;&amp;!(typ==&quot;function&quot;&amp;&amp;typeof (o.item)==&quot;function&quot;))||o===null||typeof (o.length)!=&quot;number&quot;||o.nodeType===3){
-return false;
-}
-}
-return true;
-},isDateLike:function(){
-for(var i=0;i&lt;arguments.length;i++){
-var o=arguments[i];
-if(typeof (o)!=&quot;object&quot;||o===null||typeof (o.getTime)!=&quot;function&quot;){
-return false;
-}
-}
-return true;
-},xmap:function(fn){
-if(fn===null){
-return MochiKit.Base.extend(null,arguments,1);
-}
-var _87=[];
-for(var i=1;i&lt;arguments.length;i++){
-_87.push(fn(arguments[i]));
-}
-return _87;
-},map:function(fn,lst){
-var m=MochiKit.Base;
-var itr=MochiKit.Iter;
-var _8d=m.isArrayLike;
-if(arguments.length&lt;=2){
-if(!_8d(lst)){
-if(itr){
-lst=itr.list(lst);
-if(fn===null){
-return lst;
-}
-}else{
-throw new TypeError(&quot;Argument not an array-like and MochiKit.Iter not present&quot;);
-}
-}
-if(fn===null){
-return m.extend(null,lst);
-}
-var _8e=[];
-for(var i=0;i&lt;lst.length;i++){
-_8e.push(fn(lst[i]));
-}
-return _8e;
-}else{
-if(fn===null){
-fn=Array;
-}
-var _90=null;
-for(i=1;i&lt;arguments.length;i++){
-if(!_8d(arguments[i])){
-if(itr){
-return itr.list(itr.imap.apply(null,arguments));
-}else{
-throw new TypeError(&quot;Argument not an array-like and MochiKit.Iter not present&quot;);
-}
-}
-var l=arguments[i].length;
-if(_90===null||_90&gt;l){
-_90=l;
-}
-}
-_8e=[];
-for(i=0;i&lt;_90;i++){
-var _92=[];
-for(var j=1;j&lt;arguments.length;j++){
-_92.push(arguments[j][i]);
-}
-_8e.push(fn.apply(this,_92));
-}
-return _8e;
-}
-},xfilter:function(fn){
-var _95=[];
-if(fn===null){
-fn=MochiKit.Base.operator.truth;
-}
-for(var i=1;i&lt;arguments.length;i++){
-var o=arguments[i];
-if(fn(o)){
-_95.push(o);
-}
-}
-return _95;
-},filter:function(fn,lst,_9a){
-var _9b=[];
-var m=MochiKit.Base;
-if(!m.isArrayLike(lst)){
-if(MochiKit.Iter){
-lst=MochiKit.Iter.list(lst);
-}else{
-throw new TypeError(&quot;Argument not an array-like and MochiKit.Iter not present&quot;);
-}
-}
-if(fn===null){
-fn=m.operator.truth;
-}
-if(typeof (Array.prototype.filter)==&quot;function&quot;){
-return Array.prototype.filter.call(lst,fn,_9a);
-}else{
-if(typeof (_9a)==&quot;undefined&quot;||_9a===null){
-for(var i=0;i&lt;lst.length;i++){
-var o=lst[i];
-if(fn(o)){
-_9b.push(o);
-}
-}
-}else{
-for(i=0;i&lt;lst.length;i++){
-o=lst[i];
-if(fn.call(_9a,o)){
-_9b.push(o);
-}
-}
-}
-}
-return _9b;
-},_wrapDumbFunction:function(_9f){
-return function(){
-switch(arguments.length){
-case 0:
-return _9f();
-case 1:
-return _9f(arguments[0]);
-case 2:
-return _9f(arguments[0],arguments[1]);
-case 3:
-return _9f(arguments[0],arguments[1],arguments[2]);
-}
-var _a0=[];
-for(var i=0;i&lt;arguments.length;i++){
-_a0.push(&quot;arguments[&quot;+i+&quot;]&quot;);
-}
-return eval(&quot;(func(&quot;+_a0.join(&quot;,&quot;)+&quot;))&quot;);
-};
-},methodcaller:function(_a2){
-var _a3=MochiKit.Base.extend(null,arguments,1);
-if(typeof (_a2)==&quot;function&quot;){
-return function(obj){
-return _a2.apply(obj,_a3);
-};
-}else{
-return function(obj){
-return obj[_a2].apply(obj,_a3);
-};
-}
-},method:function(_a6,_a7){
-var m=MochiKit.Base;
-return m.bind.apply(this,m.extend([_a7,_a6],arguments,2));
-},compose:function(f1,f2){
-var _ab=[];
-var m=MochiKit.Base;
-if(arguments.length===0){
-throw new TypeError(&quot;compose() requires at least one argument&quot;);
-}
-for(var i=0;i&lt;arguments.length;i++){
-var fn=arguments[i];
-if(typeof (fn)!=&quot;function&quot;){
-throw new TypeError(m.repr(fn)+&quot; is not a function&quot;);
-}
-_ab.push(fn);
-}
-return function(){
-var _af=arguments;
-for(var i=_ab.length-1;i&gt;=0;i--){
-_af=[_ab[i].apply(this,_af)];
-}
-return _af[0];
-};
-},bind:function(_b1,_b2){
-if(typeof (_b1)==&quot;string&quot;){
-_b1=_b2[_b1];
-}
-var _b3=_b1.im_func;
-var _b4=_b1.im_preargs;
-var _b5=_b1.im_self;
-var m=MochiKit.Base;
-if(typeof (_b1)==&quot;function&quot;&amp;&amp;typeof (_b1.apply)==&quot;undefined&quot;){
-_b1=m._wrapDumbFunction(_b1);
-}
-if(typeof (_b3)!=&quot;function&quot;){
-_b3=_b1;
-}
-if(typeof (_b2)!=&quot;undefined&quot;){
-_b5=_b2;
-}
-if(typeof (_b4)==&quot;undefined&quot;){
-_b4=[];
-}else{
-_b4=_b4.slice();
-}
-m.extend(_b4,arguments,2);
-var _b7=function(){
-var _b8=arguments;
-var me=arguments.callee;
-if(me.im_preargs.length&gt;0){
-_b8=m.concat(me.im_preargs,_b8);
-}
-var _ba=me.im_self;
-if(!_ba){
-_ba=this;
-}
-return me.im_func.apply(_ba,_b8);
-};
-_b7.im_self=_b5;
-_b7.im_func=_b3;
-_b7.im_preargs=_b4;
-return _b7;
-},bindMethods:function(_bb){
-var _bc=MochiKit.Base.bind;
-for(var k in _bb){
-var _be=_bb[k];
-if(typeof (_be)==&quot;function&quot;){
-_bb[k]=_bc(_be,_bb);
-}
-}
-},registerComparator:function(_bf,_c0,_c1,_c2){
-MochiKit.Base.comparatorRegistry.register(_bf,_c0,_c1,_c2);
-},_primitives:{&quot;boolean&quot;:true,&quot;string&quot;:true,&quot;number&quot;:true},compare:function(a,b){
-if(a==b){
-return 0;
-}
-var _c5=(typeof (a)==&quot;undefined&quot;||a===null);
-var _c6=(typeof (b)==&quot;undefined&quot;||b===null);
-if(_c5&amp;&amp;_c6){
-return 0;
-}else{
-if(_c5){
-return -1;
-}else{
-if(_c6){
-return 1;
-}
-}
-}
-var m=MochiKit.Base;
-var _c8=m._primitives;
-if(!(typeof (a) in _c8&amp;&amp;typeof (b) in _c8)){
-try{
-return m.comparatorRegistry.match(a,b);
-}
-catch(e){
-if(e!=m.NotFound){
-throw e;
-}
-}
-}
-if(a&lt;b){
-return -1;
-}else{
-if(a&gt;b){
-return 1;
-}
-}
-var _c9=m.repr;
-throw new TypeError(_c9(a)+&quot; and &quot;+_c9(b)+&quot; can not be compared&quot;);
-},compareDateLike:function(a,b){
-return MochiKit.Base.compare(a.getTime(),b.getTime());
-},compareArrayLike:function(a,b){
-var _ce=MochiKit.Base.compare;
-var _cf=a.length;
-var _d0=0;
-if(_cf&gt;b.length){
-_d0=1;
-_cf=b.length;
-}else{
-if(_cf&lt;b.length){
-_d0=-1;
-}
-}
-for(var i=0;i&lt;_cf;i++){
-var cmp=_ce(a[i],b[i]);
-if(cmp){
-return cmp;
-}
-}
-return _d0;
-},registerRepr:function(_d3,_d4,_d5,_d6){
-MochiKit.Base.reprRegistry.register(_d3,_d4,_d5,_d6);
-},repr:function(o){
-if(typeof (o)==&quot;undefined&quot;){
-return &quot;undefined&quot;;
-}else{
-if(o===null){
-return &quot;null&quot;;
-}
-}
-try{
-if(typeof (o.__repr__)==&quot;function&quot;){
-return o.__repr__();
-}else{
-if(typeof (o.repr)==&quot;function&quot;&amp;&amp;o.repr!=arguments.callee){
-return o.repr();
-}
-}
-return MochiKit.Base.reprRegistry.match(o);
-}
-catch(e){
-if(typeof (o.NAME)==&quot;string&quot;&amp;&amp;(o.toString==Function.prototype.toString||o.toString==Object.prototype.toString)){
-return o.NAME;
-}
-}
-try{
-var _d8=(o+&quot;&quot;);
-}
-catch(e){
-return &quot;[&quot;+typeof (o)+&quot;]&quot;;
-}
-if(typeof (o)==&quot;function&quot;){
-_d8=_d8.replace(/^\s+/,&quot;&quot;).replace(/\s+/g,&quot; &quot;);
-var idx=_d8.indexOf(&quot;{&quot;);
-if(idx!=-1){
-_d8=_d8.substr(0,idx)+&quot;{...}&quot;;
-}
-}
-return _d8;
-},reprArrayLike:function(o){
-var m=MochiKit.Base;
-return &quot;[&quot;+m.map(m.repr,o).join(&quot;, &quot;)+&quot;]&quot;;
-},reprString:function(o){
-return (&quot;\&quot;&quot;+o.replace(/([&quot;\\])/g,&quot;\\$1&quot;)+&quot;\&quot;&quot;).replace(/[\f]/g,&quot;\\f&quot;).replace(/[\b]/g,&quot;\\b&quot;).replace(/[\n]/g,&quot;\\n&quot;).replace(/[\t]/g,&quot;\\t&quot;).replace(/[\r]/g,&quot;\\r&quot;);
-},reprNumber:function(o){
-return o+&quot;&quot;;
-},registerJSON:function(_de,_df,_e0,_e1){
-MochiKit.Base.jsonRegistry.register(_de,_df,_e0,_e1);
-},evalJSON:function(){
-return eval(&quot;(&quot;+MochiKit.Base._filterJSON(arguments[0])+&quot;)&quot;);
-},_filterJSON:function(s){
-var m=s.match(/^\s*\/\*(.*)\*\/\s*$/);
-if(m){
-return m[1];
-}
-return s;
-},serializeJSON:function(o){
-var _e5=typeof (o);
-if(_e5==&quot;number&quot;||_e5==&quot;boolean&quot;){
-return o+&quot;&quot;;
-}else{
-if(o===null){
-return &quot;null&quot;;
-}
-}
-var m=MochiKit.Base;
-var _e7=m.reprString;
-if(_e5==&quot;string&quot;){
-return _e7(o);
-}
-var me=arguments.callee;
-var _e9;
-if(typeof (o.__json__)==&quot;function&quot;){
-_e9=o.__json__();
-if(o!==_e9){
-return me(_e9);
-}
-}
-if(typeof (o.json)==&quot;function&quot;){
-_e9=o.json();
-if(o!==_e9){
-return me(_e9);
-}
-}
-if(_e5!=&quot;function&quot;&amp;&amp;typeof (o.length)==&quot;number&quot;){
-var res=[];
-for(var i=0;i&lt;o.length;i++){
-var val=me(o[i]);
-if(typeof (val)!=&quot;string&quot;){
-val=&quot;undefined&quot;;
-}
-res.push(val);
-}
-return &quot;[&quot;+res.join(&quot;, &quot;)+&quot;]&quot;;
-}
-try{
-_e9=m.jsonRegistry.match(o);
-if(o!==_e9){
-return me(_e9);
-}
-}
-catch(e){
-if(e!=m.NotFound){
-throw e;
-}
-}
-if(_e5==&quot;undefined&quot;){
-throw new TypeError(&quot;undefined can not be serialized as JSON&quot;);
-}
-if(_e5==&quot;function&quot;){
-return null;
-}
-res=[];
-for(var k in o){
-var _ee;
-if(typeof (k)==&quot;number&quot;){
-_ee=&quot;\&quot;&quot;+k+&quot;\&quot;&quot;;
-}else{
-if(typeof (k)==&quot;string&quot;){
-_ee=_e7(k);
-}else{
-continue;
-}
-}
-val=me(o[k]);
-if(typeof (val)!=&quot;string&quot;){
-continue;
-}
-res.push(_ee+&quot;:&quot;+val);
-}
-return &quot;{&quot;+res.join(&quot;, &quot;)+&quot;}&quot;;
-},objEqual:function(a,b){
-return (MochiKit.Base.compare(a,b)===0);
-},arrayEqual:function(_f1,arr){
-if(_f1.length!=arr.length){
-return false;
-}
-return (MochiKit.Base.compare(_f1,arr)===0);
-},concat:function(){
-var _f3=[];
-var _f4=MochiKit.Base.extend;
-for(var i=0;i&lt;arguments.length;i++){
-_f4(_f3,arguments[i]);
-}
-return _f3;
-},keyComparator:function(key){
-var m=MochiKit.Base;
-var _f8=m.compare;
-if(arguments.length==1){
-return function(a,b){
-return _f8(a[key],b[key]);
-};
-}
-var _fb=m.extend(null,arguments);
-return function(a,b){
-var _fe=0;
-for(var i=0;(_fe===0)&amp;&amp;(i&lt;_fb.length);i++){
-var key=_fb[i];
-_fe=_f8(a[key],b[key]);
-}
-return _fe;
-};
-},reverseKeyComparator:function(key){
-var _102=MochiKit.Base.keyComparator.apply(this,arguments);
-return function(a,b){
-return _102(b,a);
-};
-},partial:function(func){
-var m=MochiKit.Base;
-return m.bind.apply(this,m.extend([func,undefined],arguments,1));
-},listMinMax:function(_107,lst){
-if(lst.length===0){
-return null;
-}
-var cur=lst[0];
-var _10a=MochiKit.Base.compare;
-for(var i=1;i&lt;lst.length;i++){
-var o=lst[i];
-if(_10a(o,cur)==_107){
-cur=o;
-}
-}
-return cur;
-},objMax:function(){
-return MochiKit.Base.listMinMax(1,arguments);
-},objMin:function(){
-return MochiKit.Base.listMinMax(-1,arguments);
-},findIdentical:function(lst,_10e,_10f,end){
-if(typeof (end)==&quot;undefined&quot;||end===null){
-end=lst.length;
-}
-if(typeof (_10f)==&quot;undefined&quot;||_10f===null){
-_10f=0;
-}
-for(var i=_10f;i&lt;end;i++){
-if(lst[i]===_10e){
-return i;
-}
-}
-return -1;
-},mean:function(){
-var sum=0;
-var m=MochiKit.Base;
-var args=m.extend(null,arguments);
-var _115=args.length;
-while(args.length){
-var o=args.shift();
-if(o&amp;&amp;typeof (o)==&quot;object&quot;&amp;&amp;typeof (o.length)==&quot;number&quot;){
-_115+=o.length-1;
-for(var i=o.length-1;i&gt;=0;i--){
-sum+=o[i];
-}
-}else{
-sum+=o;
-}
-}
-if(_115&lt;=0){
-throw new TypeError(&quot;mean() requires at least one argument&quot;);
-}
-return sum/_115;
-},median:function(){
-var data=MochiKit.Base.flattenArguments(arguments);
-if(data.length===0){
-throw new TypeError(&quot;median() requires at least one argument&quot;);
-}
-data.sort(compare);
-if(data.length%2==0){
-var _119=data.length/2;
-return (data[_119]+data[_119-1])/2;
-}else{
-return data[(data.length-1)/2];
-}
-},findValue:function(lst,_11b,_11c,end){
-if(typeof (end)==&quot;undefined&quot;||end===null){
-end=lst.length;
-}
-if(typeof (_11c)==&quot;undefined&quot;||_11c===null){
-_11c=0;
-}
-var cmp=MochiKit.Base.compare;
-for(var i=_11c;i&lt;end;i++){
-if(cmp(lst[i],_11b)===0){
-return i;
-}
-}
-return -1;
-},nodeWalk:function(node,_121){
-var _122=[node];
-var _123=MochiKit.Base.extend;
-while(_122.length){
-var res=_121(_122.shift());
-if(res){
-_123(_122,res);
-}
-}
-},nameFunctions:function(_125){
-var base=_125.NAME;
-if(typeof (base)==&quot;undefined&quot;){
-base=&quot;&quot;;
-}else{
-base=base+&quot;.&quot;;
-}
-for(var name in _125){
-var o=_125[name];
-if(typeof (o)==&quot;function&quot;&amp;&amp;typeof (o.NAME)==&quot;undefined&quot;){
-try{
-o.NAME=base+name;
-}
-catch(e){
-}
-}
-}
-},queryString:function(_129,_12a){
-if(typeof (MochiKit.DOM)!=&quot;undefined&quot;&amp;&amp;arguments.length==1&amp;&amp;(typeof (_129)==&quot;string&quot;||(typeof (_129.nodeType)!=&quot;undefined&quot;&amp;&amp;_129.nodeType&gt;0))){
-var kv=MochiKit.DOM.formContents(_129);
-_129=kv[0];
-_12a=kv[1];
-}else{
-if(arguments.length==1){
-if(typeof (_129.length)==&quot;number&quot;&amp;&amp;_129.length==2){
-return arguments.callee(_129[0],_129[1]);
-}
-var o=_129;
-_129=[];
-_12a=[];
-for(var k in o){
-var v=o[k];
-if(typeof (v)==&quot;function&quot;){
-continue;
-}else{
-if(MochiKit.Base.isArrayLike(v)){
-for(var i=0;i&lt;v.length;i++){
-_129.push(k);
-_12a.push(v[i]);
-}
-}else{
-_129.push(k);
-_12a.push(v);
-}
-}
-}
-}
-}
-var rval=[];
-var len=Math.min(_129.length,_12a.length);
-var _132=MochiKit.Base.urlEncode;
-for(var i=0;i&lt;len;i++){
-v=_12a[i];
-if(typeof (v)!=&quot;undefined&quot;&amp;&amp;v!==null){
-rval.push(_132(_129[i])+&quot;=&quot;+_132(v));
-}
-}
-return rval.join(&quot;&amp;&quot;);
-},parseQueryString:function(_133,_134){
-var qstr=(_133.charAt(0)==&quot;?&quot;)?_133.substring(1):_133;
-var _136=qstr.replace(/\+/g,&quot;%20&quot;).split(/(\&amp;amp\;|\&amp;\#38\;|\&amp;#x26;|\&amp;)/);
-var o={};
-var _138;
-if(typeof (decodeURIComponent)!=&quot;undefined&quot;){
-_138=decodeURIComponent;
-}else{
-_138=unescape;
-}
-if(_134){
-for(var i=0;i&lt;_136.length;i++){
-var pair=_136[i].split(&quot;=&quot;);
-var name=_138(pair.shift());
-if(!name){
-continue;
-}
-var arr=o[name];
-if(!(arr instanceof Array)){
-arr=[];
-o[name]=arr;
-}
-arr.push(_138(pair.join(&quot;=&quot;)));
-}
-}else{
-for(i=0;i&lt;_136.length;i++){
-pair=_136[i].split(&quot;=&quot;);
-var name=pair.shift();
-if(!name){
-continue;
-}
-o[_138(name)]=_138(pair.join(&quot;=&quot;));
-}
-}
-return o;
-}});
-MochiKit.Base.AdapterRegistry=function(){
-this.pairs=[];
-};
-MochiKit.Base.AdapterRegistry.prototype={register:function(name,_13e,wrap,_140){
-if(_140){
-this.pairs.unshift([name,_13e,wrap]);
-}else{
-this.pairs.push([name,_13e,wrap]);
-}
-},match:function(){
-for(var i=0;i&lt;this.pairs.length;i++){
-var pair=this.pairs[i];
-if(pair[1].apply(this,arguments)){
-return pair[2].apply(this,arguments);
-}
-}
-throw MochiKit.Base.NotFound;
-},unregister:function(name){
-for(var i=0;i&lt;this.pairs.length;i++){
-var pair=this.pairs[i];
-if(pair[0]==name){
-this.pairs.splice(i,1);
-return true;
-}
-}
-return false;
-}};
-MochiKit.Base.EXPORT=[&quot;flattenArray&quot;,&quot;noop&quot;,&quot;camelize&quot;,&quot;counter&quot;,&quot;clone&quot;,&quot;extend&quot;,&quot;update&quot;,&quot;updatetree&quot;,&quot;setdefault&quot;,&quot;keys&quot;,&quot;values&quot;,&quot;items&quot;,&quot;NamedError&quot;,&quot;operator&quot;,&quot;forwardCall&quot;,&quot;itemgetter&quot;,&quot;typeMatcher&quot;,&quot;isCallable&quot;,&quot;isUndefined&quot;,&quot;isUndefinedOrNull&quot;,&quot;isNull&quot;,&quot;isEmpty&quot;,&quot;isNotEmpty&quot;,&quot;isArrayLike&quot;,&quot;isDateLike&quot;,&quot;xmap&quot;,&quot;map&quot;,&quot;xfilter&quot;,&quot;filter&quot;,&quot;methodcaller&quot;,&quot;compose&quot;,&quot;bind&quot;,&quot;bindMethods&quot;,&quot;NotFound&quot;,&quot;AdapterRegistry&quot;,&quot;registerComparator&quot;,&quot;compare&quot;,&quot;registerRepr&quot;,&quot;repr&quot;,&quot;objEqual&quot;,&quot;arrayEqual&quot;,&quot;concat&quot;,&quot;keyComparator&quot;,&quot;reverseKeyComparator&quot;,&quot;partial&quot;,&quot;merge&quot;,&quot;listMinMax&quot;,&quot;listMax&quot;,&quot;listMin&quot;,&quot;objMax&quot;,&quot;objMin&quot;,&quot;nodeWalk&quot;,&quot;zip&quot;,&quot;urlEncode&quot;,&quot;queryString&quot;,&quot;serializeJSON&quot;,&quot;registerJSON&quot;,&quot;evalJSON&quot;,&quot;parseQueryString&quot;,&quot;findValue&quot;,&quot;findIdentical&quot;,&quot;flattenArguments&quot;,&quot;method&quot;,&quot;average&quot;,&quot;mean&quot;,&quot;median&quot;];
-MochiKit.Base.EXPORT_OK=[&quot;nameFunctions&quot;,&quot;comparatorRegistry&quot;,&quot;reprRegistry&quot;,&quot;jsonRegistry&quot;,&quot;compareDateLike&quot;,&quot;compareArrayLike&quot;,&quot;reprArrayLike&quot;,&quot;reprString&quot;,&quot;reprNumber&quot;];
-MochiKit.Base._exportSymbols=function(_146,_147){
-if(!MochiKit.__export__){
-return;
-}
-var all=_147.EXPORT_TAGS[&quot;:all&quot;];
-for(var i=0;i&lt;all.length;i++){
-_146[all[i]]=_147[all[i]];
-}
-};
-MochiKit.Base.__new__=function(){
-var m=this;
-m.noop=m.operator.identity;
-m.forward=m.forwardCall;
-m.find=m.findValue;
-if(typeof (encodeURIComponent)!=&quot;undefined&quot;){
-m.urlEncode=function(_14b){
-return encodeURIComponent(_14b).replace(/\'/g,&quot;%27&quot;);
-};
-}else{
-m.urlEncode=function(_14c){
-return escape(_14c).replace(/\+/g,&quot;%2B&quot;).replace(/\&quot;/g,&quot;%22&quot;).rval.replace(/\'/g,&quot;%27&quot;);
-};
-}
-m.NamedError=function(name){
-this.message=name;
-this.name=name;
-};
-m.NamedError.prototype=new Error();
-m.update(m.NamedError.prototype,{repr:function(){
-if(this.message&amp;&amp;this.message!=this.name){
-return this.name+&quot;(&quot;+m.repr(this.message)+&quot;)&quot;;
-}else{
-return this.name+&quot;()&quot;;
-}
-},toString:m.forwardCall(&quot;repr&quot;)});
-m.NotFound=new m.NamedError(&quot;MochiKit.Base.NotFound&quot;);
-m.listMax=m.partial(m.listMinMax,1);
-m.listMin=m.partial(m.listMinMax,-1);
-m.isCallable=m.typeMatcher(&quot;function&quot;);
-m.isUndefined=m.typeMatcher(&quot;undefined&quot;);
-m.merge=m.partial(m.update,null);
-m.zip=m.partial(m.map,null);
-m.average=m.mean;
-m.comparatorRegistry=new m.AdapterRegistry();
-m.registerComparator(&quot;dateLike&quot;,m.isDateLike,m.compareDateLike);
-m.registerComparator(&quot;arrayLike&quot;,m.isArrayLike,m.compareArrayLike);
-m.reprRegistry=new m.AdapterRegistry();
-m.registerRepr(&quot;arrayLike&quot;,m.isArrayLike,m.reprArrayLike);
-m.registerRepr(&quot;string&quot;,m.typeMatcher(&quot;string&quot;),m.reprString);
-m.registerRepr(&quot;numbers&quot;,m.typeMatcher(&quot;number&quot;,&quot;boolean&quot;),m.reprNumber);
-m.jsonRegistry=new m.AdapterRegistry();
-var all=m.concat(m.EXPORT,m.EXPORT_OK);
-m.EXPORT_TAGS={&quot;:common&quot;:m.concat(m.EXPORT_OK),&quot;:all&quot;:all};
-m.nameFunctions(this);
-};
-MochiKit.Base.__new__();
-if(MochiKit.__export__){
-compare=MochiKit.Base.compare;
-compose=MochiKit.Base.compose;
-serializeJSON=MochiKit.Base.serializeJSON;
-mean=MochiKit.Base.mean;
-median=MochiKit.Base.median;
-}
-MochiKit.Base._exportSymbols(this,MochiKit.Base);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Iter&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Iter depends on MochiKit.Base!&quot;;
-}
-if(typeof (MochiKit.Iter)==&quot;undefined&quot;){
-MochiKit.Iter={};
-}
-MochiKit.Iter.NAME=&quot;MochiKit.Iter&quot;;
-MochiKit.Iter.VERSION=&quot;1.4&quot;;
-MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-},toString:function(){
-return this.__repr__();
-},registerIteratorFactory:function(name,_150,_151,_152){
-MochiKit.Iter.iteratorRegistry.register(name,_150,_151,_152);
-},iter:function(_153,_154){
-var self=MochiKit.Iter;
-if(arguments.length==2){
-return self.takewhile(function(a){
-return a!=_154;
-},_153);
-}
-if(typeof (_153.next)==&quot;function&quot;){
-return _153;
-}else{
-if(typeof (_153.iter)==&quot;function&quot;){
-return _153.iter();
-}
-}
-try{
-return self.iteratorRegistry.match(_153);
-}
-catch(e){
-var m=MochiKit.Base;
-if(e==m.NotFound){
-e=new TypeError(typeof (_153)+&quot;: &quot;+m.repr(_153)+&quot; is not iterable&quot;);
-}
-throw e;
-}
-},count:function(n){
-if(!n){
-n=0;
-}
-var m=MochiKit.Base;
-return {repr:function(){
-return &quot;count(&quot;+n+&quot;)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:m.counter(n)};
-},cycle:function(p){
-var self=MochiKit.Iter;
-var m=MochiKit.Base;
-var lst=[];
-var _15e=self.iter(p);
-return {repr:function(){
-return &quot;cycle(...)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-try{
-var rval=_15e.next();
-lst.push(rval);
-return rval;
-}
-catch(e){
-if(e!=self.StopIteration){
-throw e;
-}
-if(lst.length===0){
-this.next=function(){
-throw self.StopIteration;
-};
-}else{
-var i=-1;
-this.next=function(){
-i=(i+1)%lst.length;
-return lst[i];
-};
-}
-return this.next();
-}
-}};
-},repeat:function(elem,n){
-var m=MochiKit.Base;
-if(typeof (n)==&quot;undefined&quot;){
-return {repr:function(){
-return &quot;repeat(&quot;+m.repr(elem)+&quot;)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-return elem;
-}};
-}
-return {repr:function(){
-return &quot;repeat(&quot;+m.repr(elem)+&quot;, &quot;+n+&quot;)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-if(n&lt;=0){
-throw MochiKit.Iter.StopIteration;
-}
-n-=1;
-return elem;
-}};
-},next:function(_164){
-return _164.next();
-},izip:function(p,q){
-var m=MochiKit.Base;
-var self=MochiKit.Iter;
-var next=self.next;
-var _16a=m.map(self.iter,arguments);
-return {repr:function(){
-return &quot;izip(...)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-return m.map(next,_16a);
-}};
-},ifilter:function(pred,seq){
-var m=MochiKit.Base;
-seq=MochiKit.Iter.iter(seq);
-if(pred===null){
-pred=m.operator.truth;
-}
-return {repr:function(){
-return &quot;ifilter(...)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-while(true){
-var rval=seq.next();
-if(pred(rval)){
-return rval;
-}
-}
-return undefined;
-}};
-},ifilterfalse:function(pred,seq){
-var m=MochiKit.Base;
-seq=MochiKit.Iter.iter(seq);
-if(pred===null){
-pred=m.operator.truth;
-}
-return {repr:function(){
-return &quot;ifilterfalse(...)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-while(true){
-var rval=seq.next();
-if(!pred(rval)){
-return rval;
-}
-}
-return undefined;
-}};
-},islice:function(seq){
-var self=MochiKit.Iter;
-var m=MochiKit.Base;
-seq=self.iter(seq);
-var _176=0;
-var stop=0;
-var step=1;
-var i=-1;
-if(arguments.length==2){
-stop=arguments[1];
-}else{
-if(arguments.length==3){
-_176=arguments[1];
-stop=arguments[2];
-}else{
-_176=arguments[1];
-stop=arguments[2];
-step=arguments[3];
-}
-}
-return {repr:function(){
-return &quot;islice(&quot;+[&quot;...&quot;,_176,stop,step].join(&quot;, &quot;)+&quot;)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-var rval;
-while(i&lt;_176){
-rval=seq.next();
-i++;
-}
-if(_176&gt;=stop){
-throw self.StopIteration;
-}
-_176+=step;
-return rval;
-}};
-},imap:function(fun,p,q){
-var m=MochiKit.Base;
-var self=MochiKit.Iter;
-var _180=m.map(self.iter,m.extend(null,arguments,1));
-var map=m.map;
-var next=self.next;
-return {repr:function(){
-return &quot;imap(...)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-return fun.apply(this,map(next,_180));
-}};
-},applymap:function(fun,seq,self){
-seq=MochiKit.Iter.iter(seq);
-var m=MochiKit.Base;
-return {repr:function(){
-return &quot;applymap(...)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-return fun.apply(self,seq.next());
-}};
-},chain:function(p,q){
-var self=MochiKit.Iter;
-var m=MochiKit.Base;
-if(arguments.length==1){
-return self.iter(arguments[0]);
-}
-var _18b=m.map(self.iter,arguments);
-return {repr:function(){
-return &quot;chain(...)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-while(_18b.length&gt;1){
-try{
-return _18b[0].next();
-}
-catch(e){
-if(e!=self.StopIteration){
-throw e;
-}
-_18b.shift();
-}
-}
-if(_18b.length==1){
-var arg=_18b.shift();
-this.next=m.bind(&quot;next&quot;,arg);
-return this.next();
-}
-throw self.StopIteration;
-}};
-},takewhile:function(pred,seq){
-var self=MochiKit.Iter;
-seq=self.iter(seq);
-return {repr:function(){
-return &quot;takewhile(...)&quot;;
-},toString:MochiKit.Base.forwardCall(&quot;repr&quot;),next:function(){
-var rval=seq.next();
-if(!pred(rval)){
-this.next=function(){
-throw self.StopIteration;
-};
-this.next();
-}
-return rval;
-}};
-},dropwhile:function(pred,seq){
-seq=MochiKit.Iter.iter(seq);
-var m=MochiKit.Base;
-var bind=m.bind;
-return {&quot;repr&quot;:function(){
-return &quot;dropwhile(...)&quot;;
-},&quot;toString&quot;:m.forwardCall(&quot;repr&quot;),&quot;next&quot;:function(){
-while(true){
-var rval=seq.next();
-if(!pred(rval)){
-break;
-}
-}
-this.next=bind(&quot;next&quot;,seq);
-return rval;
-}};
-},_tee:function(_196,sync,_198){
-sync.pos[_196]=-1;
-var m=MochiKit.Base;
-var _19a=m.listMin;
-return {repr:function(){
-return &quot;tee(&quot;+_196+&quot;, ...)&quot;;
-},toString:m.forwardCall(&quot;repr&quot;),next:function(){
-var rval;
-var i=sync.pos[_196];
-if(i==sync.max){
-rval=_198.next();
-sync.deque.push(rval);
-sync.max+=1;
-sync.pos[_196]+=1;
-}else{
-rval=sync.deque[i-sync.min];
-sync.pos[_196]+=1;
-if(i==sync.min&amp;&amp;_19a(sync.pos)!=sync.min){
-sync.min+=1;
-sync.deque.shift();
-}
-}
-return rval;
-}};
-},tee:function(_19d,n){
-var rval=[];
-var sync={&quot;pos&quot;:[],&quot;deque&quot;:[],&quot;max&quot;:-1,&quot;min&quot;:-1};
-if(arguments.length==1||typeof (n)==&quot;undefined&quot;||n===null){
-n=2;
-}
-var self=MochiKit.Iter;
-_19d=self.iter(_19d);
-var _tee=self._tee;
-for(var i=0;i&lt;n;i++){
-rval.push(_tee(i,sync,_19d));
-}
-return rval;
-},list:function(_1a4){
-var rval;
-if(_1a4 instanceof Array){
-return _1a4.slice();
-}
-if(typeof (_1a4)==&quot;function&quot;&amp;&amp;!(_1a4 instanceof Function)&amp;&amp;typeof (_1a4.length)==&quot;number&quot;){
-rval=[];
-for(var i=0;i&lt;_1a4.length;i++){
-rval.push(_1a4[i]);
-}
-return rval;
-}
-var self=MochiKit.Iter;
-_1a4=self.iter(_1a4);
-var rval=[];
-try{
-while(true){
-rval.push(_1a4.next());
-}
-}
-catch(e){
-if(e!=self.StopIteration){
-throw e;
-}
-return rval;
-}
-return undefined;
-},reduce:function(fn,_1a9,_1aa){
-var i=0;
-var x=_1aa;
-var self=MochiKit.Iter;
-_1a9=self.iter(_1a9);
-if(arguments.length&lt;3){
-try{
-x=_1a9.next();
-}
-catch(e){
-if(e==self.StopIteration){
-e=new TypeError(&quot;reduce() of empty sequence with no initial value&quot;);
-}
-throw e;
-}
-i++;
-}
-try{
-while(true){
-x=fn(x,_1a9.next());
-}
-}
-catch(e){
-if(e!=self.StopIteration){
-throw e;
-}
-}
-return x;
-},range:function(){
-var _1ae=0;
-var stop=0;
-var step=1;
-if(arguments.length==1){
-stop=arguments[0];
-}else{
-if(arguments.length==2){
-_1ae=arguments[0];
-stop=arguments[1];
-}else{
-if(arguments.length==3){
-_1ae=arguments[0];
-stop=arguments[1];
-step=arguments[2];
-}else{
-throw new TypeError(&quot;range() takes 1, 2, or 3 arguments!&quot;);
-}
-}
-}
-if(step===0){
-throw new TypeError(&quot;range() step must not be 0&quot;);
-}
-return {next:function(){
-if((step&gt;0&amp;&amp;_1ae&gt;=stop)||(step&lt;0&amp;&amp;_1ae&lt;=stop)){
-throw MochiKit.Iter.StopIteration;
-}
-var rval=_1ae;
-_1ae+=step;
-return rval;
-},repr:function(){
-return &quot;range(&quot;+[_1ae,stop,step].join(&quot;, &quot;)+&quot;)&quot;;
-},toString:MochiKit.Base.forwardCall(&quot;repr&quot;)};
-},sum:function(_1b2,_1b3){
-if(typeof (_1b3)==&quot;undefined&quot;||_1b3===null){
-_1b3=0;
-}
-var x=_1b3;
-var self=MochiKit.Iter;
-_1b2=self.iter(_1b2);
-try{
-while(true){
-x+=_1b2.next();
-}
-}
-catch(e){
-if(e!=self.StopIteration){
-throw e;
-}
-}
-return x;
-},exhaust:function(_1b6){
-var self=MochiKit.Iter;
-_1b6=self.iter(_1b6);
-try{
-while(true){
-_1b6.next();
-}
-}
-catch(e){
-if(e!=self.StopIteration){
-throw e;
-}
-}
-},forEach:function(_1b8,func,self){
-var m=MochiKit.Base;
-if(arguments.length&gt;2){
-func=m.bind(func,self);
-}
-if(m.isArrayLike(_1b8)){
-try{
-for(var i=0;i&lt;_1b8.length;i++){
-func(_1b8[i]);
-}
-}
-catch(e){
-if(e!=MochiKit.Iter.StopIteration){
-throw e;
-}
-}
-}else{
-self=MochiKit.Iter;
-self.exhaust(self.imap(func,_1b8));
-}
-},every:function(_1bd,func){
-var self=MochiKit.Iter;
-try{
-self.ifilterfalse(func,_1bd).next();
-return false;
-}
-catch(e){
-if(e!=self.StopIteration){
-throw e;
-}
-return true;
-}
-},sorted:function(_1c0,cmp){
-var rval=MochiKit.Iter.list(_1c0);
-if(arguments.length==1){
-cmp=MochiKit.Base.compare;
-}
-rval.sort(cmp);
-return rval;
-},reversed:function(_1c3){
-var rval=MochiKit.Iter.list(_1c3);
-rval.reverse();
-return rval;
-},some:function(_1c5,func){
-var self=MochiKit.Iter;
-try{
-self.ifilter(func,_1c5).next();
-return true;
-}
-catch(e){
-if(e!=self.StopIteration){
-throw e;
-}
-return false;
-}
-},iextend:function(lst,_1c9){
-if(MochiKit.Base.isArrayLike(_1c9)){
-for(var i=0;i&lt;_1c9.length;i++){
-lst.push(_1c9[i]);
-}
-}else{
-var self=MochiKit.Iter;
-_1c9=self.iter(_1c9);
-try{
-while(true){
-lst.push(_1c9.next());
-}
-}
-catch(e){
-if(e!=self.StopIteration){
-throw e;
-}
-}
-}
-return lst;
-},groupby:function(_1cc,_1cd){
-var m=MochiKit.Base;
-var self=MochiKit.Iter;
-if(arguments.length&lt;2){
-_1cd=m.operator.identity;
-}
-_1cc=self.iter(_1cc);
-var pk=undefined;
-var k=undefined;
-var v;
-function fetch(){
-v=_1cc.next();
-k=_1cd(v);
-}
-function eat(){
-var ret=v;
-v=undefined;
-return ret;
-}
-var _1d4=true;
-var _1d5=m.compare;
-return {repr:function(){
-return &quot;groupby(...)&quot;;
-},next:function(){
-while(_1d5(k,pk)===0){
-fetch();
-if(_1d4){
-_1d4=false;
-break;
-}
-}
-pk=k;
-return [k,{next:function(){
-if(v==undefined){
-fetch();
-}
-if(_1d5(k,pk)!==0){
-throw self.StopIteration;
-}
-return eat();
-}}];
-}};
-},groupby_as_array:function(_1d6,_1d7){
-var m=MochiKit.Base;
-var self=MochiKit.Iter;
-if(arguments.length&lt;2){
-_1d7=m.operator.identity;
-}
-_1d6=self.iter(_1d6);
-var _1da=[];
-var _1db=true;
-var _1dc;
-var _1dd=m.compare;
-while(true){
-try{
-var _1de=_1d6.next();
-var key=_1d7(_1de);
-}
-catch(e){
-if(e==self.StopIteration){
-break;
-}
-throw e;
-}
-if(_1db||_1dd(key,_1dc)!==0){
-var _1e0=[];
-_1da.push([key,_1e0]);
-}
-_1e0.push(_1de);
-_1db=false;
-_1dc=key;
-}
-return _1da;
-},arrayLikeIter:function(_1e1){
-var i=0;
-return {repr:function(){
-return &quot;arrayLikeIter(...)&quot;;
-},toString:MochiKit.Base.forwardCall(&quot;repr&quot;),next:function(){
-if(i&gt;=_1e1.length){
-throw MochiKit.Iter.StopIteration;
-}
-return _1e1[i++];
-}};
-},hasIterateNext:function(_1e3){
-return (_1e3&amp;&amp;typeof (_1e3.iterateNext)==&quot;function&quot;);
-},iterateNextIter:function(_1e4){
-return {repr:function(){
-return &quot;iterateNextIter(...)&quot;;
-},toString:MochiKit.Base.forwardCall(&quot;repr&quot;),next:function(){
-var rval=_1e4.iterateNext();
-if(rval===null||rval===undefined){
-throw MochiKit.Iter.StopIteration;
-}
-return rval;
-}};
-}});
-MochiKit.Iter.EXPORT_OK=[&quot;iteratorRegistry&quot;,&quot;arrayLikeIter&quot;,&quot;hasIterateNext&quot;,&quot;iterateNextIter&quot;];
-MochiKit.Iter.EXPORT=[&quot;StopIteration&quot;,&quot;registerIteratorFactory&quot;,&quot;iter&quot;,&quot;count&quot;,&quot;cycle&quot;,&quot;repeat&quot;,&quot;next&quot;,&quot;izip&quot;,&quot;ifilter&quot;,&quot;ifilterfalse&quot;,&quot;islice&quot;,&quot;imap&quot;,&quot;applymap&quot;,&quot;chain&quot;,&quot;takewhile&quot;,&quot;dropwhile&quot;,&quot;tee&quot;,&quot;list&quot;,&quot;reduce&quot;,&quot;range&quot;,&quot;sum&quot;,&quot;exhaust&quot;,&quot;forEach&quot;,&quot;every&quot;,&quot;sorted&quot;,&quot;reversed&quot;,&quot;some&quot;,&quot;iextend&quot;,&quot;groupby&quot;,&quot;groupby_as_array&quot;];
-MochiKit.Iter.__new__=function(){
-var m=MochiKit.Base;
-if(typeof (StopIteration)!=&quot;undefined&quot;){
-this.StopIteration=StopIteration;
-}else{
-this.StopIteration=new m.NamedError(&quot;StopIteration&quot;);
-}
-this.iteratorRegistry=new m.AdapterRegistry();
-this.registerIteratorFactory(&quot;arrayLike&quot;,m.isArrayLike,this.arrayLikeIter);
-this.registerIteratorFactory(&quot;iterateNext&quot;,this.hasIterateNext,this.iterateNextIter);
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-m.nameFunctions(this);
-};
-MochiKit.Iter.__new__();
-if(MochiKit.__export__){
-reduce=MochiKit.Iter.reduce;
-}
-MochiKit.Base._exportSymbols(this,MochiKit.Iter);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Logging&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Logging depends on MochiKit.Base!&quot;;
-}
-if(typeof (MochiKit.Logging)==&quot;undefined&quot;){
-MochiKit.Logging={};
-}
-MochiKit.Logging.NAME=&quot;MochiKit.Logging&quot;;
-MochiKit.Logging.VERSION=&quot;1.4&quot;;
-MochiKit.Logging.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.Logging.toString=function(){
-return this.__repr__();
-};
-MochiKit.Logging.EXPORT=[&quot;LogLevel&quot;,&quot;LogMessage&quot;,&quot;Logger&quot;,&quot;alertListener&quot;,&quot;logger&quot;,&quot;log&quot;,&quot;logError&quot;,&quot;logDebug&quot;,&quot;logFatal&quot;,&quot;logWarning&quot;];
-MochiKit.Logging.EXPORT_OK=[&quot;logLevelAtLeast&quot;,&quot;isLogMessage&quot;,&quot;compareLogMessage&quot;];
-MochiKit.Logging.LogMessage=function(num,_1e8,info){
-this.num=num;
-this.level=_1e8;
-this.info=info;
-this.timestamp=new Date();
-};
-MochiKit.Logging.LogMessage.prototype={repr:function(){
-var m=MochiKit.Base;
-return &quot;LogMessage(&quot;+m.map(m.repr,[this.num,this.level,this.info]).join(&quot;, &quot;)+&quot;)&quot;;
-},toString:MochiKit.Base.forwardCall(&quot;repr&quot;)};
-MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_1eb){
-var self=MochiKit.Logging;
-if(typeof (_1eb)==&quot;string&quot;){
-_1eb=self.LogLevel[_1eb];
-}
-return function(msg){
-var _1ee=msg.level;
-if(typeof (_1ee)==&quot;string&quot;){
-_1ee=self.LogLevel[_1ee];
-}
-return _1ee&gt;=_1eb;
-};
-},isLogMessage:function(){
-var _1ef=MochiKit.Logging.LogMessage;
-for(var i=0;i&lt;arguments.length;i++){
-if(!(arguments[i] instanceof _1ef)){
-return false;
-}
-}
-return true;
-},compareLogMessage:function(a,b){
-return MochiKit.Base.compare([a.level,a.info],[b.level,b.info]);
-},alertListener:function(msg){
-alert(&quot;num: &quot;+msg.num+&quot;\nlevel: &quot;+msg.level+&quot;\ninfo: &quot;+msg.info.join(&quot; &quot;));
-}});
-MochiKit.Logging.Logger=function(_1f4){
-this.counter=0;
-if(typeof (_1f4)==&quot;undefined&quot;||_1f4===null){
-_1f4=-1;
-}
-this.maxSize=_1f4;
-this._messages=[];
-this.listeners={};
-this.useNativeConsole=false;
-};
-MochiKit.Logging.Logger.prototype={clear:function(){
-this._messages.splice(0,this._messages.length);
-},logToConsole:function(msg){
-if(typeof (window)!=&quot;undefined&quot;&amp;&amp;window.console&amp;&amp;window.console.log){
-window.console.log(msg.replace(/%/g,&quot;\uff05&quot;));
-}else{
-if(typeof (opera)!=&quot;undefined&quot;&amp;&amp;opera.postError){
-opera.postError(msg);
-}else{
-if(typeof (printfire)==&quot;function&quot;){
-printfire(msg);
-}else{
-if(typeof (Debug)!=&quot;undefined&quot;&amp;&amp;Debug.writeln){
-Debug.writeln(msg);
-}else{
-if(typeof (debug)!=&quot;undefined&quot;&amp;&amp;debug.trace){
-debug.trace(msg);
-}
-}
-}
-}
-}
-},dispatchListeners:function(msg){
-for(var k in this.listeners){
-var pair=this.listeners[k];
-if(pair.ident!=k||(pair[0]&amp;&amp;!pair[0](msg))){
-continue;
-}
-pair[1](msg);
-}
-},addListener:function(_1f9,_1fa,_1fb){
-if(typeof (_1fa)==&quot;string&quot;){
-_1fa=MochiKit.Logging.logLevelAtLeast(_1fa);
-}
-var _1fc=[_1fa,_1fb];
-_1fc.ident=_1f9;
-this.listeners[_1f9]=_1fc;
-},removeListener:function(_1fd){
-delete this.listeners[_1fd];
-},baseLog:function(_1fe,_1ff){
-var msg=new MochiKit.Logging.LogMessage(this.counter,_1fe,MochiKit.Base.extend(null,arguments,1));
-this._messages.push(msg);
-this.dispatchListeners(msg);
-if(this.useNativeConsole){
-this.logToConsole(msg.level+&quot;: &quot;+msg.info.join(&quot; &quot;));
-}
-this.counter+=1;
-while(this.maxSize&gt;=0&amp;&amp;this._messages.length&gt;this.maxSize){
-this._messages.shift();
-}
-},getMessages:function(_201){
-var _202=0;
-if(!(typeof (_201)==&quot;undefined&quot;||_201===null)){
-_202=Math.max(0,this._messages.length-_201);
-}
-return this._messages.slice(_202);
-},getMessageText:function(_203){
-if(typeof (_203)==&quot;undefined&quot;||_203===null){
-_203=30;
-}
-var _204=this.getMessages(_203);
-if(_204.length){
-var lst=map(function(m){
-return &quot;\n  [&quot;+m.num+&quot;] &quot;+m.level+&quot;: &quot;+m.info.join(&quot; &quot;);
-},_204);
-lst.unshift(&quot;LAST &quot;+_204.length+&quot; MESSAGES:&quot;);
-return lst.join(&quot;&quot;);
-}
-return &quot;&quot;;
-},debuggingBookmarklet:function(_207){
-if(typeof (MochiKit.LoggingPane)==&quot;undefined&quot;){
-alert(this.getMessageText());
-}else{
-MochiKit.LoggingPane.createLoggingPane(_207||false);
-}
-}};
-MochiKit.Logging.__new__=function(){
-this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10};
-var m=MochiKit.Base;
-m.registerComparator(&quot;LogMessage&quot;,this.isLogMessage,this.compareLogMessage);
-var _209=m.partial;
-var _20a=this.Logger;
-var _20b=_20a.prototype.baseLog;
-m.update(this.Logger.prototype,{debug:_209(_20b,&quot;DEBUG&quot;),log:_209(_20b,&quot;INFO&quot;),error:_209(_20b,&quot;ERROR&quot;),fatal:_209(_20b,&quot;FATAL&quot;),warning:_209(_20b,&quot;WARNING&quot;)});
-var self=this;
-var _20d=function(name){
-return function(){
-self.logger[name].apply(self.logger,arguments);
-};
-};
-this.log=_20d(&quot;log&quot;);
-this.logError=_20d(&quot;error&quot;);
-this.logDebug=_20d(&quot;debug&quot;);
-this.logFatal=_20d(&quot;fatal&quot;);
-this.logWarning=_20d(&quot;warning&quot;);
-this.logger=new _20a();
-this.logger.useNativeConsole=true;
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-m.nameFunctions(this);
-};
-if(typeof (printfire)==&quot;undefined&quot;&amp;&amp;typeof (document)!=&quot;undefined&quot;&amp;&amp;document.createEvent&amp;&amp;typeof (dispatchEvent)!=&quot;undefined&quot;){
-printfire=function(){
-printfire.args=arguments;
-var ev=document.createEvent(&quot;Events&quot;);
-ev.initEvent(&quot;printfire&quot;,false,true);
-dispatchEvent(ev);
-};
-}
-MochiKit.Logging.__new__();
-MochiKit.Base._exportSymbols(this,MochiKit.Logging);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.DateTime&quot;);
-}
-if(typeof (MochiKit)==&quot;undefined&quot;){
-MochiKit={};
-}
-if(typeof (MochiKit.DateTime)==&quot;undefined&quot;){
-MochiKit.DateTime={};
-}
-MochiKit.DateTime.NAME=&quot;MochiKit.DateTime&quot;;
-MochiKit.DateTime.VERSION=&quot;1.4&quot;;
-MochiKit.DateTime.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.DateTime.toString=function(){
-return this.__repr__();
-};
-MochiKit.DateTime.isoDate=function(str){
-str=str+&quot;&quot;;
-if(typeof (str)!=&quot;string&quot;||str.length===0){
-return null;
-}
-var iso=str.split(&quot;-&quot;);
-if(iso.length===0){
-return null;
-}
-return new Date(iso[0],iso[1]-1,iso[2]);
-};
-MochiKit.DateTime._isoRegexp=/(\d{4,})(?:-(\d{1,2})(?:-(\d{1,2})(?:[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d+))?)?(?:(Z)|([+-])(\d{1,2})(?::(\d{1,2}))?)?)?)?)?/;
-MochiKit.DateTime.isoTimestamp=function(str){
-str=str+&quot;&quot;;
-if(typeof (str)!=&quot;string&quot;||str.length===0){
-return null;
-}
-var res=str.match(MochiKit.DateTime._isoRegexp);
-if(typeof (res)==&quot;undefined&quot;||res===null){
-return null;
-}
-var year,_215,day,hour,min,sec,msec;
-year=parseInt(res[1],10);
-if(typeof (res[2])==&quot;undefined&quot;||res[2]===&quot;&quot;){
-return new Date(year);
-}
-_215=parseInt(res[2],10)-1;
-day=parseInt(res[3],10);
-if(typeof (res[4])==&quot;undefined&quot;||res[4]===&quot;&quot;){
-return new Date(year,_215,day);
-}
-hour=parseInt(res[4],10);
-min=parseInt(res[5],10);
-sec=(typeof (res[6])!=&quot;undefined&quot;&amp;&amp;res[6]!==&quot;&quot;)?parseInt(res[6],10):0;
-if(typeof (res[7])!=&quot;undefined&quot;&amp;&amp;res[7]!==&quot;&quot;){
-msec=Math.round(1000*parseFloat(&quot;0.&quot;+res[7]));
-}else{
-msec=0;
-}
-if((typeof (res[8])==&quot;undefined&quot;||res[8]===&quot;&quot;)&amp;&amp;(typeof (res[9])==&quot;undefined&quot;||res[9]===&quot;&quot;)){
-return new Date(year,_215,day,hour,min,sec,msec);
-}
-var ofs;
-if(typeof (res[9])!=&quot;undefined&quot;&amp;&amp;res[9]!==&quot;&quot;){
-ofs=parseInt(res[10],10)*3600000;
-if(typeof (res[11])!=&quot;undefined&quot;&amp;&amp;res[11]!==&quot;&quot;){
-ofs+=parseInt(res[11],10)*60000;
-}
-if(res[9]==&quot;-&quot;){
-ofs=-ofs;
-}
-}else{
-ofs=0;
-}
-return new Date(Date.UTC(year,_215,day,hour,min,sec,msec)-ofs);
-};
-MochiKit.DateTime.toISOTime=function(date,_21d){
-if(typeof (date)==&quot;undefined&quot;||date===null){
-return null;
-}
-var hh=date.getHours();
-var mm=date.getMinutes();
-var ss=date.getSeconds();
-var lst=[((_21d&amp;&amp;(hh&lt;10))?&quot;0&quot;+hh:hh),((mm&lt;10)?&quot;0&quot;+mm:mm),((ss&lt;10)?&quot;0&quot;+ss:ss)];
-return lst.join(&quot;:&quot;);
-};
-MochiKit.DateTime.toISOTimestamp=function(date,_223){
-if(typeof (date)==&quot;undefined&quot;||date===null){
-return null;
-}
-var sep=_223?&quot;T&quot;:&quot; &quot;;
-var foot=_223?&quot;Z&quot;:&quot;&quot;;
-if(_223){
-date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
-}
-return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_223)+foot;
-};
-MochiKit.DateTime.toISODate=function(date){
-if(typeof (date)==&quot;undefined&quot;||date===null){
-return null;
-}
-var _227=MochiKit.DateTime._padTwo;
-return [date.getFullYear(),_227(date.getMonth()+1),_227(date.getDate())].join(&quot;-&quot;);
-};
-MochiKit.DateTime.americanDate=function(d){
-d=d+&quot;&quot;;
-if(typeof (d)!=&quot;string&quot;||d.length===0){
-return null;
-}
-var a=d.split(&quot;/&quot;);
-return new Date(a[2],a[0]-1,a[1]);
-};
-MochiKit.DateTime._padTwo=function(n){
-return (n&gt;9)?n:&quot;0&quot;+n;
-};
-MochiKit.DateTime.toPaddedAmericanDate=function(d){
-if(typeof (d)==&quot;undefined&quot;||d===null){
-return null;
-}
-var _22c=MochiKit.DateTime._padTwo;
-return [_22c(d.getMonth()+1),_22c(d.getDate()),d.getFullYear()].join(&quot;/&quot;);
-};
-MochiKit.DateTime.toAmericanDate=function(d){
-if(typeof (d)==&quot;undefined&quot;||d===null){
-return null;
-}
-return [d.getMonth()+1,d.getDate(),d.getFullYear()].join(&quot;/&quot;);
-};
-MochiKit.DateTime.EXPORT=[&quot;isoDate&quot;,&quot;isoTimestamp&quot;,&quot;toISOTime&quot;,&quot;toISOTimestamp&quot;,&quot;toISODate&quot;,&quot;americanDate&quot;,&quot;toPaddedAmericanDate&quot;,&quot;toAmericanDate&quot;];
-MochiKit.DateTime.EXPORT_OK=[];
-MochiKit.DateTime.EXPORT_TAGS={&quot;:common&quot;:MochiKit.DateTime.EXPORT,&quot;:all&quot;:MochiKit.DateTime.EXPORT};
-MochiKit.DateTime.__new__=function(){
-var base=this.NAME+&quot;.&quot;;
-for(var k in this){
-var o=this[k];
-if(typeof (o)==&quot;function&quot;&amp;&amp;typeof (o.NAME)==&quot;undefined&quot;){
-try{
-o.NAME=base+k;
-}
-catch(e){
-}
-}
-}
-};
-MochiKit.DateTime.__new__();
-if(typeof (MochiKit.Base)!=&quot;undefined&quot;){
-MochiKit.Base._exportSymbols(this,MochiKit.DateTime);
-}else{
-(function(_231,_232){
-if((typeof (JSAN)==&quot;undefined&quot;&amp;&amp;typeof (dojo)==&quot;undefined&quot;)||(MochiKit.__export__===false)){
-var all=_232.EXPORT_TAGS[&quot;:all&quot;];
-for(var i=0;i&lt;all.length;i++){
-_231[all[i]]=_232[all[i]];
-}
-}
-})(this,MochiKit.DateTime);
-}
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Format&quot;);
-}
-if(typeof (MochiKit)==&quot;undefined&quot;){
-MochiKit={};
-}
-if(typeof (MochiKit.Format)==&quot;undefined&quot;){
-MochiKit.Format={};
-}
-MochiKit.Format.NAME=&quot;MochiKit.Format&quot;;
-MochiKit.Format.VERSION=&quot;1.4&quot;;
-MochiKit.Format.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.Format.toString=function(){
-return this.__repr__();
-};
-MochiKit.Format._numberFormatter=function(_235,_236,_237,_238,_239,_23a,_23b,_23c,_23d){
-return function(num){
-num=parseFloat(num);
-if(typeof (num)==&quot;undefined&quot;||num===null||isNaN(num)){
-return _235;
-}
-var _23f=_236;
-var _240=_237;
-if(num&lt;0){
-num=-num;
-}else{
-_23f=_23f.replace(/-/,&quot;&quot;);
-}
-var me=arguments.callee;
-var fmt=MochiKit.Format.formatLocale(_238);
-if(_239){
-num=num*100;
-_240=fmt.percent+_240;
-}
-num=MochiKit.Format.roundToFixed(num,_23a);
-var _243=num.split(/\./);
-var _244=_243[0];
-var frac=(_243.length==1)?&quot;&quot;:_243[1];
-var res=&quot;&quot;;
-while(_244.length&lt;_23b){
-_244=&quot;0&quot;+_244;
-}
-if(_23c){
-while(_244.length&gt;_23c){
-var i=_244.length-_23c;
-res=fmt.separator+_244.substring(i,_244.length)+res;
-_244=_244.substring(0,i);
-}
-}
-res=_244+res;
-if(_23a&gt;0){
-while(frac.length&lt;_23d){
-frac=frac+&quot;0&quot;;
-}
-res=res+fmt.decimal+frac;
-}
-return _23f+res+_240;
-};
-};
-MochiKit.Format.numberFormatter=function(_248,_249,_24a){
-if(typeof (_249)==&quot;undefined&quot;){
-_249=&quot;&quot;;
-}
-var _24b=_248.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);
-if(!_24b){
-throw TypeError(&quot;Invalid pattern&quot;);
-}
-var _24c=_248.substr(0,_24b.index);
-var _24d=_248.substr(_24b.index+_24b[0].length);
-if(_24c.search(/-/)==-1){
-_24c=_24c+&quot;-&quot;;
-}
-var _24e=_24b[1];
-var frac=(typeof (_24b[2])==&quot;string&quot;&amp;&amp;_24b[2]!=&quot;&quot;)?_24b[2]:&quot;&quot;;
-var _250=(typeof (_24b[3])==&quot;string&quot;&amp;&amp;_24b[3]!=&quot;&quot;);
-var tmp=_24e.split(/,/);
-var _252;
-if(typeof (_24a)==&quot;undefined&quot;){
-_24a=&quot;default&quot;;
-}
-if(tmp.length==1){
-_252=null;
-}else{
-_252=tmp[1].length;
-}
-var _253=_24e.length-_24e.replace(/0/g,&quot;&quot;).length;
-var _254=frac.length-frac.replace(/0/g,&quot;&quot;).length;
-var _255=frac.length;
-var rval=MochiKit.Format._numberFormatter(_249,_24c,_24d,_24a,_250,_255,_253,_252,_254);
-var m=MochiKit.Base;
-if(m){
-var fn=arguments.callee;
-var args=m.concat(arguments);
-rval.repr=function(){
-return [self.NAME,&quot;(&quot;,map(m.repr,args).join(&quot;, &quot;),&quot;)&quot;].join(&quot;&quot;);
-};
-}
-return rval;
-};
-MochiKit.Format.formatLocale=function(_25a){
-if(typeof (_25a)==&quot;undefined&quot;||_25a===null){
-_25a=&quot;default&quot;;
-}
-if(typeof (_25a)==&quot;string&quot;){
-var rval=MochiKit.Format.LOCALE[_25a];
-if(typeof (rval)==&quot;string&quot;){
-rval=arguments.callee(rval);
-MochiKit.Format.LOCALE[_25a]=rval;
-}
-return rval;
-}else{
-return _25a;
-}
-};
-MochiKit.Format.twoDigitAverage=function(_25c,_25d){
-if(_25d){
-var res=_25c/_25d;
-if(!isNaN(res)){
-return MochiKit.Format.twoDigitFloat(_25c/_25d);
-}
-}
-return &quot;0&quot;;
-};
-MochiKit.Format.twoDigitFloat=function(_25f){
-var sign=(_25f&lt;0?&quot;-&quot;:&quot;&quot;);
-var s=Math.floor(Math.abs(_25f)*100).toString();
-if(s==&quot;0&quot;){
-return s;
-}
-if(s.length&lt;3){
-while(s.charAt(s.length-1)==&quot;0&quot;){
-s=s.substring(0,s.length-1);
-}
-return sign+&quot;0.&quot;+s;
-}
-var head=sign+s.substring(0,s.length-2);
-var tail=s.substring(s.length-2,s.length);
-if(tail==&quot;00&quot;){
-return head;
-}else{
-if(tail.charAt(1)==&quot;0&quot;){
-return head+&quot;.&quot;+tail.charAt(0);
-}else{
-return head+&quot;.&quot;+tail;
-}
-}
-};
-MochiKit.Format.lstrip=function(str,_265){
-str=str+&quot;&quot;;
-if(typeof (str)!=&quot;string&quot;){
-return null;
-}
-if(!_265){
-return str.replace(/^\s+/,&quot;&quot;);
-}else{
-return str.replace(new RegExp(&quot;^[&quot;+_265+&quot;]+&quot;),&quot;&quot;);
-}
-};
-MochiKit.Format.rstrip=function(str,_267){
-str=str+&quot;&quot;;
-if(typeof (str)!=&quot;string&quot;){
-return null;
-}
-if(!_267){
-return str.replace(/\s+$/,&quot;&quot;);
-}else{
-return str.replace(new RegExp(&quot;[&quot;+_267+&quot;]+$&quot;),&quot;&quot;);
-}
-};
-MochiKit.Format.strip=function(str,_269){
-var self=MochiKit.Format;
-return self.rstrip(self.lstrip(str,_269),_269);
-};
-MochiKit.Format.truncToFixed=function(_26b,_26c){
-_26b=Math.floor(_26b*Math.pow(10,_26c));
-var res=(_26b*Math.pow(10,-_26c)).toFixed(_26c);
-if(res.charAt(0)==&quot;.&quot;){
-res=&quot;0&quot;+res;
-}
-return res;
-};
-MochiKit.Format.roundToFixed=function(_26e,_26f){
-return MochiKit.Format.truncToFixed(_26e+0.5*Math.pow(10,-_26f),_26f);
-};
-MochiKit.Format.percentFormat=function(_270){
-return MochiKit.Format.twoDigitFloat(100*_270)+&quot;%&quot;;
-};
-MochiKit.Format.EXPORT=[&quot;truncToFixed&quot;,&quot;roundToFixed&quot;,&quot;numberFormatter&quot;,&quot;formatLocale&quot;,&quot;twoDigitAverage&quot;,&quot;twoDigitFloat&quot;,&quot;percentFormat&quot;,&quot;lstrip&quot;,&quot;rstrip&quot;,&quot;strip&quot;];
-MochiKit.Format.LOCALE={en_US:{separator:&quot;,&quot;,decimal:&quot;.&quot;,percent:&quot;%&quot;},de_DE:{separator:&quot;.&quot;,decimal:&quot;,&quot;,percent:&quot;%&quot;},pt_BR:{separator:&quot;.&quot;,decimal:&quot;,&quot;,percent:&quot;%&quot;},fr_FR:{separator:&quot; &quot;,decimal:&quot;,&quot;,percent:&quot;%&quot;},&quot;default&quot;:&quot;en_US&quot;};
-MochiKit.Format.EXPORT_OK=[];
-MochiKit.Format.EXPORT_TAGS={&quot;:all&quot;:MochiKit.Format.EXPORT,&quot;:common&quot;:MochiKit.Format.EXPORT};
-MochiKit.Format.__new__=function(){
-var base=this.NAME+&quot;.&quot;;
-var k,v,o;
-for(k in this.LOCALE){
-o=this.LOCALE[k];
-if(typeof (o)==&quot;object&quot;){
-o.repr=function(){
-return this.NAME;
-};
-o.NAME=base+&quot;LOCALE.&quot;+k;
-}
-}
-for(k in this){
-o=this[k];
-if(typeof (o)==&quot;function&quot;&amp;&amp;typeof (o.NAME)==&quot;undefined&quot;){
-try{
-o.NAME=base+k;
-}
-catch(e){
-}
-}
-}
-};
-MochiKit.Format.__new__();
-if(typeof (MochiKit.Base)!=&quot;undefined&quot;){
-MochiKit.Base._exportSymbols(this,MochiKit.Format);
-}else{
-(function(_275,_276){
-if((typeof (JSAN)==&quot;undefined&quot;&amp;&amp;typeof (dojo)==&quot;undefined&quot;)||(MochiKit.__export__===false)){
-var all=_276.EXPORT_TAGS[&quot;:all&quot;];
-for(var i=0;i&lt;all.length;i++){
-_275[all[i]]=_276[all[i]];
-}
-}
-})(this,MochiKit.Format);
-}
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Async&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Async depends on MochiKit.Base!&quot;;
-}
-if(typeof (MochiKit.Async)==&quot;undefined&quot;){
-MochiKit.Async={};
-}
-MochiKit.Async.NAME=&quot;MochiKit.Async&quot;;
-MochiKit.Async.VERSION=&quot;1.4&quot;;
-MochiKit.Async.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.Async.toString=function(){
-return this.__repr__();
-};
-MochiKit.Async.Deferred=function(_279){
-this.chain=[];
-this.id=this._nextId();
-this.fired=-1;
-this.paused=0;
-this.results=[null,null];
-this.canceller=_279;
-this.silentlyCancelled=false;
-this.chained=false;
-};
-MochiKit.Async.Deferred.prototype={repr:function(){
-var _27a;
-if(this.fired==-1){
-_27a=&quot;unfired&quot;;
-}else{
-if(this.fired===0){
-_27a=&quot;success&quot;;
-}else{
-_27a=&quot;error&quot;;
-}
-}
-return &quot;Deferred(&quot;+this.id+&quot;, &quot;+_27a+&quot;)&quot;;
-},toString:MochiKit.Base.forwardCall(&quot;repr&quot;),_nextId:MochiKit.Base.counter(),cancel:function(){
-var self=MochiKit.Async;
-if(this.fired==-1){
-if(this.canceller){
-this.canceller(this);
-}else{
-this.silentlyCancelled=true;
-}
-if(this.fired==-1){
-this.errback(new self.CancelledError(this));
-}
-}else{
-if((this.fired===0)&amp;&amp;(this.results[0] instanceof self.Deferred)){
-this.results[0].cancel();
-}
-}
-},_resback:function(res){
-this.fired=((res instanceof Error)?1:0);
-this.results[this.fired]=res;
-this._fire();
-},_check:function(){
-if(this.fired!=-1){
-if(!this.silentlyCancelled){
-throw new MochiKit.Async.AlreadyCalledError(this);
-}
-this.silentlyCancelled=false;
-return;
-}
-},callback:function(res){
-this._check();
-if(res instanceof MochiKit.Async.Deferred){
-throw new Error(&quot;Deferred instances can only be chained if they are the result of a callback&quot;);
-}
-this._resback(res);
-},errback:function(res){
-this._check();
-var self=MochiKit.Async;
-if(res instanceof self.Deferred){
-throw new Error(&quot;Deferred instances can only be chained if they are the result of a callback&quot;);
-}
-if(!(res instanceof Error)){
-res=new self.GenericError(res);
-}
-this._resback(res);
-},addBoth:function(fn){
-if(arguments.length&gt;1){
-fn=MochiKit.Base.partial.apply(null,arguments);
-}
-return this.addCallbacks(fn,fn);
-},addCallback:function(fn){
-if(arguments.length&gt;1){
-fn=MochiKit.Base.partial.apply(null,arguments);
-}
-return this.addCallbacks(fn,null);
-},addErrback:function(fn){
-if(arguments.length&gt;1){
-fn=MochiKit.Base.partial.apply(null,arguments);
-}
-return this.addCallbacks(null,fn);
-},addCallbacks:function(cb,eb){
-if(this.chained){
-throw new Error(&quot;Chained Deferreds can not be re-used&quot;);
-}
-this.chain.push([cb,eb]);
-if(this.fired&gt;=0){
-this._fire();
-}
-return this;
-},_fire:function(){
-var _285=this.chain;
-var _286=this.fired;
-var res=this.results[_286];
-var self=this;
-var cb=null;
-while(_285.length&gt;0&amp;&amp;this.paused===0){
-var pair=_285.shift();
-var f=pair[_286];
-if(f===null){
-continue;
-}
-try{
-res=f(res);
-_286=((res instanceof Error)?1:0);
-if(res instanceof MochiKit.Async.Deferred){
-cb=function(res){
-self._resback(res);
-self.paused--;
-if((self.paused===0)&amp;&amp;(self.fired&gt;=0)){
-self._fire();
-}
-};
-this.paused++;
-}
-}
-catch(err){
-_286=1;
-if(!(err instanceof Error)){
-err=new MochiKit.Async.GenericError(err);
-}
-res=err;
-}
-}
-this.fired=_286;
-this.results[_286]=res;
-if(cb&amp;&amp;this.paused){
-res.addBoth(cb);
-res.chained=true;
-}
-}};
-MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(req){
-return MochiKit.Base.evalJSON(req.responseText);
-},succeed:function(_28e){
-var d=new MochiKit.Async.Deferred();
-d.callback.apply(d,arguments);
-return d;
-},fail:function(_290){
-var d=new MochiKit.Async.Deferred();
-d.errback.apply(d,arguments);
-return d;
-},getXMLHttpRequest:function(){
-var self=arguments.callee;
-if(!self.XMLHttpRequest){
-var _293=[function(){
-return new XMLHttpRequest();
-},function(){
-return new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
-},function(){
-return new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
-},function(){
-return new ActiveXObject(&quot;Msxml2.XMLHTTP.4.0&quot;);
-},function(){
-throw new MochiKit.Async.BrowserComplianceError(&quot;Browser does not support XMLHttpRequest&quot;);
-}];
-for(var i=0;i&lt;_293.length;i++){
-var func=_293[i];
-try{
-self.XMLHttpRequest=func;
-return func();
-}
-catch(e){
-}
-}
-}
-return self.XMLHttpRequest();
-},_xhr_onreadystatechange:function(d){
-var m=MochiKit.Base;
-if(this.readyState==4){
-try{
-this.onreadystatechange=null;
-}
-catch(e){
-try{
-this.onreadystatechange=m.noop;
-}
-catch(e){
-}
-}
-var _298=null;
-try{
-_298=this.status;
-if(!_298&amp;&amp;m.isNotEmpty(this.responseText)){
-_298=304;
-}
-}
-catch(e){
-}
-if(_298==200||_298==201||_298==204||_298==304||_298==1223){
-d.callback(this);
-}else{
-var err=new MochiKit.Async.XMLHttpRequestError(this,&quot;Request failed&quot;);
-if(err.number){
-d.errback(err);
-}else{
-d.errback(err);
-}
-}
-}
-},_xhr_canceller:function(req){
-try{
-req.onreadystatechange=null;
-}
-catch(e){
-try{
-req.onreadystatechange=MochiKit.Base.noop;
-}
-catch(e){
-}
-}
-req.abort();
-},sendXMLHttpRequest:function(req,_29c){
-if(typeof (_29c)==&quot;undefined&quot;||_29c===null){
-_29c=&quot;&quot;;
-}
-var m=MochiKit.Base;
-var self=MochiKit.Async;
-var d=new self.Deferred(m.partial(self._xhr_canceller,req));
-try{
-req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d);
-req.send(_29c);
-}
-catch(e){
-try{
-req.onreadystatechange=null;
-}
-catch(ignore){
-}
-d.errback(e);
-}
-return d;
-},doXHR:function(url,opts){
-var self=MochiKit.Async;
-return self.callLater(0,self._doXHR,url,opts);
-},_doXHR:function(url,opts){
-var m=MochiKit.Base;
-opts=m.update({method:&quot;GET&quot;,sendContent:&quot;&quot;},opts);
-var self=MochiKit.Async;
-var req=self.getXMLHttpRequest();
-if(opts.queryString){
-var qs=m.queryString(opts.queryString);
-if(qs){
-url+=&quot;?&quot;+qs;
-}
-}
-if(&quot;username&quot; in opts){
-req.open(opts.method,url,true,opts.username,opts.password);
-}else{
-req.open(opts.method,url,true);
-}
-if(req.overrideMimeType&amp;&amp;opts.mimeType){
-req.overrideMimeType(opts.mimeType);
-}
-req.setRequestHeader(&quot;X-Requested-With&quot;,&quot;XMLHttpRequest&quot;);
-if(opts.headers){
-var _2a9=opts.headers;
-if(!m.isArrayLike(_2a9)){
-_2a9=m.items(_2a9);
-}
-for(var i=0;i&lt;_2a9.length;i++){
-var _2ab=_2a9[i];
-var name=_2ab[0];
-var _2ad=_2ab[1];
-req.setRequestHeader(name,_2ad);
-}
-}
-return self.sendXMLHttpRequest(req,opts.sendContent);
-},_buildURL:function(url){
-if(arguments.length&gt;1){
-var m=MochiKit.Base;
-var qs=m.queryString.apply(null,m.extend(null,arguments,1));
-if(qs){
-return url+&quot;?&quot;+qs;
-}
-}
-return url;
-},doSimpleXMLHttpRequest:function(url){
-var self=MochiKit.Async;
-url=self._buildURL.apply(self,arguments);
-return self.doXHR(url);
-},loadJSONDoc:function(url){
-var self=MochiKit.Async;
-url=self._buildURL.apply(self,arguments);
-var d=self.doXHR(url,{&quot;mimeType&quot;:&quot;text/plain&quot;,&quot;headers&quot;:[[&quot;Accept&quot;,&quot;application/json&quot;]]});
-d=d.addCallback(self.evalJSONRequest);
-return d;
-},wait:function(_2b6,_2b7){
-var d=new MochiKit.Async.Deferred();
-var m=MochiKit.Base;
-if(typeof (_2b7)!=&quot;undefined&quot;){
-d.addCallback(function(){
-return _2b7;
-});
-}
-var _2ba=setTimeout(m.bind(&quot;callback&quot;,d),Math.floor(_2b6*1000));
-d.canceller=function(){
-try{
-clearTimeout(_2ba);
-}
-catch(e){
-}
-};
-return d;
-},callLater:function(_2bb,func){
-var m=MochiKit.Base;
-var _2be=m.partial.apply(m,m.extend(null,arguments,1));
-return MochiKit.Async.wait(_2bb).addCallback(function(res){
-return _2be();
-});
-}});
-MochiKit.Async.DeferredLock=function(){
-this.waiting=[];
-this.locked=false;
-this.id=this._nextId();
-};
-MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){
-var d=new MochiKit.Async.Deferred();
-if(this.locked){
-this.waiting.push(d);
-}else{
-this.locked=true;
-d.callback(this);
-}
-return d;
-},release:function(){
-if(!this.locked){
-throw TypeError(&quot;Tried to release an unlocked DeferredLock&quot;);
-}
-this.locked=false;
-if(this.waiting.length&gt;0){
-this.locked=true;
-this.waiting.shift().callback(this);
-}
-},_nextId:MochiKit.Base.counter(),repr:function(){
-var _2c1;
-if(this.locked){
-_2c1=&quot;locked, &quot;+this.waiting.length+&quot; waiting&quot;;
-}else{
-_2c1=&quot;unlocked&quot;;
-}
-return &quot;DeferredLock(&quot;+this.id+&quot;, &quot;+_2c1+&quot;)&quot;;
-},toString:MochiKit.Base.forwardCall(&quot;repr&quot;)};
-MochiKit.Async.DeferredList=function(list,_2c3,_2c4,_2c5,_2c6){
-MochiKit.Async.Deferred.apply(this,[_2c6]);
-this.list=list;
-var _2c7=[];
-this.resultList=_2c7;
-this.finishedCount=0;
-this.fireOnOneCallback=_2c3;
-this.fireOnOneErrback=_2c4;
-this.consumeErrors=_2c5;
-var cb=MochiKit.Base.bind(this._cbDeferred,this);
-for(var i=0;i&lt;list.length;i++){
-var d=list[i];
-_2c7.push(undefined);
-d.addCallback(cb,i,true);
-d.addErrback(cb,i,false);
-}
-if(list.length===0&amp;&amp;!_2c3){
-this.callback(this.resultList);
-}
-};
-MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred();
-MochiKit.Async.DeferredList.prototype._cbDeferred=function(_2cb,_2cc,_2cd){
-this.resultList[_2cb]=[_2cc,_2cd];
-this.finishedCount+=1;
-if(this.fired==-1){
-if(_2cc&amp;&amp;this.fireOnOneCallback){
-this.callback([_2cb,_2cd]);
-}else{
-if(!_2cc&amp;&amp;this.fireOnOneErrback){
-this.errback(_2cd);
-}else{
-if(this.finishedCount==this.list.length){
-this.callback(this.resultList);
-}
-}
-}
-}
-if(!_2cc&amp;&amp;this.consumeErrors){
-_2cd=null;
-}
-return _2cd;
-};
-MochiKit.Async.gatherResults=function(_2ce){
-var d=new MochiKit.Async.DeferredList(_2ce,false,true,false);
-d.addCallback(function(_2d0){
-var ret=[];
-for(var i=0;i&lt;_2d0.length;i++){
-ret.push(_2d0[i][1]);
-}
-return ret;
-});
-return d;
-};
-MochiKit.Async.maybeDeferred=function(func){
-var self=MochiKit.Async;
-var _2d5;
-try{
-var r=func.apply(null,MochiKit.Base.extend([],arguments,1));
-if(r instanceof self.Deferred){
-_2d5=r;
-}else{
-if(r instanceof Error){
-_2d5=self.fail(r);
-}else{
-_2d5=self.succeed(r);
-}
-}
-}
-catch(e){
-_2d5=self.fail(e);
-}
-return _2d5;
-};
-MochiKit.Async.EXPORT=[&quot;AlreadyCalledError&quot;,&quot;CancelledError&quot;,&quot;BrowserComplianceError&quot;,&quot;GenericError&quot;,&quot;XMLHttpRequestError&quot;,&quot;Deferred&quot;,&quot;succeed&quot;,&quot;fail&quot;,&quot;getXMLHttpRequest&quot;,&quot;doSimpleXMLHttpRequest&quot;,&quot;loadJSONDoc&quot;,&quot;wait&quot;,&quot;callLater&quot;,&quot;sendXMLHttpRequest&quot;,&quot;DeferredLock&quot;,&quot;DeferredList&quot;,&quot;gatherResults&quot;,&quot;maybeDeferred&quot;,&quot;doXHR&quot;];
-MochiKit.Async.EXPORT_OK=[&quot;evalJSONRequest&quot;];
-MochiKit.Async.__new__=function(){
-var m=MochiKit.Base;
-var ne=m.partial(m._newNamedError,this);
-ne(&quot;AlreadyCalledError&quot;,function(_2d9){
-this.deferred=_2d9;
-});
-ne(&quot;CancelledError&quot;,function(_2da){
-this.deferred=_2da;
-});
-ne(&quot;BrowserComplianceError&quot;,function(msg){
-this.message=msg;
-});
-ne(&quot;GenericError&quot;,function(msg){
-this.message=msg;
-});
-ne(&quot;XMLHttpRequestError&quot;,function(req,msg){
-this.req=req;
-this.message=msg;
-try{
-this.number=req.status;
-}
-catch(e){
-}
-});
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-m.nameFunctions(this);
-};
-MochiKit.Async.__new__();
-MochiKit.Base._exportSymbols(this,MochiKit.Async);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.DOM&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.DOM depends on MochiKit.Base!&quot;;
-}
-if(typeof (MochiKit.DOM)==&quot;undefined&quot;){
-MochiKit.DOM={};
-}
-MochiKit.DOM.NAME=&quot;MochiKit.DOM&quot;;
-MochiKit.DOM.VERSION=&quot;1.4&quot;;
-MochiKit.DOM.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.DOM.toString=function(){
-return this.__repr__();
-};
-MochiKit.DOM.EXPORT=[&quot;removeEmptyTextNodes&quot;,&quot;formContents&quot;,&quot;currentWindow&quot;,&quot;currentDocument&quot;,&quot;withWindow&quot;,&quot;withDocument&quot;,&quot;registerDOMConverter&quot;,&quot;coerceToDOM&quot;,&quot;createDOM&quot;,&quot;createDOMFunc&quot;,&quot;isChildNode&quot;,&quot;getNodeAttribute&quot;,&quot;removeNodeAttribute&quot;,&quot;setNodeAttribute&quot;,&quot;updateNodeAttributes&quot;,&quot;appendChildNodes&quot;,&quot;insertSiblingNodesAfter&quot;,&quot;insertSiblingNodesBefore&quot;,&quot;replaceChildNodes&quot;,&quot;removeElement&quot;,&quot;swapDOM&quot;,&quot;BUTTON&quot;,&quot;TT&quot;,&quot;PRE&quot;,&quot;H1&quot;,&quot;H2&quot;,&quot;H3&quot;,&quot;BR&quot;,&quot;CANVAS&quot;,&quot;HR&quot;,&quot;LABEL&quot;,&quot;TEXTAREA&quot;,&quot;FORM&quot;,&quot;STRONG&quot;,&quot;SELECT&quot;,&quot;OPTION&quot;,&quot;OPTGROUP&quot;,&quot;LEGEND&quot;,&quot;FIELDSET&quot;,&quot;P&quot;,&quot;UL&quot;,&quot;OL&quot;,&quot;LI&quot;,&quot;DL&quot;,&quot;DT&quot;,&quot;DD&quot;,&quot;TD&quot;,&quot;TR&quot;,&quot;THEAD&quot;,&quot;TBODY&quot;,&quot;TFOOT&quot;,&quot;TABLE&quot;,&quot;TH&quot;,&quot;INPUT&quot;,&quot;SPAN&quot;,&quot;A&quot;,&quot;DIV&quot;,&quot;IMG&quot;,&quot;getElement&quot;,&quot;$&quot;,&quot;getElementsByTagAndClassName&quot;,&quot;addToCallStack&quot;,&quot;addLoadEvent&quot;,&quot;focusOnLoad&quot;,&quot;setElementClass&quot;,&quot;toggleElementClass&quot;,&quot;addElementClass&quot;,&quot;removeElementClass&quot;,&quot;swapElementClass&quot;,&quot;hasElementClass&quot;,&quot;escapeHTML&quot;,&quot;toHTML&quot;,&quot;emitHTML&quot;,&quot;scrapeText&quot;,&quot;isParent&quot;,&quot;getFirstParentByTagAndClassName&quot;,&quot;makeClipping&quot;,&quot;undoClipping&quot;,&quot;makePositioned&quot;,&quot;undoPositioned&quot;,&quot;getFirstElementByTagAndClassName&quot;];
-MochiKit.DOM.EXPORT_OK=[&quot;domConverters&quot;];
-MochiKit.DOM.DEPRECATED=[[&quot;computedStyle&quot;,&quot;MochiKit.Style.getStyle&quot;,&quot;1.4&quot;],[&quot;elementDimensions&quot;,&quot;MochiKit.Style.getElementDimensions&quot;,&quot;1.4&quot;],[&quot;elementPosition&quot;,&quot;MochiKit.Style.getElementPosition&quot;,&quot;1.4&quot;],[&quot;hideElement&quot;,&quot;MochiKit.Style.hideElement&quot;,&quot;1.4&quot;],[&quot;setElementDimensions&quot;,&quot;MochiKit.Style.setElementDimensions&quot;,&quot;1.4&quot;],[&quot;setElementPosition&quot;,&quot;MochiKit.Style.setElementPosition&quot;,&quot;1.4&quot;],[&quot;setDisplayForElement&quot;,&quot;MochiKit.Style.setDisplayForElement&quot;,&quot;1.4&quot;],[&quot;setOpacity&quot;,&quot;MochiKit.Style.setOpacity&quot;,&quot;1.4&quot;],[&quot;showElement&quot;,&quot;MochiKit.Style.showElement&quot;,&quot;1.4&quot;],[&quot;Coordinates&quot;,&quot;MochiKit.Style.Coordinates&quot;,&quot;1.4&quot;],[&quot;Dimensions&quot;,&quot;MochiKit.Style.Dimensions&quot;,&quot;1.4&quot;]];
-MochiKit.DOM.getViewportDimensions=new Function(&quot;&quot;+&quot;if (!MochiKit[\&quot;Style\&quot;]) {&quot;+&quot;    throw new Error(\&quot;This function has been deprecated and depends on MochiKit.Style.\&quot;);&quot;+&quot;}&quot;+&quot;return MochiKit.Style.getViewportDimensions.apply(this, arguments);&quot;);
-MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){
-return MochiKit.DOM._window;
-},currentDocument:function(){
-return MochiKit.DOM._document;
-},withWindow:function(win,func){
-var self=MochiKit.DOM;
-var _2e2=self._document;
-var _2e3=self._window;
-var rval;
-try{
-self._window=win;
-self._document=win.document;
-rval=func();
-}
-catch(e){
-self._window=_2e3;
-self._document=_2e2;
-throw e;
-}
-self._window=_2e3;
-self._document=_2e2;
-return rval;
-},formContents:function(elem){
-var _2e6=[];
-var _2e7=[];
-var m=MochiKit.Base;
-var self=MochiKit.DOM;
-if(typeof (elem)==&quot;undefined&quot;||elem===null){
-elem=self._document.body;
-}else{
-elem=self.getElement(elem);
-}
-m.nodeWalk(elem,function(elem){
-var name=elem.name;
-if(m.isNotEmpty(name)){
-var _2ec=elem.tagName.toUpperCase();
-if(_2ec===&quot;INPUT&quot;&amp;&amp;(elem.type==&quot;radio&quot;||elem.type==&quot;checkbox&quot;)&amp;&amp;!elem.checked){
-return null;
-}
-if(_2ec===&quot;SELECT&quot;){
-if(elem.type==&quot;select-one&quot;){
-if(elem.selectedIndex&gt;=0){
-var opt=elem.options[elem.selectedIndex];
-var v=opt.value;
-if(!v){
-var h=opt.outerHTML;
-if(h&amp;&amp;!h.match(/^[^&gt;]+\svalue\s*=/i)){
-v=opt.text;
-}
-}
-_2e6.push(name);
-_2e7.push(v);
-return null;
-}
-_2e6.push(name);
-_2e7.push(&quot;&quot;);
-return null;
-}else{
-var opts=elem.options;
-if(!opts.length){
-_2e6.push(name);
-_2e7.push(&quot;&quot;);
-return null;
-}
-for(var i=0;i&lt;opts.length;i++){
-var opt=opts[i];
-if(!opt.selected){
-continue;
-}
-var v=opt.value;
-if(!v){
-var h=opt.outerHTML;
-if(h&amp;&amp;!h.match(/^[^&gt;]+\svalue\s*=/i)){
-v=opt.text;
-}
-}
-_2e6.push(name);
-_2e7.push(v);
-}
-return null;
-}
-}
-if(_2ec===&quot;FORM&quot;||_2ec===&quot;P&quot;||_2ec===&quot;SPAN&quot;||_2ec===&quot;DIV&quot;){
-return elem.childNodes;
-}
-_2e6.push(name);
-_2e7.push(elem.value||&quot;&quot;);
-return null;
-}
-return elem.childNodes;
-});
-return [_2e6,_2e7];
-},withDocument:function(doc,func){
-var self=MochiKit.DOM;
-var _2f5=self._document;
-var rval;
-try{
-self._document=doc;
-rval=func();
-}
-catch(e){
-self._document=_2f5;
-throw e;
-}
-self._document=_2f5;
-return rval;
-},registerDOMConverter:function(name,_2f8,wrap,_2fa){
-MochiKit.DOM.domConverters.register(name,_2f8,wrap,_2fa);
-},coerceToDOM:function(node,ctx){
-var m=MochiKit.Base;
-var im=MochiKit.Iter;
-var self=MochiKit.DOM;
-if(im){
-var iter=im.iter;
-var _301=im.repeat;
-var map=m.map;
-}
-var _303=self.domConverters;
-var _304=arguments.callee;
-var _305=m.NotFound;
-while(true){
-if(typeof (node)==&quot;undefined&quot;||node===null){
-return null;
-}
-if(typeof (node)==&quot;function&quot;&amp;&amp;typeof (node.length)==&quot;number&quot;&amp;&amp;!(node instanceof Function)){
-node=im.list(node);
-}
-if(typeof (node.nodeType)!=&quot;undefined&quot;&amp;&amp;node.nodeType&gt;0){
-return node;
-}
-if(typeof (node)==&quot;number&quot;||typeof (node)==&quot;boolean&quot;){
-node=node.toString();
-}
-if(typeof (node)==&quot;string&quot;){
-return self._document.createTextNode(node);
-}
-if(typeof (node.__dom__)==&quot;function&quot;){
-node=node.__dom__(ctx);
-continue;
-}
-if(typeof (node.dom)==&quot;function&quot;){
-node=node.dom(ctx);
-continue;
-}
-if(typeof (node)==&quot;function&quot;){
-node=node.apply(ctx,[ctx]);
-continue;
-}
-if(im){
-var _306=null;
-try{
-_306=iter(node);
-}
-catch(e){
-}
-if(_306){
-return map(_304,_306,_301(ctx));
-}
-}
-try{
-node=_303.match(node,ctx);
-continue;
-}
-catch(e){
-if(e!=_305){
-throw e;
-}
-}
-return self._document.createTextNode(node.toString());
-}
-return undefined;
-},isChildNode:function(node,_308){
-var self=MochiKit.DOM;
-if(typeof (node)==&quot;string&quot;){
-node=self.getElement(node);
-}
-if(typeof (_308)==&quot;string&quot;){
-_308=self.getElement(_308);
-}
-if(typeof (node)==&quot;undefined&quot;||node===null||node===self._document){
-return false;
-}
-do{
-if(node===_308){
-return true;
-}
-var _30a=node.tagName;
-node=node.parentNode;
-if(!_30a){
-break;
-}
-_30a=_30a.toUpperCase();
-}while(_30a!=&quot;BODY&quot;&amp;&amp;_30a!=&quot;HTML&quot;);
-return false;
-},setNodeAttribute:function(node,attr,_30d){
-var o={};
-o[attr]=_30d;
-try{
-return MochiKit.DOM.updateNodeAttributes(node,o);
-}
-catch(e){
-}
-return null;
-},getNodeAttribute:function(node,attr){
-var self=MochiKit.DOM;
-var _312=self.attributeArray.renames[attr];
-node=self.getElement(node);
-try{
-if(_312){
-return node[_312];
-}
-return node.getAttribute(attr);
-}
-catch(e){
-}
-return null;
-},removeNodeAttribute:function(node,attr){
-var self=MochiKit.DOM;
-var _316=self.attributeArray.renames[attr];
-node=self.getElement(node);
-try{
-if(_316){
-return node[_316];
-}
-return node.removeAttribute(attr);
-}
-catch(e){
-}
-return null;
-},updateNodeAttributes:function(node,_318){
-var elem=node;
-var self=MochiKit.DOM;
-if(typeof (node)==&quot;string&quot;){
-elem=self.getElement(node);
-}
-if(_318){
-var _31b=MochiKit.Base.updatetree;
-if(self.attributeArray.compliant){
-for(var k in _318){
-var v=_318[k];
-if(typeof (v)==&quot;object&quot;&amp;&amp;typeof (elem[k])==&quot;object&quot;){
-if(k==&quot;style&quot;&amp;&amp;MochiKit.Style){
-MochiKit.Style.setStyle(elem,v);
-}else{
-_31b(elem[k],v);
-}
-}else{
-if(k.substring(0,2)==&quot;on&quot;){
-if(typeof (v)==&quot;string&quot;){
-v=new Function(v);
-}
-elem[k]=v;
-}else{
-elem.setAttribute(k,v);
-}
-}
-}
-}else{
-var _31e=self.attributeArray.renames;
-for(var k in _318){
-v=_318[k];
-var _31f=_31e[k];
-if(k==&quot;style&quot;&amp;&amp;typeof (v)==&quot;string&quot;){
-elem.style.cssText=v;
-}else{
-if(typeof (_31f)==&quot;string&quot;){
-elem[_31f]=v;
-}else{
-if(typeof (elem[k])==&quot;object&quot;&amp;&amp;typeof (v)==&quot;object&quot;){
-if(k==&quot;style&quot;&amp;&amp;MochiKit.Style){
-MochiKit.Style.setStyle(elem,v);
-}else{
-_31b(elem[k],v);
-}
-}else{
-if(k.substring(0,2)==&quot;on&quot;){
-if(typeof (v)==&quot;string&quot;){
-v=new Function(v);
-}
-elem[k]=v;
-}else{
-elem.setAttribute(k,v);
-}
-}
-}
-}
-}
-}
-}
-return elem;
-},appendChildNodes:function(node){
-var elem=node;
-var self=MochiKit.DOM;
-if(typeof (node)==&quot;string&quot;){
-elem=self.getElement(node);
-}
-var _323=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
-var _324=MochiKit.Base.concat;
-while(_323.length){
-var n=_323.shift();
-if(typeof (n)==&quot;undefined&quot;||n===null){
-}else{
-if(typeof (n.nodeType)==&quot;number&quot;){
-elem.appendChild(n);
-}else{
-_323=_324(n,_323);
-}
-}
-}
-return elem;
-},insertSiblingNodesBefore:function(node){
-var elem=node;
-var self=MochiKit.DOM;
-if(typeof (node)==&quot;string&quot;){
-elem=self.getElement(node);
-}
-var _329=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
-var _32a=elem.parentNode;
-var _32b=MochiKit.Base.concat;
-while(_329.length){
-var n=_329.shift();
-if(typeof (n)==&quot;undefined&quot;||n===null){
-}else{
-if(typeof (n.nodeType)==&quot;number&quot;){
-_32a.insertBefore(n,elem);
-}else{
-_329=_32b(n,_329);
-}
-}
-}
-return _32a;
-},insertSiblingNodesAfter:function(node){
-var elem=node;
-var self=MochiKit.DOM;
-if(typeof (node)==&quot;string&quot;){
-elem=self.getElement(node);
-}
-var _330=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
-if(elem.nextSibling){
-return self.insertSiblingNodesBefore(elem.nextSibling,_330);
-}else{
-return self.appendChildNodes(elem.parentNode,_330);
-}
-},replaceChildNodes:function(node){
-var elem=node;
-var self=MochiKit.DOM;
-if(typeof (node)==&quot;string&quot;){
-elem=self.getElement(node);
-arguments[0]=elem;
-}
-var _334;
-while((_334=elem.firstChild)){
-elem.removeChild(_334);
-}
-if(arguments.length&lt;2){
-return elem;
-}else{
-return self.appendChildNodes.apply(this,arguments);
-}
-},createDOM:function(name,_336){
-var elem;
-var self=MochiKit.DOM;
-var m=MochiKit.Base;
-if(typeof (_336)==&quot;string&quot;||typeof (_336)==&quot;number&quot;){
-var args=m.extend([name,null],arguments,1);
-return arguments.callee.apply(this,args);
-}
-if(typeof (name)==&quot;string&quot;){
-var _33b=self._xhtml;
-if(_336&amp;&amp;!self.attributeArray.compliant){
-var _33c=&quot;&quot;;
-if(&quot;name&quot; in _336){
-_33c+=&quot; name=\&quot;&quot;+self.escapeHTML(_336.name)+&quot;\&quot;&quot;;
-}
-if(name==&quot;input&quot;&amp;&amp;&quot;type&quot; in _336){
-_33c+=&quot; type=\&quot;&quot;+self.escapeHTML(_336.type)+&quot;\&quot;&quot;;
-}
-if(_33c){
-name=&quot;&lt;&quot;+name+_33c+&quot;&gt;&quot;;
-_33b=false;
-}
-}
-var d=self._document;
-if(_33b&amp;&amp;d===document){
-elem=d.createElementNS(&quot;http://www.w3.org/1999/xhtml&quot;,name);
-}else{
-elem=d.createElement(name);
-}
-}else{
-elem=name;
-}
-if(_336){
-self.updateNodeAttributes(elem,_336);
-}
-if(arguments.length&lt;=2){
-return elem;
-}else{
-var args=m.extend([elem],arguments,2);
-return self.appendChildNodes.apply(this,args);
-}
-},createDOMFunc:function(){
-var m=MochiKit.Base;
-return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
-},removeElement:function(elem){
-var e=MochiKit.DOM.getElement(elem);
-e.parentNode.removeChild(e);
-return e;
-},swapDOM:function(dest,src){
-var self=MochiKit.DOM;
-dest=self.getElement(dest);
-var _344=dest.parentNode;
-if(src){
-src=self.getElement(src);
-_344.replaceChild(src,dest);
-}else{
-_344.removeChild(dest);
-}
-return src;
-},getElement:function(id){
-var self=MochiKit.DOM;
-if(arguments.length==1){
-return ((typeof (id)==&quot;string&quot;)?self._document.getElementById(id):id);
-}else{
-return MochiKit.Base.map(self.getElement,arguments);
-}
-},getElementsByTagAndClassName:function(_347,_348,_349){
-var self=MochiKit.DOM;
-if(typeof (_347)==&quot;undefined&quot;||_347===null){
-_347=&quot;*&quot;;
-}
-if(typeof (_349)==&quot;undefined&quot;||_349===null){
-_349=self._document;
-}
-_349=self.getElement(_349);
-var _34b=(_349.getElementsByTagName(_347)||self._document.all);
-if(typeof (_348)==&quot;undefined&quot;||_348===null){
-return MochiKit.Base.extend(null,_34b);
-}
-var _34c=[];
-for(var i=0;i&lt;_34b.length;i++){
-var _34e=_34b[i];
-var cls=_34e.className;
-if(!cls){
-continue;
-}
-var _350=cls.split(&quot; &quot;);
-for(var j=0;j&lt;_350.length;j++){
-if(_350[j]==_348){
-_34c.push(_34e);
-break;
-}
-}
-}
-return _34c;
-},_newCallStack:function(path,once){
-var rval=function(){
-var _355=arguments.callee.callStack;
-for(var i=0;i&lt;_355.length;i++){
-if(_355[i].apply(this,arguments)===false){
-break;
-}
-}
-if(once){
-try{
-this[path]=null;
-}
-catch(e){
-}
-}
-};
-rval.callStack=[];
-return rval;
-},addToCallStack:function(_357,path,func,once){
-var self=MochiKit.DOM;
-var _35c=_357[path];
-var _35d=_35c;
-if(!(typeof (_35c)==&quot;function&quot;&amp;&amp;typeof (_35c.callStack)==&quot;object&quot;&amp;&amp;_35c.callStack!==null)){
-_35d=self._newCallStack(path,once);
-if(typeof (_35c)==&quot;function&quot;){
-_35d.callStack.push(_35c);
-}
-_357[path]=_35d;
-}
-_35d.callStack.push(func);
-},addLoadEvent:function(func){
-var self=MochiKit.DOM;
-self.addToCallStack(self._window,&quot;onload&quot;,func,true);
-},focusOnLoad:function(_360){
-var self=MochiKit.DOM;
-self.addLoadEvent(function(){
-_360=self.getElement(_360);
-if(_360){
-_360.focus();
-}
-});
-},setElementClass:function(_362,_363){
-var self=MochiKit.DOM;
-var obj=self.getElement(_362);
-if(self.attributeArray.compliant){
-obj.setAttribute(&quot;class&quot;,_363);
-}else{
-obj.setAttribute(&quot;className&quot;,_363);
-}
-},toggleElementClass:function(_366){
-var self=MochiKit.DOM;
-for(var i=1;i&lt;arguments.length;i++){
-var obj=self.getElement(arguments[i]);
-if(!self.addElementClass(obj,_366)){
-self.removeElementClass(obj,_366);
-}
-}
-},addElementClass:function(_36a,_36b){
-var self=MochiKit.DOM;
-var obj=self.getElement(_36a);
-var cls=obj.className;
-if(cls==undefined||cls.length===0){
-self.setElementClass(obj,_36b);
-return true;
-}
-if(cls==_36b){
-return false;
-}
-var _36f=cls.split(&quot; &quot;);
-for(var i=0;i&lt;_36f.length;i++){
-if(_36f[i]==_36b){
-return false;
-}
-}
-self.setElementClass(obj,cls+&quot; &quot;+_36b);
-return true;
-},removeElementClass:function(_371,_372){
-var self=MochiKit.DOM;
-var obj=self.getElement(_371);
-var cls=obj.className;
-if(cls==undefined||cls.length===0){
-return false;
-}
-if(cls==_372){
-self.setElementClass(obj,&quot;&quot;);
-return true;
-}
-var _376=cls.split(&quot; &quot;);
-for(var i=0;i&lt;_376.length;i++){
-if(_376[i]==_372){
-_376.splice(i,1);
-self.setElementClass(obj,_376.join(&quot; &quot;));
-return true;
-}
-}
-return false;
-},swapElementClass:function(_378,_379,_37a){
-var obj=MochiKit.DOM.getElement(_378);
-var res=MochiKit.DOM.removeElementClass(obj,_379);
-if(res){
-MochiKit.DOM.addElementClass(obj,_37a);
-}
-return res;
-},hasElementClass:function(_37d,_37e){
-var obj=MochiKit.DOM.getElement(_37d);
-var cls=obj.className;
-if(!cls){
-return false;
-}
-var _381=cls.split(&quot; &quot;);
-for(var i=1;i&lt;arguments.length;i++){
-var good=false;
-for(var j=0;j&lt;_381.length;j++){
-if(_381[j]==arguments[i]){
-good=true;
-break;
-}
-}
-if(!good){
-return false;
-}
-}
-return true;
-},escapeHTML:function(s){
-return s.replace(/&amp;/g,&quot;&amp;amp;&quot;).replace(/&quot;/g,&quot;&amp;quot;&quot;).replace(/&lt;/g,&quot;&amp;lt;&quot;).replace(/&gt;/g,&quot;&amp;gt;&quot;);
-},toHTML:function(dom){
-return MochiKit.DOM.emitHTML(dom).join(&quot;&quot;);
-},emitHTML:function(dom,lst){
-if(typeof (lst)==&quot;undefined&quot;||lst===null){
-lst=[];
-}
-var _389=[dom];
-var self=MochiKit.DOM;
-var _38b=self.escapeHTML;
-var _38c=self.attributeArray;
-while(_389.length){
-dom=_389.pop();
-if(typeof (dom)==&quot;string&quot;){
-lst.push(dom);
-}else{
-if(dom.nodeType==1){
-lst.push(&quot;&lt;&quot;+dom.tagName.toLowerCase());
-var _38d=[];
-var _38e=_38c(dom);
-for(var i=0;i&lt;_38e.length;i++){
-var a=_38e[i];
-_38d.push([&quot; &quot;,a.name,&quot;=\&quot;&quot;,_38b(a.value),&quot;\&quot;&quot;]);
-}
-_38d.sort();
-for(i=0;i&lt;_38d.length;i++){
-var _391=_38d[i];
-for(var j=0;j&lt;_391.length;j++){
-lst.push(_391[j]);
-}
-}
-if(dom.hasChildNodes()){
-lst.push(&quot;&gt;&quot;);
-_389.push(&quot;&lt;/&quot;+dom.tagName.toLowerCase()+&quot;&gt;&quot;);
-var _393=dom.childNodes;
-for(i=_393.length-1;i&gt;=0;i--){
-_389.push(_393[i]);
-}
-}else{
-lst.push(&quot;/&gt;&quot;);
-}
-}else{
-if(dom.nodeType==3){
-lst.push(_38b(dom.nodeValue));
-}
-}
-}
-}
-return lst;
-},scrapeText:function(node,_395){
-var rval=[];
-(function(node){
-var cn=node.childNodes;
-if(cn){
-for(var i=0;i&lt;cn.length;i++){
-arguments.callee.call(this,cn[i]);
-}
-}
-var _39a=node.nodeValue;
-if(typeof (_39a)==&quot;string&quot;){
-rval.push(_39a);
-}
-})(MochiKit.DOM.getElement(node));
-if(_395){
-return rval;
-}else{
-return rval.join(&quot;&quot;);
-}
-},removeEmptyTextNodes:function(_39b){
-_39b=MochiKit.DOM.getElement(_39b);
-for(var i=0;i&lt;_39b.childNodes.length;i++){
-var node=_39b.childNodes[i];
-if(node.nodeType==3&amp;&amp;!/\S/.test(node.nodeValue)){
-node.parentNode.removeChild(node);
-}
-}
-},makeClipping:function(_39e){
-_39e=MochiKit.DOM.getElement(_39e);
-var _39f=_39e.style.overflow;
-if((MochiKit.Style.getStyle(_39e,&quot;overflow&quot;)||&quot;visible&quot;)!=&quot;hidden&quot;){
-_39e.style.overflow=&quot;hidden&quot;;
-}
-return _39f;
-},undoClipping:function(_3a0,_3a1){
-_3a0=MochiKit.DOM.getElement(_3a0);
-if(!_3a1){
-return;
-}
-_3a0.style.overflow=_3a1;
-},makePositioned:function(_3a2){
-_3a2=MochiKit.DOM.getElement(_3a2);
-var pos=MochiKit.Style.getStyle(_3a2,&quot;position&quot;);
-if(pos==&quot;static&quot;||!pos){
-_3a2.style.position=&quot;relative&quot;;
-if(/Opera/.test(navigator.userAgent)){
-_3a2.style.top=0;
-_3a2.style.left=0;
-}
-}
-},undoPositioned:function(_3a4){
-_3a4=MochiKit.DOM.getElement(_3a4);
-if(_3a4.style.position==&quot;relative&quot;){
-_3a4.style.position=_3a4.style.top=_3a4.style.left=_3a4.style.bottom=_3a4.style.right=&quot;&quot;;
-}
-},getFirstElementByTagAndClassName:function(_3a5,_3a6,_3a7){
-var self=MochiKit.DOM;
-if(typeof (_3a5)==&quot;undefined&quot;||_3a5===null){
-_3a5=&quot;*&quot;;
-}
-if(typeof (_3a7)==&quot;undefined&quot;||_3a7===null){
-_3a7=self._document;
-}
-_3a7=self.getElement(_3a7);
-var _3a9=(_3a7.getElementsByTagName(_3a5)||self._document.all);
-if(typeof (_3a6)==&quot;undefined&quot;||_3a6===null){
-return _3a9[0];
-}
-for(var i=0;i&lt;_3a9.length;i++){
-var _3ab=_3a9[i];
-var _3ac=_3ab.className.split(&quot; &quot;);
-for(var j=0;j&lt;_3ac.length;j++){
-if(_3ac[j]==_3a6){
-return _3ab;
-}
-}
-}
-},getFirstParentByTagAndClassName:function(elem,_3af,_3b0){
-var self=MochiKit.DOM;
-elem=self.getElement(elem);
-if(typeof (_3af)==&quot;undefined&quot;||_3af===null){
-_3af=&quot;*&quot;;
-}else{
-_3af=_3af.toUpperCase();
-}
-if(typeof (_3b0)==&quot;undefined&quot;||_3b0===null){
-_3b0=null;
-}
-var _3b2=&quot;&quot;;
-var _3b3=&quot;&quot;;
-while(elem&amp;&amp;elem.tagName){
-elem=elem.parentNode;
-if(_3af==&quot;*&quot;&amp;&amp;_3b0===null){
-return elem;
-}
-_3b2=elem.className.split(&quot; &quot;);
-_3b3=elem.tagName.toUpperCase();
-if(_3b0===null&amp;&amp;_3af==_3b3){
-return elem;
-}else{
-if(_3b0!==null){
-for(var i=0;i&lt;_3b2.length;i++){
-if(_3af==&quot;*&quot;&amp;&amp;_3b2[i]==_3b0){
-return elem;
-}else{
-if(_3af==_3b3&amp;&amp;_3b2[i]==_3b0){
-return elem;
-}
-}
-}
-}
-}
-}
-return elem;
-},isParent:function(_3b5,_3b6){
-if(!_3b5.parentNode||_3b5==_3b6){
-return false;
-}
-if(_3b5.parentNode==_3b6){
-return true;
-}
-return MochiKit.DOM.isParent(_3b5.parentNode,_3b6);
-},__new__:function(win){
-var m=MochiKit.Base;
-if(typeof (document)!=&quot;undefined&quot;){
-this._document=document;
-var _3b9=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;;
-this._xhtml=(document.documentElement&amp;&amp;document.createElementNS&amp;&amp;document.documentElement.namespaceURI===_3b9);
-}else{
-if(MochiKit.MockDOM){
-this._document=MochiKit.MockDOM.document;
-}
-}
-this._window=win;
-this.domConverters=new m.AdapterRegistry();
-var _3ba=this._document.createElement(&quot;span&quot;);
-var _3bb;
-if(_3ba&amp;&amp;_3ba.attributes&amp;&amp;_3ba.attributes.length&gt;0){
-var _3bc=m.filter;
-_3bb=function(node){
-return _3bc(_3bb.ignoreAttrFilter,node.attributes);
-};
-_3bb.ignoreAttr={};
-var _3be=_3ba.attributes;
-var _3bf=_3bb.ignoreAttr;
-for(var i=0;i&lt;_3be.length;i++){
-var a=_3be[i];
-_3bf[a.name]=a.value;
-}
-_3bb.ignoreAttrFilter=function(a){
-return (_3bb.ignoreAttr[a.name]!=a.value);
-};
-_3bb.compliant=false;
-_3bb.renames={&quot;class&quot;:&quot;className&quot;,&quot;checked&quot;:&quot;defaultChecked&quot;,&quot;usemap&quot;:&quot;useMap&quot;,&quot;for&quot;:&quot;htmlFor&quot;,&quot;readonly&quot;:&quot;readOnly&quot;,&quot;colspan&quot;:&quot;colSpan&quot;,&quot;bgcolor&quot;:&quot;bgColor&quot;,&quot;cellspacing&quot;:&quot;cellSpacing&quot;,&quot;cellpadding&quot;:&quot;cellPadding&quot;};
-}else{
-_3bb=function(node){
-return node.attributes;
-};
-_3bb.compliant=true;
-_3bb.renames={};
-}
-this.attributeArray=_3bb;
-var _3c4=function(_3c5,arr){
-var _3c7=arr[1].split(&quot;.&quot;);
-var str=&quot;&quot;;
-var obj={};
-str+=&quot;if (!MochiKit.&quot;+_3c7[1]+&quot;) { throw new Error(\&quot;&quot;;
-str+=&quot;This function has been deprecated and depends on MochiKit.&quot;;
-str+=_3c7[1]+&quot;.\&quot;);}&quot;;
-str+=&quot;return MochiKit.&quot;+_3c7[1]+&quot;.&quot;+arr[0];
-str+=&quot;.apply(this, arguments);&quot;;
-obj[_3c7[2]]=new Function(str);
-MochiKit.Base.update(MochiKit[_3c5],obj);
-};
-for(var i;i&lt;MochiKit.DOM.DEPRECATED.length;i++){
-_3c4(&quot;DOM&quot;,MochiKit.DOM.DEPRECATED[i]);
-}
-var _3ca=this.createDOMFunc;
-this.UL=_3ca(&quot;ul&quot;);
-this.OL=_3ca(&quot;ol&quot;);
-this.LI=_3ca(&quot;li&quot;);
-this.DL=_3ca(&quot;dl&quot;);
-this.DT=_3ca(&quot;dt&quot;);
-this.DD=_3ca(&quot;dd&quot;);
-this.TD=_3ca(&quot;td&quot;);
-this.TR=_3ca(&quot;tr&quot;);
-this.TBODY=_3ca(&quot;tbody&quot;);
-this.THEAD=_3ca(&quot;thead&quot;);
-this.TFOOT=_3ca(&quot;tfoot&quot;);
-this.TABLE=_3ca(&quot;table&quot;);
-this.TH=_3ca(&quot;th&quot;);
-this.INPUT=_3ca(&quot;input&quot;);
-this.SPAN=_3ca(&quot;span&quot;);
-this.A=_3ca(&quot;a&quot;);
-this.DIV=_3ca(&quot;div&quot;);
-this.IMG=_3ca(&quot;img&quot;);
-this.BUTTON=_3ca(&quot;button&quot;);
-this.TT=_3ca(&quot;tt&quot;);
-this.PRE=_3ca(&quot;pre&quot;);
-this.H1=_3ca(&quot;h1&quot;);
-this.H2=_3ca(&quot;h2&quot;);
-this.H3=_3ca(&quot;h3&quot;);
-this.BR=_3ca(&quot;br&quot;);
-this.HR=_3ca(&quot;hr&quot;);
-this.LABEL=_3ca(&quot;label&quot;);
-this.TEXTAREA=_3ca(&quot;textarea&quot;);
-this.FORM=_3ca(&quot;form&quot;);
-this.P=_3ca(&quot;p&quot;);
-this.SELECT=_3ca(&quot;select&quot;);
-this.OPTION=_3ca(&quot;option&quot;);
-this.OPTGROUP=_3ca(&quot;optgroup&quot;);
-this.LEGEND=_3ca(&quot;legend&quot;);
-this.FIELDSET=_3ca(&quot;fieldset&quot;);
-this.STRONG=_3ca(&quot;strong&quot;);
-this.CANVAS=_3ca(&quot;canvas&quot;);
-this.$=this.getElement;
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-m.nameFunctions(this);
-}});
-MochiKit.DOM.__new__(((typeof (window)==&quot;undefined&quot;)?this:window));
-if(MochiKit.__export__){
-withWindow=MochiKit.DOM.withWindow;
-withDocument=MochiKit.DOM.withDocument;
-}
-MochiKit.Base._exportSymbols(this,MochiKit.DOM);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Selector&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-dojo.require(&quot;MochiKit.DOM&quot;);
-dojo.require(&quot;MochiKit.Iter&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-JSAN.use(&quot;MochiKit.DOM&quot;,[]);
-JSAN.use(&quot;MochiKit.Iter&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)===&quot;undefined&quot;||typeof (MochiKit.DOM)===&quot;undefined&quot;||typeof (MochiKit.Iter)===&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Selector depends on MochiKit.Base, MochiKit.DOM and MochiKit.Iter!&quot;;
-}
-if(typeof (MochiKit.Selector)==&quot;undefined&quot;){
-MochiKit.Selector={};
-}
-MochiKit.Selector.NAME=&quot;MochiKit.Selector&quot;;
-MochiKit.Selector.VERSION=&quot;1.4&quot;;
-MochiKit.Selector.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.Selector.toString=function(){
-return this.__repr__();
-};
-MochiKit.Selector.EXPORT=[&quot;Selector&quot;,&quot;findChildElements&quot;,&quot;findDocElements&quot;,&quot;$$&quot;];
-MochiKit.Selector.EXPORT_OK=[];
-MochiKit.Selector.Selector=function(_3cb){
-this.params={classNames:[],pseudoClassNames:[]};
-this.expression=_3cb.toString().replace(/(^\s+|\s+$)/g,&quot;&quot;);
-this.parseExpression();
-this.compileMatcher();
-};
-MochiKit.Selector.Selector.prototype={__class__:MochiKit.Selector.Selector,parseExpression:function(){
-function abort(_3cc){
-throw &quot;Parse error in selector: &quot;+_3cc;
-}
-if(this.expression==&quot;&quot;){
-abort(&quot;empty expression&quot;);
-}
-var repr=MochiKit.Base.repr;
-var _3ce=this.params;
-var expr=this.expression;
-var _3d0,_3d1,_3d2,rest;
-while(_3d0=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!^$*]?=)(?:&quot;([^&quot;]*)&quot;|([^\]\s]*)))?\]$/i)){
-_3ce.attributes=_3ce.attributes||[];
-_3ce.attributes.push({name:_3d0[2],operator:_3d0[3],value:_3d0[4]||_3d0[5]||&quot;&quot;});
-expr=_3d0[1];
-}
-if(expr==&quot;*&quot;){
-return this.params.wildcard=true;
-}
-while(_3d0=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+(?:\([^)]*\))?)(.*)/i)){
-_3d1=_3d0[1];
-_3d2=_3d0[2];
-rest=_3d0[3];
-switch(_3d1){
-case &quot;#&quot;:
-_3ce.id=_3d2;
-break;
-case &quot;.&quot;:
-_3ce.classNames.push(_3d2);
-break;
-case &quot;:&quot;:
-_3ce.pseudoClassNames.push(_3d2);
-break;
-case &quot;&quot;:
-case undefined:
-_3ce.tagName=_3d2.toUpperCase();
-break;
-default:
-abort(repr(expr));
-}
-expr=rest;
-}
-if(expr.length&gt;0){
-abort(repr(expr));
-}
-},buildMatchExpression:function(){
-var repr=MochiKit.Base.repr;
-var _3d5=this.params;
-var _3d6=[];
-var _3d7,i;
-function childElements(_3d9){
-return &quot;MochiKit.Base.filter(function (node) { return node.nodeType == 1; }, &quot;+_3d9+&quot;.childNodes)&quot;;
-}
-if(_3d5.wildcard){
-_3d6.push(&quot;true&quot;);
-}
-if(_3d7=_3d5.id){
-_3d6.push(&quot;element.id == &quot;+repr(_3d7));
-}
-if(_3d7=_3d5.tagName){
-_3d6.push(&quot;element.tagName.toUpperCase() == &quot;+repr(_3d7));
-}
-if((_3d7=_3d5.classNames).length&gt;0){
-for(i=0;i&lt;_3d7.length;i++){
-_3d6.push(&quot;MochiKit.DOM.hasElementClass(element, &quot;+repr(_3d7[i])+&quot;)&quot;);
-}
-}
-if((_3d7=_3d5.pseudoClassNames).length&gt;0){
-for(i=0;i&lt;_3d7.length;i++){
-var _3da=_3d7[i].match(/^([^(]+)(?:\((.*)\))?$/);
-var _3db=_3da[1];
-var _3dc=_3da[2];
-switch(_3db){
-case &quot;root&quot;:
-_3d6.push(&quot;element.nodeType == 9 || element === element.ownerDocument.documentElement&quot;);
-break;
-case &quot;nth-child&quot;:
-case &quot;nth-last-child&quot;:
-case &quot;nth-of-type&quot;:
-case &quot;nth-last-of-type&quot;:
-_3da=_3dc.match(/^((?:(\d+)n\+)?(\d+)|odd|even)$/);
-if(!_3da){
-throw &quot;Invalid argument to pseudo element nth-child: &quot;+_3dc;
-}
-var a,b;
-if(_3da[0]==&quot;odd&quot;){
-a=2;
-b=1;
-}else{
-if(_3da[0]==&quot;even&quot;){
-a=2;
-b=0;
-}else{
-a=_3da[2]&amp;&amp;parseInt(_3da)||null;
-b=parseInt(_3da[3]);
-}
-}
-_3d6.push(&quot;this.nthChild(element,&quot;+a+&quot;,&quot;+b+&quot;,&quot;+!!_3db.match(&quot;^nth-last&quot;)+&quot;,&quot;+!!_3db.match(&quot;of-type$&quot;)+&quot;)&quot;);
-break;
-case &quot;first-child&quot;:
-_3d6.push(&quot;this.nthChild(element, null, 1)&quot;);
-break;
-case &quot;last-child&quot;:
-_3d6.push(&quot;this.nthChild(element, null, 1, true)&quot;);
-break;
-case &quot;first-of-type&quot;:
-_3d6.push(&quot;this.nthChild(element, null, 1, false, true)&quot;);
-break;
-case &quot;last-of-type&quot;:
-_3d6.push(&quot;this.nthChild(element, null, 1, true, true)&quot;);
-break;
-case &quot;only-child&quot;:
-_3d6.push(childElements(&quot;element.parentNode&quot;)+&quot;.length == 1&quot;);
-break;
-case &quot;only-of-type&quot;:
-_3d6.push(&quot;MochiKit.Base.filter(function (node) { return node.tagName == element.tagName; }, &quot;+childElements(&quot;element.parentNode&quot;)+&quot;).length == 1&quot;);
-break;
-case &quot;empty&quot;:
-_3d6.push(&quot;element.childNodes.length == 0&quot;);
-break;
-case &quot;enabled&quot;:
-_3d6.push(&quot;(this.isUIElement(element) &amp;&amp; element.disabled === false)&quot;);
-break;
-case &quot;disabled&quot;:
-_3d6.push(&quot;(this.isUIElement(element) &amp;&amp; element.disabled === true)&quot;);
-break;
-case &quot;checked&quot;:
-_3d6.push(&quot;(this.isUIElement(element) &amp;&amp; element.checked === true)&quot;);
-break;
-case &quot;not&quot;:
-var _3df=new MochiKit.Selector.Selector(_3dc);
-_3d6.push(&quot;!( &quot;+_3df.buildMatchExpression()+&quot;)&quot;);
-break;
-}
-}
-}
-if(_3d7=_3d5.attributes){
-MochiKit.Base.map(function(_3e0){
-var _3e1=&quot;MochiKit.DOM.getNodeAttribute(element, &quot;+repr(_3e0.name)+&quot;)&quot;;
-var _3e2=function(_3e3){
-return _3e1+&quot;.split(&quot;+repr(_3e3)+&quot;)&quot;;
-};
-switch(_3e0.operator){
-case &quot;=&quot;:
-_3d6.push(_3e1+&quot; == &quot;+repr(_3e0.value));
-break;
-case &quot;~=&quot;:
-_3d6.push(_3e1+&quot; &amp;&amp; MochiKit.Base.findValue(&quot;+_3e2(&quot; &quot;)+&quot;, &quot;+repr(_3e0.value)+&quot;) &gt; -1&quot;);
-break;
-case &quot;^=&quot;:
-_3d6.push(_3e1+&quot;.substring(0, &quot;+_3e0.value.length+&quot;) == &quot;+repr(_3e0.value));
-break;
-case &quot;$=&quot;:
-_3d6.push(_3e1+&quot;.substring(&quot;+_3e1+&quot;.length - &quot;+_3e0.value.length+&quot;) == &quot;+repr(_3e0.value));
-break;
-case &quot;*=&quot;:
-_3d6.push(_3e1+&quot;.match(&quot;+repr(_3e0.value)+&quot;)&quot;);
-break;
-case &quot;|=&quot;:
-_3d6.push(_3e1+&quot; &amp;&amp; &quot;+_3e2(&quot;-&quot;)+&quot;[0].toUpperCase() == &quot;+repr(_3e0.value.toUpperCase()));
-break;
-case &quot;!=&quot;:
-_3d6.push(_3e1+&quot; != &quot;+repr(_3e0.value));
-break;
-case &quot;&quot;:
-case undefined:
-_3d6.push(_3e1+&quot; != null&quot;);
-break;
-default:
-throw &quot;Unknown operator &quot;+_3e0.operator+&quot; in selector&quot;;
-}
-},_3d7);
-}
-return _3d6.join(&quot; &amp;&amp; &quot;);
-},compileMatcher:function(){
-this.match=new Function(&quot;element&quot;,&quot;if (!element.tagName) return false;                 return &quot;+this.buildMatchExpression());
-},nthChild:function(_3e4,a,b,_3e7,_3e8){
-var _3e9=MochiKit.Base.filter(function(node){
-return node.nodeType==1;
-},_3e4.parentNode.childNodes);
-if(_3e8){
-_3e9=MochiKit.Base.filter(function(node){
-return node.tagName==_3e4.tagName;
-},_3e9);
-}
-if(_3e7){
-_3e9=MochiKit.Iter.reversed(_3e9);
-}
-if(a){
-var _3ec=MochiKit.Base.findIdentical(_3e9,_3e4);
-return ((_3ec+1-b)/a)%1==0;
-}else{
-return b==MochiKit.Base.findIdentical(_3e9,_3e4)+1;
-}
-},isUIElement:function(_3ed){
-return MochiKit.Base.findValue([&quot;input&quot;,&quot;button&quot;,&quot;select&quot;,&quot;option&quot;,&quot;textarea&quot;,&quot;object&quot;],_3ed.tagName.toLowerCase())&gt;-1;
-},findElements:function(_3ee,axis){
-var _3f0;
-if(axis==undefined){
-axis=&quot;&quot;;
-}
-function inScope(_3f1,_3f2){
-if(axis==&quot;&quot;){
-return MochiKit.DOM.isChildNode(_3f1,_3f2);
-}else{
-if(axis==&quot;&gt;&quot;){
-return _3f1.parentNode==_3f2;
-}else{
-if(axis==&quot;+&quot;){
-return _3f1==nextSiblingElement(_3f2);
-}else{
-if(axis==&quot;~&quot;){
-var _3f3=_3f2;
-while(_3f3=nextSiblingElement(_3f3)){
-if(_3f1==_3f3){
-return true;
-}
-}
-return false;
-}else{
-throw &quot;Invalid axis: &quot;+axis;
-}
-}
-}
-}
-}
-if(_3f0=MochiKit.DOM.getElement(this.params.id)){
-if(this.match(_3f0)){
-if(!_3ee||inScope(_3f0,_3ee)){
-return [_3f0];
-}
-}
-}
-function nextSiblingElement(node){
-node=node.nextSibling;
-while(node&amp;&amp;node.nodeType!=1){
-node=node.nextSibling;
-}
-return node;
-}
-if(axis==&quot;&quot;){
-_3ee=(_3ee||MochiKit.DOM.currentDocument()).getElementsByTagName(this.params.tagName||&quot;*&quot;);
-}else{
-if(axis==&quot;&gt;&quot;){
-if(!_3ee){
-throw &quot;&gt; combinator not allowed without preceeding expression&quot;;
-}
-_3ee=MochiKit.Base.filter(function(node){
-return node.nodeType==1;
-},_3ee.childNodes);
-}else{
-if(axis==&quot;+&quot;){
-if(!_3ee){
-throw &quot;+ combinator not allowed without preceeding expression&quot;;
-}
-_3ee=nextSiblingElement(_3ee)&amp;&amp;[nextSiblingElement(_3ee)];
-}else{
-if(axis==&quot;~&quot;){
-if(!_3ee){
-throw &quot;~ combinator not allowed without preceeding expression&quot;;
-}
-var _3f6=[];
-while(nextSiblingElement(_3ee)){
-_3ee=nextSiblingElement(_3ee);
-_3f6.push(_3ee);
-}
-_3ee=_3f6;
-}
-}
-}
-}
-if(!_3ee){
-return [];
-}
-var _3f7=MochiKit.Base.filter(MochiKit.Base.bind(function(_3f8){
-return this.match(_3f8);
-},this),_3ee);
-return _3f7;
-},repr:function(){
-return &quot;Selector(&quot;+this.expression+&quot;)&quot;;
-},toString:MochiKit.Base.forwardCall(&quot;repr&quot;)};
-MochiKit.Base.update(MochiKit.Selector,{findChildElements:function(_3f9,_3fa){
-return MochiKit.Base.flattenArray(MochiKit.Base.map(function(_3fb){
-var _3fc=&quot;&quot;;
-return MochiKit.Iter.reduce(function(_3fd,expr){
-if(match=expr.match(/^[&gt;+~]$/)){
-_3fc=match[0];
-return _3fd;
-}else{
-var _3ff=new MochiKit.Selector.Selector(expr);
-var _400=MochiKit.Iter.reduce(function(_401,_402){
-return MochiKit.Base.extend(_401,_3ff.findElements(_402||_3f9,_3fc));
-},_3fd,[]);
-_3fc=&quot;&quot;;
-return _400;
-}
-},_3fb.replace(/(^\s+|\s+$)/g,&quot;&quot;).split(/\s+/),[null]);
-},_3fa));
-},findDocElements:function(){
-return MochiKit.Selector.findChildElements(MochiKit.DOM.currentDocument(),arguments);
-},__new__:function(){
-var m=MochiKit.Base;
-this.$$=this.findDocElements;
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-m.nameFunctions(this);
-}});
-MochiKit.Selector.__new__();
-MochiKit.Base._exportSymbols(this,MochiKit.Selector);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Style&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-dojo.require(&quot;MochiKit.DOM&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-JSAN.use(&quot;MochiKit.DOM&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Style depends on MochiKit.Base!&quot;;
-}
-try{
-if(typeof (MochiKit.DOM)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Style depends on MochiKit.DOM!&quot;;
-}
-if(typeof (MochiKit.Style)==&quot;undefined&quot;){
-MochiKit.Style={};
-}
-MochiKit.Style.NAME=&quot;MochiKit.Style&quot;;
-MochiKit.Style.VERSION=&quot;1.4&quot;;
-MochiKit.Style.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.Style.toString=function(){
-return this.__repr__();
-};
-MochiKit.Style.EXPORT_OK=[];
-MochiKit.Style.EXPORT=[&quot;setStyle&quot;,&quot;setOpacity&quot;,&quot;getStyle&quot;,&quot;getElementDimensions&quot;,&quot;elementDimensions&quot;,&quot;setElementDimensions&quot;,&quot;getElementPosition&quot;,&quot;elementPosition&quot;,&quot;setElementPosition&quot;,&quot;setDisplayForElement&quot;,&quot;hideElement&quot;,&quot;showElement&quot;,&quot;getViewportDimensions&quot;,&quot;getViewportPosition&quot;,&quot;Dimensions&quot;,&quot;Coordinates&quot;];
-MochiKit.Style.Dimensions=function(w,h){
-this.w=w;
-this.h=h;
-};
-MochiKit.Style.Dimensions.prototype.__repr__=function(){
-var repr=MochiKit.Base.repr;
-return &quot;{w: &quot;+repr(this.w)+&quot;, h: &quot;+repr(this.h)+&quot;}&quot;;
-};
-MochiKit.Style.Dimensions.prototype.toString=function(){
-return this.__repr__();
-};
-MochiKit.Style.Coordinates=function(x,y){
-this.x=x;
-this.y=y;
-};
-MochiKit.Style.Coordinates.prototype.__repr__=function(){
-var repr=MochiKit.Base.repr;
-return &quot;{x: &quot;+repr(this.x)+&quot;, y: &quot;+repr(this.y)+&quot;}&quot;;
-};
-MochiKit.Style.Coordinates.prototype.toString=function(){
-return this.__repr__();
-};
-MochiKit.Base.update(MochiKit.Style,{getStyle:function(elem,_40b){
-var dom=MochiKit.DOM;
-var d=dom._document;
-elem=dom.getElement(elem);
-_40b=MochiKit.Base.camelize(_40b);
-if(!elem||elem==d){
-return undefined;
-}
-if(_40b==&quot;opacity&quot;&amp;&amp;elem.filters){
-var _40e=(MochiKit.Style.getStyle(elem,&quot;filter&quot;)||&quot;&quot;).match(/alpha\(opacity=(.*)\)/);
-if(_40e&amp;&amp;_40e[1]){
-return parseFloat(_40e[1])/100;
-}
-return 1;
-}
-var _40f=elem.style?elem.style[_40b]:null;
-if(!_40f){
-if(d.defaultView&amp;&amp;d.defaultView.getComputedStyle){
-var css=d.defaultView.getComputedStyle(elem,null);
-_40b=_40b.replace(/([A-Z])/g,&quot;-$1&quot;).toLowerCase();
-_40f=css?css.getPropertyValue(_40b):null;
-}else{
-if(elem.currentStyle){
-_40f=elem.currentStyle[_40b];
-}
-}
-}
-if(_40b==&quot;opacity&quot;){
-_40f=parseFloat(_40f);
-}
-if(/Opera/.test(navigator.userAgent)&amp;&amp;(MochiKit.Base.find([&quot;left&quot;,&quot;top&quot;,&quot;right&quot;,&quot;bottom&quot;],_40b)!=-1)){
-if(MochiKit.Style.getStyle(elem,&quot;position&quot;)==&quot;static&quot;){
-_40f=&quot;auto&quot;;
-}
-}
-return _40f==&quot;auto&quot;?null:_40f;
-},setStyle:function(elem,_412){
-elem=MochiKit.DOM.getElement(elem);
-for(var name in _412){
-if(name==&quot;opacity&quot;){
-MochiKit.Style.setOpacity(elem,_412[name]);
-}else{
-elem.style[MochiKit.Base.camelize(name)]=_412[name];
-}
-}
-},setOpacity:function(elem,o){
-elem=MochiKit.DOM.getElement(elem);
-var self=MochiKit.Style;
-if(o==1){
-var _417=/Gecko/.test(navigator.userAgent)&amp;&amp;!(/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent));
-elem.style[&quot;opacity&quot;]=_417?0.999999:1;
-if(/MSIE/.test(navigator.userAgent)){
-elem.style[&quot;filter&quot;]=self.getStyle(elem,&quot;filter&quot;).replace(/alpha\([^\)]*\)/gi,&quot;&quot;);
-}
-}else{
-if(o&lt;0.00001){
-o=0;
-}
-elem.style[&quot;opacity&quot;]=o;
-if(/MSIE/.test(navigator.userAgent)){
-elem.style[&quot;filter&quot;]=self.getStyle(elem,&quot;filter&quot;).replace(/alpha\([^\)]*\)/gi,&quot;&quot;)+&quot;alpha(opacity=&quot;+o*100+&quot;)&quot;;
-}
-}
-},getElementPosition:function(elem,_419){
-var self=MochiKit.Style;
-var dom=MochiKit.DOM;
-elem=dom.getElement(elem);
-if(!elem||(!(elem.x&amp;&amp;elem.y)&amp;&amp;(!elem.parentNode===null||self.getStyle(elem,&quot;display&quot;)==&quot;none&quot;))){
-return undefined;
-}
-var c=new self.Coordinates(0,0);
-var box=null;
-var _41e=null;
-var d=MochiKit.DOM._document;
-var de=d.documentElement;
-var b=d.body;
-if(!elem.parentNode&amp;&amp;elem.x&amp;&amp;elem.y){
-c.x+=elem.x||0;
-c.y+=elem.y||0;
-}else{
-if(elem.getBoundingClientRect){
-box=elem.getBoundingClientRect();
-c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
-c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
-return c;
-}else{
-if(elem.offsetParent){
-c.x+=elem.offsetLeft;
-c.y+=elem.offsetTop;
-_41e=elem.offsetParent;
-if(_41e!=elem){
-while(_41e){
-c.x+=_41e.offsetLeft;
-c.y+=_41e.offsetTop;
-_41e=_41e.offsetParent;
-}
-}
-var ua=navigator.userAgent.toLowerCase();
-if((typeof (opera)!=&quot;undefined&quot;&amp;&amp;parseFloat(opera.version())&lt;9)||(ua.indexOf(&quot;AppleWebKit&quot;)!=-1&amp;&amp;self.getStyle(elem,&quot;position&quot;)==&quot;absolute&quot;)){
-c.x-=b.offsetLeft;
-c.y-=b.offsetTop;
-}
-}
-}
-}
-if(typeof (_419)!=&quot;undefined&quot;){
-_419=arguments.callee(_419);
-if(_419){
-c.x-=(_419.x||0);
-c.y-=(_419.y||0);
-}
-}
-if(elem.parentNode){
-_41e=elem.parentNode;
-}else{
-_41e=null;
-}
-while(_41e){
-var _423=_41e.tagName.toUpperCase();
-if(_423===&quot;BODY&quot;||_423===&quot;HTML&quot;){
-break;
-}
-var disp=self.getStyle(_41e,&quot;display&quot;);
-if(disp.search(/^inline|table-row.*$/i)){
-c.x-=_41e.scrollLeft;
-c.y-=_41e.scrollTop;
-}
-if(_41e.parentNode){
-_41e=_41e.parentNode;
-}else{
-_41e=null;
-}
-}
-return c;
-},setElementPosition:function(elem,_426,_427){
-elem=MochiKit.DOM.getElement(elem);
-if(typeof (_427)==&quot;undefined&quot;){
-_427=&quot;px&quot;;
-}
-var _428={};
-var _429=MochiKit.Base.isUndefinedOrNull;
-if(!_429(_426.x)){
-_428[&quot;left&quot;]=_426.x+_427;
-}
-if(!_429(_426.y)){
-_428[&quot;top&quot;]=_426.y+_427;
-}
-MochiKit.DOM.updateNodeAttributes(elem,{&quot;style&quot;:_428});
-},getElementDimensions:function(elem){
-var self=MochiKit.Style;
-var dom=MochiKit.DOM;
-if(typeof (elem.w)==&quot;number&quot;||typeof (elem.h)==&quot;number&quot;){
-return new self.Dimensions(elem.w||0,elem.h||0);
-}
-elem=dom.getElement(elem);
-if(!elem){
-return undefined;
-}
-var disp=self.getStyle(elem,&quot;display&quot;);
-if(disp!=&quot;none&quot;&amp;&amp;disp!==&quot;&quot;&amp;&amp;typeof (disp)!=&quot;undefined&quot;){
-return new self.Dimensions(elem.offsetWidth||0,elem.offsetHeight||0);
-}
-var s=elem.style;
-var _42f=s.visibility;
-var _430=s.position;
-s.visibility=&quot;hidden&quot;;
-s.position=&quot;absolute&quot;;
-s.display=&quot;&quot;;
-var _431=elem.offsetWidth;
-var _432=elem.offsetHeight;
-s.display=&quot;none&quot;;
-s.position=_430;
-s.visibility=_42f;
-return new self.Dimensions(_431,_432);
-},setElementDimensions:function(elem,_434,_435){
-elem=MochiKit.DOM.getElement(elem);
-if(typeof (_435)==&quot;undefined&quot;){
-_435=&quot;px&quot;;
-}
-var _436={};
-var _437=MochiKit.Base.isUndefinedOrNull;
-if(!_437(_434.w)){
-_436[&quot;width&quot;]=_434.w+_435;
-}
-if(!_437(_434.h)){
-_436[&quot;height&quot;]=_434.h+_435;
-}
-MochiKit.DOM.updateNodeAttributes(elem,{&quot;style&quot;:_436});
-},setDisplayForElement:function(_438,_439){
-var _43a=MochiKit.Base.extend(null,arguments,1);
-var _43b=MochiKit.DOM.getElement;
-for(var i=0;i&lt;_43a.length;i++){
-_439=_43b(_43a[i]);
-if(_439){
-_439.style.display=_438;
-}
-}
-},getViewportDimensions:function(){
-var d=new MochiKit.Style.Dimensions();
-var w=MochiKit.DOM._window;
-var b=MochiKit.DOM._document.body;
-if(w.innerWidth){
-d.w=w.innerWidth;
-d.h=w.innerHeight;
-}else{
-if(b.parentElement.clientWidth){
-d.w=b.parentElement.clientWidth;
-d.h=b.parentElement.clientHeight;
-}else{
-if(b&amp;&amp;b.clientWidth){
-d.w=b.clientWidth;
-d.h=b.clientHeight;
-}
-}
-}
-return d;
-},getViewportPosition:function(){
-var c=new MochiKit.Style.Coordinates(0,0);
-var d=MochiKit.DOM._document;
-var de=d.documentElement;
-var db=d.body;
-if(de&amp;&amp;(de.scrollTop||de.scrollLeft)){
-c.x=de.scrollLeft;
-c.y=de.scrollTop;
-}else{
-if(db){
-c.x=db.scrollLeft;
-c.y=db.scrollTop;
-}
-}
-return c;
-},__new__:function(){
-var m=MochiKit.Base;
-this.elementPosition=this.getElementPosition;
-this.elementDimensions=this.getElementDimensions;
-this.hideElement=m.partial(this.setDisplayForElement,&quot;none&quot;);
-this.showElement=m.partial(this.setDisplayForElement,&quot;block&quot;);
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-m.nameFunctions(this);
-}});
-MochiKit.Style.__new__();
-MochiKit.Base._exportSymbols(this,MochiKit.Style);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.LoggingPane&quot;);
-dojo.require(&quot;MochiKit.Logging&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Logging&quot;,[]);
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)==&quot;undefined&quot;||typeof (MochiKit.Logging)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.LoggingPane depends on MochiKit.Base and MochiKit.Logging!&quot;;
-}
-if(typeof (MochiKit.LoggingPane)==&quot;undefined&quot;){
-MochiKit.LoggingPane={};
-}
-MochiKit.LoggingPane.NAME=&quot;MochiKit.LoggingPane&quot;;
-MochiKit.LoggingPane.VERSION=&quot;1.4&quot;;
-MochiKit.LoggingPane.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.LoggingPane.toString=function(){
-return this.__repr__();
-};
-MochiKit.LoggingPane.createLoggingPane=function(_445){
-var m=MochiKit.LoggingPane;
-_445=!(!_445);
-if(m._loggingPane&amp;&amp;m._loggingPane.inline!=_445){
-m._loggingPane.closePane();
-m._loggingPane=null;
-}
-if(!m._loggingPane||m._loggingPane.closed){
-m._loggingPane=new m.LoggingPane(_445,MochiKit.Logging.logger);
-}
-return m._loggingPane;
-};
-MochiKit.LoggingPane.LoggingPane=function(_447,_448){
-if(typeof (_448)==&quot;undefined&quot;||_448===null){
-_448=MochiKit.Logging.logger;
-}
-this.logger=_448;
-var _449=MochiKit.Base.update;
-var _44a=MochiKit.Base.updatetree;
-var bind=MochiKit.Base.bind;
-var _44c=MochiKit.Base.clone;
-var win=window;
-var uid=&quot;_MochiKit_LoggingPane&quot;;
-if(typeof (MochiKit.DOM)!=&quot;undefined&quot;){
-win=MochiKit.DOM.currentWindow();
-}
-if(!_447){
-var url=win.location.href.split(&quot;?&quot;)[0].replace(/[#:\/.&gt;&lt;&amp;-]/g,&quot;_&quot;);
-var name=uid+&quot;_&quot;+url;
-var nwin=win.open(&quot;&quot;,name,&quot;dependent,resizable,height=200&quot;);
-if(!nwin){
-alert(&quot;Not able to open debugging window due to pop-up blocking.&quot;);
-return undefined;
-}
-nwin.document.write(&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.0 Transitional//EN\&quot; &quot;+&quot;\&quot;http://www.w3.org/TR/html4/loose.dtd\&quot;&gt;&quot;+&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;[MochiKit.LoggingPane]&lt;/title&gt;&lt;/head&gt;&quot;+&quot;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;&quot;);
-nwin.document.close();
-nwin.document.title+=&quot; &quot;+win.document.title;
-win=nwin;
-}
-var doc=win.document;
-this.doc=doc;
-var _453=doc.getElementById(uid);
-var _454=!!_453;
-if(_453&amp;&amp;typeof (_453.loggingPane)!=&quot;undefined&quot;){
-_453.loggingPane.logger=this.logger;
-_453.loggingPane.buildAndApplyFilter();
-return _453.loggingPane;
-}
-if(_454){
-var _455;
-while((_455=_453.firstChild)){
-_453.removeChild(_455);
-}
-}else{
-_453=doc.createElement(&quot;div&quot;);
-_453.id=uid;
-}
-_453.loggingPane=this;
-var _456=doc.createElement(&quot;input&quot;);
-var _457=doc.createElement(&quot;input&quot;);
-var _458=doc.createElement(&quot;button&quot;);
-var _459=doc.createElement(&quot;button&quot;);
-var _45a=doc.createElement(&quot;button&quot;);
-var _45b=doc.createElement(&quot;button&quot;);
-var _45c=doc.createElement(&quot;div&quot;);
-var _45d=doc.createElement(&quot;div&quot;);
-var _45e=uid+&quot;_Listener&quot;;
-this.colorTable=_44c(this.colorTable);
-var _45f=[];
-var _460=null;
-var _461=function(msg){
-var _463=msg.level;
-if(typeof (_463)==&quot;number&quot;){
-_463=MochiKit.Logging.LogLevel[_463];
-}
-return _463;
-};
-var _464=function(msg){
-return msg.info.join(&quot; &quot;);
-};
-var _466=bind(function(msg){
-var _468=_461(msg);
-var text=_464(msg);
-var c=this.colorTable[_468];
-var p=doc.createElement(&quot;span&quot;);
-p.className=&quot;MochiKit-LogMessage MochiKit-LogLevel-&quot;+_468;
-p.style.cssText=&quot;margin: 0px; white-space: -moz-pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word; wrap-option: emergency; color: &quot;+c;
-p.appendChild(doc.createTextNode(_468+&quot;: &quot;+text));
-_45d.appendChild(p);
-_45d.appendChild(doc.createElement(&quot;br&quot;));
-if(_45c.offsetHeight&gt;_45c.scrollHeight){
-_45c.scrollTop=0;
-}else{
-_45c.scrollTop=_45c.scrollHeight;
-}
-},this);
-var _46c=function(msg){
-_45f[_45f.length]=msg;
-_466(msg);
-};
-var _46e=function(){
-var _46f,_470;
-try{
-_46f=new RegExp(_456.value);
-_470=new RegExp(_457.value);
-}
-catch(e){
-logDebug(&quot;Error in filter regex: &quot;+e.message);
-return null;
-}
-return function(msg){
-return (_46f.test(_461(msg))&amp;&amp;_470.test(_464(msg)));
-};
-};
-var _472=function(){
-while(_45d.firstChild){
-_45d.removeChild(_45d.firstChild);
-}
-};
-var _473=function(){
-_45f=[];
-_472();
-};
-var _474=bind(function(){
-if(this.closed){
-return;
-}
-this.closed=true;
-if(MochiKit.LoggingPane._loggingPane==this){
-MochiKit.LoggingPane._loggingPane=null;
-}
-this.logger.removeListener(_45e);
-try{
-try{
-_453.loggingPane=null;
-}
-catch(e){
-logFatal(&quot;Bookmarklet was closed incorrectly.&quot;);
-}
-if(_447){
-_453.parentNode.removeChild(_453);
-}else{
-this.win.close();
-}
-}
-catch(e){
-}
-},this);
-var _475=function(){
-_472();
-for(var i=0;i&lt;_45f.length;i++){
-var msg=_45f[i];
-if(_460===null||_460(msg)){
-_466(msg);
-}
-}
-};
-this.buildAndApplyFilter=function(){
-_460=_46e();
-_475();
-this.logger.removeListener(_45e);
-this.logger.addListener(_45e,_460,_46c);
-};
-var _478=bind(function(){
-_45f=this.logger.getMessages();
-_475();
-},this);
-var _479=bind(function(_47a){
-_47a=_47a||window.event;
-key=_47a.which||_47a.keyCode;
-if(key==13){
-this.buildAndApplyFilter();
-}
-},this);
-var _47b=&quot;display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: &quot;+this.logFont;
-if(_447){
-_47b+=&quot;; height: 10em; border-top: 2px solid black&quot;;
-}else{
-_47b+=&quot;; height: 100%;&quot;;
-}
-_453.style.cssText=_47b;
-if(!_454){
-doc.body.appendChild(_453);
-}
-_47b={&quot;cssText&quot;:&quot;width: 33%; display: inline; font: &quot;+this.logFont};
-_44a(_456,{&quot;value&quot;:&quot;FATAL|ERROR|WARNING|INFO|DEBUG&quot;,&quot;onkeypress&quot;:_479,&quot;style&quot;:_47b});
-_453.appendChild(_456);
-_44a(_457,{&quot;value&quot;:&quot;.*&quot;,&quot;onkeypress&quot;:_479,&quot;style&quot;:_47b});
-_453.appendChild(_457);
-_47b=&quot;width: 8%; display:inline; font: &quot;+this.logFont;
-_458.appendChild(doc.createTextNode(&quot;Filter&quot;));
-_458.onclick=bind(&quot;buildAndApplyFilter&quot;,this);
-_458.style.cssText=_47b;
-_453.appendChild(_458);
-_459.appendChild(doc.createTextNode(&quot;Load&quot;));
-_459.onclick=_478;
-_459.style.cssText=_47b;
-_453.appendChild(_459);
-_45a.appendChild(doc.createTextNode(&quot;Clear&quot;));
-_45a.onclick=_473;
-_45a.style.cssText=_47b;
-_453.appendChild(_45a);
-_45b.appendChild(doc.createTextNode(&quot;Close&quot;));
-_45b.onclick=_474;
-_45b.style.cssText=_47b;
-_453.appendChild(_45b);
-_45c.style.cssText=&quot;overflow: auto; width: 100%&quot;;
-_45d.style.cssText=&quot;width: 100%; height: &quot;+(_447?&quot;8em&quot;:&quot;100%&quot;);
-_45c.appendChild(_45d);
-_453.appendChild(_45c);
-this.buildAndApplyFilter();
-_478();
-if(_447){
-this.win=undefined;
-}else{
-this.win=win;
-}
-this.inline=_447;
-this.closePane=_474;
-this.closed=false;
-return this;
-};
-MochiKit.LoggingPane.LoggingPane.prototype={&quot;logFont&quot;:&quot;8pt Verdana,sans-serif&quot;,&quot;colorTable&quot;:{&quot;ERROR&quot;:&quot;red&quot;,&quot;FATAL&quot;:&quot;darkred&quot;,&quot;WARNING&quot;:&quot;blue&quot;,&quot;INFO&quot;:&quot;black&quot;,&quot;DEBUG&quot;:&quot;green&quot;}};
-MochiKit.LoggingPane.EXPORT_OK=[&quot;LoggingPane&quot;];
-MochiKit.LoggingPane.EXPORT=[&quot;createLoggingPane&quot;];
-MochiKit.LoggingPane.__new__=function(){
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
-MochiKit.Base.nameFunctions(this);
-MochiKit.LoggingPane._loggingPane=null;
-};
-MochiKit.LoggingPane.__new__();
-MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Color&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-dojo.require(&quot;MochiKit.DOM&quot;);
-dojo.require(&quot;MochiKit.Style&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-JSAN.use(&quot;MochiKit.DOM&quot;,[]);
-JSAN.use(&quot;MochiKit.Style&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Color depends on MochiKit.Base&quot;;
-}
-try{
-if(typeof (MochiKit.DOM)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Color depends on MochiKit.DOM&quot;;
-}
-try{
-if(typeof (MochiKit.Style)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Color depends on MochiKit.Style&quot;;
-}
-if(typeof (MochiKit.Color)==&quot;undefined&quot;){
-MochiKit.Color={};
-}
-MochiKit.Color.NAME=&quot;MochiKit.Color&quot;;
-MochiKit.Color.VERSION=&quot;1.4&quot;;
-MochiKit.Color.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.Color.toString=function(){
-return this.__repr__();
-};
-MochiKit.Color.Color=function(red,_47d,blue,_47f){
-if(typeof (_47f)==&quot;undefined&quot;||_47f===null){
-_47f=1;
-}
-this.rgb={r:red,g:_47d,b:blue,a:_47f};
-};
-MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_480){
-var rgb=this.rgb;
-var m=MochiKit.Color;
-return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_480);
-},colorWithHue:function(hue){
-var hsl=this.asHSL();
-hsl.h=hue;
-var m=MochiKit.Color;
-return m.Color.fromHSL(hsl);
-},colorWithSaturation:function(_486){
-var hsl=this.asHSL();
-hsl.s=_486;
-var m=MochiKit.Color;
-return m.Color.fromHSL(hsl);
-},colorWithLightness:function(_489){
-var hsl=this.asHSL();
-hsl.l=_489;
-var m=MochiKit.Color;
-return m.Color.fromHSL(hsl);
-},darkerColorWithLevel:function(_48c){
-var hsl=this.asHSL();
-hsl.l=Math.max(hsl.l-_48c,0);
-var m=MochiKit.Color;
-return m.Color.fromHSL(hsl);
-},lighterColorWithLevel:function(_48f){
-var hsl=this.asHSL();
-hsl.l=Math.min(hsl.l+_48f,1);
-var m=MochiKit.Color;
-return m.Color.fromHSL(hsl);
-},blendedColor:function(_492,_493){
-if(typeof (_493)==&quot;undefined&quot;||_493===null){
-_493=0.5;
-}
-var sf=1-_493;
-var s=this.rgb;
-var d=_492.rgb;
-var df=_493;
-return MochiKit.Color.Color.fromRGB((s.r*sf)+(d.r*df),(s.g*sf)+(d.g*df),(s.b*sf)+(d.b*df),(s.a*sf)+(d.a*df));
-},compareRGB:function(_498){
-var a=this.asRGB();
-var b=_498.asRGB();
-return MochiKit.Base.compare([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a]);
-},isLight:function(){
-return this.asHSL().b&gt;0.5;
-},isDark:function(){
-return (!this.isLight());
-},toHSLString:function(){
-var c=this.asHSL();
-var ccc=MochiKit.Color.clampColorComponent;
-var rval=this._hslString;
-if(!rval){
-var mid=(ccc(c.h,360).toFixed(0)+&quot;,&quot;+ccc(c.s,100).toPrecision(4)+&quot;%&quot;+&quot;,&quot;+ccc(c.l,100).toPrecision(4)+&quot;%&quot;);
-var a=c.a;
-if(a&gt;=1){
-a=1;
-rval=&quot;hsl(&quot;+mid+&quot;)&quot;;
-}else{
-if(a&lt;=0){
-a=0;
-}
-rval=&quot;hsla(&quot;+mid+&quot;,&quot;+a+&quot;)&quot;;
-}
-this._hslString=rval;
-}
-return rval;
-},toRGBString:function(){
-var c=this.rgb;
-var ccc=MochiKit.Color.clampColorComponent;
-var rval=this._rgbString;
-if(!rval){
-var mid=(ccc(c.r,255).toFixed(0)+&quot;,&quot;+ccc(c.g,255).toFixed(0)+&quot;,&quot;+ccc(c.b,255).toFixed(0));
-if(c.a!=1){
-rval=&quot;rgba(&quot;+mid+&quot;,&quot;+c.a+&quot;)&quot;;
-}else{
-rval=&quot;rgb(&quot;+mid+&quot;)&quot;;
-}
-this._rgbString=rval;
-}
-return rval;
-},asRGB:function(){
-return MochiKit.Base.clone(this.rgb);
-},toHexString:function(){
-var m=MochiKit.Color;
-var c=this.rgb;
-var ccc=MochiKit.Color.clampColorComponent;
-var rval=this._hexString;
-if(!rval){
-rval=(&quot;#&quot;+m.toColorPart(ccc(c.r,255))+m.toColorPart(ccc(c.g,255))+m.toColorPart(ccc(c.b,255)));
-this._hexString=rval;
-}
-return rval;
-},asHSV:function(){
-var hsv=this.hsv;
-var c=this.rgb;
-if(typeof (hsv)==&quot;undefined&quot;||hsv===null){
-hsv=MochiKit.Color.rgbToHSV(this.rgb);
-this.hsv=hsv;
-}
-return MochiKit.Base.clone(hsv);
-},asHSL:function(){
-var hsl=this.hsl;
-var c=this.rgb;
-if(typeof (hsl)==&quot;undefined&quot;||hsl===null){
-hsl=MochiKit.Color.rgbToHSL(this.rgb);
-this.hsl=hsl;
-}
-return MochiKit.Base.clone(hsl);
-},toString:function(){
-return this.toRGBString();
-},repr:function(){
-var c=this.rgb;
-var col=[c.r,c.g,c.b,c.a];
-return this.__class__.NAME+&quot;(&quot;+col.join(&quot;, &quot;)+&quot;)&quot;;
-}};
-MochiKit.Base.update(MochiKit.Color.Color,{fromRGB:function(red,_4af,blue,_4b1){
-var _4b2=MochiKit.Color.Color;
-if(arguments.length==1){
-var rgb=red;
-red=rgb.r;
-_4af=rgb.g;
-blue=rgb.b;
-if(typeof (rgb.a)==&quot;undefined&quot;){
-_4b1=undefined;
-}else{
-_4b1=rgb.a;
-}
-}
-return new _4b2(red,_4af,blue,_4b1);
-},fromHSL:function(hue,_4b5,_4b6,_4b7){
-var m=MochiKit.Color;
-return m.Color.fromRGB(m.hslToRGB.apply(m,arguments));
-},fromHSV:function(hue,_4ba,_4bb,_4bc){
-var m=MochiKit.Color;
-return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments));
-},fromName:function(name){
-var _4bf=MochiKit.Color.Color;
-if(name.charAt(0)==&quot;\&quot;&quot;){
-name=name.substr(1,name.length-2);
-}
-var _4c0=_4bf._namedColors[name.toLowerCase()];
-if(typeof (_4c0)==&quot;string&quot;){
-return _4bf.fromHexString(_4c0);
-}else{
-if(name==&quot;transparent&quot;){
-return _4bf.transparentColor();
-}
-}
-return null;
-},fromString:function(_4c1){
-var self=MochiKit.Color.Color;
-var _4c3=_4c1.substr(0,3);
-if(_4c3==&quot;rgb&quot;){
-return self.fromRGBString(_4c1);
-}else{
-if(_4c3==&quot;hsl&quot;){
-return self.fromHSLString(_4c1);
-}else{
-if(_4c1.charAt(0)==&quot;#&quot;){
-return self.fromHexString(_4c1);
-}
-}
-}
-return self.fromName(_4c1);
-},fromHexString:function(_4c4){
-if(_4c4.charAt(0)==&quot;#&quot;){
-_4c4=_4c4.substring(1);
-}
-var _4c5=[];
-var i,hex;
-if(_4c4.length==3){
-for(i=0;i&lt;3;i++){
-hex=_4c4.substr(i,1);
-_4c5.push(parseInt(hex+hex,16)/255);
-}
-}else{
-for(i=0;i&lt;6;i+=2){
-hex=_4c4.substr(i,2);
-_4c5.push(parseInt(hex,16)/255);
-}
-}
-var _4c8=MochiKit.Color.Color;
-return _4c8.fromRGB.apply(_4c8,_4c5);
-},_fromColorString:function(pre,_4ca,_4cb,_4cc){
-if(_4cc.indexOf(pre)===0){
-_4cc=_4cc.substring(_4cc.indexOf(&quot;(&quot;,3)+1,_4cc.length-1);
-}
-var _4cd=_4cc.split(/\s*,\s*/);
-var _4ce=[];
-for(var i=0;i&lt;_4cd.length;i++){
-var c=_4cd[i];
-var val;
-var _4d2=c.substring(c.length-3);
-if(c.charAt(c.length-1)==&quot;%&quot;){
-val=0.01*parseFloat(c.substring(0,c.length-1));
-}else{
-if(_4d2==&quot;deg&quot;){
-val=parseFloat(c)/360;
-}else{
-if(_4d2==&quot;rad&quot;){
-val=parseFloat(c)/(Math.PI*2);
-}else{
-val=_4cb[i]*parseFloat(c);
-}
-}
-}
-_4ce.push(val);
-}
-return this[_4ca].apply(this,_4ce);
-},fromComputedStyle:function(elem,_4d4){
-var d=MochiKit.DOM;
-var cls=MochiKit.Color.Color;
-for(elem=d.getElement(elem);elem;elem=elem.parentNode){
-var _4d7=MochiKit.Style.getStyle.apply(d,arguments);
-if(!_4d7){
-continue;
-}
-var _4d8=cls.fromString(_4d7);
-if(!_4d8){
-break;
-}
-if(_4d8.asRGB().a&gt;0){
-return _4d8;
-}
-}
-return null;
-},fromBackground:function(elem){
-var cls=MochiKit.Color.Color;
-return cls.fromComputedStyle(elem,&quot;backgroundColor&quot;,&quot;background-color&quot;)||cls.whiteColor();
-},fromText:function(elem){
-var cls=MochiKit.Color.Color;
-return cls.fromComputedStyle(elem,&quot;color&quot;,&quot;color&quot;)||cls.blackColor();
-},namedColors:function(){
-return MochiKit.Base.clone(MochiKit.Color.Color._namedColors);
-}});
-MochiKit.Base.update(MochiKit.Color,{clampColorComponent:function(v,_4de){
-v*=_4de;
-if(v&lt;0){
-return 0;
-}else{
-if(v&gt;_4de){
-return _4de;
-}else{
-return v;
-}
-}
-},_hslValue:function(n1,n2,hue){
-if(hue&gt;6){
-hue-=6;
-}else{
-if(hue&lt;0){
-hue+=6;
-}
-}
-var val;
-if(hue&lt;1){
-val=n1+(n2-n1)*hue;
-}else{
-if(hue&lt;3){
-val=n2;
-}else{
-if(hue&lt;4){
-val=n1+(n2-n1)*(4-hue);
-}else{
-val=n1;
-}
-}
-}
-return val;
-},hsvToRGB:function(hue,_4e4,_4e5,_4e6){
-if(arguments.length==1){
-var hsv=hue;
-hue=hsv.h;
-_4e4=hsv.s;
-_4e5=hsv.v;
-_4e6=hsv.a;
-}
-var red;
-var _4e9;
-var blue;
-if(_4e4===0){
-red=_4e5;
-_4e9=_4e5;
-blue=_4e5;
-}else{
-var i=Math.floor(hue*6);
-var f=(hue*6)-i;
-var p=_4e5*(1-_4e4);
-var q=_4e5*(1-(_4e4*f));
-var t=_4e5*(1-(_4e4*(1-f)));
-switch(i){
-case 1:
-red=q;
-_4e9=_4e5;
-blue=p;
-break;
-case 2:
-red=p;
-_4e9=_4e5;
-blue=t;
-break;
-case 3:
-red=p;
-_4e9=q;
-blue=_4e5;
-break;
-case 4:
-red=t;
-_4e9=p;
-blue=_4e5;
-break;
-case 5:
-red=_4e5;
-_4e9=p;
-blue=q;
-break;
-case 6:
-case 0:
-red=_4e5;
-_4e9=t;
-blue=p;
-break;
-}
-}
-return {r:red,g:_4e9,b:blue,a:_4e6};
-},hslToRGB:function(hue,_4f1,_4f2,_4f3){
-if(arguments.length==1){
-var hsl=hue;
-hue=hsl.h;
-_4f1=hsl.s;
-_4f2=hsl.l;
-_4f3=hsl.a;
-}
-var red;
-var _4f6;
-var blue;
-if(_4f1===0){
-red=_4f2;
-_4f6=_4f2;
-blue=_4f2;
-}else{
-var m2;
-if(_4f2&lt;=0.5){
-m2=_4f2*(1+_4f1);
-}else{
-m2=_4f2+_4f1-(_4f2*_4f1);
-}
-var m1=(2*_4f2)-m2;
-var f=MochiKit.Color._hslValue;
-var h6=hue*6;
-red=f(m1,m2,h6+2);
-_4f6=f(m1,m2,h6);
-blue=f(m1,m2,h6-2);
-}
-return {r:red,g:_4f6,b:blue,a:_4f3};
-},rgbToHSV:function(red,_4fd,blue,_4ff){
-if(arguments.length==1){
-var rgb=red;
-red=rgb.r;
-_4fd=rgb.g;
-blue=rgb.b;
-_4ff=rgb.a;
-}
-var max=Math.max(Math.max(red,_4fd),blue);
-var min=Math.min(Math.min(red,_4fd),blue);
-var hue;
-var _504;
-var _505=max;
-if(min==max){
-hue=0;
-_504=0;
-}else{
-var _506=(max-min);
-_504=_506/max;
-if(red==max){
-hue=(_4fd-blue)/_506;
-}else{
-if(_4fd==max){
-hue=2+((blue-red)/_506);
-}else{
-hue=4+((red-_4fd)/_506);
-}
-}
-hue/=6;
-if(hue&lt;0){
-hue+=1;
-}
-if(hue&gt;1){
-hue-=1;
-}
-}
-return {h:hue,s:_504,v:_505,a:_4ff};
-},rgbToHSL:function(red,_508,blue,_50a){
-if(arguments.length==1){
-var rgb=red;
-red=rgb.r;
-_508=rgb.g;
-blue=rgb.b;
-_50a=rgb.a;
-}
-var max=Math.max(red,Math.max(_508,blue));
-var min=Math.min(red,Math.min(_508,blue));
-var hue;
-var _50f;
-var _510=(max+min)/2;
-var _511=max-min;
-if(_511===0){
-hue=0;
-_50f=0;
-}else{
-if(_510&lt;=0.5){
-_50f=_511/(max+min);
-}else{
-_50f=_511/(2-max-min);
-}
-if(red==max){
-hue=(_508-blue)/_511;
-}else{
-if(_508==max){
-hue=2+((blue-red)/_511);
-}else{
-hue=4+((red-_508)/_511);
-}
-}
-hue/=6;
-if(hue&lt;0){
-hue+=1;
-}
-if(hue&gt;1){
-hue-=1;
-}
-}
-return {h:hue,s:_50f,l:_510,a:_50a};
-},toColorPart:function(num){
-num=Math.round(num);
-var _513=num.toString(16);
-if(num&lt;16){
-return &quot;0&quot;+_513;
-}
-return _513;
-},__new__:function(){
-var m=MochiKit.Base;
-this.Color.fromRGBString=m.bind(this.Color._fromColorString,this.Color,&quot;rgb&quot;,&quot;fromRGB&quot;,[1/255,1/255,1/255,1]);
-this.Color.fromHSLString=m.bind(this.Color._fromColorString,this.Color,&quot;hsl&quot;,&quot;fromHSL&quot;,[1/360,0.01,0.01,1]);
-var _515=1/3;
-var _516={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_515,_515,_515],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_515,2*_515,2*_515],magenta:[1,0,1],orange:[1,0.5,0],purple:[0.5,0,0.5],red:[1,0,0],transparent:[0,0,0,0],white:[1,1,1],yellow:[1,1,0]};
-var _517=function(name,r,g,b,a){
-var rval=this.fromRGB(r,g,b,a);
-this[name]=function(){
-return rval;
-};
-return rval;
-};
-for(var k in _516){
-var name=k+&quot;Color&quot;;
-var _520=m.concat([_517,this.Color,name],_516[k]);
-this.Color[name]=m.bind.apply(null,_520);
-}
-var _521=function(){
-for(var i=0;i&lt;arguments.length;i++){
-if(!(arguments[i] instanceof Color)){
-return false;
-}
-}
-return true;
-};
-var _523=function(a,b){
-return a.compareRGB(b);
-};
-m.nameFunctions(this);
-m.registerComparator(this.Color.NAME,_521,_523);
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-}});
-MochiKit.Color.EXPORT=[&quot;Color&quot;];
-MochiKit.Color.EXPORT_OK=[&quot;clampColorComponent&quot;,&quot;rgbToHSL&quot;,&quot;hslToRGB&quot;,&quot;rgbToHSV&quot;,&quot;hsvToRGB&quot;,&quot;toColorPart&quot;];
-MochiKit.Color.__new__();
-MochiKit.Base._exportSymbols(this,MochiKit.Color);
-MochiKit.Color.Color._namedColors={aliceblue:&quot;#f0f8ff&quot;,antiquewhite:&quot;#faebd7&quot;,aqua:&quot;#00ffff&quot;,aquamarine:&quot;#7fffd4&quot;,azure:&quot;#f0ffff&quot;,beige:&quot;#f5f5dc&quot;,bisque:&quot;#ffe4c4&quot;,black:&quot;#000000&quot;,blanchedalmond:&quot;#ffebcd&quot;,blue:&quot;#0000ff&quot;,blueviolet:&quot;#8a2be2&quot;,brown:&quot;#a52a2a&quot;,burlywood:&quot;#deb887&quot;,cadetblue:&quot;#5f9ea0&quot;,chartreuse:&quot;#7fff00&quot;,chocolate:&quot;#d2691e&quot;,coral:&quot;#ff7f50&quot;,cornflowerblue:&quot;#6495ed&quot;,cornsilk:&quot;#fff8dc&quot;,crimson:&quot;#dc143c&quot;,cyan:&quot;#00ffff&quot;,darkblue:&quot;#00008b&quot;,darkcyan:&quot;#008b8b&quot;,darkgoldenrod:&quot;#b8860b&quot;,darkgray:&quot;#a9a9a9&quot;,darkgreen:&quot;#006400&quot;,darkgrey:&quot;#a9a9a9&quot;,darkkhaki:&quot;#bdb76b&quot;,darkmagenta:&quot;#8b008b&quot;,darkolivegreen:&quot;#556b2f&quot;,darkorange:&quot;#ff8c00&quot;,darkorchid:&quot;#9932cc&quot;,darkred:&quot;#8b0000&quot;,darksalmon:&quot;#e9967a&quot;,darkseagreen:&quot;#8fbc8f&quot;,darkslateblue:&quot;#483d8b&quot;,darkslategray:&quot;#2f4f4f&quot;,darkslategrey:&quot;#2f4f4f&quot;,darkturquoise:&quot;#00ced1&quot;,darkviolet:&quot;#9400d3&quot;,deeppink:&quot;#ff1493&quot;,deepskyblue:&quot;#00bfff&quot;,dimgray:&quot;#696969&quot;,dimgrey:&quot;#696969&quot;,dodgerblue:&quot;#1e90ff&quot;,firebrick:&quot;#b22222&quot;,floralwhite:&quot;#fffaf0&quot;,forestgreen:&quot;#228b22&quot;,fuchsia:&quot;#ff00ff&quot;,gainsboro:&quot;#dcdcdc&quot;,ghostwhite:&quot;#f8f8ff&quot;,gold:&quot;#ffd700&quot;,goldenrod:&quot;#daa520&quot;,gray:&quot;#808080&quot;,green:&quot;#008000&quot;,greenyellow:&quot;#adff2f&quot;,grey:&quot;#808080&quot;,honeydew:&quot;#f0fff0&quot;,hotpink:&quot;#ff69b4&quot;,indianred:&quot;#cd5c5c&quot;,indigo:&quot;#4b0082&quot;,ivory:&quot;#fffff0&quot;,khaki:&quot;#f0e68c&quot;,lavender:&quot;#e6e6fa&quot;,lavenderblush:&quot;#fff0f5&quot;,lawngreen:&quot;#7cfc00&quot;,lemonchiffon:&quot;#fffacd&quot;,lightblue:&quot;#add8e6&quot;,lightcoral:&quot;#f08080&quot;,lightcyan:&quot;#e0ffff&quot;,lightgoldenrodyellow:&quot;#fafad2&quot;,lightgray:&quot;#d3d3d3&quot;,lightgreen:&quot;#90ee90&quot;,lightgrey:&quot;#d3d3d3&quot;,lightpink:&quot;#ffb6c1&quot;,lightsalmon:&quot;#ffa07a&quot;,lightseagreen:&quot;#20b2aa&quot;,lightskyblue:&quot;#87cefa&quot;,lightslategray:&quot;#778899&quot;,lightslategrey:&quot;#778899&quot;,lightsteelblue:&quot;#b0c4de&quot;,lightyellow:&quot;#ffffe0&quot;,lime:&quot;#00ff00&quot;,limegreen:&quot;#32cd32&quot;,linen:&quot;#faf0e6&quot;,magenta:&quot;#ff00ff&quot;,maroon:&quot;#800000&quot;,mediumaquamarine:&quot;#66cdaa&quot;,mediumblue:&quot;#0000cd&quot;,mediumorchid:&quot;#ba55d3&quot;,mediumpurple:&quot;#9370db&quot;,mediumseagreen:&quot;#3cb371&quot;,mediumslateblue:&quot;#7b68ee&quot;,mediumspringgreen:&quot;#00fa9a&quot;,mediumturquoise:&quot;#48d1cc&quot;,mediumvioletred:&quot;#c71585&quot;,midnightblue:&quot;#191970&quot;,mintcream:&quot;#f5fffa&quot;,mistyrose:&quot;#ffe4e1&quot;,moccasin:&quot;#ffe4b5&quot;,navajowhite:&quot;#ffdead&quot;,navy:&quot;#000080&quot;,oldlace:&quot;#fdf5e6&quot;,olive:&quot;#808000&quot;,olivedrab:&quot;#6b8e23&quot;,orange:&quot;#ffa500&quot;,orangered:&quot;#ff4500&quot;,orchid:&quot;#da70d6&quot;,palegoldenrod:&quot;#eee8aa&quot;,palegreen:&quot;#98fb98&quot;,paleturquoise:&quot;#afeeee&quot;,palevioletred:&quot;#db7093&quot;,papayawhip:&quot;#ffefd5&quot;,peachpuff:&quot;#ffdab9&quot;,peru:&quot;#cd853f&quot;,pink:&quot;#ffc0cb&quot;,plum:&quot;#dda0dd&quot;,powderblue:&quot;#b0e0e6&quot;,purple:&quot;#800080&quot;,red:&quot;#ff0000&quot;,rosybrown:&quot;#bc8f8f&quot;,royalblue:&quot;#4169e1&quot;,saddlebrown:&quot;#8b4513&quot;,salmon:&quot;#fa8072&quot;,sandybrown:&quot;#f4a460&quot;,seagreen:&quot;#2e8b57&quot;,seashell:&quot;#fff5ee&quot;,sienna:&quot;#a0522d&quot;,silver:&quot;#c0c0c0&quot;,skyblue:&quot;#87ceeb&quot;,slateblue:&quot;#6a5acd&quot;,slategray:&quot;#708090&quot;,slategrey:&quot;#708090&quot;,snow:&quot;#fffafa&quot;,springgreen:&quot;#00ff7f&quot;,steelblue:&quot;#4682b4&quot;,tan:&quot;#d2b48c&quot;,teal:&quot;#008080&quot;,thistle:&quot;#d8bfd8&quot;,tomato:&quot;#ff6347&quot;,turquoise:&quot;#40e0d0&quot;,violet:&quot;#ee82ee&quot;,wheat:&quot;#f5deb3&quot;,white:&quot;#ffffff&quot;,whitesmoke:&quot;#f5f5f5&quot;,yellow:&quot;#ffff00&quot;,yellowgreen:&quot;#9acd32&quot;};
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Signal&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-dojo.require(&quot;MochiKit.DOM&quot;);
-dojo.require(&quot;MochiKit.Style&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-JSAN.use(&quot;MochiKit.DOM&quot;,[]);
-JSAN.use(&quot;MochiKit.Style&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Signal depends on MochiKit.Base!&quot;;
-}
-try{
-if(typeof (MochiKit.DOM)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Signal depends on MochiKit.DOM!&quot;;
-}
-try{
-if(typeof (MochiKit.Style)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Signal depends on MochiKit.Style!&quot;;
-}
-if(typeof (MochiKit.Signal)==&quot;undefined&quot;){
-MochiKit.Signal={};
-}
-MochiKit.Signal.NAME=&quot;MochiKit.Signal&quot;;
-MochiKit.Signal.VERSION=&quot;1.4&quot;;
-MochiKit.Signal._observers=[];
-MochiKit.Signal.Event=function(src,e){
-this._event=e||window.event;
-this._src=src;
-};
-MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){
-var repr=MochiKit.Base.repr;
-var str=&quot;{event(): &quot;+repr(this.event())+&quot;, src(): &quot;+repr(this.src())+&quot;, type(): &quot;+repr(this.type())+&quot;, target(): &quot;+repr(this.target());
-if(this.type()&amp;&amp;this.type().indexOf(&quot;key&quot;)===0||this.type().indexOf(&quot;mouse&quot;)===0||this.type().indexOf(&quot;click&quot;)!=-1||this.type()==&quot;contextmenu&quot;){
-str+=&quot;, modifier(): &quot;+&quot;{alt: &quot;+repr(this.modifier().alt)+&quot;, ctrl: &quot;+repr(this.modifier().ctrl)+&quot;, meta: &quot;+repr(this.modifier().meta)+&quot;, shift: &quot;+repr(this.modifier().shift)+&quot;, any: &quot;+repr(this.modifier().any)+&quot;}&quot;;
-}
-if(this.type()&amp;&amp;this.type().indexOf(&quot;key&quot;)===0){
-str+=&quot;, key(): {code: &quot;+repr(this.key().code)+&quot;, string: &quot;+repr(this.key().string)+&quot;}&quot;;
-}
-if(this.type()&amp;&amp;(this.type().indexOf(&quot;mouse&quot;)===0||this.type().indexOf(&quot;click&quot;)!=-1||this.type()==&quot;contextmenu&quot;)){
-str+=&quot;, mouse(): {page: &quot;+repr(this.mouse().page)+&quot;, client: &quot;+repr(this.mouse().client);
-if(this.type()!=&quot;mousemove&quot;){
-str+=&quot;, button: {left: &quot;+repr(this.mouse().button.left)+&quot;, middle: &quot;+repr(this.mouse().button.middle)+&quot;, right: &quot;+repr(this.mouse().button.right)+&quot;}}&quot;;
-}else{
-str+=&quot;}&quot;;
-}
-}
-if(this.type()==&quot;mouseover&quot;||this.type()==&quot;mouseout&quot;){
-str+=&quot;, relatedTarget(): &quot;+repr(this.relatedTarget());
-}
-str+=&quot;}&quot;;
-return str;
-},toString:function(){
-return this.__repr__();
-},src:function(){
-return this._src;
-},event:function(){
-return this._event;
-},type:function(){
-return this._event.type||undefined;
-},target:function(){
-return this._event.target||this._event.srcElement;
-},_relatedTarget:null,relatedTarget:function(){
-if(this._relatedTarget!==null){
-return this._relatedTarget;
-}
-var elem=null;
-if(this.type()==&quot;mouseover&quot;){
-elem=(this._event.relatedTarget||this._event.fromElement);
-}else{
-if(this.type()==&quot;mouseout&quot;){
-elem=(this._event.relatedTarget||this._event.toElement);
-}
-}
-if(elem!==null){
-this._relatedTarget=elem;
-return elem;
-}
-return undefined;
-},_modifier:null,modifier:function(){
-if(this._modifier!==null){
-return this._modifier;
-}
-var m={};
-m.alt=this._event.altKey;
-m.ctrl=this._event.ctrlKey;
-m.meta=this._event.metaKey||false;
-m.shift=this._event.shiftKey;
-m.any=m.alt||m.ctrl||m.shift||m.meta;
-this._modifier=m;
-return m;
-},_key:null,key:function(){
-if(this._key!==null){
-return this._key;
-}
-var k={};
-if(this.type()&amp;&amp;this.type().indexOf(&quot;key&quot;)===0){
-if(this.type()==&quot;keydown&quot;||this.type()==&quot;keyup&quot;){
-k.code=this._event.keyCode;
-k.string=(MochiKit.Signal._specialKeys[k.code]||&quot;KEY_UNKNOWN&quot;);
-this._key=k;
-return k;
-}else{
-if(this.type()==&quot;keypress&quot;){
-k.code=0;
-k.string=&quot;&quot;;
-if(typeof (this._event.charCode)!=&quot;undefined&quot;&amp;&amp;this._event.charCode!==0&amp;&amp;!MochiKit.Signal._specialMacKeys[this._event.charCode]){
-k.code=this._event.charCode;
-k.string=String.fromCharCode(k.code);
-}else{
-if(this._event.keyCode&amp;&amp;typeof (this._event.charCode)==&quot;undefined&quot;){
-k.code=this._event.keyCode;
-k.string=String.fromCharCode(k.code);
-}
-}
-this._key=k;
-return k;
-}
-}
-}
-return undefined;
-},_mouse:null,mouse:function(){
-if(this._mouse!==null){
-return this._mouse;
-}
-var m={};
-var e=this._event;
-if(this.type()&amp;&amp;(this.type().indexOf(&quot;mouse&quot;)===0||this.type().indexOf(&quot;click&quot;)!=-1||this.type()==&quot;contextmenu&quot;)){
-m.client=new MochiKit.Style.Coordinates(0,0);
-if(e.clientX||e.clientY){
-m.client.x=(!e.clientX||e.clientX&lt;0)?0:e.clientX;
-m.client.y=(!e.clientY||e.clientY&lt;0)?0:e.clientY;
-}
-m.page=new MochiKit.Style.Coordinates(0,0);
-if(e.pageX||e.pageY){
-m.page.x=(!e.pageX||e.pageX&lt;0)?0:e.pageX;
-m.page.y=(!e.pageY||e.pageY&lt;0)?0:e.pageY;
-}else{
-var de=MochiKit.DOM._document.documentElement;
-var b=MochiKit.DOM._document.body;
-m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
-m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
-}
-if(this.type()!=&quot;mousemove&quot;){
-m.button={};
-m.button.left=false;
-m.button.right=false;
-m.button.middle=false;
-if(e.which){
-m.button.left=(e.which==1);
-m.button.middle=(e.which==2);
-m.button.right=(e.which==3);
-}else{
-m.button.left=!!(e.button&amp;1);
-m.button.right=!!(e.button&amp;2);
-m.button.middle=!!(e.button&amp;4);
-}
-}
-this._mouse=m;
-return m;
-}
-return undefined;
-},stop:function(){
-this.stopPropagation();
-this.preventDefault();
-},stopPropagation:function(){
-if(this._event.stopPropagation){
-this._event.stopPropagation();
-}else{
-this._event.cancelBubble=true;
-}
-},preventDefault:function(){
-if(this._event.preventDefault){
-this._event.preventDefault();
-}else{
-if(this._confirmUnload===null){
-this._event.returnValue=false;
-}
-}
-},_confirmUnload:null,confirmUnload:function(msg){
-if(this.type()==&quot;beforeunload&quot;){
-this._confirmUnload=msg;
-this._event.returnValue=msg;
-}
-}});
-MochiKit.Signal._specialMacKeys={3:&quot;KEY_ENTER&quot;,63289:&quot;KEY_NUM_PAD_CLEAR&quot;,63276:&quot;KEY_PAGE_UP&quot;,63277:&quot;KEY_PAGE_DOWN&quot;,63275:&quot;KEY_END&quot;,63273:&quot;KEY_HOME&quot;,63234:&quot;KEY_ARROW_LEFT&quot;,63232:&quot;KEY_ARROW_UP&quot;,63235:&quot;KEY_ARROW_RIGHT&quot;,63233:&quot;KEY_ARROW_DOWN&quot;,63302:&quot;KEY_INSERT&quot;,63272:&quot;KEY_DELETE&quot;};
-(function(){
-var _532=MochiKit.Signal._specialMacKeys;
-for(i=63236;i&lt;=63242;i++){
-_532[i]=&quot;KEY_F&quot;+(i-63236+1);
-}
-})();
-MochiKit.Signal._specialKeys={8:&quot;KEY_BACKSPACE&quot;,9:&quot;KEY_TAB&quot;,12:&quot;KEY_NUM_PAD_CLEAR&quot;,13:&quot;KEY_ENTER&quot;,16:&quot;KEY_SHIFT&quot;,17:&quot;KEY_CTRL&quot;,18:&quot;KEY_ALT&quot;,19:&quot;KEY_PAUSE&quot;,20:&quot;KEY_CAPS_LOCK&quot;,27:&quot;KEY_ESCAPE&quot;,32:&quot;KEY_SPACEBAR&quot;,33:&quot;KEY_PAGE_UP&quot;,34:&quot;KEY_PAGE_DOWN&quot;,35:&quot;KEY_END&quot;,36:&quot;KEY_HOME&quot;,37:&quot;KEY_ARROW_LEFT&quot;,38:&quot;KEY_ARROW_UP&quot;,39:&quot;KEY_ARROW_RIGHT&quot;,40:&quot;KEY_ARROW_DOWN&quot;,44:&quot;KEY_PRINT_SCREEN&quot;,45:&quot;KEY_INSERT&quot;,46:&quot;KEY_DELETE&quot;,59:&quot;KEY_SEMICOLON&quot;,91:&quot;KEY_WINDOWS_LEFT&quot;,92:&quot;KEY_WINDOWS_RIGHT&quot;,93:&quot;KEY_SELECT&quot;,106:&quot;KEY_NUM_PAD_ASTERISK&quot;,107:&quot;KEY_NUM_PAD_PLUS_SIGN&quot;,109:&quot;KEY_NUM_PAD_HYPHEN-MINUS&quot;,110:&quot;KEY_NUM_PAD_FULL_STOP&quot;,111:&quot;KEY_NUM_PAD_SOLIDUS&quot;,144:&quot;KEY_NUM_LOCK&quot;,145:&quot;KEY_SCROLL_LOCK&quot;,186:&quot;KEY_SEMICOLON&quot;,187:&quot;KEY_EQUALS_SIGN&quot;,188:&quot;KEY_COMMA&quot;,189:&quot;KEY_HYPHEN-MINUS&quot;,190:&quot;KEY_FULL_STOP&quot;,191:&quot;KEY_SOLIDUS&quot;,192:&quot;KEY_GRAVE_ACCENT&quot;,219:&quot;KEY_LEFT_SQUARE_BRACKET&quot;,220:&quot;KEY_REVERSE_SOLIDUS&quot;,221:&quot;KEY_RIGHT_SQUARE_BRACKET&quot;,222:&quot;KEY_APOSTROPHE&quot;};
-(function(){
-var _533=MochiKit.Signal._specialKeys;
-for(var i=48;i&lt;=57;i++){
-_533[i]=&quot;KEY_&quot;+(i-48);
-}
-for(i=65;i&lt;=90;i++){
-_533[i]=&quot;KEY_&quot;+String.fromCharCode(i);
-}
-for(i=96;i&lt;=105;i++){
-_533[i]=&quot;KEY_NUM_PAD_&quot;+(i-96);
-}
-for(i=112;i&lt;=123;i++){
-_533[i]=&quot;KEY_F&quot;+(i-112+1);
-}
-})();
-MochiKit.Signal.Ident=function(_535){
-this.source=_535.source;
-this.signal=_535.signal;
-this.listener=_535.listener;
-this.isDOM=_535.isDOM;
-this.objOrFunc=_535.objOrFunc;
-this.funcOrStr=_535.funcOrStr;
-this.connected=_535.connected;
-};
-MochiKit.Signal.Ident.prototype={};
-MochiKit.Base.update(MochiKit.Signal,{__repr__:function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-},toString:function(){
-return this.__repr__();
-},_unloadCache:function(){
-var self=MochiKit.Signal;
-var _537=self._observers;
-for(var i=0;i&lt;_537.length;i++){
-if(_537[i].signal!==&quot;onload&quot;&amp;&amp;_537[i].signal!==&quot;onunload&quot;){
-self._disconnect(_537[i]);
-}
-}
-},_listener:function(src,sig,func,obj,_53d){
-var self=MochiKit.Signal;
-var E=self.Event;
-if(!_53d){
-if(typeof (func.im_self)==&quot;undefined&quot;){
-return MochiKit.Base.bind(func,obj);
-}else{
-return func;
-}
-}
-obj=obj||src;
-if(typeof (func)==&quot;string&quot;){
-if(sig===&quot;onload&quot;||sig===&quot;onunload&quot;){
-return function(_540){
-obj[func].apply(obj,[new E(src,_540)]);
-var _541=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:obj,funcOrStr:func});
-MochiKit.Signal._disconnect(_541);
-};
-}else{
-return function(_542){
-obj[func].apply(obj,[new E(src,_542)]);
-};
-}
-}else{
-if(sig===&quot;onload&quot;||sig===&quot;onunload&quot;){
-return function(_543){
-func.apply(obj,[new E(src,_543)]);
-var _544=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:func});
-MochiKit.Signal._disconnect(_544);
-};
-}else{
-return function(_545){
-func.apply(obj,[new E(src,_545)]);
-};
-}
-}
-},_browserAlreadyHasMouseEnterAndLeave:function(){
-return /MSIE/.test(navigator.userAgent);
-},_mouseEnterListener:function(src,sig,func,obj){
-var E=MochiKit.Signal.Event;
-return function(_54b){
-var e=new E(src,_54b);
-try{
-e.relatedTarget().nodeName;
-}
-catch(err){
-return;
-}
-e.stop();
-if(MochiKit.DOM.isChildNode(e.relatedTarget(),src)){
-return;
-}
-e.type=function(){
-return sig;
-};
-if(typeof (func)==&quot;string&quot;){
-return obj[func].apply(obj,[e]);
-}else{
-return func.apply(obj,[e]);
-}
-};
-},_getDestPair:function(_54d,_54e){
-var obj=null;
-var func=null;
-if(typeof (_54e)!=&quot;undefined&quot;){
-obj=_54d;
-func=_54e;
-if(typeof (_54e)==&quot;string&quot;){
-if(typeof (_54d[_54e])!=&quot;function&quot;){
-throw new Error(&quot;'funcOrStr' must be a function on 'objOrFunc'&quot;);
-}
-}else{
-if(typeof (_54e)!=&quot;function&quot;){
-throw new Error(&quot;'funcOrStr' must be a function or string&quot;);
-}
-}
-}else{
-if(typeof (_54d)!=&quot;function&quot;){
-throw new Error(&quot;'objOrFunc' must be a function if 'funcOrStr' is not given&quot;);
-}else{
-func=_54d;
-}
-}
-return [obj,func];
-},connect:function(src,sig,_553,_554){
-src=MochiKit.DOM.getElement(src);
-var self=MochiKit.Signal;
-if(typeof (sig)!=&quot;string&quot;){
-throw new Error(&quot;'sig' must be a string&quot;);
-}
-var _556=self._getDestPair(_553,_554);
-var obj=_556[0];
-var func=_556[1];
-if(typeof (obj)==&quot;undefined&quot;||obj===null){
-obj=src;
-}
-var _559=!!(src.addEventListener||src.attachEvent);
-if(_559&amp;&amp;(sig===&quot;onmouseenter&quot;||sig===&quot;onmouseleave&quot;)&amp;&amp;!self._browserAlreadyHasMouseEnterAndLeave()){
-var _55a=self._mouseEnterListener(src,sig.substr(2),func,obj);
-if(sig===&quot;onmouseenter&quot;){
-sig=&quot;onmouseover&quot;;
-}else{
-sig=&quot;onmouseout&quot;;
-}
-}else{
-var _55a=self._listener(src,sig,func,obj,_559);
-}
-if(src.addEventListener){
-src.addEventListener(sig.substr(2),_55a,false);
-}else{
-if(src.attachEvent){
-src.attachEvent(sig,_55a);
-}
-}
-var _55b=new MochiKit.Signal.Ident({source:src,signal:sig,listener:_55a,isDOM:_559,objOrFunc:_553,funcOrStr:_554,connected:true});
-self._observers.push(_55b);
-if(!_559&amp;&amp;typeof (src.__connect__)==&quot;function&quot;){
-var args=MochiKit.Base.extend([_55b],arguments,1);
-src.__connect__.apply(src,args);
-}
-return _55b;
-},_disconnect:function(_55d){
-if(!_55d.connected){
-return;
-}
-_55d.connected=false;
-if(!_55d.isDOM){
-return;
-}
-var src=_55d.source;
-var sig=_55d.signal;
-var _560=_55d.listener;
-if(src.removeEventListener){
-src.removeEventListener(sig.substr(2),_560,false);
-}else{
-if(src.detachEvent){
-src.detachEvent(sig,_560);
-}else{
-throw new Error(&quot;'src' must be a DOM element&quot;);
-}
-}
-},disconnect:function(_561){
-var self=MochiKit.Signal;
-var _563=self._observers;
-var m=MochiKit.Base;
-if(arguments.length&gt;1){
-var src=MochiKit.DOM.getElement(arguments[0]);
-var sig=arguments[1];
-var obj=arguments[2];
-var func=arguments[3];
-for(var i=_563.length-1;i&gt;=0;i--){
-var o=_563[i];
-if(o.source===src&amp;&amp;o.signal===sig&amp;&amp;o.objOrFunc===obj&amp;&amp;o.funcOrStr===func){
-self._disconnect(o);
-if(!self._lock){
-_563.splice(i,1);
-}else{
-self._dirty=true;
-}
-return true;
-}
-}
-}else{
-var idx=m.findIdentical(_563,_561);
-if(idx&gt;=0){
-self._disconnect(_561);
-if(!self._lock){
-_563.splice(idx,1);
-}else{
-self._dirty=true;
-}
-return true;
-}
-}
-return false;
-},disconnectAllTo:function(_56c,_56d){
-var self=MochiKit.Signal;
-var _56f=self._observers;
-var _570=self._disconnect;
-var _571=self._lock;
-var _572=self._dirty;
-if(typeof (_56d)===&quot;undefined&quot;){
-_56d=null;
-}
-for(var i=_56f.length-1;i&gt;=0;i--){
-var _574=_56f[i];
-if(_574.objOrFunc===_56c&amp;&amp;(_56d===null||_574.funcOrStr===_56d)){
-_570(_574);
-if(_571){
-_572=true;
-}else{
-_56f.splice(i,1);
-}
-}
-}
-self._dirty=_572;
-},disconnectAll:function(src,sig){
-src=MochiKit.DOM.getElement(src);
-var m=MochiKit.Base;
-var _578=m.flattenArguments(m.extend(null,arguments,1));
-var self=MochiKit.Signal;
-var _57a=self._disconnect;
-var _57b=self._observers;
-var i,_57d;
-var _57e=self._lock;
-var _57f=self._dirty;
-if(_578.length===0){
-for(i=_57b.length-1;i&gt;=0;i--){
-_57d=_57b[i];
-if(_57d.source===src){
-_57a(_57d);
-if(!_57e){
-_57b.splice(i,1);
-}else{
-_57f=true;
-}
-}
-}
-}else{
-var sigs={};
-for(i=0;i&lt;_578.length;i++){
-sigs[_578[i]]=true;
-}
-for(i=_57b.length-1;i&gt;=0;i--){
-_57d=_57b[i];
-if(_57d.source===src&amp;&amp;_57d.signal in sigs){
-_57a(_57d);
-if(!_57e){
-_57b.splice(i,1);
-}else{
-_57f=true;
-}
-}
-}
-}
-self._dirty=_57f;
-},signal:function(src,sig){
-var self=MochiKit.Signal;
-var _584=self._observers;
-src=MochiKit.DOM.getElement(src);
-var args=MochiKit.Base.extend(null,arguments,2);
-var _586=[];
-self._lock=true;
-for(var i=0;i&lt;_584.length;i++){
-var _588=_584[i];
-if(_588.source===src&amp;&amp;_588.signal===sig&amp;&amp;_588.connected){
-try{
-_588.listener.apply(src,args);
-}
-catch(e){
-_586.push(e);
-}
-}
-}
-self._lock=false;
-if(self._dirty){
-self._dirty=false;
-for(var i=_584.length-1;i&gt;=0;i--){
-if(!_584[i].connected){
-_584.splice(i,1);
-}
-}
-}
-if(_586.length==1){
-throw _586[0];
-}else{
-if(_586.length&gt;1){
-var e=new Error(&quot;Multiple errors thrown in handling 'sig', see errors property&quot;);
-e.errors=_586;
-throw e;
-}
-}
-}});
-MochiKit.Signal.EXPORT_OK=[];
-MochiKit.Signal.EXPORT=[&quot;connect&quot;,&quot;disconnect&quot;,&quot;signal&quot;,&quot;disconnectAll&quot;,&quot;disconnectAllTo&quot;];
-MochiKit.Signal.__new__=function(win){
-var m=MochiKit.Base;
-this._document=document;
-this._window=win;
-this._lock=false;
-this._dirty=false;
-try{
-this.connect(window,&quot;onunload&quot;,this._unloadCache);
-}
-catch(e){
-}
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-m.nameFunctions(this);
-};
-MochiKit.Signal.__new__(this);
-if(MochiKit.__export__){
-connect=MochiKit.Signal.connect;
-disconnect=MochiKit.Signal.disconnect;
-disconnectAll=MochiKit.Signal.disconnectAll;
-signal=MochiKit.Signal.signal;
-}
-MochiKit.Base._exportSymbols(this,MochiKit.Signal);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Position&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-dojo.require(&quot;MochiKit.DOM&quot;);
-dojo.require(&quot;MochiKit.Style&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-JSAN.use(&quot;MochiKit.DOM&quot;,[]);
-JSAN.use(&quot;MochiKit.Style&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)==&quot;undefined&quot;||typeof (MochiKit.Style)==&quot;undefined&quot;||typeof (MochiKit.DOM)==&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Style depends on MochiKit.Base, MochiKit.DOM, and MochiKit.Style!&quot;;
-}
-if(typeof (MochiKit.Position)==&quot;undefined&quot;){
-MochiKit.Position={};
-}
-MochiKit.Position.NAME=&quot;MochiKit.Position&quot;;
-MochiKit.Position.VERSION=&quot;1.4&quot;;
-MochiKit.Position.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.Position.toString=function(){
-return this.__repr__();
-};
-MochiKit.Position.EXPORT_OK=[];
-MochiKit.Position.EXPORT=[];
-MochiKit.Base.update(MochiKit.Position,{includeScrollOffsets:false,prepare:function(){
-var _58c=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
-var _58d=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
-this.windowOffset=new MochiKit.Style.Coordinates(_58c,_58d);
-},cumulativeOffset:function(_58e){
-var _58f=0;
-var _590=0;
-do{
-_58f+=_58e.offsetTop||0;
-_590+=_58e.offsetLeft||0;
-_58e=_58e.offsetParent;
-}while(_58e);
-return new MochiKit.Style.Coordinates(_590,_58f);
-},realOffset:function(_591){
-var _592=0;
-var _593=0;
-do{
-_592+=_591.scrollTop||0;
-_593+=_591.scrollLeft||0;
-_591=_591.parentNode;
-}while(_591);
-return new MochiKit.Style.Coordinates(_593,_592);
-},within:function(_594,x,y){
-if(this.includeScrollOffsets){
-return this.withinIncludingScrolloffsets(_594,x,y);
-}
-this.xcomp=x;
-this.ycomp=y;
-this.offset=this.cumulativeOffset(_594);
-if(_594.style.position==&quot;fixed&quot;){
-this.offset.x+=this.windowOffset.x;
-this.offset.y+=this.windowOffset.y;
-}
-return (y&gt;=this.offset.y&amp;&amp;y&lt;this.offset.y+_594.offsetHeight&amp;&amp;x&gt;=this.offset.x&amp;&amp;x&lt;this.offset.x+_594.offsetWidth);
-},withinIncludingScrolloffsets:function(_597,x,y){
-var _59a=this.realOffset(_597);
-this.xcomp=x+_59a.x-this.windowOffset.x;
-this.ycomp=y+_59a.y-this.windowOffset.y;
-this.offset=this.cumulativeOffset(_597);
-return (this.ycomp&gt;=this.offset.y&amp;&amp;this.ycomp&lt;this.offset.y+_597.offsetHeight&amp;&amp;this.xcomp&gt;=this.offset.x&amp;&amp;this.xcomp&lt;this.offset.x+_597.offsetWidth);
-},overlap:function(mode,_59c){
-if(!mode){
-return 0;
-}
-if(mode==&quot;vertical&quot;){
-return ((this.offset.y+_59c.offsetHeight)-this.ycomp)/_59c.offsetHeight;
-}
-if(mode==&quot;horizontal&quot;){
-return ((this.offset.x+_59c.offsetWidth)-this.xcomp)/_59c.offsetWidth;
-}
-},absolutize:function(_59d){
-_59d=MochiKit.DOM.getElement(_59d);
-if(_59d.style.position==&quot;absolute&quot;){
-return;
-}
-MochiKit.Position.prepare();
-var _59e=MochiKit.Position.positionedOffset(_59d);
-var _59f=_59d.clientWidth;
-var _5a0=_59d.clientHeight;
-var _5a1={&quot;position&quot;:_59d.style.position,&quot;left&quot;:_59e.x-parseFloat(_59d.style.left||0),&quot;top&quot;:_59e.y-parseFloat(_59d.style.top||0),&quot;width&quot;:_59d.style.width,&quot;height&quot;:_59d.style.height};
-_59d.style.position=&quot;absolute&quot;;
-_59d.style.top=_59e.y+&quot;px&quot;;
-_59d.style.left=_59e.x+&quot;px&quot;;
-_59d.style.width=_59f+&quot;px&quot;;
-_59d.style.height=_5a0+&quot;px&quot;;
-return _5a1;
-},positionedOffset:function(_5a2){
-var _5a3=0,_5a4=0;
-do{
-_5a3+=_5a2.offsetTop||0;
-_5a4+=_5a2.offsetLeft||0;
-_5a2=_5a2.offsetParent;
-if(_5a2){
-p=MochiKit.Style.getStyle(_5a2,&quot;position&quot;);
-if(p==&quot;relative&quot;||p==&quot;absolute&quot;){
-break;
-}
-}
-}while(_5a2);
-return new MochiKit.Style.Coordinates(_5a4,_5a3);
-},relativize:function(_5a5,_5a6){
-_5a5=MochiKit.DOM.getElement(_5a5);
-if(_5a5.style.position==&quot;relative&quot;){
-return;
-}
-MochiKit.Position.prepare();
-var top=parseFloat(_5a5.style.top||0)-(_5a6[&quot;top&quot;]||0);
-var left=parseFloat(_5a5.style.left||0)-(_5a6[&quot;left&quot;]||0);
-_5a5.style.position=_5a6[&quot;position&quot;];
-_5a5.style.top=top+&quot;px&quot;;
-_5a5.style.left=left+&quot;px&quot;;
-_5a5.style.width=_5a6[&quot;width&quot;];
-_5a5.style.height=_5a6[&quot;height&quot;];
-},clone:function(_5a9,_5aa){
-_5a9=MochiKit.DOM.getElement(_5a9);
-_5aa=MochiKit.DOM.getElement(_5aa);
-_5aa.style.position=&quot;absolute&quot;;
-var _5ab=this.cumulativeOffset(_5a9);
-_5aa.style.top=_5ab.y+&quot;px&quot;;
-_5aa.style.left=_5ab.x+&quot;px&quot;;
-_5aa.style.width=_5a9.offsetWidth+&quot;px&quot;;
-_5aa.style.height=_5a9.offsetHeight+&quot;px&quot;;
-},page:function(_5ac){
-var _5ad=0;
-var _5ae=0;
-var _5af=_5ac;
-do{
-_5ad+=_5af.offsetTop||0;
-_5ae+=_5af.offsetLeft||0;
-if(_5af.offsetParent==document.body&amp;&amp;MochiKit.Style.getStyle(_5af,&quot;position&quot;)==&quot;absolute&quot;){
-break;
-}
-}while(_5af=_5af.offsetParent);
-_5af=_5ac;
-do{
-_5ad-=_5af.scrollTop||0;
-_5ae-=_5af.scrollLeft||0;
-}while(_5af=_5af.parentNode);
-return new MochiKit.Style.Coordinates(_5ae,_5ad);
-}});
-MochiKit.Position.__new__=function(win){
-var m=MochiKit.Base;
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-m.nameFunctions(this);
-};
-MochiKit.Position.__new__(this);
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.Visual&quot;);
-dojo.require(&quot;MochiKit.Base&quot;);
-dojo.require(&quot;MochiKit.DOM&quot;);
-dojo.require(&quot;MochiKit.Style&quot;);
-dojo.require(&quot;MochiKit.Color&quot;);
-dojo.require(&quot;MochiKit.Position&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-JSAN.use(&quot;MochiKit.Base&quot;,[]);
-JSAN.use(&quot;MochiKit.DOM&quot;,[]);
-JSAN.use(&quot;MochiKit.Style&quot;,[]);
-JSAN.use(&quot;MochiKit.Color&quot;,[]);
-JSAN.use(&quot;MochiKit.Position&quot;,[]);
-}
-try{
-if(typeof (MochiKit.Base)===&quot;undefined&quot;||typeof (MochiKit.DOM)===&quot;undefined&quot;||typeof (MochiKit.Style)===&quot;undefined&quot;||typeof (MochiKit.Position)===&quot;undefined&quot;||typeof (MochiKit.Color)===&quot;undefined&quot;){
-throw &quot;&quot;;
-}
-}
-catch(e){
-throw &quot;MochiKit.Visual depends on MochiKit.Base, MochiKit.DOM, MochiKit.Style, MochiKit.Position and MochiKit.Color!&quot;;
-}
-if(typeof (MochiKit.Visual)==&quot;undefined&quot;){
-MochiKit.Visual={};
-}
-MochiKit.Visual.NAME=&quot;MochiKit.Visual&quot;;
-MochiKit.Visual.VERSION=&quot;1.4&quot;;
-MochiKit.Visual.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.Visual.toString=function(){
-return this.__repr__();
-};
-MochiKit.Visual._RoundCorners=function(e,_5b3){
-e=MochiKit.DOM.getElement(e);
-this._setOptions(_5b3);
-if(this.options.__unstable__wrapElement){
-e=this._doWrap(e);
-}
-var _5b4=this.options.color;
-var C=MochiKit.Color.Color;
-if(this.options.color===&quot;fromElement&quot;){
-_5b4=C.fromBackground(e);
-}else{
-if(!(_5b4 instanceof C)){
-_5b4=C.fromString(_5b4);
-}
-}
-this.isTransparent=(_5b4.asRGB().a&lt;=0);
-var _5b6=this.options.bgColor;
-if(this.options.bgColor===&quot;fromParent&quot;){
-_5b6=C.fromBackground(e.offsetParent);
-}else{
-if(!(_5b6 instanceof C)){
-_5b6=C.fromString(_5b6);
-}
-}
-this._roundCornersImpl(e,_5b4,_5b6);
-};
-MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){
-var _5b8=e.parentNode;
-var doc=MochiKit.DOM.currentDocument();
-if(typeof (doc.defaultView)===&quot;undefined&quot;||doc.defaultView===null){
-return e;
-}
-var _5ba=doc.defaultView.getComputedStyle(e,null);
-if(typeof (_5ba)===&quot;undefined&quot;||_5ba===null){
-return e;
-}
-var _5bb=MochiKit.DOM.DIV({&quot;style&quot;:{display:&quot;block&quot;,marginTop:_5ba.getPropertyValue(&quot;padding-top&quot;),marginRight:_5ba.getPropertyValue(&quot;padding-right&quot;),marginBottom:_5ba.getPropertyValue(&quot;padding-bottom&quot;),marginLeft:_5ba.getPropertyValue(&quot;padding-left&quot;),padding:&quot;0px&quot;}});
-_5bb.innerHTML=e.innerHTML;
-e.innerHTML=&quot;&quot;;
-e.appendChild(_5bb);
-return e;
-},_roundCornersImpl:function(e,_5bd,_5be){
-if(this.options.border){
-this._renderBorder(e,_5be);
-}
-if(this._isTopRounded()){
-this._roundTopCorners(e,_5bd,_5be);
-}
-if(this._isBottomRounded()){
-this._roundBottomCorners(e,_5bd,_5be);
-}
-},_renderBorder:function(el,_5c0){
-var _5c1=&quot;1px solid &quot;+this._borderColor(_5c0);
-var _5c2=&quot;border-left: &quot;+_5c1;
-var _5c3=&quot;border-right: &quot;+_5c1;
-var _5c4=&quot;style='&quot;+_5c2+&quot;;&quot;+_5c3+&quot;'&quot;;
-el.innerHTML=&quot;&lt;div &quot;+_5c4+&quot;&gt;&quot;+el.innerHTML+&quot;&lt;/div&gt;&quot;;
-},_roundTopCorners:function(el,_5c6,_5c7){
-var _5c8=this._createCorner(_5c7);
-for(var i=0;i&lt;this.options.numSlices;i++){
-_5c8.appendChild(this._createCornerSlice(_5c6,_5c7,i,&quot;top&quot;));
-}
-el.style.paddingTop=0;
-el.insertBefore(_5c8,el.firstChild);
-},_roundBottomCorners:function(el,_5cb,_5cc){
-var _5cd=this._createCorner(_5cc);
-for(var i=(this.options.numSlices-1);i&gt;=0;i--){
-_5cd.appendChild(this._createCornerSlice(_5cb,_5cc,i,&quot;bottom&quot;));
-}
-el.style.paddingBottom=0;
-el.appendChild(_5cd);
-},_createCorner:function(_5cf){
-var dom=MochiKit.DOM;
-return dom.DIV({style:{backgroundColor:_5cf.toString()}});
-},_createCornerSlice:function(_5d1,_5d2,n,_5d4){
-var _5d5=MochiKit.DOM.SPAN();
-var _5d6=_5d5.style;
-_5d6.backgroundColor=_5d1.toString();
-_5d6.display=&quot;block&quot;;
-_5d6.height=&quot;1px&quot;;
-_5d6.overflow=&quot;hidden&quot;;
-_5d6.fontSize=&quot;1px&quot;;
-var _5d7=this._borderColor(_5d1,_5d2);
-if(this.options.border&amp;&amp;n===0){
-_5d6.borderTopStyle=&quot;solid&quot;;
-_5d6.borderTopWidth=&quot;1px&quot;;
-_5d6.borderLeftWidth=&quot;0px&quot;;
-_5d6.borderRightWidth=&quot;0px&quot;;
-_5d6.borderBottomWidth=&quot;0px&quot;;
-_5d6.height=&quot;0px&quot;;
-_5d6.borderColor=_5d7.toString();
-}else{
-if(_5d7){
-_5d6.borderColor=_5d7.toString();
-_5d6.borderStyle=&quot;solid&quot;;
-_5d6.borderWidth=&quot;0px 1px&quot;;
-}
-}
-if(!this.options.compact&amp;&amp;(n==(this.options.numSlices-1))){
-_5d6.height=&quot;2px&quot;;
-}
-this._setMargin(_5d5,n,_5d4);
-this._setBorder(_5d5,n,_5d4);
-return _5d5;
-},_setOptions:function(_5d8){
-this.options={corners:&quot;all&quot;,color:&quot;fromElement&quot;,bgColor:&quot;fromParent&quot;,blend:true,border:false,compact:false,__unstable__wrapElement:false};
-MochiKit.Base.update(this.options,_5d8);
-this.options.numSlices=(this.options.compact?2:4);
-},_whichSideTop:function(){
-var _5d9=this.options.corners;
-if(this._hasString(_5d9,&quot;all&quot;,&quot;top&quot;)){
-return &quot;&quot;;
-}
-var _5da=(_5d9.indexOf(&quot;tl&quot;)!=-1);
-var _5db=(_5d9.indexOf(&quot;tr&quot;)!=-1);
-if(_5da&amp;&amp;_5db){
-return &quot;&quot;;
-}
-if(_5da){
-return &quot;left&quot;;
-}
-if(_5db){
-return &quot;right&quot;;
-}
-return &quot;&quot;;
-},_whichSideBottom:function(){
-var _5dc=this.options.corners;
-if(this._hasString(_5dc,&quot;all&quot;,&quot;bottom&quot;)){
-return &quot;&quot;;
-}
-var _5dd=(_5dc.indexOf(&quot;bl&quot;)!=-1);
-var _5de=(_5dc.indexOf(&quot;br&quot;)!=-1);
-if(_5dd&amp;&amp;_5de){
-return &quot;&quot;;
-}
-if(_5dd){
-return &quot;left&quot;;
-}
-if(_5de){
-return &quot;right&quot;;
-}
-return &quot;&quot;;
-},_borderColor:function(_5df,_5e0){
-if(_5df==&quot;transparent&quot;){
-return _5e0;
-}else{
-if(this.options.border){
-return this.options.border;
-}else{
-if(this.options.blend){
-return _5e0.blendedColor(_5df);
-}
-}
-}
-return &quot;&quot;;
-},_setMargin:function(el,n,_5e3){
-var _5e4=this._marginSize(n)+&quot;px&quot;;
-var _5e5=(_5e3==&quot;top&quot;?this._whichSideTop():this._whichSideBottom());
-var _5e6=el.style;
-if(_5e5==&quot;left&quot;){
-_5e6.marginLeft=_5e4;
-_5e6.marginRight=&quot;0px&quot;;
-}else{
-if(_5e5==&quot;right&quot;){
-_5e6.marginRight=_5e4;
-_5e6.marginLeft=&quot;0px&quot;;
-}else{
-_5e6.marginLeft=_5e4;
-_5e6.marginRight=_5e4;
-}
-}
-},_setBorder:function(el,n,_5e9){
-var _5ea=this._borderSize(n)+&quot;px&quot;;
-var _5eb=(_5e9==&quot;top&quot;?this._whichSideTop():this._whichSideBottom());
-var _5ec=el.style;
-if(_5eb==&quot;left&quot;){
-_5ec.borderLeftWidth=_5ea;
-_5ec.borderRightWidth=&quot;0px&quot;;
-}else{
-if(_5eb==&quot;right&quot;){
-_5ec.borderRightWidth=_5ea;
-_5ec.borderLeftWidth=&quot;0px&quot;;
-}else{
-_5ec.borderLeftWidth=_5ea;
-_5ec.borderRightWidth=_5ea;
-}
-}
-},_marginSize:function(n){
-if(this.isTransparent){
-return 0;
-}
-var o=this.options;
-if(o.compact&amp;&amp;o.blend){
-var _5ef=[1,0];
-return _5ef[n];
-}else{
-if(o.compact){
-var _5f0=[2,1];
-return _5f0[n];
-}else{
-if(o.blend){
-var _5f1=[3,2,1,0];
-return _5f1[n];
-}else{
-var _5f2=[5,3,2,1];
-return _5f2[n];
-}
-}
-}
-},_borderSize:function(n){
-var o=this.options;
-var _5f5;
-if(o.compact&amp;&amp;(o.blend||this.isTransparent)){
-return 1;
-}else{
-if(o.compact){
-_5f5=[1,0];
-}else{
-if(o.blend){
-_5f5=[2,1,1,1];
-}else{
-if(o.border){
-_5f5=[0,2,0,0];
-}else{
-if(this.isTransparent){
-_5f5=[5,3,2,1];
-}else{
-return 0;
-}
-}
-}
-}
-}
-return _5f5[n];
-},_hasString:function(str){
-for(var i=1;i&lt;arguments.length;i++){
-if(str.indexOf(arguments[i])!=-1){
-return true;
-}
-}
-return false;
-},_isTopRounded:function(){
-return this._hasString(this.options.corners,&quot;all&quot;,&quot;top&quot;,&quot;tl&quot;,&quot;tr&quot;);
-},_isBottomRounded:function(){
-return this._hasString(this.options.corners,&quot;all&quot;,&quot;bottom&quot;,&quot;bl&quot;,&quot;br&quot;);
-},_hasSingleTextChild:function(el){
-return (el.childNodes.length==1&amp;&amp;el.childNodes[0].nodeType==3);
-}};
-MochiKit.Visual.roundElement=function(e,_5fa){
-new MochiKit.Visual._RoundCorners(e,_5fa);
-};
-MochiKit.Visual.roundClass=function(_5fb,_5fc,_5fd){
-var _5fe=MochiKit.DOM.getElementsByTagAndClassName(_5fb,_5fc);
-for(var i=0;i&lt;_5fe.length;i++){
-MochiKit.Visual.roundElement(_5fe[i],_5fd);
-}
-};
-MochiKit.Visual.tagifyText=function(_600,_601){
-_601=_601||&quot;position:relative&quot;;
-if(/MSIE/.test(navigator.userAgent)){
-_601+=&quot;;zoom:1&quot;;
-}
-_600=MochiKit.DOM.getElement(_600);
-var ma=MochiKit.Base.map;
-ma(function(_603){
-if(_603.nodeType==3){
-ma(function(_604){
-_600.insertBefore(MochiKit.DOM.SPAN({style:_601},_604==&quot; &quot;?String.fromCharCode(160):_604),_603);
-},_603.nodeValue.split(&quot;&quot;));
-MochiKit.DOM.removeElement(_603);
-}
-},_600.childNodes);
-};
-MochiKit.Visual.forceRerendering=function(_605){
-try{
-_605=MochiKit.DOM.getElement(_605);
-var n=document.createTextNode(&quot; &quot;);
-_605.appendChild(n);
-_605.removeChild(n);
-}
-catch(e){
-}
-};
-MochiKit.Visual.multiple=function(_607,_608,_609){
-_609=MochiKit.Base.update({speed:0.1,delay:0},_609);
-var _60a=_609.delay;
-var _60b=0;
-MochiKit.Base.map(function(_60c){
-_609.delay=_60b*_609.speed+_60a;
-new _608(_60c,_609);
-_60b+=1;
-},_607);
-};
-MochiKit.Visual.PAIRS={&quot;slide&quot;:[&quot;slideDown&quot;,&quot;slideUp&quot;],&quot;blind&quot;:[&quot;blindDown&quot;,&quot;blindUp&quot;],&quot;appear&quot;:[&quot;appear&quot;,&quot;fade&quot;],&quot;size&quot;:[&quot;grow&quot;,&quot;shrink&quot;]};
-MochiKit.Visual.toggle=function(_60d,_60e,_60f){
-_60d=MochiKit.DOM.getElement(_60d);
-_60e=(_60e||&quot;appear&quot;).toLowerCase();
-_60f=MochiKit.Base.update({queue:{position:&quot;end&quot;,scope:(_60d.id||&quot;global&quot;),limit:1}},_60f);
-var v=MochiKit.Visual;
-v[MochiKit.Style.getStyle(_60d,&quot;display&quot;)!=&quot;none&quot;?v.PAIRS[_60e][1]:v.PAIRS[_60e][0]](_60d,_60f);
-};
-MochiKit.Visual.Transitions={};
-MochiKit.Visual.Transitions.linear=function(pos){
-return pos;
-};
-MochiKit.Visual.Transitions.sinoidal=function(pos){
-return (-Math.cos(pos*Math.PI)/2)+0.5;
-};
-MochiKit.Visual.Transitions.reverse=function(pos){
-return 1-pos;
-};
-MochiKit.Visual.Transitions.flicker=function(pos){
-return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
-};
-MochiKit.Visual.Transitions.wobble=function(pos){
-return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
-};
-MochiKit.Visual.Transitions.pulse=function(pos,_617){
-if(!_617){
-return (Math.floor(pos*10)%2===0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10)));
-}
-return (Math.round((pos%(1/_617))*_617)==0?((pos*_617*2)-Math.floor(pos*_617*2)):1-((pos*_617*2)-Math.floor(pos*_617*2)));
-};
-MochiKit.Visual.Transitions.none=function(pos){
-return 0;
-};
-MochiKit.Visual.Transitions.full=function(pos){
-return 1;
-};
-MochiKit.Visual.ScopedQueue=function(){
-var cls=arguments.callee;
-if(!(this instanceof cls)){
-return new cls();
-}
-this.__init__();
-};
-MochiKit.Base.update(MochiKit.Visual.ScopedQueue.prototype,{__init__:function(){
-this.effects=[];
-this.interval=null;
-},add:function(_61b){
-var _61c=new Date().getTime();
-var _61d=(typeof (_61b.options.queue)==&quot;string&quot;)?_61b.options.queue:_61b.options.queue.position;
-var ma=MochiKit.Base.map;
-switch(_61d){
-case &quot;front&quot;:
-ma(function(e){
-if(e.state==&quot;idle&quot;){
-e.startOn+=_61b.finishOn;
-e.finishOn+=_61b.finishOn;
-}
-},this.effects);
-break;
-case &quot;end&quot;:
-var _620;
-ma(function(e){
-var i=e.finishOn;
-if(i&gt;=(_620||i)){
-_620=i;
-}
-},this.effects);
-_61c=_620||_61c;
-break;
-case &quot;break&quot;:
-ma(function(e){
-e.finalize();
-},this.effects);
-break;
-}
-_61b.startOn+=_61c;
-_61b.finishOn+=_61c;
-if(!_61b.options.queue.limit||this.effects.length&lt;_61b.options.queue.limit){
-this.effects.push(_61b);
-}
-if(!this.interval){
-this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40);
-}
-},startLoop:function(func,_625){
-return setInterval(func,_625);
-},remove:function(_626){
-this.effects=MochiKit.Base.filter(function(e){
-return e!=_626;
-},this.effects);
-if(!this.effects.length){
-this.stopLoop(this.interval);
-this.interval=null;
-}
-},stopLoop:function(_628){
-clearInterval(_628);
-},loop:function(){
-var _629=new Date().getTime();
-MochiKit.Base.map(function(_62a){
-_62a.loop(_629);
-},this.effects);
-}});
-MochiKit.Visual.Queues={instances:{},get:function(_62b){
-if(typeof (_62b)!=&quot;string&quot;){
-return _62b;
-}
-if(!this.instances[_62b]){
-this.instances[_62b]=new MochiKit.Visual.ScopedQueue();
-}
-return this.instances[_62b];
-}};
-MochiKit.Visual.Queue=MochiKit.Visual.Queues.get(&quot;global&quot;);
-MochiKit.Visual.DefaultOptions={transition:MochiKit.Visual.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:&quot;parallel&quot;};
-MochiKit.Visual.Base=function(){
-};
-MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_62c){
-var v=MochiKit.Visual;
-this.options=MochiKit.Base.setdefault(_62c,v.DefaultOptions);
-this.currentFrame=0;
-this.state=&quot;idle&quot;;
-this.startOn=this.options.delay*1000;
-this.finishOn=this.startOn+(this.options.duration*1000);
-this.event(&quot;beforeStart&quot;);
-if(!this.options.sync){
-v.Queues.get(typeof (this.options.queue)==&quot;string&quot;?&quot;global&quot;:this.options.queue.scope).add(this);
-}
-},loop:function(_62e){
-if(_62e&gt;=this.startOn){
-if(_62e&gt;=this.finishOn){
-return this.finalize();
-}
-var pos=(_62e-this.startOn)/(this.finishOn-this.startOn);
-var _630=Math.round(pos*this.options.fps*this.options.duration);
-if(_630&gt;this.currentFrame){
-this.render(pos);
-this.currentFrame=_630;
-}
-}
-},render:function(pos){
-if(this.state==&quot;idle&quot;){
-this.state=&quot;running&quot;;
-this.event(&quot;beforeSetup&quot;);
-this.setup();
-this.event(&quot;afterSetup&quot;);
-}
-if(this.state==&quot;running&quot;){
-if(this.options.transition){
-pos=this.options.transition(pos);
-}
-pos*=(this.options.to-this.options.from);
-pos+=this.options.from;
-this.event(&quot;beforeUpdate&quot;);
-this.update(pos);
-this.event(&quot;afterUpdate&quot;);
-}
-},cancel:function(){
-if(!this.options.sync){
-MochiKit.Visual.Queues.get(typeof (this.options.queue)==&quot;string&quot;?&quot;global&quot;:this.options.queue.scope).remove(this);
-}
-this.state=&quot;finished&quot;;
-},finalize:function(){
-this.render(1);
-this.cancel();
-this.event(&quot;beforeFinish&quot;);
-this.finish();
-this.event(&quot;afterFinish&quot;);
-},setup:function(){
-},finish:function(){
-},update:function(_632){
-},event:function(_633){
-if(this.options[_633+&quot;Internal&quot;]){
-this.options[_633+&quot;Internal&quot;](this);
-}
-if(this.options[_633]){
-this.options[_633](this);
-}
-},repr:function(){
-return &quot;[&quot;+this.__class__.NAME+&quot;, options:&quot;+MochiKit.Base.repr(this.options)+&quot;]&quot;;
-}};
-MochiKit.Visual.Parallel=function(_634,_635){
-var cls=arguments.callee;
-if(!(this instanceof cls)){
-return new cls(_634,_635);
-}
-this.__init__(_634,_635);
-};
-MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base();
-MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_637,_638){
-this.effects=_637||[];
-this.start(_638);
-},update:function(_639){
-MochiKit.Base.map(function(_63a){
-_63a.render(_639);
-},this.effects);
-},finish:function(){
-MochiKit.Base.map(function(_63b){
-_63b.finalize();
-},this.effects);
-}});
-MochiKit.Visual.Opacity=function(_63c,_63d){
-var cls=arguments.callee;
-if(!(this instanceof cls)){
-return new cls(_63c,_63d);
-}
-this.__init__(_63c,_63d);
-};
-MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base();
-MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_63f,_640){
-var b=MochiKit.Base;
-var s=MochiKit.Style;
-this.element=MochiKit.DOM.getElement(_63f);
-if(this.element.currentStyle&amp;&amp;(!this.element.currentStyle.hasLayout)){
-s.setStyle(this.element,{zoom:1});
-}
-_640=b.update({from:s.getStyle(this.element,&quot;opacity&quot;)||0,to:1},_640);
-this.start(_640);
-},update:function(_643){
-MochiKit.Style.setStyle(this.element,{&quot;opacity&quot;:_643});
-}});
-MochiKit.Visual.Move=function(_644,_645){
-var cls=arguments.callee;
-if(!(this instanceof cls)){
-return new cls(_644,_645);
-}
-this.__init__(_644,_645);
-};
-MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base();
-MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_647,_648){
-this.element=MochiKit.DOM.getElement(_647);
-_648=MochiKit.Base.update({x:0,y:0,mode:&quot;relative&quot;},_648);
-this.start(_648);
-},setup:function(){
-MochiKit.DOM.makePositioned(this.element);
-var s=this.element.style;
-var _64a=s.visibility;
-var _64b=s.display;
-if(_64b==&quot;none&quot;){
-s.visibility=&quot;hidden&quot;;
-s.display=&quot;&quot;;
-}
-this.originalLeft=parseFloat(MochiKit.Style.getStyle(this.element,&quot;left&quot;)||&quot;0&quot;);
-this.originalTop=parseFloat(MochiKit.Style.getStyle(this.element,&quot;top&quot;)||&quot;0&quot;);
-if(this.options.mode==&quot;absolute&quot;){
-this.options.x-=this.originalLeft;
-this.options.y-=this.originalTop;
-}
-if(_64b==&quot;none&quot;){
-s.visibility=_64a;
-s.display=_64b;
-}
-},update:function(_64c){
-MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_64c+this.originalLeft)+&quot;px&quot;,top:Math.round(this.options.y*_64c+this.originalTop)+&quot;px&quot;});
-}});
-MochiKit.Visual.Scale=function(_64d,_64e,_64f){
-var cls=arguments.callee;
-if(!(this instanceof cls)){
-return new cls(_64d,_64e,_64f);
-}
-this.__init__(_64d,_64e,_64f);
-};
-MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base();
-MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_651,_652,_653){
-this.element=MochiKit.DOM.getElement(_651);
-_653=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:&quot;box&quot;,scaleFrom:100,scaleTo:_652},_653);
-this.start(_653);
-},setup:function(){
-this.restoreAfterFinish=this.options.restoreAfterFinish||false;
-this.elementPositioning=MochiKit.Style.getStyle(this.element,&quot;position&quot;);
-var ma=MochiKit.Base.map;
-var b=MochiKit.Base.bind;
-this.originalStyle={};
-ma(b(function(k){
-this.originalStyle[k]=this.element.style[k];
-},this),[&quot;top&quot;,&quot;left&quot;,&quot;width&quot;,&quot;height&quot;,&quot;fontSize&quot;]);
-this.originalTop=this.element.offsetTop;
-this.originalLeft=this.element.offsetLeft;
-var _657=MochiKit.Style.getStyle(this.element,&quot;font-size&quot;)||&quot;100%&quot;;
-ma(b(function(_658){
-if(_657.indexOf(_658)&gt;0){
-this.fontSize=parseFloat(_657);
-this.fontSizeType=_658;
-}
-},this),[&quot;em&quot;,&quot;px&quot;,&quot;%&quot;]);
-this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
-if(/^content/.test(this.options.scaleMode)){
-this.dims=[this.element.scrollHeight,this.element.scrollWidth];
-}else{
-if(this.options.scaleMode==&quot;box&quot;){
-this.dims=[this.element.offsetHeight,this.element.offsetWidth];
-}else{
-this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
-}
-}
-},update:function(_659){
-var _65a=(this.options.scaleFrom/100)+(this.factor*_659);
-if(this.options.scaleContent&amp;&amp;this.fontSize){
-MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_65a+this.fontSizeType});
-}
-this.setDimensions(this.dims[0]*_65a,this.dims[1]*_65a);
-},finish:function(){
-if(this.restoreAfterFinish){
-MochiKit.Style.setStyle(this.element,this.originalStyle);
-}
-},setDimensions:function(_65b,_65c){
-var d={};
-var r=Math.round;
-if(/MSIE/.test(navigator.userAgent)){
-r=Math.ceil;
-}
-if(this.options.scaleX){
-d.width=r(_65c)+&quot;px&quot;;
-}
-if(this.options.scaleY){
-d.height=r(_65b)+&quot;px&quot;;
-}
-if(this.options.scaleFromCenter){
-var topd=(_65b-this.dims[0])/2;
-var _660=(_65c-this.dims[1])/2;
-if(this.elementPositioning==&quot;absolute&quot;){
-if(this.options.scaleY){
-d.top=this.originalTop-topd+&quot;px&quot;;
-}
-if(this.options.scaleX){
-d.left=this.originalLeft-_660+&quot;px&quot;;
-}
-}else{
-if(this.options.scaleY){
-d.top=-topd+&quot;px&quot;;
-}
-if(this.options.scaleX){
-d.left=-_660+&quot;px&quot;;
-}
-}
-}
-MochiKit.Style.setStyle(this.element,d);
-}});
-MochiKit.Visual.Highlight=function(_661,_662){
-var cls=arguments.callee;
-if(!(this instanceof cls)){
-return new cls(_661,_662);
-}
-this.__init__(_661,_662);
-};
-MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base();
-MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_664,_665){
-this.element=MochiKit.DOM.getElement(_664);
-_665=MochiKit.Base.update({startcolor:&quot;#ffff99&quot;},_665);
-this.start(_665);
-},setup:function(){
-var b=MochiKit.Base;
-var s=MochiKit.Style;
-if(s.getStyle(this.element,&quot;display&quot;)==&quot;none&quot;){
-this.cancel();
-return;
-}
-this.oldStyle={backgroundImage:s.getStyle(this.element,&quot;background-image&quot;)};
-s.setStyle(this.element,{backgroundImage:&quot;none&quot;});
-if(!this.options.endcolor){
-this.options.endcolor=MochiKit.Color.Color.fromBackground(this.element).toHexString();
-}
-if(b.isUndefinedOrNull(this.options.restorecolor)){
-this.options.restorecolor=s.getStyle(this.element,&quot;background-color&quot;);
-}
-this._base=b.map(b.bind(function(i){
-return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
-},this),[0,1,2]);
-this._delta=b.map(b.bind(function(i){
-return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
-},this),[0,1,2]);
-},update:function(_66a){
-var m=&quot;#&quot;;
-MochiKit.Base.map(MochiKit.Base.bind(function(i){
-m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_66a));
-},this),[0,1,2]);
-MochiKit.Style.setStyle(this.element,{backgroundColor:m});
-},finish:function(){
-MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor}));
-}});
-MochiKit.Visual.ScrollTo=function(_66d,_66e){
-var cls=arguments.callee;
-if(!(this instanceof cls)){
-return new cls(_66d,_66e);
-}
-this.__init__(_66d,_66e);
-};
-MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base();
-MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_670,_671){
-this.element=MochiKit.DOM.getElement(_670);
-this.start(_671);
-},setup:function(){
-var p=MochiKit.Position;
-p.prepare();
-var _673=p.cumulativeOffset(this.element);
-if(this.options.offset){
-_673.y+=this.options.offset;
-}
-var max;
-if(window.innerHeight){
-max=window.innerHeight-window.height;
-}else{
-if(document.documentElement&amp;&amp;document.documentElement.clientHeight){
-max=document.documentElement.clientHeight-document.body.scrollHeight;
-}else{
-if(document.body){
-max=document.body.clientHeight-document.body.scrollHeight;
-}
-}
-}
-this.scrollStart=p.windowOffset.y;
-this.delta=(_673.y&gt;max?max:_673.y)-this.scrollStart;
-},update:function(_675){
-var p=MochiKit.Position;
-p.prepare();
-window.scrollTo(p.windowOffset.x,this.scrollStart+(_675*this.delta));
-}});
-MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
-MochiKit.Visual.Morph=function(_677,_678){
-var cls=arguments.callee;
-if(!(this instanceof cls)){
-return new cls(_677,_678);
-}
-this.__init__(_677,_678);
-};
-MochiKit.Visual.Morph.prototype=new MochiKit.Visual.Base();
-MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_67a,_67b){
-this.element=MochiKit.DOM.getElement(_67a);
-this.start(_67b);
-},setup:function(){
-var b=MochiKit.Base;
-var _67d=this.options.style;
-this.styleStart={};
-this.styleEnd={};
-this.units={};
-var _67e,unit;
-for(var s in _67d){
-_67e=_67d[s];
-s=b.camelize(s);
-if(MochiKit.Visual.CSS_LENGTH.test(_67e)){
-var _681=_67e.match(/^([\+\-]?[0-9\.]+)(.*)$/);
-_67e=parseFloat(_681[1]);
-unit=(_681.length==3)?_681[2]:null;
-this.styleEnd[s]=_67e;
-this.units[s]=unit;
-_67e=MochiKit.Style.getStyle(this.element,s);
-_681=_67e.match(/^([\+\-]?[0-9\.]+)(.*)$/);
-_67e=parseFloat(_681[1]);
-this.styleStart[s]=_67e;
-}else{
-var c=MochiKit.Color.Color;
-_67e=c.fromString(_67e);
-if(_67e){
-this.units[s]=&quot;color&quot;;
-this.styleEnd[s]=_67e.toHexString();
-_67e=MochiKit.Style.getStyle(this.element,s);
-this.styleStart[s]=c.fromString(_67e).toHexString();
-this.styleStart[s]=b.map(b.bind(function(i){
-return parseInt(this.styleStart[s].slice(i*2+1,i*2+3),16);
-},this),[0,1,2]);
-this.styleEnd[s]=b.map(b.bind(function(i){
-return parseInt(this.styleEnd[s].slice(i*2+1,i*2+3),16);
-},this),[0,1,2]);
-}
-}
-}
-},update:function(_685){
-var _686;
-for(var s in this.styleStart){
-if(this.units[s]==&quot;color&quot;){
-var m=&quot;#&quot;;
-var _689=this.styleStart[s];
-var end=this.styleEnd[s];
-MochiKit.Base.map(MochiKit.Base.bind(function(i){
-m+=MochiKit.Color.toColorPart(Math.round(_689[i]+(end[i]-_689[i])*_685));
-},this),[0,1,2]);
-this.element.style[s]=m;
-}else{
-_686=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_685*1000)/1000+this.units[s];
-this.element.style[s]=_686;
-}
-}
-}});
-MochiKit.Visual.fade=function(_68c,_68d){
-var s=MochiKit.Style;
-var _68f=s.getStyle(_68c,&quot;opacity&quot;);
-_68d=MochiKit.Base.update({from:s.getStyle(_68c,&quot;opacity&quot;)||1,to:0,afterFinishInternal:function(_690){
-if(_690.options.to!==0){
-return;
-}
-s.hideElement(_690.element);
-s.setStyle(_690.element,{&quot;opacity&quot;:_68f});
-}},_68d);
-return new MochiKit.Visual.Opacity(_68c,_68d);
-};
-MochiKit.Visual.appear=function(_691,_692){
-var s=MochiKit.Style;
-var v=MochiKit.Visual;
-_692=MochiKit.Base.update({from:(s.getStyle(_691,&quot;display&quot;)==&quot;none&quot;?0:s.getStyle(_691,&quot;opacity&quot;)||0),to:1,afterFinishInternal:function(_695){
-v.forceRerendering(_695.element);
-},beforeSetupInternal:function(_696){
-s.setStyle(_696.element,{&quot;opacity&quot;:_696.options.from});
-s.showElement(_696.element);
-}},_692);
-return new v.Opacity(_691,_692);
-};
-MochiKit.Visual.puff=function(_697,_698){
-var s=MochiKit.Style;
-var v=MochiKit.Visual;
-_697=MochiKit.DOM.getElement(_697);
-var _69b={position:s.getStyle(_697,&quot;position&quot;),top:_697.style.top,left:_697.style.left,width:_697.style.width,height:_697.style.height,opacity:s.getStyle(_697,&quot;opacity&quot;)};
-_698=MochiKit.Base.update({beforeSetupInternal:function(_69c){
-MochiKit.Position.absolutize(_69c.effects[0].element);
-},afterFinishInternal:function(_69d){
-s.hideElement(_69d.effects[0].element);
-s.setStyle(_69d.effects[0].element,_69b);
-},scaleContent:true,scaleFromCenter:true},_698);
-return new v.Parallel([new v.Scale(_697,200,{sync:true,scaleFromCenter:_698.scaleFromCenter,scaleContent:_698.scaleContent,restoreAfterFinish:true}),new v.Opacity(_697,{sync:true,to:0})],_698);
-};
-MochiKit.Visual.blindUp=function(_69e,_69f){
-var d=MochiKit.DOM;
-_69e=d.getElement(_69e);
-var _6a1=d.makeClipping(_69e);
-_69f=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_6a2){
-MochiKit.Style.hideElement(_6a2.element);
-d.undoClipping(_6a2.element,_6a1);
-}},_69f);
-return new MochiKit.Visual.Scale(_69e,0,_69f);
-};
-MochiKit.Visual.blindDown=function(_6a3,_6a4){
-var d=MochiKit.DOM;
-var s=MochiKit.Style;
-_6a3=d.getElement(_6a3);
-var _6a7=s.getElementDimensions(_6a3);
-var _6a8;
-_6a4=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6a7.h,originalWidth:_6a7.w},restoreAfterFinish:true,afterSetupInternal:function(_6a9){
-_6a8=d.makeClipping(_6a9.element);
-s.setStyle(_6a9.element,{height:&quot;0px&quot;});
-s.showElement(_6a9.element);
-},afterFinishInternal:function(_6aa){
-d.undoClipping(_6aa.element,_6a8);
-}},_6a4);
-return new MochiKit.Visual.Scale(_6a3,100,_6a4);
-};
-MochiKit.Visual.switchOff=function(_6ab,_6ac){
-var d=MochiKit.DOM;
-_6ab=d.getElement(_6ab);
-var _6ae=MochiKit.Style.getStyle(_6ab,&quot;opacity&quot;);
-var _6af;
-_6ac=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_6b0){
-d.makePositioned(_6b0.element);
-_6af=d.makeClipping(_6b0.element);
-},afterFinishInternal:function(_6b1){
-MochiKit.Style.hideElement(_6b1.element);
-d.undoClipping(_6b1.element,_6af);
-d.undoPositioned(_6b1.element);
-MochiKit.Style.setStyle(_6b1.element,{&quot;opacity&quot;:_6ae});
-}},_6ac);
-var v=MochiKit.Visual;
-return new v.appear(_6ab,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_6b3){
-new v.Scale(_6b3.element,1,_6ac);
-}});
-};
-MochiKit.Visual.dropOut=function(_6b4,_6b5){
-var d=MochiKit.DOM;
-var s=MochiKit.Style;
-_6b4=d.getElement(_6b4);
-var _6b8={top:s.getStyle(_6b4,&quot;top&quot;),left:s.getStyle(_6b4,&quot;left&quot;),opacity:s.getStyle(_6b4,&quot;opacity&quot;)};
-_6b5=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6b9){
-d.makePositioned(_6b9.effects[0].element);
-},afterFinishInternal:function(_6ba){
-s.hideElement(_6ba.effects[0].element);
-d.undoPositioned(_6ba.effects[0].element);
-s.setStyle(_6ba.effects[0].element,_6b8);
-}},_6b5);
-var v=MochiKit.Visual;
-return new v.Parallel([new v.Move(_6b4,{x:0,y:_6b5.distance,sync:true}),new v.Opacity(_6b4,{sync:true,to:0})],_6b5);
-};
-MochiKit.Visual.shake=function(_6bc,_6bd){
-var d=MochiKit.DOM;
-var v=MochiKit.Visual;
-var s=MochiKit.Style;
-_6bc=d.getElement(_6bc);
-_6bd=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_6c1){
-d.undoPositioned(_6c1.element);
-s.setStyle(_6c1.element,_6c2);
-}},_6bd);
-var _6c2={top:s.getStyle(_6bc,&quot;top&quot;),left:s.getStyle(_6bc,&quot;left&quot;)};
-return new v.Move(_6bc,{x:20,y:0,duration:0.05,afterFinishInternal:function(_6c3){
-new v.Move(_6c3.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6c4){
-new v.Move(_6c4.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6c5){
-new v.Move(_6c5.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6c6){
-new v.Move(_6c6.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6c7){
-new v.Move(_6c7.element,_6bd);
-}});
-}});
-}});
-}});
-}});
-};
-MochiKit.Visual.slideDown=function(_6c8,_6c9){
-var d=MochiKit.DOM;
-var b=MochiKit.Base;
-var s=MochiKit.Style;
-_6c8=d.getElement(_6c8);
-if(!_6c8.firstChild){
-throw &quot;MochiKit.Visual.slideDown must be used on a element with a child&quot;;
-}
-d.removeEmptyTextNodes(_6c8);
-var _6cd=s.getStyle(_6c8.firstChild,&quot;bottom&quot;)||0;
-var _6ce=s.getElementDimensions(_6c8);
-var _6cf;
-_6c9=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6ce.h,originalWidth:_6ce.w},restoreAfterFinish:true,afterSetupInternal:function(_6d0){
-d.makePositioned(_6d0.element);
-d.makePositioned(_6d0.element.firstChild);
-if(/Opera/.test(navigator.userAgent)){
-s.setStyle(_6d0.element,{top:&quot;&quot;});
-}
-_6cf=d.makeClipping(_6d0.element);
-s.setStyle(_6d0.element,{height:&quot;0px&quot;});
-s.showElement(_6d0.element);
-},afterUpdateInternal:function(_6d1){
-s.setStyle(_6d1.element.firstChild,{bottom:(_6d1.dims[0]-_6d1.element.clientHeight)+&quot;px&quot;});
-},afterFinishInternal:function(_6d2){
-d.undoClipping(_6d2.element,_6cf);
-if(/MSIE/.test(navigator.userAgent)){
-d.undoPositioned(_6d2.element);
-d.undoPositioned(_6d2.element.firstChild);
-}else{
-d.undoPositioned(_6d2.element.firstChild);
-d.undoPositioned(_6d2.element);
-}
-s.setStyle(_6d2.element.firstChild,{bottom:_6cd});
-}},_6c9);
-return new MochiKit.Visual.Scale(_6c8,100,_6c9);
-};
-MochiKit.Visual.slideUp=function(_6d3,_6d4){
-var d=MochiKit.DOM;
-var b=MochiKit.Base;
-var s=MochiKit.Style;
-_6d3=d.getElement(_6d3);
-if(!_6d3.firstChild){
-throw &quot;MochiKit.Visual.slideUp must be used on a element with a child&quot;;
-}
-d.removeEmptyTextNodes(_6d3);
-var _6d8=s.getStyle(_6d3.firstChild,&quot;bottom&quot;);
-var _6d9;
-_6d4=b.update({scaleContent:false,scaleX:false,scaleMode:&quot;box&quot;,scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_6da){
-d.makePositioned(_6da.element);
-d.makePositioned(_6da.element.firstChild);
-if(/Opera/.test(navigator.userAgent)){
-s.setStyle(_6da.element,{top:&quot;&quot;});
-}
-_6d9=d.makeClipping(_6da.element);
-s.showElement(_6da.element);
-},afterUpdateInternal:function(_6db){
-s.setStyle(_6db.element.firstChild,{bottom:(_6db.dims[0]-_6db.element.clientHeight)+&quot;px&quot;});
-},afterFinishInternal:function(_6dc){
-s.hideElement(_6dc.element);
-d.undoClipping(_6dc.element,_6d9);
-d.undoPositioned(_6dc.element.firstChild);
-d.undoPositioned(_6dc.element);
-s.setStyle(_6dc.element.firstChild,{bottom:_6d8});
-}},_6d4);
-return new MochiKit.Visual.Scale(_6d3,0,_6d4);
-};
-MochiKit.Visual.squish=function(_6dd,_6de){
-var d=MochiKit.DOM;
-var b=MochiKit.Base;
-var _6e1;
-_6de=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_6e2){
-_6e1=d.makeClipping(_6e2.element);
-},afterFinishInternal:function(_6e3){
-MochiKit.Style.hideElement(_6e3.element);
-d.undoClipping(_6e3.element,_6e1);
-}},_6de);
-return new MochiKit.Visual.Scale(_6dd,/Opera/.test(navigator.userAgent)?1:0,_6de);
-};
-MochiKit.Visual.grow=function(_6e4,_6e5){
-var d=MochiKit.DOM;
-var v=MochiKit.Visual;
-var s=MochiKit.Style;
-_6e4=d.getElement(_6e4);
-_6e5=MochiKit.Base.update({direction:&quot;center&quot;,moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_6e5);
-var _6e9={top:_6e4.style.top,left:_6e4.style.left,height:_6e4.style.height,width:_6e4.style.width,opacity:s.getStyle(_6e4,&quot;opacity&quot;)};
-var dims=s.getElementDimensions(_6e4);
-var _6eb,_6ec;
-var _6ed,_6ee;
-switch(_6e5.direction){
-case &quot;top-left&quot;:
-_6eb=_6ec=_6ed=_6ee=0;
-break;
-case &quot;top-right&quot;:
-_6eb=dims.w;
-_6ec=_6ee=0;
-_6ed=-dims.w;
-break;
-case &quot;bottom-left&quot;:
-_6eb=_6ed=0;
-_6ec=dims.h;
-_6ee=-dims.h;
-break;
-case &quot;bottom-right&quot;:
-_6eb=dims.w;
-_6ec=dims.h;
-_6ed=-dims.w;
-_6ee=-dims.h;
-break;
-case &quot;center&quot;:
-_6eb=dims.w/2;
-_6ec=dims.h/2;
-_6ed=-dims.w/2;
-_6ee=-dims.h/2;
-break;
-}
-var _6ef=MochiKit.Base.update({beforeSetupInternal:function(_6f0){
-s.setStyle(_6f0.effects[0].element,{height:&quot;0px&quot;});
-s.showElement(_6f0.effects[0].element);
-},afterFinishInternal:function(_6f1){
-d.undoClipping(_6f1.effects[0].element);
-d.undoPositioned(_6f1.effects[0].element);
-s.setStyle(_6f1.effects[0].element,_6e9);
-}},_6e5);
-return new v.Move(_6e4,{x:_6eb,y:_6ec,duration:0.01,beforeSetupInternal:function(_6f2){
-s.hideElement(_6f2.element);
-d.makeClipping(_6f2.element);
-d.makePositioned(_6f2.element);
-},afterFinishInternal:function(_6f3){
-new v.Parallel([new v.Opacity(_6f3.element,{sync:true,to:1,from:0,transition:_6e5.opacityTransition}),new v.Move(_6f3.element,{x:_6ed,y:_6ee,sync:true,transition:_6e5.moveTransition}),new v.Scale(_6f3.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_6e5.scaleTransition,scaleContent:_6e5.scaleContent,scaleFromCenter:_6e5.scaleFromCenter,restoreAfterFinish:true})],_6ef);
-}});
-};
-MochiKit.Visual.shrink=function(_6f4,_6f5){
-var d=MochiKit.DOM;
-var v=MochiKit.Visual;
-var s=MochiKit.Style;
-_6f4=d.getElement(_6f4);
-_6f5=MochiKit.Base.update({direction:&quot;center&quot;,moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_6f5);
-var _6f9={top:_6f4.style.top,left:_6f4.style.left,height:_6f4.style.height,width:_6f4.style.width,opacity:s.getStyle(_6f4,&quot;opacity&quot;)};
-var dims=s.getElementDimensions(_6f4);
-var _6fb,_6fc;
-switch(_6f5.direction){
-case &quot;top-left&quot;:
-_6fb=_6fc=0;
-break;
-case &quot;top-right&quot;:
-_6fb=dims.w;
-_6fc=0;
-break;
-case &quot;bottom-left&quot;:
-_6fb=0;
-_6fc=dims.h;
-break;
-case &quot;bottom-right&quot;:
-_6fb=dims.w;
-_6fc=dims.h;
-break;
-case &quot;center&quot;:
-_6fb=dims.w/2;
-_6fc=dims.h/2;
-break;
-}
-var _6fd;
-var _6fe=MochiKit.Base.update({beforeStartInternal:function(_6ff){
-_6fd=d.makePositioned(_6ff.effects[0].element);
-d.makeClipping(_6ff.effects[0].element);
-},afterFinishInternal:function(_700){
-s.hideElement(_700.effects[0].element);
-d.undoClipping(_700.effects[0].element,_6fd);
-d.undoPositioned(_700.effects[0].element);
-s.setStyle(_700.effects[0].element,_6f9);
-}},_6f5);
-return new v.Parallel([new v.Opacity(_6f4,{sync:true,to:0,from:1,transition:_6f5.opacityTransition}),new v.Scale(_6f4,/Opera/.test(navigator.userAgent)?1:0,{sync:true,transition:_6f5.scaleTransition,scaleContent:_6f5.scaleContent,scaleFromCenter:_6f5.scaleFromCenter,restoreAfterFinish:true}),new v.Move(_6f4,{x:_6fb,y:_6fc,sync:true,transition:_6f5.moveTransition})],_6fe);
-};
-MochiKit.Visual.pulsate=function(_701,_702){
-var d=MochiKit.DOM;
-var v=MochiKit.Visual;
-var b=MochiKit.Base;
-var _706=MochiKit.Style.getStyle(_701,&quot;opacity&quot;);
-_702=b.update({duration:3,from:0,afterFinishInternal:function(_707){
-MochiKit.Style.setStyle(_707.element,{&quot;opacity&quot;:_706});
-}},_702);
-var _708=_702.transition||v.Transitions.sinoidal;
-var _709=b.bind(function(pos){
-return _708(1-v.Transitions.pulse(pos,_702.pulses));
-},_708);
-b.bind(_709,_708);
-return new v.Opacity(_701,b.update({transition:_709},_702));
-};
-MochiKit.Visual.fold=function(_70b,_70c){
-var d=MochiKit.DOM;
-var v=MochiKit.Visual;
-var s=MochiKit.Style;
-_70b=d.getElement(_70b);
-var _710={top:_70b.style.top,left:_70b.style.left,width:_70b.style.width,height:_70b.style.height};
-var _711=d.makeClipping(_70b);
-_70c=MochiKit.Base.update({scaleContent:false,scaleX:false,afterFinishInternal:function(_712){
-new v.Scale(_70b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_713){
-s.hideElement(_713.element);
-d.undoClipping(_713.element,_711);
-s.setStyle(_713.element,_710);
-}});
-}},_70c);
-return new v.Scale(_70b,5,_70c);
-};
-MochiKit.Visual.Color=MochiKit.Color.Color;
-MochiKit.Visual.getElementsComputedStyle=MochiKit.DOM.computedStyle;
-MochiKit.Visual.__new__=function(){
-var m=MochiKit.Base;
-m.nameFunctions(this);
-this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
-};
-MochiKit.Visual.EXPORT=[&quot;roundElement&quot;,&quot;roundClass&quot;,&quot;tagifyText&quot;,&quot;multiple&quot;,&quot;toggle&quot;,&quot;Parallel&quot;,&quot;Opacity&quot;,&quot;Move&quot;,&quot;Scale&quot;,&quot;Highlight&quot;,&quot;ScrollTo&quot;,&quot;Morph&quot;,&quot;fade&quot;,&quot;appear&quot;,&quot;puff&quot;,&quot;blindUp&quot;,&quot;blindDown&quot;,&quot;switchOff&quot;,&quot;dropOut&quot;,&quot;shake&quot;,&quot;slideDown&quot;,&quot;slideUp&quot;,&quot;squish&quot;,&quot;grow&quot;,&quot;shrink&quot;,&quot;pulsate&quot;,&quot;fold&quot;];
-MochiKit.Visual.EXPORT_OK=[&quot;Base&quot;,&quot;PAIRS&quot;];
-MochiKit.Visual.__new__();
-MochiKit.Base._exportSymbols(this,MochiKit.Visual);
-if(typeof (MochiKit)==&quot;undefined&quot;){
-MochiKit={};
-}
-if(typeof (MochiKit.MochiKit)==&quot;undefined&quot;){
-MochiKit.MochiKit={};
-}
-MochiKit.MochiKit.NAME=&quot;MochiKit.MochiKit&quot;;
-MochiKit.MochiKit.VERSION=&quot;1.4&quot;;
-MochiKit.MochiKit.__repr__=function(){
-return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
-};
-MochiKit.MochiKit.toString=function(){
-return this.__repr__();
-};
-MochiKit.MochiKit.SUBMODULES=[&quot;Base&quot;,&quot;Iter&quot;,&quot;Logging&quot;,&quot;DateTime&quot;,&quot;Format&quot;,&quot;Async&quot;,&quot;DOM&quot;,&quot;Selector&quot;,&quot;Style&quot;,&quot;LoggingPane&quot;,&quot;Color&quot;,&quot;Signal&quot;,&quot;Position&quot;,&quot;Visual&quot;];
-if(typeof (JSAN)!=&quot;undefined&quot;||typeof (dojo)!=&quot;undefined&quot;){
-if(typeof (dojo)!=&quot;undefined&quot;){
-dojo.provide(&quot;MochiKit.MochiKit&quot;);
-dojo.require(&quot;MochiKit.*&quot;);
-}
-if(typeof (JSAN)!=&quot;undefined&quot;){
-(function(lst){
-for(var i=0;i&lt;lst.length;i++){
-JSAN.use(&quot;MochiKit.&quot;+lst[i],[]);
-}
-})(MochiKit.MochiKit.SUBMODULES);
-}
-(function(){
-var _717=MochiKit.Base.extend;
-var self=MochiKit.MochiKit;
-var _719=self.SUBMODULES;
-var _71a=[];
-var _71b=[];
-var _71c={};
-var i,k,m,all;
-for(i=0;i&lt;_719.length;i++){
-m=MochiKit[_719[i]];
-_717(_71a,m.EXPORT);
-_717(_71b,m.EXPORT_OK);
-for(k in m.EXPORT_TAGS){
-_71c[k]=_717(_71c[k],m.EXPORT_TAGS[k]);
-}
-all=m.EXPORT_TAGS[&quot;:all&quot;];
-if(!all){
-all=_717(null,m.EXPORT,m.EXPORT_OK);
-}
-var j;
-for(j=0;j&lt;all.length;j++){
-k=all[j];
-self[k]=m[k];
-}
-}
-self.EXPORT=_71a;
-self.EXPORT_OK=_71b;
-self.EXPORT_TAGS=_71c;
-}());
-}else{
-if(typeof (MochiKit.__compat__)==&quot;undefined&quot;){
-MochiKit.__compat__=true;
-}
-(function(){
-if(typeof (document)==&quot;undefined&quot;){
-return;
-}
-var _722=document.getElementsByTagName(&quot;script&quot;);
-var _723=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;;
-var base=null;
-var _725=null;
-var _726={};
-var i;
-for(i=0;i&lt;_722.length;i++){
-var src=_722[i].getAttribute(&quot;src&quot;);
-if(!src){
-continue;
-}
-_726[src]=true;
-if(src.match(/MochiKit.js$/)){
-base=src.substring(0,src.lastIndexOf(&quot;MochiKit.js&quot;));
-_725=_722[i];
-}
-}
-if(base===null){
-return;
-}
-var _729=MochiKit.MochiKit.SUBMODULES;
-for(var i=0;i&lt;_729.length;i++){
-if(MochiKit[_729[i]]){
-continue;
-}
-var uri=base+_729[i]+&quot;.js&quot;;
-if(uri in _726){
-continue;
-}
-if(document.documentElement&amp;&amp;document.documentElement.namespaceURI==_723){
-var s=document.createElementNS(_723,&quot;script&quot;);
-s.setAttribute(&quot;id&quot;,&quot;MochiKit_&quot;+base+_729[i]);
-s.setAttribute(&quot;src&quot;,uri);
-s.setAttribute(&quot;type&quot;,&quot;application/x-javascript&quot;);
-_725.parentNode.appendChild(s);
-}else{
-document.write(&quot;&lt;script src=\&quot;&quot;+uri+&quot;\&quot; type=\&quot;text/javascript\&quot;&gt;&lt;/script&gt;&quot;);
-}
-}
-})();
-}
-
-
+/***
+
+    MochiKit.MochiKit 1.4 : PACKED VERSION
+
+    THIS FILE IS AUTOMATICALLY GENERATED.  If creating patches, please
+    diff against the source tree, not this file.
+
+    See &lt;http://mochikit.com/&gt; for documentation, downloads, license, etc.
+
+    (c) 2005 Bob Ippolito.  All rights Reserved.
+
+***/
+
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Base&quot;);
+}
+if(typeof (MochiKit)==&quot;undefined&quot;){
+MochiKit={};
+}
+if(typeof (MochiKit.Base)==&quot;undefined&quot;){
+MochiKit.Base={};
+}
+if(typeof (MochiKit.__export__)==&quot;undefined&quot;){
+MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)==&quot;undefined&quot;&amp;&amp;typeof (dojo)==&quot;undefined&quot;));
+}
+MochiKit.Base.VERSION=&quot;1.4&quot;;
+MochiKit.Base.NAME=&quot;MochiKit.Base&quot;;
+MochiKit.Base.update=function(_1,_2){
+if(_1===null||_1===undefined){
+_1={};
+}
+for(var i=1;i&lt;arguments.length;i++){
+var o=arguments[i];
+if(typeof (o)!=&quot;undefined&quot;&amp;&amp;o!==null){
+for(var k in o){
+_1[k]=o[k];
+}
+}
+}
+return _1;
+};
+MochiKit.Base.update(MochiKit.Base,{__repr__:function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+},toString:function(){
+return this.__repr__();
+},camelize:function(_6){
+var _7=_6.split(&quot;-&quot;);
+var cc=_7[0];
+for(var i=1;i&lt;_7.length;i++){
+cc+=_7[i].charAt(0).toUpperCase()+_7[i].substring(1);
+}
+return cc;
+},counter:function(n){
+if(arguments.length===0){
+n=1;
+}
+return function(){
+return n++;
+};
+},clone:function(_b){
+var me=arguments.callee;
+if(arguments.length==1){
+me.prototype=_b;
+return new me();
+}
+},_flattenArray:function(_d,_e){
+for(var i=0;i&lt;_e.length;i++){
+var o=_e[i];
+if(o instanceof Array){
+arguments.callee(_d,o);
+}else{
+_d.push(o);
+}
+}
+return _d;
+},flattenArray:function(lst){
+return MochiKit.Base._flattenArray([],lst);
+},flattenArguments:function(lst){
+var res=[];
+var m=MochiKit.Base;
+var _15=m.extend(null,arguments);
+while(_15.length){
+var o=_15.shift();
+if(o&amp;&amp;typeof (o)==&quot;object&quot;&amp;&amp;typeof (o.length)==&quot;number&quot;){
+for(var i=o.length-1;i&gt;=0;i--){
+_15.unshift(o[i]);
+}
+}else{
+res.push(o);
+}
+}
+return res;
+},extend:function(_18,obj,_1a){
+if(!_1a){
+_1a=0;
+}
+if(obj){
+var l=obj.length;
+if(typeof (l)!=&quot;number&quot;){
+if(typeof (MochiKit.Iter)!=&quot;undefined&quot;){
+obj=MochiKit.Iter.list(obj);
+l=obj.length;
+}else{
+throw new TypeError(&quot;Argument not an array-like and MochiKit.Iter not present&quot;);
+}
+}
+if(!_18){
+_18=[];
+}
+for(var i=_1a;i&lt;l;i++){
+_18.push(obj[i]);
+}
+}
+return _18;
+},updatetree:function(_1d,obj){
+if(_1d===null||_1d===undefined){
+_1d={};
+}
+for(var i=1;i&lt;arguments.length;i++){
+var o=arguments[i];
+if(typeof (o)!=&quot;undefined&quot;&amp;&amp;o!==null){
+for(var k in o){
+var v=o[k];
+if(typeof (_1d[k])==&quot;object&quot;&amp;&amp;typeof (v)==&quot;object&quot;){
+arguments.callee(_1d[k],v);
+}else{
+_1d[k]=v;
+}
+}
+}
+}
+return _1d;
+},setdefault:function(_23,obj){
+if(_23===null||_23===undefined){
+_23={};
+}
+for(var i=1;i&lt;arguments.length;i++){
+var o=arguments[i];
+for(var k in o){
+if(!(k in _23)){
+_23[k]=o[k];
+}
+}
+}
+return _23;
+},keys:function(obj){
+var _29=[];
+for(var _2a in obj){
+_29.push(_2a);
+}
+return _29;
+},values:function(obj){
+var _2c=[];
+for(var _2d in obj){
+_2c.push(obj[_2d]);
+}
+return _2c;
+},items:function(obj){
+var _2f=[];
+var e;
+for(var _31 in obj){
+var v;
+try{
+v=obj[_31];
+}
+catch(e){
+continue;
+}
+_2f.push([_31,v]);
+}
+return _2f;
+},_newNamedError:function(_33,_34,_35){
+_35.prototype=new MochiKit.Base.NamedError(_33.NAME+&quot;.&quot;+_34);
+_33[_34]=_35;
+},operator:{truth:function(a){
+return !!a;
+},lognot:function(a){
+return !a;
+},identity:function(a){
+return a;
+},not:function(a){
+return ~a;
+},neg:function(a){
+return -a;
+},add:function(a,b){
+return a+b;
+},sub:function(a,b){
+return a-b;
+},div:function(a,b){
+return a/b;
+},mod:function(a,b){
+return a%b;
+},mul:function(a,b){
+return a*b;
+},and:function(a,b){
+return a&amp;b;
+},or:function(a,b){
+return a|b;
+},xor:function(a,b){
+return a^b;
+},lshift:function(a,b){
+return a&lt;&lt;b;
+},rshift:function(a,b){
+return a&gt;&gt;b;
+},zrshift:function(a,b){
+return a&gt;&gt;&gt;b;
+},eq:function(a,b){
+return a==b;
+},ne:function(a,b){
+return a!=b;
+},gt:function(a,b){
+return a&gt;b;
+},ge:function(a,b){
+return a&gt;=b;
+},lt:function(a,b){
+return a&lt;b;
+},le:function(a,b){
+return a&lt;=b;
+},seq:function(a,b){
+return a===b;
+},sne:function(a,b){
+return a!==b;
+},ceq:function(a,b){
+return MochiKit.Base.compare(a,b)===0;
+},cne:function(a,b){
+return MochiKit.Base.compare(a,b)!==0;
+},cgt:function(a,b){
+return MochiKit.Base.compare(a,b)==1;
+},cge:function(a,b){
+return MochiKit.Base.compare(a,b)!=-1;
+},clt:function(a,b){
+return MochiKit.Base.compare(a,b)==-1;
+},cle:function(a,b){
+return MochiKit.Base.compare(a,b)!=1;
+},logand:function(a,b){
+return a&amp;&amp;b;
+},logor:function(a,b){
+return a||b;
+},contains:function(a,b){
+return b in a;
+}},forwardCall:function(_73){
+return function(){
+return this[_73].apply(this,arguments);
+};
+},itemgetter:function(_74){
+return function(arg){
+return arg[_74];
+};
+},typeMatcher:function(){
+var _76={};
+for(var i=0;i&lt;arguments.length;i++){
+var typ=arguments[i];
+_76[typ]=typ;
+}
+return function(){
+for(var i=0;i&lt;arguments.length;i++){
+if(!(typeof (arguments[i]) in _76)){
+return false;
+}
+}
+return true;
+};
+},isNull:function(){
+for(var i=0;i&lt;arguments.length;i++){
+if(arguments[i]!==null){
+return false;
+}
+}
+return true;
+},isUndefinedOrNull:function(){
+for(var i=0;i&lt;arguments.length;i++){
+var o=arguments[i];
+if(!(typeof (o)==&quot;undefined&quot;||o===null)){
+return false;
+}
+}
+return true;
+},isEmpty:function(obj){
+return !MochiKit.Base.isNotEmpty.apply(this,arguments);
+},isNotEmpty:function(obj){
+for(var i=0;i&lt;arguments.length;i++){
+var o=arguments[i];
+if(!(o&amp;&amp;o.length)){
+return false;
+}
+}
+return true;
+},isArrayLike:function(){
+for(var i=0;i&lt;arguments.length;i++){
+var o=arguments[i];
+var typ=typeof (o);
+if((typ!=&quot;object&quot;&amp;&amp;!(typ==&quot;function&quot;&amp;&amp;typeof (o.item)==&quot;function&quot;))||o===null||typeof (o.length)!=&quot;number&quot;||o.nodeType===3){
+return false;
+}
+}
+return true;
+},isDateLike:function(){
+for(var i=0;i&lt;arguments.length;i++){
+var o=arguments[i];
+if(typeof (o)!=&quot;object&quot;||o===null||typeof (o.getTime)!=&quot;function&quot;){
+return false;
+}
+}
+return true;
+},xmap:function(fn){
+if(fn===null){
+return MochiKit.Base.extend(null,arguments,1);
+}
+var _87=[];
+for(var i=1;i&lt;arguments.length;i++){
+_87.push(fn(arguments[i]));
+}
+return _87;
+},map:function(fn,lst){
+var m=MochiKit.Base;
+var itr=MochiKit.Iter;
+var _8d=m.isArrayLike;
+if(arguments.length&lt;=2){
+if(!_8d(lst)){
+if(itr){
+lst=itr.list(lst);
+if(fn===null){
+return lst;
+}
+}else{
+throw new TypeError(&quot;Argument not an array-like and MochiKit.Iter not present&quot;);
+}
+}
+if(fn===null){
+return m.extend(null,lst);
+}
+var _8e=[];
+for(var i=0;i&lt;lst.length;i++){
+_8e.push(fn(lst[i]));
+}
+return _8e;
+}else{
+if(fn===null){
+fn=Array;
+}
+var _90=null;
+for(i=1;i&lt;arguments.length;i++){
+if(!_8d(arguments[i])){
+if(itr){
+return itr.list(itr.imap.apply(null,arguments));
+}else{
+throw new TypeError(&quot;Argument not an array-like and MochiKit.Iter not present&quot;);
+}
+}
+var l=arguments[i].length;
+if(_90===null||_90&gt;l){
+_90=l;
+}
+}
+_8e=[];
+for(i=0;i&lt;_90;i++){
+var _92=[];
+for(var j=1;j&lt;arguments.length;j++){
+_92.push(arguments[j][i]);
+}
+_8e.push(fn.apply(this,_92));
+}
+return _8e;
+}
+},xfilter:function(fn){
+var _95=[];
+if(fn===null){
+fn=MochiKit.Base.operator.truth;
+}
+for(var i=1;i&lt;arguments.length;i++){
+var o=arguments[i];
+if(fn(o)){
+_95.push(o);
+}
+}
+return _95;
+},filter:function(fn,lst,_9a){
+var _9b=[];
+var m=MochiKit.Base;
+if(!m.isArrayLike(lst)){
+if(MochiKit.Iter){
+lst=MochiKit.Iter.list(lst);
+}else{
+throw new TypeError(&quot;Argument not an array-like and MochiKit.Iter not present&quot;);
+}
+}
+if(fn===null){
+fn=m.operator.truth;
+}
+if(typeof (Array.prototype.filter)==&quot;function&quot;){
+return Array.prototype.filter.call(lst,fn,_9a);
+}else{
+if(typeof (_9a)==&quot;undefined&quot;||_9a===null){
+for(var i=0;i&lt;lst.length;i++){
+var o=lst[i];
+if(fn(o)){
+_9b.push(o);
+}
+}
+}else{
+for(i=0;i&lt;lst.length;i++){
+o=lst[i];
+if(fn.call(_9a,o)){
+_9b.push(o);
+}
+}
+}
+}
+return _9b;
+},_wrapDumbFunction:function(_9f){
+return function(){
+switch(arguments.length){
+case 0:
+return _9f();
+case 1:
+return _9f(arguments[0]);
+case 2:
+return _9f(arguments[0],arguments[1]);
+case 3:
+return _9f(arguments[0],arguments[1],arguments[2]);
+}
+var _a0=[];
+for(var i=0;i&lt;arguments.length;i++){
+_a0.push(&quot;arguments[&quot;+i+&quot;]&quot;);
+}
+return eval(&quot;(func(&quot;+_a0.join(&quot;,&quot;)+&quot;))&quot;);
+};
+},methodcaller:function(_a2){
+var _a3=MochiKit.Base.extend(null,arguments,1);
+if(typeof (_a2)==&quot;function&quot;){
+return function(obj){
+return _a2.apply(obj,_a3);
+};
+}else{
+return function(obj){
+return obj[_a2].apply(obj,_a3);
+};
+}
+},method:function(_a6,_a7){
+var m=MochiKit.Base;
+return m.bind.apply(this,m.extend([_a7,_a6],arguments,2));
+},compose:function(f1,f2){
+var _ab=[];
+var m=MochiKit.Base;
+if(arguments.length===0){
+throw new TypeError(&quot;compose() requires at least one argument&quot;);
+}
+for(var i=0;i&lt;arguments.length;i++){
+var fn=arguments[i];
+if(typeof (fn)!=&quot;function&quot;){
+throw new TypeError(m.repr(fn)+&quot; is not a function&quot;);
+}
+_ab.push(fn);
+}
+return function(){
+var _af=arguments;
+for(var i=_ab.length-1;i&gt;=0;i--){
+_af=[_ab[i].apply(this,_af)];
+}
+return _af[0];
+};
+},bind:function(_b1,_b2){
+if(typeof (_b1)==&quot;string&quot;){
+_b1=_b2[_b1];
+}
+var _b3=_b1.im_func;
+var _b4=_b1.im_preargs;
+var _b5=_b1.im_self;
+var m=MochiKit.Base;
+if(typeof (_b1)==&quot;function&quot;&amp;&amp;typeof (_b1.apply)==&quot;undefined&quot;){
+_b1=m._wrapDumbFunction(_b1);
+}
+if(typeof (_b3)!=&quot;function&quot;){
+_b3=_b1;
+}
+if(typeof (_b2)!=&quot;undefined&quot;){
+_b5=_b2;
+}
+if(typeof (_b4)==&quot;undefined&quot;){
+_b4=[];
+}else{
+_b4=_b4.slice();
+}
+m.extend(_b4,arguments,2);
+var _b7=function(){
+var _b8=arguments;
+var me=arguments.callee;
+if(me.im_preargs.length&gt;0){
+_b8=m.concat(me.im_preargs,_b8);
+}
+var _ba=me.im_self;
+if(!_ba){
+_ba=this;
+}
+return me.im_func.apply(_ba,_b8);
+};
+_b7.im_self=_b5;
+_b7.im_func=_b3;
+_b7.im_preargs=_b4;
+return _b7;
+},bindMethods:function(_bb){
+var _bc=MochiKit.Base.bind;
+for(var k in _bb){
+var _be=_bb[k];
+if(typeof (_be)==&quot;function&quot;){
+_bb[k]=_bc(_be,_bb);
+}
+}
+},registerComparator:function(_bf,_c0,_c1,_c2){
+MochiKit.Base.comparatorRegistry.register(_bf,_c0,_c1,_c2);
+},_primitives:{&quot;boolean&quot;:true,&quot;string&quot;:true,&quot;number&quot;:true},compare:function(a,b){
+if(a==b){
+return 0;
+}
+var _c5=(typeof (a)==&quot;undefined&quot;||a===null);
+var _c6=(typeof (b)==&quot;undefined&quot;||b===null);
+if(_c5&amp;&amp;_c6){
+return 0;
+}else{
+if(_c5){
+return -1;
+}else{
+if(_c6){
+return 1;
+}
+}
+}
+var m=MochiKit.Base;
+var _c8=m._primitives;
+if(!(typeof (a) in _c8&amp;&amp;typeof (b) in _c8)){
+try{
+return m.comparatorRegistry.match(a,b);
+}
+catch(e){
+if(e!=m.NotFound){
+throw e;
+}
+}
+}
+if(a&lt;b){
+return -1;
+}else{
+if(a&gt;b){
+return 1;
+}
+}
+var _c9=m.repr;
+throw new TypeError(_c9(a)+&quot; and &quot;+_c9(b)+&quot; can not be compared&quot;);
+},compareDateLike:function(a,b){
+return MochiKit.Base.compare(a.getTime(),b.getTime());
+},compareArrayLike:function(a,b){
+var _ce=MochiKit.Base.compare;
+var _cf=a.length;
+var _d0=0;
+if(_cf&gt;b.length){
+_d0=1;
+_cf=b.length;
+}else{
+if(_cf&lt;b.length){
+_d0=-1;
+}
+}
+for(var i=0;i&lt;_cf;i++){
+var cmp=_ce(a[i],b[i]);
+if(cmp){
+return cmp;
+}
+}
+return _d0;
+},registerRepr:function(_d3,_d4,_d5,_d6){
+MochiKit.Base.reprRegistry.register(_d3,_d4,_d5,_d6);
+},repr:function(o){
+if(typeof (o)==&quot;undefined&quot;){
+return &quot;undefined&quot;;
+}else{
+if(o===null){
+return &quot;null&quot;;
+}
+}
+try{
+if(typeof (o.__repr__)==&quot;function&quot;){
+return o.__repr__();
+}else{
+if(typeof (o.repr)==&quot;function&quot;&amp;&amp;o.repr!=arguments.callee){
+return o.repr();
+}
+}
+return MochiKit.Base.reprRegistry.match(o);
+}
+catch(e){
+if(typeof (o.NAME)==&quot;string&quot;&amp;&amp;(o.toString==Function.prototype.toString||o.toString==Object.prototype.toString)){
+return o.NAME;
+}
+}
+try{
+var _d8=(o+&quot;&quot;);
+}
+catch(e){
+return &quot;[&quot;+typeof (o)+&quot;]&quot;;
+}
+if(typeof (o)==&quot;function&quot;){
+_d8=_d8.replace(/^\s+/,&quot;&quot;).replace(/\s+/g,&quot; &quot;);
+var idx=_d8.indexOf(&quot;{&quot;);
+if(idx!=-1){
+_d8=_d8.substr(0,idx)+&quot;{...}&quot;;
+}
+}
+return _d8;
+},reprArrayLike:function(o){
+var m=MochiKit.Base;
+return &quot;[&quot;+m.map(m.repr,o).join(&quot;, &quot;)+&quot;]&quot;;
+},reprString:function(o){
+return (&quot;\&quot;&quot;+o.replace(/([&quot;\\])/g,&quot;\\$1&quot;)+&quot;\&quot;&quot;).replace(/[\f]/g,&quot;\\f&quot;).replace(/[\b]/g,&quot;\\b&quot;).replace(/[\n]/g,&quot;\\n&quot;).replace(/[\t]/g,&quot;\\t&quot;).replace(/[\r]/g,&quot;\\r&quot;);
+},reprNumber:function(o){
+return o+&quot;&quot;;
+},registerJSON:function(_de,_df,_e0,_e1){
+MochiKit.Base.jsonRegistry.register(_de,_df,_e0,_e1);
+},evalJSON:function(){
+return eval(&quot;(&quot;+MochiKit.Base._filterJSON(arguments[0])+&quot;)&quot;);
+},_filterJSON:function(s){
+var m=s.match(/^\s*\/\*(.*)\*\/\s*$/);
+if(m){
+return m[1];
+}
+return s;
+},serializeJSON:function(o){
+var _e5=typeof (o);
+if(_e5==&quot;number&quot;||_e5==&quot;boolean&quot;){
+return o+&quot;&quot;;
+}else{
+if(o===null){
+return &quot;null&quot;;
+}
+}
+var m=MochiKit.Base;
+var _e7=m.reprString;
+if(_e5==&quot;string&quot;){
+return _e7(o);
+}
+var me=arguments.callee;
+var _e9;
+if(typeof (o.__json__)==&quot;function&quot;){
+_e9=o.__json__();
+if(o!==_e9){
+return me(_e9);
+}
+}
+if(typeof (o.json)==&quot;function&quot;){
+_e9=o.json();
+if(o!==_e9){
+return me(_e9);
+}
+}
+if(_e5!=&quot;function&quot;&amp;&amp;typeof (o.length)==&quot;number&quot;){
+var res=[];
+for(var i=0;i&lt;o.length;i++){
+var val=me(o[i]);
+if(typeof (val)!=&quot;string&quot;){
+val=&quot;undefined&quot;;
+}
+res.push(val);
+}
+return &quot;[&quot;+res.join(&quot;, &quot;)+&quot;]&quot;;
+}
+try{
+_e9=m.jsonRegistry.match(o);
+if(o!==_e9){
+return me(_e9);
+}
+}
+catch(e){
+if(e!=m.NotFound){
+throw e;
+}
+}
+if(_e5==&quot;undefined&quot;){
+throw new TypeError(&quot;undefined can not be serialized as JSON&quot;);
+}
+if(_e5==&quot;function&quot;){
+return null;
+}
+res=[];
+for(var k in o){
+var _ee;
+if(typeof (k)==&quot;number&quot;){
+_ee=&quot;\&quot;&quot;+k+&quot;\&quot;&quot;;
+}else{
+if(typeof (k)==&quot;string&quot;){
+_ee=_e7(k);
+}else{
+continue;
+}
+}
+val=me(o[k]);
+if(typeof (val)!=&quot;string&quot;){
+continue;
+}
+res.push(_ee+&quot;:&quot;+val);
+}
+return &quot;{&quot;+res.join(&quot;, &quot;)+&quot;}&quot;;
+},objEqual:function(a,b){
+return (MochiKit.Base.compare(a,b)===0);
+},arrayEqual:function(_f1,arr){
+if(_f1.length!=arr.length){
+return false;
+}
+return (MochiKit.Base.compare(_f1,arr)===0);
+},concat:function(){
+var _f3=[];
+var _f4=MochiKit.Base.extend;
+for(var i=0;i&lt;arguments.length;i++){
+_f4(_f3,arguments[i]);
+}
+return _f3;
+},keyComparator:function(key){
+var m=MochiKit.Base;
+var _f8=m.compare;
+if(arguments.length==1){
+return function(a,b){
+return _f8(a[key],b[key]);
+};
+}
+var _fb=m.extend(null,arguments);
+return function(a,b){
+var _fe=0;
+for(var i=0;(_fe===0)&amp;&amp;(i&lt;_fb.length);i++){
+var key=_fb[i];
+_fe=_f8(a[key],b[key]);
+}
+return _fe;
+};
+},reverseKeyComparator:function(key){
+var _102=MochiKit.Base.keyComparator.apply(this,arguments);
+return function(a,b){
+return _102(b,a);
+};
+},partial:function(func){
+var m=MochiKit.Base;
+return m.bind.apply(this,m.extend([func,undefined],arguments,1));
+},listMinMax:function(_107,lst){
+if(lst.length===0){
+return null;
+}
+var cur=lst[0];
+var _10a=MochiKit.Base.compare;
+for(var i=1;i&lt;lst.length;i++){
+var o=lst[i];
+if(_10a(o,cur)==_107){
+cur=o;
+}
+}
+return cur;
+},objMax:function(){
+return MochiKit.Base.listMinMax(1,arguments);
+},objMin:function(){
+return MochiKit.Base.listMinMax(-1,arguments);
+},findIdentical:function(lst,_10e,_10f,end){
+if(typeof (end)==&quot;undefined&quot;||end===null){
+end=lst.length;
+}
+if(typeof (_10f)==&quot;undefined&quot;||_10f===null){
+_10f=0;
+}
+for(var i=_10f;i&lt;end;i++){
+if(lst[i]===_10e){
+return i;
+}
+}
+return -1;
+},mean:function(){
+var sum=0;
+var m=MochiKit.Base;
+var args=m.extend(null,arguments);
+var _115=args.length;
+while(args.length){
+var o=args.shift();
+if(o&amp;&amp;typeof (o)==&quot;object&quot;&amp;&amp;typeof (o.length)==&quot;number&quot;){
+_115+=o.length-1;
+for(var i=o.length-1;i&gt;=0;i--){
+sum+=o[i];
+}
+}else{
+sum+=o;
+}
+}
+if(_115&lt;=0){
+throw new TypeError(&quot;mean() requires at least one argument&quot;);
+}
+return sum/_115;
+},median:function(){
+var data=MochiKit.Base.flattenArguments(arguments);
+if(data.length===0){
+throw new TypeError(&quot;median() requires at least one argument&quot;);
+}
+data.sort(compare);
+if(data.length%2==0){
+var _119=data.length/2;
+return (data[_119]+data[_119-1])/2;
+}else{
+return data[(data.length-1)/2];
+}
+},findValue:function(lst,_11b,_11c,end){
+if(typeof (end)==&quot;undefined&quot;||end===null){
+end=lst.length;
+}
+if(typeof (_11c)==&quot;undefined&quot;||_11c===null){
+_11c=0;
+}
+var cmp=MochiKit.Base.compare;
+for(var i=_11c;i&lt;end;i++){
+if(cmp(lst[i],_11b)===0){
+return i;
+}
+}
+return -1;
+},nodeWalk:function(node,_121){
+var _122=[node];
+var _123=MochiKit.Base.extend;
+while(_122.length){
+var res=_121(_122.shift());
+if(res){
+_123(_122,res);
+}
+}
+},nameFunctions:function(_125){
+var base=_125.NAME;
+if(typeof (base)==&quot;undefined&quot;){
+base=&quot;&quot;;
+}else{
+base=base+&quot;.&quot;;
+}
+for(var name in _125){
+var o=_125[name];
+if(typeof (o)==&quot;function&quot;&amp;&amp;typeof (o.NAME)==&quot;undefined&quot;){
+try{
+o.NAME=base+name;
+}
+catch(e){
+}
+}
+}
+},queryString:function(_129,_12a){
+if(typeof (MochiKit.DOM)!=&quot;undefined&quot;&amp;&amp;arguments.length==1&amp;&amp;(typeof (_129)==&quot;string&quot;||(typeof (_129.nodeType)!=&quot;undefined&quot;&amp;&amp;_129.nodeType&gt;0))){
+var kv=MochiKit.DOM.formContents(_129);
+_129=kv[0];
+_12a=kv[1];
+}else{
+if(arguments.length==1){
+if(typeof (_129.length)==&quot;number&quot;&amp;&amp;_129.length==2){
+return arguments.callee(_129[0],_129[1]);
+}
+var o=_129;
+_129=[];
+_12a=[];
+for(var k in o){
+var v=o[k];
+if(typeof (v)==&quot;function&quot;){
+continue;
+}else{
+if(MochiKit.Base.isArrayLike(v)){
+for(var i=0;i&lt;v.length;i++){
+_129.push(k);
+_12a.push(v[i]);
+}
+}else{
+_129.push(k);
+_12a.push(v);
+}
+}
+}
+}
+}
+var rval=[];
+var len=Math.min(_129.length,_12a.length);
+var _132=MochiKit.Base.urlEncode;
+for(var i=0;i&lt;len;i++){
+v=_12a[i];
+if(typeof (v)!=&quot;undefined&quot;&amp;&amp;v!==null){
+rval.push(_132(_129[i])+&quot;=&quot;+_132(v));
+}
+}
+return rval.join(&quot;&amp;&quot;);
+},parseQueryString:function(_133,_134){
+var qstr=(_133.charAt(0)==&quot;?&quot;)?_133.substring(1):_133;
+var _136=qstr.replace(/\+/g,&quot;%20&quot;).split(/(\&amp;amp\;|\&amp;\#38\;|\&amp;#x26;|\&amp;)/);
+var o={};
+var _138;
+if(typeof (decodeURIComponent)!=&quot;undefined&quot;){
+_138=decodeURIComponent;
+}else{
+_138=unescape;
+}
+if(_134){
+for(var i=0;i&lt;_136.length;i++){
+var pair=_136[i].split(&quot;=&quot;);
+var name=_138(pair.shift());
+if(!name){
+continue;
+}
+var arr=o[name];
+if(!(arr instanceof Array)){
+arr=[];
+o[name]=arr;
+}
+arr.push(_138(pair.join(&quot;=&quot;)));
+}
+}else{
+for(i=0;i&lt;_136.length;i++){
+pair=_136[i].split(&quot;=&quot;);
+var name=pair.shift();
+if(!name){
+continue;
+}
+o[_138(name)]=_138(pair.join(&quot;=&quot;));
+}
+}
+return o;
+}});
+MochiKit.Base.AdapterRegistry=function(){
+this.pairs=[];
+};
+MochiKit.Base.AdapterRegistry.prototype={register:function(name,_13e,wrap,_140){
+if(_140){
+this.pairs.unshift([name,_13e,wrap]);
+}else{
+this.pairs.push([name,_13e,wrap]);
+}
+},match:function(){
+for(var i=0;i&lt;this.pairs.length;i++){
+var pair=this.pairs[i];
+if(pair[1].apply(this,arguments)){
+return pair[2].apply(this,arguments);
+}
+}
+throw MochiKit.Base.NotFound;
+},unregister:function(name){
+for(var i=0;i&lt;this.pairs.length;i++){
+var pair=this.pairs[i];
+if(pair[0]==name){
+this.pairs.splice(i,1);
+return true;
+}
+}
+return false;
+}};
+MochiKit.Base.EXPORT=[&quot;flattenArray&quot;,&quot;noop&quot;,&quot;camelize&quot;,&quot;counter&quot;,&quot;clone&quot;,&quot;extend&quot;,&quot;update&quot;,&quot;updatetree&quot;,&quot;setdefault&quot;,&quot;keys&quot;,&quot;values&quot;,&quot;items&quot;,&quot;NamedError&quot;,&quot;operator&quot;,&quot;forwardCall&quot;,&quot;itemgetter&quot;,&quot;typeMatcher&quot;,&quot;isCallable&quot;,&quot;isUndefined&quot;,&quot;isUndefinedOrNull&quot;,&quot;isNull&quot;,&quot;isEmpty&quot;,&quot;isNotEmpty&quot;,&quot;isArrayLike&quot;,&quot;isDateLike&quot;,&quot;xmap&quot;,&quot;map&quot;,&quot;xfilter&quot;,&quot;filter&quot;,&quot;methodcaller&quot;,&quot;compose&quot;,&quot;bind&quot;,&quot;bindMethods&quot;,&quot;NotFound&quot;,&quot;AdapterRegistry&quot;,&quot;registerComparator&quot;,&quot;compare&quot;,&quot;registerRepr&quot;,&quot;repr&quot;,&quot;objEqual&quot;,&quot;arrayEqual&quot;,&quot;concat&quot;,&quot;keyComparator&quot;,&quot;reverseKeyComparator&quot;,&quot;partial&quot;,&quot;merge&quot;,&quot;listMinMax&quot;,&quot;listMax&quot;,&quot;listMin&quot;,&quot;objMax&quot;,&quot;objMin&quot;,&quot;nodeWalk&quot;,&quot;zip&quot;,&quot;urlEncode&quot;,&quot;queryString&quot;,&quot;serializeJSON&quot;,&quot;registerJSON&quot;,&quot;evalJSON&quot;,&quot;parseQueryString&quot;,&quot;findValue&quot;,&quot;findIdentical&quot;,&quot;flattenArguments&quot;,&quot;method&quot;,&quot;average&quot;,&quot;mean&quot;,&quot;median&quot;];
+MochiKit.Base.EXPORT_OK=[&quot;nameFunctions&quot;,&quot;comparatorRegistry&quot;,&quot;reprRegistry&quot;,&quot;jsonRegistry&quot;,&quot;compareDateLike&quot;,&quot;compareArrayLike&quot;,&quot;reprArrayLike&quot;,&quot;reprString&quot;,&quot;reprNumber&quot;];
+MochiKit.Base._exportSymbols=function(_146,_147){
+if(!MochiKit.__export__){
+return;
+}
+var all=_147.EXPORT_TAGS[&quot;:all&quot;];
+for(var i=0;i&lt;all.length;i++){
+_146[all[i]]=_147[all[i]];
+}
+};
+MochiKit.Base.__new__=function(){
+var m=this;
+m.noop=m.operator.identity;
+m.forward=m.forwardCall;
+m.find=m.findValue;
+if(typeof (encodeURIComponent)!=&quot;undefined&quot;){
+m.urlEncode=function(_14b){
+return encodeURIComponent(_14b).replace(/\'/g,&quot;%27&quot;);
+};
+}else{
+m.urlEncode=function(_14c){
+return escape(_14c).replace(/\+/g,&quot;%2B&quot;).replace(/\&quot;/g,&quot;%22&quot;).rval.replace(/\'/g,&quot;%27&quot;);
+};
+}
+m.NamedError=function(name){
+this.message=name;
+this.name=name;
+};
+m.NamedError.prototype=new Error();
+m.update(m.NamedError.prototype,{repr:function(){
+if(this.message&amp;&amp;this.message!=this.name){
+return this.name+&quot;(&quot;+m.repr(this.message)+&quot;)&quot;;
+}else{
+return this.name+&quot;()&quot;;
+}
+},toString:m.forwardCall(&quot;repr&quot;)});
+m.NotFound=new m.NamedError(&quot;MochiKit.Base.NotFound&quot;);
+m.listMax=m.partial(m.listMinMax,1);
+m.listMin=m.partial(m.listMinMax,-1);
+m.isCallable=m.typeMatcher(&quot;function&quot;);
+m.isUndefined=m.typeMatcher(&quot;undefined&quot;);
+m.merge=m.partial(m.update,null);
+m.zip=m.partial(m.map,null);
+m.average=m.mean;
+m.comparatorRegistry=new m.AdapterRegistry();
+m.registerComparator(&quot;dateLike&quot;,m.isDateLike,m.compareDateLike);
+m.registerComparator(&quot;arrayLike&quot;,m.isArrayLike,m.compareArrayLike);
+m.reprRegistry=new m.AdapterRegistry();
+m.registerRepr(&quot;arrayLike&quot;,m.isArrayLike,m.reprArrayLike);
+m.registerRepr(&quot;string&quot;,m.typeMatcher(&quot;string&quot;),m.reprString);
+m.registerRepr(&quot;numbers&quot;,m.typeMatcher(&quot;number&quot;,&quot;boolean&quot;),m.reprNumber);
+m.jsonRegistry=new m.AdapterRegistry();
+var all=m.concat(m.EXPORT,m.EXPORT_OK);
+m.EXPORT_TAGS={&quot;:common&quot;:m.concat(m.EXPORT_OK),&quot;:all&quot;:all};
+m.nameFunctions(this);
+};
+MochiKit.Base.__new__();
+if(MochiKit.__export__){
+compare=MochiKit.Base.compare;
+compose=MochiKit.Base.compose;
+serializeJSON=MochiKit.Base.serializeJSON;
+mean=MochiKit.Base.mean;
+median=MochiKit.Base.median;
+}
+MochiKit.Base._exportSymbols(this,MochiKit.Base);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Iter&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Iter depends on MochiKit.Base!&quot;;
+}
+if(typeof (MochiKit.Iter)==&quot;undefined&quot;){
+MochiKit.Iter={};
+}
+MochiKit.Iter.NAME=&quot;MochiKit.Iter&quot;;
+MochiKit.Iter.VERSION=&quot;1.4&quot;;
+MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+},toString:function(){
+return this.__repr__();
+},registerIteratorFactory:function(name,_150,_151,_152){
+MochiKit.Iter.iteratorRegistry.register(name,_150,_151,_152);
+},iter:function(_153,_154){
+var self=MochiKit.Iter;
+if(arguments.length==2){
+return self.takewhile(function(a){
+return a!=_154;
+},_153);
+}
+if(typeof (_153.next)==&quot;function&quot;){
+return _153;
+}else{
+if(typeof (_153.iter)==&quot;function&quot;){
+return _153.iter();
+}
+}
+try{
+return self.iteratorRegistry.match(_153);
+}
+catch(e){
+var m=MochiKit.Base;
+if(e==m.NotFound){
+e=new TypeError(typeof (_153)+&quot;: &quot;+m.repr(_153)+&quot; is not iterable&quot;);
+}
+throw e;
+}
+},count:function(n){
+if(!n){
+n=0;
+}
+var m=MochiKit.Base;
+return {repr:function(){
+return &quot;count(&quot;+n+&quot;)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:m.counter(n)};
+},cycle:function(p){
+var self=MochiKit.Iter;
+var m=MochiKit.Base;
+var lst=[];
+var _15e=self.iter(p);
+return {repr:function(){
+return &quot;cycle(...)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+try{
+var rval=_15e.next();
+lst.push(rval);
+return rval;
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+if(lst.length===0){
+this.next=function(){
+throw self.StopIteration;
+};
+}else{
+var i=-1;
+this.next=function(){
+i=(i+1)%lst.length;
+return lst[i];
+};
+}
+return this.next();
+}
+}};
+},repeat:function(elem,n){
+var m=MochiKit.Base;
+if(typeof (n)==&quot;undefined&quot;){
+return {repr:function(){
+return &quot;repeat(&quot;+m.repr(elem)+&quot;)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+return elem;
+}};
+}
+return {repr:function(){
+return &quot;repeat(&quot;+m.repr(elem)+&quot;, &quot;+n+&quot;)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+if(n&lt;=0){
+throw MochiKit.Iter.StopIteration;
+}
+n-=1;
+return elem;
+}};
+},next:function(_164){
+return _164.next();
+},izip:function(p,q){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+var next=self.next;
+var _16a=m.map(self.iter,arguments);
+return {repr:function(){
+return &quot;izip(...)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+return m.map(next,_16a);
+}};
+},ifilter:function(pred,seq){
+var m=MochiKit.Base;
+seq=MochiKit.Iter.iter(seq);
+if(pred===null){
+pred=m.operator.truth;
+}
+return {repr:function(){
+return &quot;ifilter(...)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+while(true){
+var rval=seq.next();
+if(pred(rval)){
+return rval;
+}
+}
+return undefined;
+}};
+},ifilterfalse:function(pred,seq){
+var m=MochiKit.Base;
+seq=MochiKit.Iter.iter(seq);
+if(pred===null){
+pred=m.operator.truth;
+}
+return {repr:function(){
+return &quot;ifilterfalse(...)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+while(true){
+var rval=seq.next();
+if(!pred(rval)){
+return rval;
+}
+}
+return undefined;
+}};
+},islice:function(seq){
+var self=MochiKit.Iter;
+var m=MochiKit.Base;
+seq=self.iter(seq);
+var _176=0;
+var stop=0;
+var step=1;
+var i=-1;
+if(arguments.length==2){
+stop=arguments[1];
+}else{
+if(arguments.length==3){
+_176=arguments[1];
+stop=arguments[2];
+}else{
+_176=arguments[1];
+stop=arguments[2];
+step=arguments[3];
+}
+}
+return {repr:function(){
+return &quot;islice(&quot;+[&quot;...&quot;,_176,stop,step].join(&quot;, &quot;)+&quot;)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+var rval;
+while(i&lt;_176){
+rval=seq.next();
+i++;
+}
+if(_176&gt;=stop){
+throw self.StopIteration;
+}
+_176+=step;
+return rval;
+}};
+},imap:function(fun,p,q){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+var _180=m.map(self.iter,m.extend(null,arguments,1));
+var map=m.map;
+var next=self.next;
+return {repr:function(){
+return &quot;imap(...)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+return fun.apply(this,map(next,_180));
+}};
+},applymap:function(fun,seq,self){
+seq=MochiKit.Iter.iter(seq);
+var m=MochiKit.Base;
+return {repr:function(){
+return &quot;applymap(...)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+return fun.apply(self,seq.next());
+}};
+},chain:function(p,q){
+var self=MochiKit.Iter;
+var m=MochiKit.Base;
+if(arguments.length==1){
+return self.iter(arguments[0]);
+}
+var _18b=m.map(self.iter,arguments);
+return {repr:function(){
+return &quot;chain(...)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+while(_18b.length&gt;1){
+try{
+return _18b[0].next();
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+_18b.shift();
+}
+}
+if(_18b.length==1){
+var arg=_18b.shift();
+this.next=m.bind(&quot;next&quot;,arg);
+return this.next();
+}
+throw self.StopIteration;
+}};
+},takewhile:function(pred,seq){
+var self=MochiKit.Iter;
+seq=self.iter(seq);
+return {repr:function(){
+return &quot;takewhile(...)&quot;;
+},toString:MochiKit.Base.forwardCall(&quot;repr&quot;),next:function(){
+var rval=seq.next();
+if(!pred(rval)){
+this.next=function(){
+throw self.StopIteration;
+};
+this.next();
+}
+return rval;
+}};
+},dropwhile:function(pred,seq){
+seq=MochiKit.Iter.iter(seq);
+var m=MochiKit.Base;
+var bind=m.bind;
+return {&quot;repr&quot;:function(){
+return &quot;dropwhile(...)&quot;;
+},&quot;toString&quot;:m.forwardCall(&quot;repr&quot;),&quot;next&quot;:function(){
+while(true){
+var rval=seq.next();
+if(!pred(rval)){
+break;
+}
+}
+this.next=bind(&quot;next&quot;,seq);
+return rval;
+}};
+},_tee:function(_196,sync,_198){
+sync.pos[_196]=-1;
+var m=MochiKit.Base;
+var _19a=m.listMin;
+return {repr:function(){
+return &quot;tee(&quot;+_196+&quot;, ...)&quot;;
+},toString:m.forwardCall(&quot;repr&quot;),next:function(){
+var rval;
+var i=sync.pos[_196];
+if(i==sync.max){
+rval=_198.next();
+sync.deque.push(rval);
+sync.max+=1;
+sync.pos[_196]+=1;
+}else{
+rval=sync.deque[i-sync.min];
+sync.pos[_196]+=1;
+if(i==sync.min&amp;&amp;_19a(sync.pos)!=sync.min){
+sync.min+=1;
+sync.deque.shift();
+}
+}
+return rval;
+}};
+},tee:function(_19d,n){
+var rval=[];
+var sync={&quot;pos&quot;:[],&quot;deque&quot;:[],&quot;max&quot;:-1,&quot;min&quot;:-1};
+if(arguments.length==1||typeof (n)==&quot;undefined&quot;||n===null){
+n=2;
+}
+var self=MochiKit.Iter;
+_19d=self.iter(_19d);
+var _tee=self._tee;
+for(var i=0;i&lt;n;i++){
+rval.push(_tee(i,sync,_19d));
+}
+return rval;
+},list:function(_1a4){
+var rval;
+if(_1a4 instanceof Array){
+return _1a4.slice();
+}
+if(typeof (_1a4)==&quot;function&quot;&amp;&amp;!(_1a4 instanceof Function)&amp;&amp;typeof (_1a4.length)==&quot;number&quot;){
+rval=[];
+for(var i=0;i&lt;_1a4.length;i++){
+rval.push(_1a4[i]);
+}
+return rval;
+}
+var self=MochiKit.Iter;
+_1a4=self.iter(_1a4);
+var rval=[];
+try{
+while(true){
+rval.push(_1a4.next());
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+return rval;
+}
+return undefined;
+},reduce:function(fn,_1a9,_1aa){
+var i=0;
+var x=_1aa;
+var self=MochiKit.Iter;
+_1a9=self.iter(_1a9);
+if(arguments.length&lt;3){
+try{
+x=_1a9.next();
+}
+catch(e){
+if(e==self.StopIteration){
+e=new TypeError(&quot;reduce() of empty sequence with no initial value&quot;);
+}
+throw e;
+}
+i++;
+}
+try{
+while(true){
+x=fn(x,_1a9.next());
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+return x;
+},range:function(){
+var _1ae=0;
+var stop=0;
+var step=1;
+if(arguments.length==1){
+stop=arguments[0];
+}else{
+if(arguments.length==2){
+_1ae=arguments[0];
+stop=arguments[1];
+}else{
+if(arguments.length==3){
+_1ae=arguments[0];
+stop=arguments[1];
+step=arguments[2];
+}else{
+throw new TypeError(&quot;range() takes 1, 2, or 3 arguments!&quot;);
+}
+}
+}
+if(step===0){
+throw new TypeError(&quot;range() step must not be 0&quot;);
+}
+return {next:function(){
+if((step&gt;0&amp;&amp;_1ae&gt;=stop)||(step&lt;0&amp;&amp;_1ae&lt;=stop)){
+throw MochiKit.Iter.StopIteration;
+}
+var rval=_1ae;
+_1ae+=step;
+return rval;
+},repr:function(){
+return &quot;range(&quot;+[_1ae,stop,step].join(&quot;, &quot;)+&quot;)&quot;;
+},toString:MochiKit.Base.forwardCall(&quot;repr&quot;)};
+},sum:function(_1b2,_1b3){
+if(typeof (_1b3)==&quot;undefined&quot;||_1b3===null){
+_1b3=0;
+}
+var x=_1b3;
+var self=MochiKit.Iter;
+_1b2=self.iter(_1b2);
+try{
+while(true){
+x+=_1b2.next();
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+return x;
+},exhaust:function(_1b6){
+var self=MochiKit.Iter;
+_1b6=self.iter(_1b6);
+try{
+while(true){
+_1b6.next();
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+},forEach:function(_1b8,func,self){
+var m=MochiKit.Base;
+if(arguments.length&gt;2){
+func=m.bind(func,self);
+}
+if(m.isArrayLike(_1b8)){
+try{
+for(var i=0;i&lt;_1b8.length;i++){
+func(_1b8[i]);
+}
+}
+catch(e){
+if(e!=MochiKit.Iter.StopIteration){
+throw e;
+}
+}
+}else{
+self=MochiKit.Iter;
+self.exhaust(self.imap(func,_1b8));
+}
+},every:function(_1bd,func){
+var self=MochiKit.Iter;
+try{
+self.ifilterfalse(func,_1bd).next();
+return false;
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+return true;
+}
+},sorted:function(_1c0,cmp){
+var rval=MochiKit.Iter.list(_1c0);
+if(arguments.length==1){
+cmp=MochiKit.Base.compare;
+}
+rval.sort(cmp);
+return rval;
+},reversed:function(_1c3){
+var rval=MochiKit.Iter.list(_1c3);
+rval.reverse();
+return rval;
+},some:function(_1c5,func){
+var self=MochiKit.Iter;
+try{
+self.ifilter(func,_1c5).next();
+return true;
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+return false;
+}
+},iextend:function(lst,_1c9){
+if(MochiKit.Base.isArrayLike(_1c9)){
+for(var i=0;i&lt;_1c9.length;i++){
+lst.push(_1c9[i]);
+}
+}else{
+var self=MochiKit.Iter;
+_1c9=self.iter(_1c9);
+try{
+while(true){
+lst.push(_1c9.next());
+}
+}
+catch(e){
+if(e!=self.StopIteration){
+throw e;
+}
+}
+}
+return lst;
+},groupby:function(_1cc,_1cd){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+if(arguments.length&lt;2){
+_1cd=m.operator.identity;
+}
+_1cc=self.iter(_1cc);
+var pk=undefined;
+var k=undefined;
+var v;
+function fetch(){
+v=_1cc.next();
+k=_1cd(v);
+}
+function eat(){
+var ret=v;
+v=undefined;
+return ret;
+}
+var _1d4=true;
+var _1d5=m.compare;
+return {repr:function(){
+return &quot;groupby(...)&quot;;
+},next:function(){
+while(_1d5(k,pk)===0){
+fetch();
+if(_1d4){
+_1d4=false;
+break;
+}
+}
+pk=k;
+return [k,{next:function(){
+if(v==undefined){
+fetch();
+}
+if(_1d5(k,pk)!==0){
+throw self.StopIteration;
+}
+return eat();
+}}];
+}};
+},groupby_as_array:function(_1d6,_1d7){
+var m=MochiKit.Base;
+var self=MochiKit.Iter;
+if(arguments.length&lt;2){
+_1d7=m.operator.identity;
+}
+_1d6=self.iter(_1d6);
+var _1da=[];
+var _1db=true;
+var _1dc;
+var _1dd=m.compare;
+while(true){
+try{
+var _1de=_1d6.next();
+var key=_1d7(_1de);
+}
+catch(e){
+if(e==self.StopIteration){
+break;
+}
+throw e;
+}
+if(_1db||_1dd(key,_1dc)!==0){
+var _1e0=[];
+_1da.push([key,_1e0]);
+}
+_1e0.push(_1de);
+_1db=false;
+_1dc=key;
+}
+return _1da;
+},arrayLikeIter:function(_1e1){
+var i=0;
+return {repr:function(){
+return &quot;arrayLikeIter(...)&quot;;
+},toString:MochiKit.Base.forwardCall(&quot;repr&quot;),next:function(){
+if(i&gt;=_1e1.length){
+throw MochiKit.Iter.StopIteration;
+}
+return _1e1[i++];
+}};
+},hasIterateNext:function(_1e3){
+return (_1e3&amp;&amp;typeof (_1e3.iterateNext)==&quot;function&quot;);
+},iterateNextIter:function(_1e4){
+return {repr:function(){
+return &quot;iterateNextIter(...)&quot;;
+},toString:MochiKit.Base.forwardCall(&quot;repr&quot;),next:function(){
+var rval=_1e4.iterateNext();
+if(rval===null||rval===undefined){
+throw MochiKit.Iter.StopIteration;
+}
+return rval;
+}};
+}});
+MochiKit.Iter.EXPORT_OK=[&quot;iteratorRegistry&quot;,&quot;arrayLikeIter&quot;,&quot;hasIterateNext&quot;,&quot;iterateNextIter&quot;];
+MochiKit.Iter.EXPORT=[&quot;StopIteration&quot;,&quot;registerIteratorFactory&quot;,&quot;iter&quot;,&quot;count&quot;,&quot;cycle&quot;,&quot;repeat&quot;,&quot;next&quot;,&quot;izip&quot;,&quot;ifilter&quot;,&quot;ifilterfalse&quot;,&quot;islice&quot;,&quot;imap&quot;,&quot;applymap&quot;,&quot;chain&quot;,&quot;takewhile&quot;,&quot;dropwhile&quot;,&quot;tee&quot;,&quot;list&quot;,&quot;reduce&quot;,&quot;range&quot;,&quot;sum&quot;,&quot;exhaust&quot;,&quot;forEach&quot;,&quot;every&quot;,&quot;sorted&quot;,&quot;reversed&quot;,&quot;some&quot;,&quot;iextend&quot;,&quot;groupby&quot;,&quot;groupby_as_array&quot;];
+MochiKit.Iter.__new__=function(){
+var m=MochiKit.Base;
+if(typeof (StopIteration)!=&quot;undefined&quot;){
+this.StopIteration=StopIteration;
+}else{
+this.StopIteration=new m.NamedError(&quot;StopIteration&quot;);
+}
+this.iteratorRegistry=new m.AdapterRegistry();
+this.registerIteratorFactory(&quot;arrayLike&quot;,m.isArrayLike,this.arrayLikeIter);
+this.registerIteratorFactory(&quot;iterateNext&quot;,this.hasIterateNext,this.iterateNextIter);
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+MochiKit.Iter.__new__();
+if(MochiKit.__export__){
+reduce=MochiKit.Iter.reduce;
+}
+MochiKit.Base._exportSymbols(this,MochiKit.Iter);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Logging&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Logging depends on MochiKit.Base!&quot;;
+}
+if(typeof (MochiKit.Logging)==&quot;undefined&quot;){
+MochiKit.Logging={};
+}
+MochiKit.Logging.NAME=&quot;MochiKit.Logging&quot;;
+MochiKit.Logging.VERSION=&quot;1.4&quot;;
+MochiKit.Logging.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.Logging.toString=function(){
+return this.__repr__();
+};
+MochiKit.Logging.EXPORT=[&quot;LogLevel&quot;,&quot;LogMessage&quot;,&quot;Logger&quot;,&quot;alertListener&quot;,&quot;logger&quot;,&quot;log&quot;,&quot;logError&quot;,&quot;logDebug&quot;,&quot;logFatal&quot;,&quot;logWarning&quot;];
+MochiKit.Logging.EXPORT_OK=[&quot;logLevelAtLeast&quot;,&quot;isLogMessage&quot;,&quot;compareLogMessage&quot;];
+MochiKit.Logging.LogMessage=function(num,_1e8,info){
+this.num=num;
+this.level=_1e8;
+this.info=info;
+this.timestamp=new Date();
+};
+MochiKit.Logging.LogMessage.prototype={repr:function(){
+var m=MochiKit.Base;
+return &quot;LogMessage(&quot;+m.map(m.repr,[this.num,this.level,this.info]).join(&quot;, &quot;)+&quot;)&quot;;
+},toString:MochiKit.Base.forwardCall(&quot;repr&quot;)};
+MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_1eb){
+var self=MochiKit.Logging;
+if(typeof (_1eb)==&quot;string&quot;){
+_1eb=self.LogLevel[_1eb];
+}
+return function(msg){
+var _1ee=msg.level;
+if(typeof (_1ee)==&quot;string&quot;){
+_1ee=self.LogLevel[_1ee];
+}
+return _1ee&gt;=_1eb;
+};
+},isLogMessage:function(){
+var _1ef=MochiKit.Logging.LogMessage;
+for(var i=0;i&lt;arguments.length;i++){
+if(!(arguments[i] instanceof _1ef)){
+return false;
+}
+}
+return true;
+},compareLogMessage:function(a,b){
+return MochiKit.Base.compare([a.level,a.info],[b.level,b.info]);
+},alertListener:function(msg){
+alert(&quot;num: &quot;+msg.num+&quot;\nlevel: &quot;+msg.level+&quot;\ninfo: &quot;+msg.info.join(&quot; &quot;));
+}});
+MochiKit.Logging.Logger=function(_1f4){
+this.counter=0;
+if(typeof (_1f4)==&quot;undefined&quot;||_1f4===null){
+_1f4=-1;
+}
+this.maxSize=_1f4;
+this._messages=[];
+this.listeners={};
+this.useNativeConsole=false;
+};
+MochiKit.Logging.Logger.prototype={clear:function(){
+this._messages.splice(0,this._messages.length);
+},logToConsole:function(msg){
+if(typeof (window)!=&quot;undefined&quot;&amp;&amp;window.console&amp;&amp;window.console.log){
+window.console.log(msg.replace(/%/g,&quot;\uff05&quot;));
+}else{
+if(typeof (opera)!=&quot;undefined&quot;&amp;&amp;opera.postError){
+opera.postError(msg);
+}else{
+if(typeof (printfire)==&quot;function&quot;){
+printfire(msg);
+}else{
+if(typeof (Debug)!=&quot;undefined&quot;&amp;&amp;Debug.writeln){
+Debug.writeln(msg);
+}else{
+if(typeof (debug)!=&quot;undefined&quot;&amp;&amp;debug.trace){
+debug.trace(msg);
+}
+}
+}
+}
+}
+},dispatchListeners:function(msg){
+for(var k in this.listeners){
+var pair=this.listeners[k];
+if(pair.ident!=k||(pair[0]&amp;&amp;!pair[0](msg))){
+continue;
+}
+pair[1](msg);
+}
+},addListener:function(_1f9,_1fa,_1fb){
+if(typeof (_1fa)==&quot;string&quot;){
+_1fa=MochiKit.Logging.logLevelAtLeast(_1fa);
+}
+var _1fc=[_1fa,_1fb];
+_1fc.ident=_1f9;
+this.listeners[_1f9]=_1fc;
+},removeListener:function(_1fd){
+delete this.listeners[_1fd];
+},baseLog:function(_1fe,_1ff){
+var msg=new MochiKit.Logging.LogMessage(this.counter,_1fe,MochiKit.Base.extend(null,arguments,1));
+this._messages.push(msg);
+this.dispatchListeners(msg);
+if(this.useNativeConsole){
+this.logToConsole(msg.level+&quot;: &quot;+msg.info.join(&quot; &quot;));
+}
+this.counter+=1;
+while(this.maxSize&gt;=0&amp;&amp;this._messages.length&gt;this.maxSize){
+this._messages.shift();
+}
+},getMessages:function(_201){
+var _202=0;
+if(!(typeof (_201)==&quot;undefined&quot;||_201===null)){
+_202=Math.max(0,this._messages.length-_201);
+}
+return this._messages.slice(_202);
+},getMessageText:function(_203){
+if(typeof (_203)==&quot;undefined&quot;||_203===null){
+_203=30;
+}
+var _204=this.getMessages(_203);
+if(_204.length){
+var lst=map(function(m){
+return &quot;\n  [&quot;+m.num+&quot;] &quot;+m.level+&quot;: &quot;+m.info.join(&quot; &quot;);
+},_204);
+lst.unshift(&quot;LAST &quot;+_204.length+&quot; MESSAGES:&quot;);
+return lst.join(&quot;&quot;);
+}
+return &quot;&quot;;
+},debuggingBookmarklet:function(_207){
+if(typeof (MochiKit.LoggingPane)==&quot;undefined&quot;){
+alert(this.getMessageText());
+}else{
+MochiKit.LoggingPane.createLoggingPane(_207||false);
+}
+}};
+MochiKit.Logging.__new__=function(){
+this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10};
+var m=MochiKit.Base;
+m.registerComparator(&quot;LogMessage&quot;,this.isLogMessage,this.compareLogMessage);
+var _209=m.partial;
+var _20a=this.Logger;
+var _20b=_20a.prototype.baseLog;
+m.update(this.Logger.prototype,{debug:_209(_20b,&quot;DEBUG&quot;),log:_209(_20b,&quot;INFO&quot;),error:_209(_20b,&quot;ERROR&quot;),fatal:_209(_20b,&quot;FATAL&quot;),warning:_209(_20b,&quot;WARNING&quot;)});
+var self=this;
+var _20d=function(name){
+return function(){
+self.logger[name].apply(self.logger,arguments);
+};
+};
+this.log=_20d(&quot;log&quot;);
+this.logError=_20d(&quot;error&quot;);
+this.logDebug=_20d(&quot;debug&quot;);
+this.logFatal=_20d(&quot;fatal&quot;);
+this.logWarning=_20d(&quot;warning&quot;);
+this.logger=new _20a();
+this.logger.useNativeConsole=true;
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+if(typeof (printfire)==&quot;undefined&quot;&amp;&amp;typeof (document)!=&quot;undefined&quot;&amp;&amp;document.createEvent&amp;&amp;typeof (dispatchEvent)!=&quot;undefined&quot;){
+printfire=function(){
+printfire.args=arguments;
+var ev=document.createEvent(&quot;Events&quot;);
+ev.initEvent(&quot;printfire&quot;,false,true);
+dispatchEvent(ev);
+};
+}
+MochiKit.Logging.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Logging);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.DateTime&quot;);
+}
+if(typeof (MochiKit)==&quot;undefined&quot;){
+MochiKit={};
+}
+if(typeof (MochiKit.DateTime)==&quot;undefined&quot;){
+MochiKit.DateTime={};
+}
+MochiKit.DateTime.NAME=&quot;MochiKit.DateTime&quot;;
+MochiKit.DateTime.VERSION=&quot;1.4&quot;;
+MochiKit.DateTime.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.DateTime.toString=function(){
+return this.__repr__();
+};
+MochiKit.DateTime.isoDate=function(str){
+str=str+&quot;&quot;;
+if(typeof (str)!=&quot;string&quot;||str.length===0){
+return null;
+}
+var iso=str.split(&quot;-&quot;);
+if(iso.length===0){
+return null;
+}
+return new Date(iso[0],iso[1]-1,iso[2]);
+};
+MochiKit.DateTime._isoRegexp=/(\d{4,})(?:-(\d{1,2})(?:-(\d{1,2})(?:[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d+))?)?(?:(Z)|([+-])(\d{1,2})(?::(\d{1,2}))?)?)?)?)?/;
+MochiKit.DateTime.isoTimestamp=function(str){
+str=str+&quot;&quot;;
+if(typeof (str)!=&quot;string&quot;||str.length===0){
+return null;
+}
+var res=str.match(MochiKit.DateTime._isoRegexp);
+if(typeof (res)==&quot;undefined&quot;||res===null){
+return null;
+}
+var year,_215,day,hour,min,sec,msec;
+year=parseInt(res[1],10);
+if(typeof (res[2])==&quot;undefined&quot;||res[2]===&quot;&quot;){
+return new Date(year);
+}
+_215=parseInt(res[2],10)-1;
+day=parseInt(res[3],10);
+if(typeof (res[4])==&quot;undefined&quot;||res[4]===&quot;&quot;){
+return new Date(year,_215,day);
+}
+hour=parseInt(res[4],10);
+min=parseInt(res[5],10);
+sec=(typeof (res[6])!=&quot;undefined&quot;&amp;&amp;res[6]!==&quot;&quot;)?parseInt(res[6],10):0;
+if(typeof (res[7])!=&quot;undefined&quot;&amp;&amp;res[7]!==&quot;&quot;){
+msec=Math.round(1000*parseFloat(&quot;0.&quot;+res[7]));
+}else{
+msec=0;
+}
+if((typeof (res[8])==&quot;undefined&quot;||res[8]===&quot;&quot;)&amp;&amp;(typeof (res[9])==&quot;undefined&quot;||res[9]===&quot;&quot;)){
+return new Date(year,_215,day,hour,min,sec,msec);
+}
+var ofs;
+if(typeof (res[9])!=&quot;undefined&quot;&amp;&amp;res[9]!==&quot;&quot;){
+ofs=parseInt(res[10],10)*3600000;
+if(typeof (res[11])!=&quot;undefined&quot;&amp;&amp;res[11]!==&quot;&quot;){
+ofs+=parseInt(res[11],10)*60000;
+}
+if(res[9]==&quot;-&quot;){
+ofs=-ofs;
+}
+}else{
+ofs=0;
+}
+return new Date(Date.UTC(year,_215,day,hour,min,sec,msec)-ofs);
+};
+MochiKit.DateTime.toISOTime=function(date,_21d){
+if(typeof (date)==&quot;undefined&quot;||date===null){
+return null;
+}
+var hh=date.getHours();
+var mm=date.getMinutes();
+var ss=date.getSeconds();
+var lst=[((_21d&amp;&amp;(hh&lt;10))?&quot;0&quot;+hh:hh),((mm&lt;10)?&quot;0&quot;+mm:mm),((ss&lt;10)?&quot;0&quot;+ss:ss)];
+return lst.join(&quot;:&quot;);
+};
+MochiKit.DateTime.toISOTimestamp=function(date,_223){
+if(typeof (date)==&quot;undefined&quot;||date===null){
+return null;
+}
+var sep=_223?&quot;T&quot;:&quot; &quot;;
+var foot=_223?&quot;Z&quot;:&quot;&quot;;
+if(_223){
+date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
+}
+return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_223)+foot;
+};
+MochiKit.DateTime.toISODate=function(date){
+if(typeof (date)==&quot;undefined&quot;||date===null){
+return null;
+}
+var _227=MochiKit.DateTime._padTwo;
+return [date.getFullYear(),_227(date.getMonth()+1),_227(date.getDate())].join(&quot;-&quot;);
+};
+MochiKit.DateTime.americanDate=function(d){
+d=d+&quot;&quot;;
+if(typeof (d)!=&quot;string&quot;||d.length===0){
+return null;
+}
+var a=d.split(&quot;/&quot;);
+return new Date(a[2],a[0]-1,a[1]);
+};
+MochiKit.DateTime._padTwo=function(n){
+return (n&gt;9)?n:&quot;0&quot;+n;
+};
+MochiKit.DateTime.toPaddedAmericanDate=function(d){
+if(typeof (d)==&quot;undefined&quot;||d===null){
+return null;
+}
+var _22c=MochiKit.DateTime._padTwo;
+return [_22c(d.getMonth()+1),_22c(d.getDate()),d.getFullYear()].join(&quot;/&quot;);
+};
+MochiKit.DateTime.toAmericanDate=function(d){
+if(typeof (d)==&quot;undefined&quot;||d===null){
+return null;
+}
+return [d.getMonth()+1,d.getDate(),d.getFullYear()].join(&quot;/&quot;);
+};
+MochiKit.DateTime.EXPORT=[&quot;isoDate&quot;,&quot;isoTimestamp&quot;,&quot;toISOTime&quot;,&quot;toISOTimestamp&quot;,&quot;toISODate&quot;,&quot;americanDate&quot;,&quot;toPaddedAmericanDate&quot;,&quot;toAmericanDate&quot;];
+MochiKit.DateTime.EXPORT_OK=[];
+MochiKit.DateTime.EXPORT_TAGS={&quot;:common&quot;:MochiKit.DateTime.EXPORT,&quot;:all&quot;:MochiKit.DateTime.EXPORT};
+MochiKit.DateTime.__new__=function(){
+var base=this.NAME+&quot;.&quot;;
+for(var k in this){
+var o=this[k];
+if(typeof (o)==&quot;function&quot;&amp;&amp;typeof (o.NAME)==&quot;undefined&quot;){
+try{
+o.NAME=base+k;
+}
+catch(e){
+}
+}
+}
+};
+MochiKit.DateTime.__new__();
+if(typeof (MochiKit.Base)!=&quot;undefined&quot;){
+MochiKit.Base._exportSymbols(this,MochiKit.DateTime);
+}else{
+(function(_231,_232){
+if((typeof (JSAN)==&quot;undefined&quot;&amp;&amp;typeof (dojo)==&quot;undefined&quot;)||(MochiKit.__export__===false)){
+var all=_232.EXPORT_TAGS[&quot;:all&quot;];
+for(var i=0;i&lt;all.length;i++){
+_231[all[i]]=_232[all[i]];
+}
+}
+})(this,MochiKit.DateTime);
+}
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Format&quot;);
+}
+if(typeof (MochiKit)==&quot;undefined&quot;){
+MochiKit={};
+}
+if(typeof (MochiKit.Format)==&quot;undefined&quot;){
+MochiKit.Format={};
+}
+MochiKit.Format.NAME=&quot;MochiKit.Format&quot;;
+MochiKit.Format.VERSION=&quot;1.4&quot;;
+MochiKit.Format.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.Format.toString=function(){
+return this.__repr__();
+};
+MochiKit.Format._numberFormatter=function(_235,_236,_237,_238,_239,_23a,_23b,_23c,_23d){
+return function(num){
+num=parseFloat(num);
+if(typeof (num)==&quot;undefined&quot;||num===null||isNaN(num)){
+return _235;
+}
+var _23f=_236;
+var _240=_237;
+if(num&lt;0){
+num=-num;
+}else{
+_23f=_23f.replace(/-/,&quot;&quot;);
+}
+var me=arguments.callee;
+var fmt=MochiKit.Format.formatLocale(_238);
+if(_239){
+num=num*100;
+_240=fmt.percent+_240;
+}
+num=MochiKit.Format.roundToFixed(num,_23a);
+var _243=num.split(/\./);
+var _244=_243[0];
+var frac=(_243.length==1)?&quot;&quot;:_243[1];
+var res=&quot;&quot;;
+while(_244.length&lt;_23b){
+_244=&quot;0&quot;+_244;
+}
+if(_23c){
+while(_244.length&gt;_23c){
+var i=_244.length-_23c;
+res=fmt.separator+_244.substring(i,_244.length)+res;
+_244=_244.substring(0,i);
+}
+}
+res=_244+res;
+if(_23a&gt;0){
+while(frac.length&lt;_23d){
+frac=frac+&quot;0&quot;;
+}
+res=res+fmt.decimal+frac;
+}
+return _23f+res+_240;
+};
+};
+MochiKit.Format.numberFormatter=function(_248,_249,_24a){
+if(typeof (_249)==&quot;undefined&quot;){
+_249=&quot;&quot;;
+}
+var _24b=_248.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);
+if(!_24b){
+throw TypeError(&quot;Invalid pattern&quot;);
+}
+var _24c=_248.substr(0,_24b.index);
+var _24d=_248.substr(_24b.index+_24b[0].length);
+if(_24c.search(/-/)==-1){
+_24c=_24c+&quot;-&quot;;
+}
+var _24e=_24b[1];
+var frac=(typeof (_24b[2])==&quot;string&quot;&amp;&amp;_24b[2]!=&quot;&quot;)?_24b[2]:&quot;&quot;;
+var _250=(typeof (_24b[3])==&quot;string&quot;&amp;&amp;_24b[3]!=&quot;&quot;);
+var tmp=_24e.split(/,/);
+var _252;
+if(typeof (_24a)==&quot;undefined&quot;){
+_24a=&quot;default&quot;;
+}
+if(tmp.length==1){
+_252=null;
+}else{
+_252=tmp[1].length;
+}
+var _253=_24e.length-_24e.replace(/0/g,&quot;&quot;).length;
+var _254=frac.length-frac.replace(/0/g,&quot;&quot;).length;
+var _255=frac.length;
+var rval=MochiKit.Format._numberFormatter(_249,_24c,_24d,_24a,_250,_255,_253,_252,_254);
+var m=MochiKit.Base;
+if(m){
+var fn=arguments.callee;
+var args=m.concat(arguments);
+rval.repr=function(){
+return [self.NAME,&quot;(&quot;,map(m.repr,args).join(&quot;, &quot;),&quot;)&quot;].join(&quot;&quot;);
+};
+}
+return rval;
+};
+MochiKit.Format.formatLocale=function(_25a){
+if(typeof (_25a)==&quot;undefined&quot;||_25a===null){
+_25a=&quot;default&quot;;
+}
+if(typeof (_25a)==&quot;string&quot;){
+var rval=MochiKit.Format.LOCALE[_25a];
+if(typeof (rval)==&quot;string&quot;){
+rval=arguments.callee(rval);
+MochiKit.Format.LOCALE[_25a]=rval;
+}
+return rval;
+}else{
+return _25a;
+}
+};
+MochiKit.Format.twoDigitAverage=function(_25c,_25d){
+if(_25d){
+var res=_25c/_25d;
+if(!isNaN(res)){
+return MochiKit.Format.twoDigitFloat(_25c/_25d);
+}
+}
+return &quot;0&quot;;
+};
+MochiKit.Format.twoDigitFloat=function(_25f){
+var sign=(_25f&lt;0?&quot;-&quot;:&quot;&quot;);
+var s=Math.floor(Math.abs(_25f)*100).toString();
+if(s==&quot;0&quot;){
+return s;
+}
+if(s.length&lt;3){
+while(s.charAt(s.length-1)==&quot;0&quot;){
+s=s.substring(0,s.length-1);
+}
+return sign+&quot;0.&quot;+s;
+}
+var head=sign+s.substring(0,s.length-2);
+var tail=s.substring(s.length-2,s.length);
+if(tail==&quot;00&quot;){
+return head;
+}else{
+if(tail.charAt(1)==&quot;0&quot;){
+return head+&quot;.&quot;+tail.charAt(0);
+}else{
+return head+&quot;.&quot;+tail;
+}
+}
+};
+MochiKit.Format.lstrip=function(str,_265){
+str=str+&quot;&quot;;
+if(typeof (str)!=&quot;string&quot;){
+return null;
+}
+if(!_265){
+return str.replace(/^\s+/,&quot;&quot;);
+}else{
+return str.replace(new RegExp(&quot;^[&quot;+_265+&quot;]+&quot;),&quot;&quot;);
+}
+};
+MochiKit.Format.rstrip=function(str,_267){
+str=str+&quot;&quot;;
+if(typeof (str)!=&quot;string&quot;){
+return null;
+}
+if(!_267){
+return str.replace(/\s+$/,&quot;&quot;);
+}else{
+return str.replace(new RegExp(&quot;[&quot;+_267+&quot;]+$&quot;),&quot;&quot;);
+}
+};
+MochiKit.Format.strip=function(str,_269){
+var self=MochiKit.Format;
+return self.rstrip(self.lstrip(str,_269),_269);
+};
+MochiKit.Format.truncToFixed=function(_26b,_26c){
+_26b=Math.floor(_26b*Math.pow(10,_26c));
+var res=(_26b*Math.pow(10,-_26c)).toFixed(_26c);
+if(res.charAt(0)==&quot;.&quot;){
+res=&quot;0&quot;+res;
+}
+return res;
+};
+MochiKit.Format.roundToFixed=function(_26e,_26f){
+return MochiKit.Format.truncToFixed(_26e+0.5*Math.pow(10,-_26f),_26f);
+};
+MochiKit.Format.percentFormat=function(_270){
+return MochiKit.Format.twoDigitFloat(100*_270)+&quot;%&quot;;
+};
+MochiKit.Format.EXPORT=[&quot;truncToFixed&quot;,&quot;roundToFixed&quot;,&quot;numberFormatter&quot;,&quot;formatLocale&quot;,&quot;twoDigitAverage&quot;,&quot;twoDigitFloat&quot;,&quot;percentFormat&quot;,&quot;lstrip&quot;,&quot;rstrip&quot;,&quot;strip&quot;];
+MochiKit.Format.LOCALE={en_US:{separator:&quot;,&quot;,decimal:&quot;.&quot;,percent:&quot;%&quot;},de_DE:{separator:&quot;.&quot;,decimal:&quot;,&quot;,percent:&quot;%&quot;},pt_BR:{separator:&quot;.&quot;,decimal:&quot;,&quot;,percent:&quot;%&quot;},fr_FR:{separator:&quot; &quot;,decimal:&quot;,&quot;,percent:&quot;%&quot;},&quot;default&quot;:&quot;en_US&quot;};
+MochiKit.Format.EXPORT_OK=[];
+MochiKit.Format.EXPORT_TAGS={&quot;:all&quot;:MochiKit.Format.EXPORT,&quot;:common&quot;:MochiKit.Format.EXPORT};
+MochiKit.Format.__new__=function(){
+var base=this.NAME+&quot;.&quot;;
+var k,v,o;
+for(k in this.LOCALE){
+o=this.LOCALE[k];
+if(typeof (o)==&quot;object&quot;){
+o.repr=function(){
+return this.NAME;
+};
+o.NAME=base+&quot;LOCALE.&quot;+k;
+}
+}
+for(k in this){
+o=this[k];
+if(typeof (o)==&quot;function&quot;&amp;&amp;typeof (o.NAME)==&quot;undefined&quot;){
+try{
+o.NAME=base+k;
+}
+catch(e){
+}
+}
+}
+};
+MochiKit.Format.__new__();
+if(typeof (MochiKit.Base)!=&quot;undefined&quot;){
+MochiKit.Base._exportSymbols(this,MochiKit.Format);
+}else{
+(function(_275,_276){
+if((typeof (JSAN)==&quot;undefined&quot;&amp;&amp;typeof (dojo)==&quot;undefined&quot;)||(MochiKit.__export__===false)){
+var all=_276.EXPORT_TAGS[&quot;:all&quot;];
+for(var i=0;i&lt;all.length;i++){
+_275[all[i]]=_276[all[i]];
+}
+}
+})(this,MochiKit.Format);
+}
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Async&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Async depends on MochiKit.Base!&quot;;
+}
+if(typeof (MochiKit.Async)==&quot;undefined&quot;){
+MochiKit.Async={};
+}
+MochiKit.Async.NAME=&quot;MochiKit.Async&quot;;
+MochiKit.Async.VERSION=&quot;1.4&quot;;
+MochiKit.Async.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.Async.toString=function(){
+return this.__repr__();
+};
+MochiKit.Async.Deferred=function(_279){
+this.chain=[];
+this.id=this._nextId();
+this.fired=-1;
+this.paused=0;
+this.results=[null,null];
+this.canceller=_279;
+this.silentlyCancelled=false;
+this.chained=false;
+};
+MochiKit.Async.Deferred.prototype={repr:function(){
+var _27a;
+if(this.fired==-1){
+_27a=&quot;unfired&quot;;
+}else{
+if(this.fired===0){
+_27a=&quot;success&quot;;
+}else{
+_27a=&quot;error&quot;;
+}
+}
+return &quot;Deferred(&quot;+this.id+&quot;, &quot;+_27a+&quot;)&quot;;
+},toString:MochiKit.Base.forwardCall(&quot;repr&quot;),_nextId:MochiKit.Base.counter(),cancel:function(){
+var self=MochiKit.Async;
+if(this.fired==-1){
+if(this.canceller){
+this.canceller(this);
+}else{
+this.silentlyCancelled=true;
+}
+if(this.fired==-1){
+this.errback(new self.CancelledError(this));
+}
+}else{
+if((this.fired===0)&amp;&amp;(this.results[0] instanceof self.Deferred)){
+this.results[0].cancel();
+}
+}
+},_resback:function(res){
+this.fired=((res instanceof Error)?1:0);
+this.results[this.fired]=res;
+this._fire();
+},_check:function(){
+if(this.fired!=-1){
+if(!this.silentlyCancelled){
+throw new MochiKit.Async.AlreadyCalledError(this);
+}
+this.silentlyCancelled=false;
+return;
+}
+},callback:function(res){
+this._check();
+if(res instanceof MochiKit.Async.Deferred){
+throw new Error(&quot;Deferred instances can only be chained if they are the result of a callback&quot;);
+}
+this._resback(res);
+},errback:function(res){
+this._check();
+var self=MochiKit.Async;
+if(res instanceof self.Deferred){
+throw new Error(&quot;Deferred instances can only be chained if they are the result of a callback&quot;);
+}
+if(!(res instanceof Error)){
+res=new self.GenericError(res);
+}
+this._resback(res);
+},addBoth:function(fn){
+if(arguments.length&gt;1){
+fn=MochiKit.Base.partial.apply(null,arguments);
+}
+return this.addCallbacks(fn,fn);
+},addCallback:function(fn){
+if(arguments.length&gt;1){
+fn=MochiKit.Base.partial.apply(null,arguments);
+}
+return this.addCallbacks(fn,null);
+},addErrback:function(fn){
+if(arguments.length&gt;1){
+fn=MochiKit.Base.partial.apply(null,arguments);
+}
+return this.addCallbacks(null,fn);
+},addCallbacks:function(cb,eb){
+if(this.chained){
+throw new Error(&quot;Chained Deferreds can not be re-used&quot;);
+}
+this.chain.push([cb,eb]);
+if(this.fired&gt;=0){
+this._fire();
+}
+return this;
+},_fire:function(){
+var _285=this.chain;
+var _286=this.fired;
+var res=this.results[_286];
+var self=this;
+var cb=null;
+while(_285.length&gt;0&amp;&amp;this.paused===0){
+var pair=_285.shift();
+var f=pair[_286];
+if(f===null){
+continue;
+}
+try{
+res=f(res);
+_286=((res instanceof Error)?1:0);
+if(res instanceof MochiKit.Async.Deferred){
+cb=function(res){
+self._resback(res);
+self.paused--;
+if((self.paused===0)&amp;&amp;(self.fired&gt;=0)){
+self._fire();
+}
+};
+this.paused++;
+}
+}
+catch(err){
+_286=1;
+if(!(err instanceof Error)){
+err=new MochiKit.Async.GenericError(err);
+}
+res=err;
+}
+}
+this.fired=_286;
+this.results[_286]=res;
+if(cb&amp;&amp;this.paused){
+res.addBoth(cb);
+res.chained=true;
+}
+}};
+MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(req){
+return MochiKit.Base.evalJSON(req.responseText);
+},succeed:function(_28e){
+var d=new MochiKit.Async.Deferred();
+d.callback.apply(d,arguments);
+return d;
+},fail:function(_290){
+var d=new MochiKit.Async.Deferred();
+d.errback.apply(d,arguments);
+return d;
+},getXMLHttpRequest:function(){
+var self=arguments.callee;
+if(!self.XMLHttpRequest){
+var _293=[function(){
+return new XMLHttpRequest();
+},function(){
+return new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
+},function(){
+return new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
+},function(){
+return new ActiveXObject(&quot;Msxml2.XMLHTTP.4.0&quot;);
+},function(){
+throw new MochiKit.Async.BrowserComplianceError(&quot;Browser does not support XMLHttpRequest&quot;);
+}];
+for(var i=0;i&lt;_293.length;i++){
+var func=_293[i];
+try{
+self.XMLHttpRequest=func;
+return func();
+}
+catch(e){
+}
+}
+}
+return self.XMLHttpRequest();
+},_xhr_onreadystatechange:function(d){
+var m=MochiKit.Base;
+if(this.readyState==4){
+try{
+this.onreadystatechange=null;
+}
+catch(e){
+try{
+this.onreadystatechange=m.noop;
+}
+catch(e){
+}
+}
+var _298=null;
+try{
+_298=this.status;
+if(!_298&amp;&amp;m.isNotEmpty(this.responseText)){
+_298=304;
+}
+}
+catch(e){
+}
+if(_298==200||_298==201||_298==204||_298==304||_298==1223){
+d.callback(this);
+}else{
+var err=new MochiKit.Async.XMLHttpRequestError(this,&quot;Request failed&quot;);
+if(err.number){
+d.errback(err);
+}else{
+d.errback(err);
+}
+}
+}
+},_xhr_canceller:function(req){
+try{
+req.onreadystatechange=null;
+}
+catch(e){
+try{
+req.onreadystatechange=MochiKit.Base.noop;
+}
+catch(e){
+}
+}
+req.abort();
+},sendXMLHttpRequest:function(req,_29c){
+if(typeof (_29c)==&quot;undefined&quot;||_29c===null){
+_29c=&quot;&quot;;
+}
+var m=MochiKit.Base;
+var self=MochiKit.Async;
+var d=new self.Deferred(m.partial(self._xhr_canceller,req));
+try{
+req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d);
+req.send(_29c);
+}
+catch(e){
+try{
+req.onreadystatechange=null;
+}
+catch(ignore){
+}
+d.errback(e);
+}
+return d;
+},doXHR:function(url,opts){
+var self=MochiKit.Async;
+return self.callLater(0,self._doXHR,url,opts);
+},_doXHR:function(url,opts){
+var m=MochiKit.Base;
+opts=m.update({method:&quot;GET&quot;,sendContent:&quot;&quot;},opts);
+var self=MochiKit.Async;
+var req=self.getXMLHttpRequest();
+if(opts.queryString){
+var qs=m.queryString(opts.queryString);
+if(qs){
+url+=&quot;?&quot;+qs;
+}
+}
+if(&quot;username&quot; in opts){
+req.open(opts.method,url,true,opts.username,opts.password);
+}else{
+req.open(opts.method,url,true);
+}
+if(req.overrideMimeType&amp;&amp;opts.mimeType){
+req.overrideMimeType(opts.mimeType);
+}
+req.setRequestHeader(&quot;X-Requested-With&quot;,&quot;XMLHttpRequest&quot;);
+if(opts.headers){
+var _2a9=opts.headers;
+if(!m.isArrayLike(_2a9)){
+_2a9=m.items(_2a9);
+}
+for(var i=0;i&lt;_2a9.length;i++){
+var _2ab=_2a9[i];
+var name=_2ab[0];
+var _2ad=_2ab[1];
+req.setRequestHeader(name,_2ad);
+}
+}
+return self.sendXMLHttpRequest(req,opts.sendContent);
+},_buildURL:function(url){
+if(arguments.length&gt;1){
+var m=MochiKit.Base;
+var qs=m.queryString.apply(null,m.extend(null,arguments,1));
+if(qs){
+return url+&quot;?&quot;+qs;
+}
+}
+return url;
+},doSimpleXMLHttpRequest:function(url){
+var self=MochiKit.Async;
+url=self._buildURL.apply(self,arguments);
+return self.doXHR(url);
+},loadJSONDoc:function(url){
+var self=MochiKit.Async;
+url=self._buildURL.apply(self,arguments);
+var d=self.doXHR(url,{&quot;mimeType&quot;:&quot;text/plain&quot;,&quot;headers&quot;:[[&quot;Accept&quot;,&quot;application/json&quot;]]});
+d=d.addCallback(self.evalJSONRequest);
+return d;
+},wait:function(_2b6,_2b7){
+var d=new MochiKit.Async.Deferred();
+var m=MochiKit.Base;
+if(typeof (_2b7)!=&quot;undefined&quot;){
+d.addCallback(function(){
+return _2b7;
+});
+}
+var _2ba=setTimeout(m.bind(&quot;callback&quot;,d),Math.floor(_2b6*1000));
+d.canceller=function(){
+try{
+clearTimeout(_2ba);
+}
+catch(e){
+}
+};
+return d;
+},callLater:function(_2bb,func){
+var m=MochiKit.Base;
+var _2be=m.partial.apply(m,m.extend(null,arguments,1));
+return MochiKit.Async.wait(_2bb).addCallback(function(res){
+return _2be();
+});
+}});
+MochiKit.Async.DeferredLock=function(){
+this.waiting=[];
+this.locked=false;
+this.id=this._nextId();
+};
+MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){
+var d=new MochiKit.Async.Deferred();
+if(this.locked){
+this.waiting.push(d);
+}else{
+this.locked=true;
+d.callback(this);
+}
+return d;
+},release:function(){
+if(!this.locked){
+throw TypeError(&quot;Tried to release an unlocked DeferredLock&quot;);
+}
+this.locked=false;
+if(this.waiting.length&gt;0){
+this.locked=true;
+this.waiting.shift().callback(this);
+}
+},_nextId:MochiKit.Base.counter(),repr:function(){
+var _2c1;
+if(this.locked){
+_2c1=&quot;locked, &quot;+this.waiting.length+&quot; waiting&quot;;
+}else{
+_2c1=&quot;unlocked&quot;;
+}
+return &quot;DeferredLock(&quot;+this.id+&quot;, &quot;+_2c1+&quot;)&quot;;
+},toString:MochiKit.Base.forwardCall(&quot;repr&quot;)};
+MochiKit.Async.DeferredList=function(list,_2c3,_2c4,_2c5,_2c6){
+MochiKit.Async.Deferred.apply(this,[_2c6]);
+this.list=list;
+var _2c7=[];
+this.resultList=_2c7;
+this.finishedCount=0;
+this.fireOnOneCallback=_2c3;
+this.fireOnOneErrback=_2c4;
+this.consumeErrors=_2c5;
+var cb=MochiKit.Base.bind(this._cbDeferred,this);
+for(var i=0;i&lt;list.length;i++){
+var d=list[i];
+_2c7.push(undefined);
+d.addCallback(cb,i,true);
+d.addErrback(cb,i,false);
+}
+if(list.length===0&amp;&amp;!_2c3){
+this.callback(this.resultList);
+}
+};
+MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred();
+MochiKit.Async.DeferredList.prototype._cbDeferred=function(_2cb,_2cc,_2cd){
+this.resultList[_2cb]=[_2cc,_2cd];
+this.finishedCount+=1;
+if(this.fired==-1){
+if(_2cc&amp;&amp;this.fireOnOneCallback){
+this.callback([_2cb,_2cd]);
+}else{
+if(!_2cc&amp;&amp;this.fireOnOneErrback){
+this.errback(_2cd);
+}else{
+if(this.finishedCount==this.list.length){
+this.callback(this.resultList);
+}
+}
+}
+}
+if(!_2cc&amp;&amp;this.consumeErrors){
+_2cd=null;
+}
+return _2cd;
+};
+MochiKit.Async.gatherResults=function(_2ce){
+var d=new MochiKit.Async.DeferredList(_2ce,false,true,false);
+d.addCallback(function(_2d0){
+var ret=[];
+for(var i=0;i&lt;_2d0.length;i++){
+ret.push(_2d0[i][1]);
+}
+return ret;
+});
+return d;
+};
+MochiKit.Async.maybeDeferred=function(func){
+var self=MochiKit.Async;
+var _2d5;
+try{
+var r=func.apply(null,MochiKit.Base.extend([],arguments,1));
+if(r instanceof self.Deferred){
+_2d5=r;
+}else{
+if(r instanceof Error){
+_2d5=self.fail(r);
+}else{
+_2d5=self.succeed(r);
+}
+}
+}
+catch(e){
+_2d5=self.fail(e);
+}
+return _2d5;
+};
+MochiKit.Async.EXPORT=[&quot;AlreadyCalledError&quot;,&quot;CancelledError&quot;,&quot;BrowserComplianceError&quot;,&quot;GenericError&quot;,&quot;XMLHttpRequestError&quot;,&quot;Deferred&quot;,&quot;succeed&quot;,&quot;fail&quot;,&quot;getXMLHttpRequest&quot;,&quot;doSimpleXMLHttpRequest&quot;,&quot;loadJSONDoc&quot;,&quot;wait&quot;,&quot;callLater&quot;,&quot;sendXMLHttpRequest&quot;,&quot;DeferredLock&quot;,&quot;DeferredList&quot;,&quot;gatherResults&quot;,&quot;maybeDeferred&quot;,&quot;doXHR&quot;];
+MochiKit.Async.EXPORT_OK=[&quot;evalJSONRequest&quot;];
+MochiKit.Async.__new__=function(){
+var m=MochiKit.Base;
+var ne=m.partial(m._newNamedError,this);
+ne(&quot;AlreadyCalledError&quot;,function(_2d9){
+this.deferred=_2d9;
+});
+ne(&quot;CancelledError&quot;,function(_2da){
+this.deferred=_2da;
+});
+ne(&quot;BrowserComplianceError&quot;,function(msg){
+this.message=msg;
+});
+ne(&quot;GenericError&quot;,function(msg){
+this.message=msg;
+});
+ne(&quot;XMLHttpRequestError&quot;,function(req,msg){
+this.req=req;
+this.message=msg;
+try{
+this.number=req.status;
+}
+catch(e){
+}
+});
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+MochiKit.Async.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Async);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.DOM&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.DOM depends on MochiKit.Base!&quot;;
+}
+if(typeof (MochiKit.DOM)==&quot;undefined&quot;){
+MochiKit.DOM={};
+}
+MochiKit.DOM.NAME=&quot;MochiKit.DOM&quot;;
+MochiKit.DOM.VERSION=&quot;1.4&quot;;
+MochiKit.DOM.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.DOM.toString=function(){
+return this.__repr__();
+};
+MochiKit.DOM.EXPORT=[&quot;removeEmptyTextNodes&quot;,&quot;formContents&quot;,&quot;currentWindow&quot;,&quot;currentDocument&quot;,&quot;withWindow&quot;,&quot;withDocument&quot;,&quot;registerDOMConverter&quot;,&quot;coerceToDOM&quot;,&quot;createDOM&quot;,&quot;createDOMFunc&quot;,&quot;isChildNode&quot;,&quot;getNodeAttribute&quot;,&quot;removeNodeAttribute&quot;,&quot;setNodeAttribute&quot;,&quot;updateNodeAttributes&quot;,&quot;appendChildNodes&quot;,&quot;insertSiblingNodesAfter&quot;,&quot;insertSiblingNodesBefore&quot;,&quot;replaceChildNodes&quot;,&quot;removeElement&quot;,&quot;swapDOM&quot;,&quot;BUTTON&quot;,&quot;TT&quot;,&quot;PRE&quot;,&quot;H1&quot;,&quot;H2&quot;,&quot;H3&quot;,&quot;BR&quot;,&quot;CANVAS&quot;,&quot;HR&quot;,&quot;LABEL&quot;,&quot;TEXTAREA&quot;,&quot;FORM&quot;,&quot;STRONG&quot;,&quot;SELECT&quot;,&quot;OPTION&quot;,&quot;OPTGROUP&quot;,&quot;LEGEND&quot;,&quot;FIELDSET&quot;,&quot;P&quot;,&quot;UL&quot;,&quot;OL&quot;,&quot;LI&quot;,&quot;DL&quot;,&quot;DT&quot;,&quot;DD&quot;,&quot;TD&quot;,&quot;TR&quot;,&quot;THEAD&quot;,&quot;TBODY&quot;,&quot;TFOOT&quot;,&quot;TABLE&quot;,&quot;TH&quot;,&quot;INPUT&quot;,&quot;SPAN&quot;,&quot;A&quot;,&quot;DIV&quot;,&quot;IMG&quot;,&quot;getElement&quot;,&quot;$&quot;,&quot;getElementsByTagAndClassName&quot;,&quot;addToCallStack&quot;,&quot;addLoadEvent&quot;,&quot;focusOnLoad&quot;,&quot;setElementClass&quot;,&quot;toggleElementClass&quot;,&quot;addElementClass&quot;,&quot;removeElementClass&quot;,&quot;swapElementClass&quot;,&quot;hasElementClass&quot;,&quot;escapeHTML&quot;,&quot;toHTML&quot;,&quot;emitHTML&quot;,&quot;scrapeText&quot;,&quot;isParent&quot;,&quot;getFirstParentByTagAndClassName&quot;,&quot;makeClipping&quot;,&quot;undoClipping&quot;,&quot;makePositioned&quot;,&quot;undoPositioned&quot;,&quot;getFirstElementByTagAndClassName&quot;];
+MochiKit.DOM.EXPORT_OK=[&quot;domConverters&quot;];
+MochiKit.DOM.DEPRECATED=[[&quot;computedStyle&quot;,&quot;MochiKit.Style.getStyle&quot;,&quot;1.4&quot;],[&quot;elementDimensions&quot;,&quot;MochiKit.Style.getElementDimensions&quot;,&quot;1.4&quot;],[&quot;elementPosition&quot;,&quot;MochiKit.Style.getElementPosition&quot;,&quot;1.4&quot;],[&quot;hideElement&quot;,&quot;MochiKit.Style.hideElement&quot;,&quot;1.4&quot;],[&quot;setElementDimensions&quot;,&quot;MochiKit.Style.setElementDimensions&quot;,&quot;1.4&quot;],[&quot;setElementPosition&quot;,&quot;MochiKit.Style.setElementPosition&quot;,&quot;1.4&quot;],[&quot;setDisplayForElement&quot;,&quot;MochiKit.Style.setDisplayForElement&quot;,&quot;1.4&quot;],[&quot;setOpacity&quot;,&quot;MochiKit.Style.setOpacity&quot;,&quot;1.4&quot;],[&quot;showElement&quot;,&quot;MochiKit.Style.showElement&quot;,&quot;1.4&quot;],[&quot;Coordinates&quot;,&quot;MochiKit.Style.Coordinates&quot;,&quot;1.4&quot;],[&quot;Dimensions&quot;,&quot;MochiKit.Style.Dimensions&quot;,&quot;1.4&quot;]];
+MochiKit.DOM.getViewportDimensions=new Function(&quot;&quot;+&quot;if (!MochiKit[\&quot;Style\&quot;]) {&quot;+&quot;    throw new Error(\&quot;This function has been deprecated and depends on MochiKit.Style.\&quot;);&quot;+&quot;}&quot;+&quot;return MochiKit.Style.getViewportDimensions.apply(this, arguments);&quot;);
+MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){
+return MochiKit.DOM._window;
+},currentDocument:function(){
+return MochiKit.DOM._document;
+},withWindow:function(win,func){
+var self=MochiKit.DOM;
+var _2e2=self._document;
+var _2e3=self._window;
+var rval;
+try{
+self._window=win;
+self._document=win.document;
+rval=func();
+}
+catch(e){
+self._window=_2e3;
+self._document=_2e2;
+throw e;
+}
+self._window=_2e3;
+self._document=_2e2;
+return rval;
+},formContents:function(elem){
+var _2e6=[];
+var _2e7=[];
+var m=MochiKit.Base;
+var self=MochiKit.DOM;
+if(typeof (elem)==&quot;undefined&quot;||elem===null){
+elem=self._document.body;
+}else{
+elem=self.getElement(elem);
+}
+m.nodeWalk(elem,function(elem){
+var name=elem.name;
+if(m.isNotEmpty(name)){
+var _2ec=elem.tagName.toUpperCase();
+if(_2ec===&quot;INPUT&quot;&amp;&amp;(elem.type==&quot;radio&quot;||elem.type==&quot;checkbox&quot;)&amp;&amp;!elem.checked){
+return null;
+}
+if(_2ec===&quot;SELECT&quot;){
+if(elem.type==&quot;select-one&quot;){
+if(elem.selectedIndex&gt;=0){
+var opt=elem.options[elem.selectedIndex];
+var v=opt.value;
+if(!v){
+var h=opt.outerHTML;
+if(h&amp;&amp;!h.match(/^[^&gt;]+\svalue\s*=/i)){
+v=opt.text;
+}
+}
+_2e6.push(name);
+_2e7.push(v);
+return null;
+}
+_2e6.push(name);
+_2e7.push(&quot;&quot;);
+return null;
+}else{
+var opts=elem.options;
+if(!opts.length){
+_2e6.push(name);
+_2e7.push(&quot;&quot;);
+return null;
+}
+for(var i=0;i&lt;opts.length;i++){
+var opt=opts[i];
+if(!opt.selected){
+continue;
+}
+var v=opt.value;
+if(!v){
+var h=opt.outerHTML;
+if(h&amp;&amp;!h.match(/^[^&gt;]+\svalue\s*=/i)){
+v=opt.text;
+}
+}
+_2e6.push(name);
+_2e7.push(v);
+}
+return null;
+}
+}
+if(_2ec===&quot;FORM&quot;||_2ec===&quot;P&quot;||_2ec===&quot;SPAN&quot;||_2ec===&quot;DIV&quot;){
+return elem.childNodes;
+}
+_2e6.push(name);
+_2e7.push(elem.value||&quot;&quot;);
+return null;
+}
+return elem.childNodes;
+});
+return [_2e6,_2e7];
+},withDocument:function(doc,func){
+var self=MochiKit.DOM;
+var _2f5=self._document;
+var rval;
+try{
+self._document=doc;
+rval=func();
+}
+catch(e){
+self._document=_2f5;
+throw e;
+}
+self._document=_2f5;
+return rval;
+},registerDOMConverter:function(name,_2f8,wrap,_2fa){
+MochiKit.DOM.domConverters.register(name,_2f8,wrap,_2fa);
+},coerceToDOM:function(node,ctx){
+var m=MochiKit.Base;
+var im=MochiKit.Iter;
+var self=MochiKit.DOM;
+if(im){
+var iter=im.iter;
+var _301=im.repeat;
+var map=m.map;
+}
+var _303=self.domConverters;
+var _304=arguments.callee;
+var _305=m.NotFound;
+while(true){
+if(typeof (node)==&quot;undefined&quot;||node===null){
+return null;
+}
+if(typeof (node)==&quot;function&quot;&amp;&amp;typeof (node.length)==&quot;number&quot;&amp;&amp;!(node instanceof Function)){
+node=im.list(node);
+}
+if(typeof (node.nodeType)!=&quot;undefined&quot;&amp;&amp;node.nodeType&gt;0){
+return node;
+}
+if(typeof (node)==&quot;number&quot;||typeof (node)==&quot;boolean&quot;){
+node=node.toString();
+}
+if(typeof (node)==&quot;string&quot;){
+return self._document.createTextNode(node);
+}
+if(typeof (node.__dom__)==&quot;function&quot;){
+node=node.__dom__(ctx);
+continue;
+}
+if(typeof (node.dom)==&quot;function&quot;){
+node=node.dom(ctx);
+continue;
+}
+if(typeof (node)==&quot;function&quot;){
+node=node.apply(ctx,[ctx]);
+continue;
+}
+if(im){
+var _306=null;
+try{
+_306=iter(node);
+}
+catch(e){
+}
+if(_306){
+return map(_304,_306,_301(ctx));
+}
+}
+try{
+node=_303.match(node,ctx);
+continue;
+}
+catch(e){
+if(e!=_305){
+throw e;
+}
+}
+return self._document.createTextNode(node.toString());
+}
+return undefined;
+},isChildNode:function(node,_308){
+var self=MochiKit.DOM;
+if(typeof (node)==&quot;string&quot;){
+node=self.getElement(node);
+}
+if(typeof (_308)==&quot;string&quot;){
+_308=self.getElement(_308);
+}
+if(typeof (node)==&quot;undefined&quot;||node===null||node===self._document){
+return false;
+}
+do{
+if(node===_308){
+return true;
+}
+var _30a=node.tagName;
+node=node.parentNode;
+if(!_30a){
+break;
+}
+_30a=_30a.toUpperCase();
+}while(_30a!=&quot;BODY&quot;&amp;&amp;_30a!=&quot;HTML&quot;);
+return false;
+},setNodeAttribute:function(node,attr,_30d){
+var o={};
+o[attr]=_30d;
+try{
+return MochiKit.DOM.updateNodeAttributes(node,o);
+}
+catch(e){
+}
+return null;
+},getNodeAttribute:function(node,attr){
+var self=MochiKit.DOM;
+var _312=self.attributeArray.renames[attr];
+node=self.getElement(node);
+try{
+if(_312){
+return node[_312];
+}
+return node.getAttribute(attr);
+}
+catch(e){
+}
+return null;
+},removeNodeAttribute:function(node,attr){
+var self=MochiKit.DOM;
+var _316=self.attributeArray.renames[attr];
+node=self.getElement(node);
+try{
+if(_316){
+return node[_316];
+}
+return node.removeAttribute(attr);
+}
+catch(e){
+}
+return null;
+},updateNodeAttributes:function(node,_318){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)==&quot;string&quot;){
+elem=self.getElement(node);
+}
+if(_318){
+var _31b=MochiKit.Base.updatetree;
+if(self.attributeArray.compliant){
+for(var k in _318){
+var v=_318[k];
+if(typeof (v)==&quot;object&quot;&amp;&amp;typeof (elem[k])==&quot;object&quot;){
+if(k==&quot;style&quot;&amp;&amp;MochiKit.Style){
+MochiKit.Style.setStyle(elem,v);
+}else{
+_31b(elem[k],v);
+}
+}else{
+if(k.substring(0,2)==&quot;on&quot;){
+if(typeof (v)==&quot;string&quot;){
+v=new Function(v);
+}
+elem[k]=v;
+}else{
+elem.setAttribute(k,v);
+}
+}
+}
+}else{
+var _31e=self.attributeArray.renames;
+for(var k in _318){
+v=_318[k];
+var _31f=_31e[k];
+if(k==&quot;style&quot;&amp;&amp;typeof (v)==&quot;string&quot;){
+elem.style.cssText=v;
+}else{
+if(typeof (_31f)==&quot;string&quot;){
+elem[_31f]=v;
+}else{
+if(typeof (elem[k])==&quot;object&quot;&amp;&amp;typeof (v)==&quot;object&quot;){
+if(k==&quot;style&quot;&amp;&amp;MochiKit.Style){
+MochiKit.Style.setStyle(elem,v);
+}else{
+_31b(elem[k],v);
+}
+}else{
+if(k.substring(0,2)==&quot;on&quot;){
+if(typeof (v)==&quot;string&quot;){
+v=new Function(v);
+}
+elem[k]=v;
+}else{
+elem.setAttribute(k,v);
+}
+}
+}
+}
+}
+}
+}
+return elem;
+},appendChildNodes:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)==&quot;string&quot;){
+elem=self.getElement(node);
+}
+var _323=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
+var _324=MochiKit.Base.concat;
+while(_323.length){
+var n=_323.shift();
+if(typeof (n)==&quot;undefined&quot;||n===null){
+}else{
+if(typeof (n.nodeType)==&quot;number&quot;){
+elem.appendChild(n);
+}else{
+_323=_324(n,_323);
+}
+}
+}
+return elem;
+},insertSiblingNodesBefore:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)==&quot;string&quot;){
+elem=self.getElement(node);
+}
+var _329=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
+var _32a=elem.parentNode;
+var _32b=MochiKit.Base.concat;
+while(_329.length){
+var n=_329.shift();
+if(typeof (n)==&quot;undefined&quot;||n===null){
+}else{
+if(typeof (n.nodeType)==&quot;number&quot;){
+_32a.insertBefore(n,elem);
+}else{
+_329=_32b(n,_329);
+}
+}
+}
+return _32a;
+},insertSiblingNodesAfter:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)==&quot;string&quot;){
+elem=self.getElement(node);
+}
+var _330=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
+if(elem.nextSibling){
+return self.insertSiblingNodesBefore(elem.nextSibling,_330);
+}else{
+return self.appendChildNodes(elem.parentNode,_330);
+}
+},replaceChildNodes:function(node){
+var elem=node;
+var self=MochiKit.DOM;
+if(typeof (node)==&quot;string&quot;){
+elem=self.getElement(node);
+arguments[0]=elem;
+}
+var _334;
+while((_334=elem.firstChild)){
+elem.removeChild(_334);
+}
+if(arguments.length&lt;2){
+return elem;
+}else{
+return self.appendChildNodes.apply(this,arguments);
+}
+},createDOM:function(name,_336){
+var elem;
+var self=MochiKit.DOM;
+var m=MochiKit.Base;
+if(typeof (_336)==&quot;string&quot;||typeof (_336)==&quot;number&quot;){
+var args=m.extend([name,null],arguments,1);
+return arguments.callee.apply(this,args);
+}
+if(typeof (name)==&quot;string&quot;){
+var _33b=self._xhtml;
+if(_336&amp;&amp;!self.attributeArray.compliant){
+var _33c=&quot;&quot;;
+if(&quot;name&quot; in _336){
+_33c+=&quot; name=\&quot;&quot;+self.escapeHTML(_336.name)+&quot;\&quot;&quot;;
+}
+if(name==&quot;input&quot;&amp;&amp;&quot;type&quot; in _336){
+_33c+=&quot; type=\&quot;&quot;+self.escapeHTML(_336.type)+&quot;\&quot;&quot;;
+}
+if(_33c){
+name=&quot;&lt;&quot;+name+_33c+&quot;&gt;&quot;;
+_33b=false;
+}
+}
+var d=self._document;
+if(_33b&amp;&amp;d===document){
+elem=d.createElementNS(&quot;http://www.w3.org/1999/xhtml&quot;,name);
+}else{
+elem=d.createElement(name);
+}
+}else{
+elem=name;
+}
+if(_336){
+self.updateNodeAttributes(elem,_336);
+}
+if(arguments.length&lt;=2){
+return elem;
+}else{
+var args=m.extend([elem],arguments,2);
+return self.appendChildNodes.apply(this,args);
+}
+},createDOMFunc:function(){
+var m=MochiKit.Base;
+return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
+},removeElement:function(elem){
+var e=MochiKit.DOM.getElement(elem);
+e.parentNode.removeChild(e);
+return e;
+},swapDOM:function(dest,src){
+var self=MochiKit.DOM;
+dest=self.getElement(dest);
+var _344=dest.parentNode;
+if(src){
+src=self.getElement(src);
+_344.replaceChild(src,dest);
+}else{
+_344.removeChild(dest);
+}
+return src;
+},getElement:function(id){
+var self=MochiKit.DOM;
+if(arguments.length==1){
+return ((typeof (id)==&quot;string&quot;)?self._document.getElementById(id):id);
+}else{
+return MochiKit.Base.map(self.getElement,arguments);
+}
+},getElementsByTagAndClassName:function(_347,_348,_349){
+var self=MochiKit.DOM;
+if(typeof (_347)==&quot;undefined&quot;||_347===null){
+_347=&quot;*&quot;;
+}
+if(typeof (_349)==&quot;undefined&quot;||_349===null){
+_349=self._document;
+}
+_349=self.getElement(_349);
+var _34b=(_349.getElementsByTagName(_347)||self._document.all);
+if(typeof (_348)==&quot;undefined&quot;||_348===null){
+return MochiKit.Base.extend(null,_34b);
+}
+var _34c=[];
+for(var i=0;i&lt;_34b.length;i++){
+var _34e=_34b[i];
+var cls=_34e.className;
+if(!cls){
+continue;
+}
+var _350=cls.split(&quot; &quot;);
+for(var j=0;j&lt;_350.length;j++){
+if(_350[j]==_348){
+_34c.push(_34e);
+break;
+}
+}
+}
+return _34c;
+},_newCallStack:function(path,once){
+var rval=function(){
+var _355=arguments.callee.callStack;
+for(var i=0;i&lt;_355.length;i++){
+if(_355[i].apply(this,arguments)===false){
+break;
+}
+}
+if(once){
+try{
+this[path]=null;
+}
+catch(e){
+}
+}
+};
+rval.callStack=[];
+return rval;
+},addToCallStack:function(_357,path,func,once){
+var self=MochiKit.DOM;
+var _35c=_357[path];
+var _35d=_35c;
+if(!(typeof (_35c)==&quot;function&quot;&amp;&amp;typeof (_35c.callStack)==&quot;object&quot;&amp;&amp;_35c.callStack!==null)){
+_35d=self._newCallStack(path,once);
+if(typeof (_35c)==&quot;function&quot;){
+_35d.callStack.push(_35c);
+}
+_357[path]=_35d;
+}
+_35d.callStack.push(func);
+},addLoadEvent:function(func){
+var self=MochiKit.DOM;
+self.addToCallStack(self._window,&quot;onload&quot;,func,true);
+},focusOnLoad:function(_360){
+var self=MochiKit.DOM;
+self.addLoadEvent(function(){
+_360=self.getElement(_360);
+if(_360){
+_360.focus();
+}
+});
+},setElementClass:function(_362,_363){
+var self=MochiKit.DOM;
+var obj=self.getElement(_362);
+if(self.attributeArray.compliant){
+obj.setAttribute(&quot;class&quot;,_363);
+}else{
+obj.setAttribute(&quot;className&quot;,_363);
+}
+},toggleElementClass:function(_366){
+var self=MochiKit.DOM;
+for(var i=1;i&lt;arguments.length;i++){
+var obj=self.getElement(arguments[i]);
+if(!self.addElementClass(obj,_366)){
+self.removeElementClass(obj,_366);
+}
+}
+},addElementClass:function(_36a,_36b){
+var self=MochiKit.DOM;
+var obj=self.getElement(_36a);
+var cls=obj.className;
+if(cls==undefined||cls.length===0){
+self.setElementClass(obj,_36b);
+return true;
+}
+if(cls==_36b){
+return false;
+}
+var _36f=cls.split(&quot; &quot;);
+for(var i=0;i&lt;_36f.length;i++){
+if(_36f[i]==_36b){
+return false;
+}
+}
+self.setElementClass(obj,cls+&quot; &quot;+_36b);
+return true;
+},removeElementClass:function(_371,_372){
+var self=MochiKit.DOM;
+var obj=self.getElement(_371);
+var cls=obj.className;
+if(cls==undefined||cls.length===0){
+return false;
+}
+if(cls==_372){
+self.setElementClass(obj,&quot;&quot;);
+return true;
+}
+var _376=cls.split(&quot; &quot;);
+for(var i=0;i&lt;_376.length;i++){
+if(_376[i]==_372){
+_376.splice(i,1);
+self.setElementClass(obj,_376.join(&quot; &quot;));
+return true;
+}
+}
+return false;
+},swapElementClass:function(_378,_379,_37a){
+var obj=MochiKit.DOM.getElement(_378);
+var res=MochiKit.DOM.removeElementClass(obj,_379);
+if(res){
+MochiKit.DOM.addElementClass(obj,_37a);
+}
+return res;
+},hasElementClass:function(_37d,_37e){
+var obj=MochiKit.DOM.getElement(_37d);
+var cls=obj.className;
+if(!cls){
+return false;
+}
+var _381=cls.split(&quot; &quot;);
+for(var i=1;i&lt;arguments.length;i++){
+var good=false;
+for(var j=0;j&lt;_381.length;j++){
+if(_381[j]==arguments[i]){
+good=true;
+break;
+}
+}
+if(!good){
+return false;
+}
+}
+return true;
+},escapeHTML:function(s){
+return s.replace(/&amp;/g,&quot;&amp;amp;&quot;).replace(/&quot;/g,&quot;&amp;quot;&quot;).replace(/&lt;/g,&quot;&amp;lt;&quot;).replace(/&gt;/g,&quot;&amp;gt;&quot;);
+},toHTML:function(dom){
+return MochiKit.DOM.emitHTML(dom).join(&quot;&quot;);
+},emitHTML:function(dom,lst){
+if(typeof (lst)==&quot;undefined&quot;||lst===null){
+lst=[];
+}
+var _389=[dom];
+var self=MochiKit.DOM;
+var _38b=self.escapeHTML;
+var _38c=self.attributeArray;
+while(_389.length){
+dom=_389.pop();
+if(typeof (dom)==&quot;string&quot;){
+lst.push(dom);
+}else{
+if(dom.nodeType==1){
+lst.push(&quot;&lt;&quot;+dom.tagName.toLowerCase());
+var _38d=[];
+var _38e=_38c(dom);
+for(var i=0;i&lt;_38e.length;i++){
+var a=_38e[i];
+_38d.push([&quot; &quot;,a.name,&quot;=\&quot;&quot;,_38b(a.value),&quot;\&quot;&quot;]);
+}
+_38d.sort();
+for(i=0;i&lt;_38d.length;i++){
+var _391=_38d[i];
+for(var j=0;j&lt;_391.length;j++){
+lst.push(_391[j]);
+}
+}
+if(dom.hasChildNodes()){
+lst.push(&quot;&gt;&quot;);
+_389.push(&quot;&lt;/&quot;+dom.tagName.toLowerCase()+&quot;&gt;&quot;);
+var _393=dom.childNodes;
+for(i=_393.length-1;i&gt;=0;i--){
+_389.push(_393[i]);
+}
+}else{
+lst.push(&quot;/&gt;&quot;);
+}
+}else{
+if(dom.nodeType==3){
+lst.push(_38b(dom.nodeValue));
+}
+}
+}
+}
+return lst;
+},scrapeText:function(node,_395){
+var rval=[];
+(function(node){
+var cn=node.childNodes;
+if(cn){
+for(var i=0;i&lt;cn.length;i++){
+arguments.callee.call(this,cn[i]);
+}
+}
+var _39a=node.nodeValue;
+if(typeof (_39a)==&quot;string&quot;){
+rval.push(_39a);
+}
+})(MochiKit.DOM.getElement(node));
+if(_395){
+return rval;
+}else{
+return rval.join(&quot;&quot;);
+}
+},removeEmptyTextNodes:function(_39b){
+_39b=MochiKit.DOM.getElement(_39b);
+for(var i=0;i&lt;_39b.childNodes.length;i++){
+var node=_39b.childNodes[i];
+if(node.nodeType==3&amp;&amp;!/\S/.test(node.nodeValue)){
+node.parentNode.removeChild(node);
+}
+}
+},makeClipping:function(_39e){
+_39e=MochiKit.DOM.getElement(_39e);
+var _39f=_39e.style.overflow;
+if((MochiKit.Style.getStyle(_39e,&quot;overflow&quot;)||&quot;visible&quot;)!=&quot;hidden&quot;){
+_39e.style.overflow=&quot;hidden&quot;;
+}
+return _39f;
+},undoClipping:function(_3a0,_3a1){
+_3a0=MochiKit.DOM.getElement(_3a0);
+if(!_3a1){
+return;
+}
+_3a0.style.overflow=_3a1;
+},makePositioned:function(_3a2){
+_3a2=MochiKit.DOM.getElement(_3a2);
+var pos=MochiKit.Style.getStyle(_3a2,&quot;position&quot;);
+if(pos==&quot;static&quot;||!pos){
+_3a2.style.position=&quot;relative&quot;;
+if(/Opera/.test(navigator.userAgent)){
+_3a2.style.top=0;
+_3a2.style.left=0;
+}
+}
+},undoPositioned:function(_3a4){
+_3a4=MochiKit.DOM.getElement(_3a4);
+if(_3a4.style.position==&quot;relative&quot;){
+_3a4.style.position=_3a4.style.top=_3a4.style.left=_3a4.style.bottom=_3a4.style.right=&quot;&quot;;
+}
+},getFirstElementByTagAndClassName:function(_3a5,_3a6,_3a7){
+var self=MochiKit.DOM;
+if(typeof (_3a5)==&quot;undefined&quot;||_3a5===null){
+_3a5=&quot;*&quot;;
+}
+if(typeof (_3a7)==&quot;undefined&quot;||_3a7===null){
+_3a7=self._document;
+}
+_3a7=self.getElement(_3a7);
+var _3a9=(_3a7.getElementsByTagName(_3a5)||self._document.all);
+if(typeof (_3a6)==&quot;undefined&quot;||_3a6===null){
+return _3a9[0];
+}
+for(var i=0;i&lt;_3a9.length;i++){
+var _3ab=_3a9[i];
+var _3ac=_3ab.className.split(&quot; &quot;);
+for(var j=0;j&lt;_3ac.length;j++){
+if(_3ac[j]==_3a6){
+return _3ab;
+}
+}
+}
+},getFirstParentByTagAndClassName:function(elem,_3af,_3b0){
+var self=MochiKit.DOM;
+elem=self.getElement(elem);
+if(typeof (_3af)==&quot;undefined&quot;||_3af===null){
+_3af=&quot;*&quot;;
+}else{
+_3af=_3af.toUpperCase();
+}
+if(typeof (_3b0)==&quot;undefined&quot;||_3b0===null){
+_3b0=null;
+}
+var _3b2=&quot;&quot;;
+var _3b3=&quot;&quot;;
+while(elem&amp;&amp;elem.tagName){
+elem=elem.parentNode;
+if(_3af==&quot;*&quot;&amp;&amp;_3b0===null){
+return elem;
+}
+_3b2=elem.className.split(&quot; &quot;);
+_3b3=elem.tagName.toUpperCase();
+if(_3b0===null&amp;&amp;_3af==_3b3){
+return elem;
+}else{
+if(_3b0!==null){
+for(var i=0;i&lt;_3b2.length;i++){
+if(_3af==&quot;*&quot;&amp;&amp;_3b2[i]==_3b0){
+return elem;
+}else{
+if(_3af==_3b3&amp;&amp;_3b2[i]==_3b0){
+return elem;
+}
+}
+}
+}
+}
+}
+return elem;
+},isParent:function(_3b5,_3b6){
+if(!_3b5.parentNode||_3b5==_3b6){
+return false;
+}
+if(_3b5.parentNode==_3b6){
+return true;
+}
+return MochiKit.DOM.isParent(_3b5.parentNode,_3b6);
+},__new__:function(win){
+var m=MochiKit.Base;
+if(typeof (document)!=&quot;undefined&quot;){
+this._document=document;
+var _3b9=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;;
+this._xhtml=(document.documentElement&amp;&amp;document.createElementNS&amp;&amp;document.documentElement.namespaceURI===_3b9);
+}else{
+if(MochiKit.MockDOM){
+this._document=MochiKit.MockDOM.document;
+}
+}
+this._window=win;
+this.domConverters=new m.AdapterRegistry();
+var _3ba=this._document.createElement(&quot;span&quot;);
+var _3bb;
+if(_3ba&amp;&amp;_3ba.attributes&amp;&amp;_3ba.attributes.length&gt;0){
+var _3bc=m.filter;
+_3bb=function(node){
+return _3bc(_3bb.ignoreAttrFilter,node.attributes);
+};
+_3bb.ignoreAttr={};
+var _3be=_3ba.attributes;
+var _3bf=_3bb.ignoreAttr;
+for(var i=0;i&lt;_3be.length;i++){
+var a=_3be[i];
+_3bf[a.name]=a.value;
+}
+_3bb.ignoreAttrFilter=function(a){
+return (_3bb.ignoreAttr[a.name]!=a.value);
+};
+_3bb.compliant=false;
+_3bb.renames={&quot;class&quot;:&quot;className&quot;,&quot;checked&quot;:&quot;defaultChecked&quot;,&quot;usemap&quot;:&quot;useMap&quot;,&quot;for&quot;:&quot;htmlFor&quot;,&quot;readonly&quot;:&quot;readOnly&quot;,&quot;colspan&quot;:&quot;colSpan&quot;,&quot;bgcolor&quot;:&quot;bgColor&quot;,&quot;cellspacing&quot;:&quot;cellSpacing&quot;,&quot;cellpadding&quot;:&quot;cellPadding&quot;};
+}else{
+_3bb=function(node){
+return node.attributes;
+};
+_3bb.compliant=true;
+_3bb.renames={};
+}
+this.attributeArray=_3bb;
+var _3c4=function(_3c5,arr){
+var _3c7=arr[1].split(&quot;.&quot;);
+var str=&quot;&quot;;
+var obj={};
+str+=&quot;if (!MochiKit.&quot;+_3c7[1]+&quot;) { throw new Error(\&quot;&quot;;
+str+=&quot;This function has been deprecated and depends on MochiKit.&quot;;
+str+=_3c7[1]+&quot;.\&quot;);}&quot;;
+str+=&quot;return MochiKit.&quot;+_3c7[1]+&quot;.&quot;+arr[0];
+str+=&quot;.apply(this, arguments);&quot;;
+obj[_3c7[2]]=new Function(str);
+MochiKit.Base.update(MochiKit[_3c5],obj);
+};
+for(var i;i&lt;MochiKit.DOM.DEPRECATED.length;i++){
+_3c4(&quot;DOM&quot;,MochiKit.DOM.DEPRECATED[i]);
+}
+var _3ca=this.createDOMFunc;
+this.UL=_3ca(&quot;ul&quot;);
+this.OL=_3ca(&quot;ol&quot;);
+this.LI=_3ca(&quot;li&quot;);
+this.DL=_3ca(&quot;dl&quot;);
+this.DT=_3ca(&quot;dt&quot;);
+this.DD=_3ca(&quot;dd&quot;);
+this.TD=_3ca(&quot;td&quot;);
+this.TR=_3ca(&quot;tr&quot;);
+this.TBODY=_3ca(&quot;tbody&quot;);
+this.THEAD=_3ca(&quot;thead&quot;);
+this.TFOOT=_3ca(&quot;tfoot&quot;);
+this.TABLE=_3ca(&quot;table&quot;);
+this.TH=_3ca(&quot;th&quot;);
+this.INPUT=_3ca(&quot;input&quot;);
+this.SPAN=_3ca(&quot;span&quot;);
+this.A=_3ca(&quot;a&quot;);
+this.DIV=_3ca(&quot;div&quot;);
+this.IMG=_3ca(&quot;img&quot;);
+this.BUTTON=_3ca(&quot;button&quot;);
+this.TT=_3ca(&quot;tt&quot;);
+this.PRE=_3ca(&quot;pre&quot;);
+this.H1=_3ca(&quot;h1&quot;);
+this.H2=_3ca(&quot;h2&quot;);
+this.H3=_3ca(&quot;h3&quot;);
+this.BR=_3ca(&quot;br&quot;);
+this.HR=_3ca(&quot;hr&quot;);
+this.LABEL=_3ca(&quot;label&quot;);
+this.TEXTAREA=_3ca(&quot;textarea&quot;);
+this.FORM=_3ca(&quot;form&quot;);
+this.P=_3ca(&quot;p&quot;);
+this.SELECT=_3ca(&quot;select&quot;);
+this.OPTION=_3ca(&quot;option&quot;);
+this.OPTGROUP=_3ca(&quot;optgroup&quot;);
+this.LEGEND=_3ca(&quot;legend&quot;);
+this.FIELDSET=_3ca(&quot;fieldset&quot;);
+this.STRONG=_3ca(&quot;strong&quot;);
+this.CANVAS=_3ca(&quot;canvas&quot;);
+this.$=this.getElement;
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+}});
+MochiKit.DOM.__new__(((typeof (window)==&quot;undefined&quot;)?this:window));
+if(MochiKit.__export__){
+withWindow=MochiKit.DOM.withWindow;
+withDocument=MochiKit.DOM.withDocument;
+}
+MochiKit.Base._exportSymbols(this,MochiKit.DOM);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Selector&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+dojo.require(&quot;MochiKit.DOM&quot;);
+dojo.require(&quot;MochiKit.Iter&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+JSAN.use(&quot;MochiKit.DOM&quot;,[]);
+JSAN.use(&quot;MochiKit.Iter&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)===&quot;undefined&quot;||typeof (MochiKit.DOM)===&quot;undefined&quot;||typeof (MochiKit.Iter)===&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Selector depends on MochiKit.Base, MochiKit.DOM and MochiKit.Iter!&quot;;
+}
+if(typeof (MochiKit.Selector)==&quot;undefined&quot;){
+MochiKit.Selector={};
+}
+MochiKit.Selector.NAME=&quot;MochiKit.Selector&quot;;
+MochiKit.Selector.VERSION=&quot;1.4&quot;;
+MochiKit.Selector.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.Selector.toString=function(){
+return this.__repr__();
+};
+MochiKit.Selector.EXPORT=[&quot;Selector&quot;,&quot;findChildElements&quot;,&quot;findDocElements&quot;,&quot;$$&quot;];
+MochiKit.Selector.EXPORT_OK=[];
+MochiKit.Selector.Selector=function(_3cb){
+this.params={classNames:[],pseudoClassNames:[]};
+this.expression=_3cb.toString().replace(/(^\s+|\s+$)/g,&quot;&quot;);
+this.parseExpression();
+this.compileMatcher();
+};
+MochiKit.Selector.Selector.prototype={__class__:MochiKit.Selector.Selector,parseExpression:function(){
+function abort(_3cc){
+throw &quot;Parse error in selector: &quot;+_3cc;
+}
+if(this.expression==&quot;&quot;){
+abort(&quot;empty expression&quot;);
+}
+var repr=MochiKit.Base.repr;
+var _3ce=this.params;
+var expr=this.expression;
+var _3d0,_3d1,_3d2,rest;
+while(_3d0=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!^$*]?=)(?:&quot;([^&quot;]*)&quot;|([^\]\s]*)))?\]$/i)){
+_3ce.attributes=_3ce.attributes||[];
+_3ce.attributes.push({name:_3d0[2],operator:_3d0[3],value:_3d0[4]||_3d0[5]||&quot;&quot;});
+expr=_3d0[1];
+}
+if(expr==&quot;*&quot;){
+return this.params.wildcard=true;
+}
+while(_3d0=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+(?:\([^)]*\))?)(.*)/i)){
+_3d1=_3d0[1];
+_3d2=_3d0[2];
+rest=_3d0[3];
+switch(_3d1){
+case &quot;#&quot;:
+_3ce.id=_3d2;
+break;
+case &quot;.&quot;:
+_3ce.classNames.push(_3d2);
+break;
+case &quot;:&quot;:
+_3ce.pseudoClassNames.push(_3d2);
+break;
+case &quot;&quot;:
+case undefined:
+_3ce.tagName=_3d2.toUpperCase();
+break;
+default:
+abort(repr(expr));
+}
+expr=rest;
+}
+if(expr.length&gt;0){
+abort(repr(expr));
+}
+},buildMatchExpression:function(){
+var repr=MochiKit.Base.repr;
+var _3d5=this.params;
+var _3d6=[];
+var _3d7,i;
+function childElements(_3d9){
+return &quot;MochiKit.Base.filter(function (node) { return node.nodeType == 1; }, &quot;+_3d9+&quot;.childNodes)&quot;;
+}
+if(_3d5.wildcard){
+_3d6.push(&quot;true&quot;);
+}
+if(_3d7=_3d5.id){
+_3d6.push(&quot;element.id == &quot;+repr(_3d7));
+}
+if(_3d7=_3d5.tagName){
+_3d6.push(&quot;element.tagName.toUpperCase() == &quot;+repr(_3d7));
+}
+if((_3d7=_3d5.classNames).length&gt;0){
+for(i=0;i&lt;_3d7.length;i++){
+_3d6.push(&quot;MochiKit.DOM.hasElementClass(element, &quot;+repr(_3d7[i])+&quot;)&quot;);
+}
+}
+if((_3d7=_3d5.pseudoClassNames).length&gt;0){
+for(i=0;i&lt;_3d7.length;i++){
+var _3da=_3d7[i].match(/^([^(]+)(?:\((.*)\))?$/);
+var _3db=_3da[1];
+var _3dc=_3da[2];
+switch(_3db){
+case &quot;root&quot;:
+_3d6.push(&quot;element.nodeType == 9 || element === element.ownerDocument.documentElement&quot;);
+break;
+case &quot;nth-child&quot;:
+case &quot;nth-last-child&quot;:
+case &quot;nth-of-type&quot;:
+case &quot;nth-last-of-type&quot;:
+_3da=_3dc.match(/^((?:(\d+)n\+)?(\d+)|odd|even)$/);
+if(!_3da){
+throw &quot;Invalid argument to pseudo element nth-child: &quot;+_3dc;
+}
+var a,b;
+if(_3da[0]==&quot;odd&quot;){
+a=2;
+b=1;
+}else{
+if(_3da[0]==&quot;even&quot;){
+a=2;
+b=0;
+}else{
+a=_3da[2]&amp;&amp;parseInt(_3da)||null;
+b=parseInt(_3da[3]);
+}
+}
+_3d6.push(&quot;this.nthChild(element,&quot;+a+&quot;,&quot;+b+&quot;,&quot;+!!_3db.match(&quot;^nth-last&quot;)+&quot;,&quot;+!!_3db.match(&quot;of-type$&quot;)+&quot;)&quot;);
+break;
+case &quot;first-child&quot;:
+_3d6.push(&quot;this.nthChild(element, null, 1)&quot;);
+break;
+case &quot;last-child&quot;:
+_3d6.push(&quot;this.nthChild(element, null, 1, true)&quot;);
+break;
+case &quot;first-of-type&quot;:
+_3d6.push(&quot;this.nthChild(element, null, 1, false, true)&quot;);
+break;
+case &quot;last-of-type&quot;:
+_3d6.push(&quot;this.nthChild(element, null, 1, true, true)&quot;);
+break;
+case &quot;only-child&quot;:
+_3d6.push(childElements(&quot;element.parentNode&quot;)+&quot;.length == 1&quot;);
+break;
+case &quot;only-of-type&quot;:
+_3d6.push(&quot;MochiKit.Base.filter(function (node) { return node.tagName == element.tagName; }, &quot;+childElements(&quot;element.parentNode&quot;)+&quot;).length == 1&quot;);
+break;
+case &quot;empty&quot;:
+_3d6.push(&quot;element.childNodes.length == 0&quot;);
+break;
+case &quot;enabled&quot;:
+_3d6.push(&quot;(this.isUIElement(element) &amp;&amp; element.disabled === false)&quot;);
+break;
+case &quot;disabled&quot;:
+_3d6.push(&quot;(this.isUIElement(element) &amp;&amp; element.disabled === true)&quot;);
+break;
+case &quot;checked&quot;:
+_3d6.push(&quot;(this.isUIElement(element) &amp;&amp; element.checked === true)&quot;);
+break;
+case &quot;not&quot;:
+var _3df=new MochiKit.Selector.Selector(_3dc);
+_3d6.push(&quot;!( &quot;+_3df.buildMatchExpression()+&quot;)&quot;);
+break;
+}
+}
+}
+if(_3d7=_3d5.attributes){
+MochiKit.Base.map(function(_3e0){
+var _3e1=&quot;MochiKit.DOM.getNodeAttribute(element, &quot;+repr(_3e0.name)+&quot;)&quot;;
+var _3e2=function(_3e3){
+return _3e1+&quot;.split(&quot;+repr(_3e3)+&quot;)&quot;;
+};
+switch(_3e0.operator){
+case &quot;=&quot;:
+_3d6.push(_3e1+&quot; == &quot;+repr(_3e0.value));
+break;
+case &quot;~=&quot;:
+_3d6.push(_3e1+&quot; &amp;&amp; MochiKit.Base.findValue(&quot;+_3e2(&quot; &quot;)+&quot;, &quot;+repr(_3e0.value)+&quot;) &gt; -1&quot;);
+break;
+case &quot;^=&quot;:
+_3d6.push(_3e1+&quot;.substring(0, &quot;+_3e0.value.length+&quot;) == &quot;+repr(_3e0.value));
+break;
+case &quot;$=&quot;:
+_3d6.push(_3e1+&quot;.substring(&quot;+_3e1+&quot;.length - &quot;+_3e0.value.length+&quot;) == &quot;+repr(_3e0.value));
+break;
+case &quot;*=&quot;:
+_3d6.push(_3e1+&quot;.match(&quot;+repr(_3e0.value)+&quot;)&quot;);
+break;
+case &quot;|=&quot;:
+_3d6.push(_3e1+&quot; &amp;&amp; &quot;+_3e2(&quot;-&quot;)+&quot;[0].toUpperCase() == &quot;+repr(_3e0.value.toUpperCase()));
+break;
+case &quot;!=&quot;:
+_3d6.push(_3e1+&quot; != &quot;+repr(_3e0.value));
+break;
+case &quot;&quot;:
+case undefined:
+_3d6.push(_3e1+&quot; != null&quot;);
+break;
+default:
+throw &quot;Unknown operator &quot;+_3e0.operator+&quot; in selector&quot;;
+}
+},_3d7);
+}
+return _3d6.join(&quot; &amp;&amp; &quot;);
+},compileMatcher:function(){
+this.match=new Function(&quot;element&quot;,&quot;if (!element.tagName) return false;                 return &quot;+this.buildMatchExpression());
+},nthChild:function(_3e4,a,b,_3e7,_3e8){
+var _3e9=MochiKit.Base.filter(function(node){
+return node.nodeType==1;
+},_3e4.parentNode.childNodes);
+if(_3e8){
+_3e9=MochiKit.Base.filter(function(node){
+return node.tagName==_3e4.tagName;
+},_3e9);
+}
+if(_3e7){
+_3e9=MochiKit.Iter.reversed(_3e9);
+}
+if(a){
+var _3ec=MochiKit.Base.findIdentical(_3e9,_3e4);
+return ((_3ec+1-b)/a)%1==0;
+}else{
+return b==MochiKit.Base.findIdentical(_3e9,_3e4)+1;
+}
+},isUIElement:function(_3ed){
+return MochiKit.Base.findValue([&quot;input&quot;,&quot;button&quot;,&quot;select&quot;,&quot;option&quot;,&quot;textarea&quot;,&quot;object&quot;],_3ed.tagName.toLowerCase())&gt;-1;
+},findElements:function(_3ee,axis){
+var _3f0;
+if(axis==undefined){
+axis=&quot;&quot;;
+}
+function inScope(_3f1,_3f2){
+if(axis==&quot;&quot;){
+return MochiKit.DOM.isChildNode(_3f1,_3f2);
+}else{
+if(axis==&quot;&gt;&quot;){
+return _3f1.parentNode==_3f2;
+}else{
+if(axis==&quot;+&quot;){
+return _3f1==nextSiblingElement(_3f2);
+}else{
+if(axis==&quot;~&quot;){
+var _3f3=_3f2;
+while(_3f3=nextSiblingElement(_3f3)){
+if(_3f1==_3f3){
+return true;
+}
+}
+return false;
+}else{
+throw &quot;Invalid axis: &quot;+axis;
+}
+}
+}
+}
+}
+if(_3f0=MochiKit.DOM.getElement(this.params.id)){
+if(this.match(_3f0)){
+if(!_3ee||inScope(_3f0,_3ee)){
+return [_3f0];
+}
+}
+}
+function nextSiblingElement(node){
+node=node.nextSibling;
+while(node&amp;&amp;node.nodeType!=1){
+node=node.nextSibling;
+}
+return node;
+}
+if(axis==&quot;&quot;){
+_3ee=(_3ee||MochiKit.DOM.currentDocument()).getElementsByTagName(this.params.tagName||&quot;*&quot;);
+}else{
+if(axis==&quot;&gt;&quot;){
+if(!_3ee){
+throw &quot;&gt; combinator not allowed without preceeding expression&quot;;
+}
+_3ee=MochiKit.Base.filter(function(node){
+return node.nodeType==1;
+},_3ee.childNodes);
+}else{
+if(axis==&quot;+&quot;){
+if(!_3ee){
+throw &quot;+ combinator not allowed without preceeding expression&quot;;
+}
+_3ee=nextSiblingElement(_3ee)&amp;&amp;[nextSiblingElement(_3ee)];
+}else{
+if(axis==&quot;~&quot;){
+if(!_3ee){
+throw &quot;~ combinator not allowed without preceeding expression&quot;;
+}
+var _3f6=[];
+while(nextSiblingElement(_3ee)){
+_3ee=nextSiblingElement(_3ee);
+_3f6.push(_3ee);
+}
+_3ee=_3f6;
+}
+}
+}
+}
+if(!_3ee){
+return [];
+}
+var _3f7=MochiKit.Base.filter(MochiKit.Base.bind(function(_3f8){
+return this.match(_3f8);
+},this),_3ee);
+return _3f7;
+},repr:function(){
+return &quot;Selector(&quot;+this.expression+&quot;)&quot;;
+},toString:MochiKit.Base.forwardCall(&quot;repr&quot;)};
+MochiKit.Base.update(MochiKit.Selector,{findChildElements:function(_3f9,_3fa){
+return MochiKit.Base.flattenArray(MochiKit.Base.map(function(_3fb){
+var _3fc=&quot;&quot;;
+return MochiKit.Iter.reduce(function(_3fd,expr){
+if(match=expr.match(/^[&gt;+~]$/)){
+_3fc=match[0];
+return _3fd;
+}else{
+var _3ff=new MochiKit.Selector.Selector(expr);
+var _400=MochiKit.Iter.reduce(function(_401,_402){
+return MochiKit.Base.extend(_401,_3ff.findElements(_402||_3f9,_3fc));
+},_3fd,[]);
+_3fc=&quot;&quot;;
+return _400;
+}
+},_3fb.replace(/(^\s+|\s+$)/g,&quot;&quot;).split(/\s+/),[null]);
+},_3fa));
+},findDocElements:function(){
+return MochiKit.Selector.findChildElements(MochiKit.DOM.currentDocument(),arguments);
+},__new__:function(){
+var m=MochiKit.Base;
+this.$$=this.findDocElements;
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+}});
+MochiKit.Selector.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Selector);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Style&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+dojo.require(&quot;MochiKit.DOM&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+JSAN.use(&quot;MochiKit.DOM&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Style depends on MochiKit.Base!&quot;;
+}
+try{
+if(typeof (MochiKit.DOM)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Style depends on MochiKit.DOM!&quot;;
+}
+if(typeof (MochiKit.Style)==&quot;undefined&quot;){
+MochiKit.Style={};
+}
+MochiKit.Style.NAME=&quot;MochiKit.Style&quot;;
+MochiKit.Style.VERSION=&quot;1.4&quot;;
+MochiKit.Style.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.Style.toString=function(){
+return this.__repr__();
+};
+MochiKit.Style.EXPORT_OK=[];
+MochiKit.Style.EXPORT=[&quot;setStyle&quot;,&quot;setOpacity&quot;,&quot;getStyle&quot;,&quot;getElementDimensions&quot;,&quot;elementDimensions&quot;,&quot;setElementDimensions&quot;,&quot;getElementPosition&quot;,&quot;elementPosition&quot;,&quot;setElementPosition&quot;,&quot;setDisplayForElement&quot;,&quot;hideElement&quot;,&quot;showElement&quot;,&quot;getViewportDimensions&quot;,&quot;getViewportPosition&quot;,&quot;Dimensions&quot;,&quot;Coordinates&quot;];
+MochiKit.Style.Dimensions=function(w,h){
+this.w=w;
+this.h=h;
+};
+MochiKit.Style.Dimensions.prototype.__repr__=function(){
+var repr=MochiKit.Base.repr;
+return &quot;{w: &quot;+repr(this.w)+&quot;, h: &quot;+repr(this.h)+&quot;}&quot;;
+};
+MochiKit.Style.Dimensions.prototype.toString=function(){
+return this.__repr__();
+};
+MochiKit.Style.Coordinates=function(x,y){
+this.x=x;
+this.y=y;
+};
+MochiKit.Style.Coordinates.prototype.__repr__=function(){
+var repr=MochiKit.Base.repr;
+return &quot;{x: &quot;+repr(this.x)+&quot;, y: &quot;+repr(this.y)+&quot;}&quot;;
+};
+MochiKit.Style.Coordinates.prototype.toString=function(){
+return this.__repr__();
+};
+MochiKit.Base.update(MochiKit.Style,{getStyle:function(elem,_40b){
+var dom=MochiKit.DOM;
+var d=dom._document;
+elem=dom.getElement(elem);
+_40b=MochiKit.Base.camelize(_40b);
+if(!elem||elem==d){
+return undefined;
+}
+if(_40b==&quot;opacity&quot;&amp;&amp;elem.filters){
+var _40e=(MochiKit.Style.getStyle(elem,&quot;filter&quot;)||&quot;&quot;).match(/alpha\(opacity=(.*)\)/);
+if(_40e&amp;&amp;_40e[1]){
+return parseFloat(_40e[1])/100;
+}
+return 1;
+}
+var _40f=elem.style?elem.style[_40b]:null;
+if(!_40f){
+if(d.defaultView&amp;&amp;d.defaultView.getComputedStyle){
+var css=d.defaultView.getComputedStyle(elem,null);
+_40b=_40b.replace(/([A-Z])/g,&quot;-$1&quot;).toLowerCase();
+_40f=css?css.getPropertyValue(_40b):null;
+}else{
+if(elem.currentStyle){
+_40f=elem.currentStyle[_40b];
+}
+}
+}
+if(_40b==&quot;opacity&quot;){
+_40f=parseFloat(_40f);
+}
+if(/Opera/.test(navigator.userAgent)&amp;&amp;(MochiKit.Base.find([&quot;left&quot;,&quot;top&quot;,&quot;right&quot;,&quot;bottom&quot;],_40b)!=-1)){
+if(MochiKit.Style.getStyle(elem,&quot;position&quot;)==&quot;static&quot;){
+_40f=&quot;auto&quot;;
+}
+}
+return _40f==&quot;auto&quot;?null:_40f;
+},setStyle:function(elem,_412){
+elem=MochiKit.DOM.getElement(elem);
+for(var name in _412){
+if(name==&quot;opacity&quot;){
+MochiKit.Style.setOpacity(elem,_412[name]);
+}else{
+elem.style[MochiKit.Base.camelize(name)]=_412[name];
+}
+}
+},setOpacity:function(elem,o){
+elem=MochiKit.DOM.getElement(elem);
+var self=MochiKit.Style;
+if(o==1){
+var _417=/Gecko/.test(navigator.userAgent)&amp;&amp;!(/Konqueror|AppleWebKit|KHTML/.test(navigator.userAgent));
+elem.style[&quot;opacity&quot;]=_417?0.999999:1;
+if(/MSIE/.test(navigator.userAgent)){
+elem.style[&quot;filter&quot;]=self.getStyle(elem,&quot;filter&quot;).replace(/alpha\([^\)]*\)/gi,&quot;&quot;);
+}
+}else{
+if(o&lt;0.00001){
+o=0;
+}
+elem.style[&quot;opacity&quot;]=o;
+if(/MSIE/.test(navigator.userAgent)){
+elem.style[&quot;filter&quot;]=self.getStyle(elem,&quot;filter&quot;).replace(/alpha\([^\)]*\)/gi,&quot;&quot;)+&quot;alpha(opacity=&quot;+o*100+&quot;)&quot;;
+}
+}
+},getElementPosition:function(elem,_419){
+var self=MochiKit.Style;
+var dom=MochiKit.DOM;
+elem=dom.getElement(elem);
+if(!elem||(!(elem.x&amp;&amp;elem.y)&amp;&amp;(!elem.parentNode===null||self.getStyle(elem,&quot;display&quot;)==&quot;none&quot;))){
+return undefined;
+}
+var c=new self.Coordinates(0,0);
+var box=null;
+var _41e=null;
+var d=MochiKit.DOM._document;
+var de=d.documentElement;
+var b=d.body;
+if(!elem.parentNode&amp;&amp;elem.x&amp;&amp;elem.y){
+c.x+=elem.x||0;
+c.y+=elem.y||0;
+}else{
+if(elem.getBoundingClientRect){
+box=elem.getBoundingClientRect();
+c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
+c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
+return c;
+}else{
+if(elem.offsetParent){
+c.x+=elem.offsetLeft;
+c.y+=elem.offsetTop;
+_41e=elem.offsetParent;
+if(_41e!=elem){
+while(_41e){
+c.x+=_41e.offsetLeft;
+c.y+=_41e.offsetTop;
+_41e=_41e.offsetParent;
+}
+}
+var ua=navigator.userAgent.toLowerCase();
+if((typeof (opera)!=&quot;undefined&quot;&amp;&amp;parseFloat(opera.version())&lt;9)||(ua.indexOf(&quot;AppleWebKit&quot;)!=-1&amp;&amp;self.getStyle(elem,&quot;position&quot;)==&quot;absolute&quot;)){
+c.x-=b.offsetLeft;
+c.y-=b.offsetTop;
+}
+}
+}
+}
+if(typeof (_419)!=&quot;undefined&quot;){
+_419=arguments.callee(_419);
+if(_419){
+c.x-=(_419.x||0);
+c.y-=(_419.y||0);
+}
+}
+if(elem.parentNode){
+_41e=elem.parentNode;
+}else{
+_41e=null;
+}
+while(_41e){
+var _423=_41e.tagName.toUpperCase();
+if(_423===&quot;BODY&quot;||_423===&quot;HTML&quot;){
+break;
+}
+var disp=self.getStyle(_41e,&quot;display&quot;);
+if(disp.search(/^inline|table-row.*$/i)){
+c.x-=_41e.scrollLeft;
+c.y-=_41e.scrollTop;
+}
+if(_41e.parentNode){
+_41e=_41e.parentNode;
+}else{
+_41e=null;
+}
+}
+return c;
+},setElementPosition:function(elem,_426,_427){
+elem=MochiKit.DOM.getElement(elem);
+if(typeof (_427)==&quot;undefined&quot;){
+_427=&quot;px&quot;;
+}
+var _428={};
+var _429=MochiKit.Base.isUndefinedOrNull;
+if(!_429(_426.x)){
+_428[&quot;left&quot;]=_426.x+_427;
+}
+if(!_429(_426.y)){
+_428[&quot;top&quot;]=_426.y+_427;
+}
+MochiKit.DOM.updateNodeAttributes(elem,{&quot;style&quot;:_428});
+},getElementDimensions:function(elem){
+var self=MochiKit.Style;
+var dom=MochiKit.DOM;
+if(typeof (elem.w)==&quot;number&quot;||typeof (elem.h)==&quot;number&quot;){
+return new self.Dimensions(elem.w||0,elem.h||0);
+}
+elem=dom.getElement(elem);
+if(!elem){
+return undefined;
+}
+var disp=self.getStyle(elem,&quot;display&quot;);
+if(disp!=&quot;none&quot;&amp;&amp;disp!==&quot;&quot;&amp;&amp;typeof (disp)!=&quot;undefined&quot;){
+return new self.Dimensions(elem.offsetWidth||0,elem.offsetHeight||0);
+}
+var s=elem.style;
+var _42f=s.visibility;
+var _430=s.position;
+s.visibility=&quot;hidden&quot;;
+s.position=&quot;absolute&quot;;
+s.display=&quot;&quot;;
+var _431=elem.offsetWidth;
+var _432=elem.offsetHeight;
+s.display=&quot;none&quot;;
+s.position=_430;
+s.visibility=_42f;
+return new self.Dimensions(_431,_432);
+},setElementDimensions:function(elem,_434,_435){
+elem=MochiKit.DOM.getElement(elem);
+if(typeof (_435)==&quot;undefined&quot;){
+_435=&quot;px&quot;;
+}
+var _436={};
+var _437=MochiKit.Base.isUndefinedOrNull;
+if(!_437(_434.w)){
+_436[&quot;width&quot;]=_434.w+_435;
+}
+if(!_437(_434.h)){
+_436[&quot;height&quot;]=_434.h+_435;
+}
+MochiKit.DOM.updateNodeAttributes(elem,{&quot;style&quot;:_436});
+},setDisplayForElement:function(_438,_439){
+var _43a=MochiKit.Base.extend(null,arguments,1);
+var _43b=MochiKit.DOM.getElement;
+for(var i=0;i&lt;_43a.length;i++){
+_439=_43b(_43a[i]);
+if(_439){
+_439.style.display=_438;
+}
+}
+},getViewportDimensions:function(){
+var d=new MochiKit.Style.Dimensions();
+var w=MochiKit.DOM._window;
+var b=MochiKit.DOM._document.body;
+if(w.innerWidth){
+d.w=w.innerWidth;
+d.h=w.innerHeight;
+}else{
+if(b.parentElement.clientWidth){
+d.w=b.parentElement.clientWidth;
+d.h=b.parentElement.clientHeight;
+}else{
+if(b&amp;&amp;b.clientWidth){
+d.w=b.clientWidth;
+d.h=b.clientHeight;
+}
+}
+}
+return d;
+},getViewportPosition:function(){
+var c=new MochiKit.Style.Coordinates(0,0);
+var d=MochiKit.DOM._document;
+var de=d.documentElement;
+var db=d.body;
+if(de&amp;&amp;(de.scrollTop||de.scrollLeft)){
+c.x=de.scrollLeft;
+c.y=de.scrollTop;
+}else{
+if(db){
+c.x=db.scrollLeft;
+c.y=db.scrollTop;
+}
+}
+return c;
+},__new__:function(){
+var m=MochiKit.Base;
+this.elementPosition=this.getElementPosition;
+this.elementDimensions=this.getElementDimensions;
+this.hideElement=m.partial(this.setDisplayForElement,&quot;none&quot;);
+this.showElement=m.partial(this.setDisplayForElement,&quot;block&quot;);
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+}});
+MochiKit.Style.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Style);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.LoggingPane&quot;);
+dojo.require(&quot;MochiKit.Logging&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Logging&quot;,[]);
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)==&quot;undefined&quot;||typeof (MochiKit.Logging)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.LoggingPane depends on MochiKit.Base and MochiKit.Logging!&quot;;
+}
+if(typeof (MochiKit.LoggingPane)==&quot;undefined&quot;){
+MochiKit.LoggingPane={};
+}
+MochiKit.LoggingPane.NAME=&quot;MochiKit.LoggingPane&quot;;
+MochiKit.LoggingPane.VERSION=&quot;1.4&quot;;
+MochiKit.LoggingPane.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.LoggingPane.toString=function(){
+return this.__repr__();
+};
+MochiKit.LoggingPane.createLoggingPane=function(_445){
+var m=MochiKit.LoggingPane;
+_445=!(!_445);
+if(m._loggingPane&amp;&amp;m._loggingPane.inline!=_445){
+m._loggingPane.closePane();
+m._loggingPane=null;
+}
+if(!m._loggingPane||m._loggingPane.closed){
+m._loggingPane=new m.LoggingPane(_445,MochiKit.Logging.logger);
+}
+return m._loggingPane;
+};
+MochiKit.LoggingPane.LoggingPane=function(_447,_448){
+if(typeof (_448)==&quot;undefined&quot;||_448===null){
+_448=MochiKit.Logging.logger;
+}
+this.logger=_448;
+var _449=MochiKit.Base.update;
+var _44a=MochiKit.Base.updatetree;
+var bind=MochiKit.Base.bind;
+var _44c=MochiKit.Base.clone;
+var win=window;
+var uid=&quot;_MochiKit_LoggingPane&quot;;
+if(typeof (MochiKit.DOM)!=&quot;undefined&quot;){
+win=MochiKit.DOM.currentWindow();
+}
+if(!_447){
+var url=win.location.href.split(&quot;?&quot;)[0].replace(/[#:\/.&gt;&lt;&amp;-]/g,&quot;_&quot;);
+var name=uid+&quot;_&quot;+url;
+var nwin=win.open(&quot;&quot;,name,&quot;dependent,resizable,height=200&quot;);
+if(!nwin){
+alert(&quot;Not able to open debugging window due to pop-up blocking.&quot;);
+return undefined;
+}
+nwin.document.write(&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.0 Transitional//EN\&quot; &quot;+&quot;\&quot;http://www.w3.org/TR/html4/loose.dtd\&quot;&gt;&quot;+&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;[MochiKit.LoggingPane]&lt;/title&gt;&lt;/head&gt;&quot;+&quot;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;&quot;);
+nwin.document.close();
+nwin.document.title+=&quot; &quot;+win.document.title;
+win=nwin;
+}
+var doc=win.document;
+this.doc=doc;
+var _453=doc.getElementById(uid);
+var _454=!!_453;
+if(_453&amp;&amp;typeof (_453.loggingPane)!=&quot;undefined&quot;){
+_453.loggingPane.logger=this.logger;
+_453.loggingPane.buildAndApplyFilter();
+return _453.loggingPane;
+}
+if(_454){
+var _455;
+while((_455=_453.firstChild)){
+_453.removeChild(_455);
+}
+}else{
+_453=doc.createElement(&quot;div&quot;);
+_453.id=uid;
+}
+_453.loggingPane=this;
+var _456=doc.createElement(&quot;input&quot;);
+var _457=doc.createElement(&quot;input&quot;);
+var _458=doc.createElement(&quot;button&quot;);
+var _459=doc.createElement(&quot;button&quot;);
+var _45a=doc.createElement(&quot;button&quot;);
+var _45b=doc.createElement(&quot;button&quot;);
+var _45c=doc.createElement(&quot;div&quot;);
+var _45d=doc.createElement(&quot;div&quot;);
+var _45e=uid+&quot;_Listener&quot;;
+this.colorTable=_44c(this.colorTable);
+var _45f=[];
+var _460=null;
+var _461=function(msg){
+var _463=msg.level;
+if(typeof (_463)==&quot;number&quot;){
+_463=MochiKit.Logging.LogLevel[_463];
+}
+return _463;
+};
+var _464=function(msg){
+return msg.info.join(&quot; &quot;);
+};
+var _466=bind(function(msg){
+var _468=_461(msg);
+var text=_464(msg);
+var c=this.colorTable[_468];
+var p=doc.createElement(&quot;span&quot;);
+p.className=&quot;MochiKit-LogMessage MochiKit-LogLevel-&quot;+_468;
+p.style.cssText=&quot;margin: 0px; white-space: -moz-pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word; wrap-option: emergency; color: &quot;+c;
+p.appendChild(doc.createTextNode(_468+&quot;: &quot;+text));
+_45d.appendChild(p);
+_45d.appendChild(doc.createElement(&quot;br&quot;));
+if(_45c.offsetHeight&gt;_45c.scrollHeight){
+_45c.scrollTop=0;
+}else{
+_45c.scrollTop=_45c.scrollHeight;
+}
+},this);
+var _46c=function(msg){
+_45f[_45f.length]=msg;
+_466(msg);
+};
+var _46e=function(){
+var _46f,_470;
+try{
+_46f=new RegExp(_456.value);
+_470=new RegExp(_457.value);
+}
+catch(e){
+logDebug(&quot;Error in filter regex: &quot;+e.message);
+return null;
+}
+return function(msg){
+return (_46f.test(_461(msg))&amp;&amp;_470.test(_464(msg)));
+};
+};
+var _472=function(){
+while(_45d.firstChild){
+_45d.removeChild(_45d.firstChild);
+}
+};
+var _473=function(){
+_45f=[];
+_472();
+};
+var _474=bind(function(){
+if(this.closed){
+return;
+}
+this.closed=true;
+if(MochiKit.LoggingPane._loggingPane==this){
+MochiKit.LoggingPane._loggingPane=null;
+}
+this.logger.removeListener(_45e);
+try{
+try{
+_453.loggingPane=null;
+}
+catch(e){
+logFatal(&quot;Bookmarklet was closed incorrectly.&quot;);
+}
+if(_447){
+_453.parentNode.removeChild(_453);
+}else{
+this.win.close();
+}
+}
+catch(e){
+}
+},this);
+var _475=function(){
+_472();
+for(var i=0;i&lt;_45f.length;i++){
+var msg=_45f[i];
+if(_460===null||_460(msg)){
+_466(msg);
+}
+}
+};
+this.buildAndApplyFilter=function(){
+_460=_46e();
+_475();
+this.logger.removeListener(_45e);
+this.logger.addListener(_45e,_460,_46c);
+};
+var _478=bind(function(){
+_45f=this.logger.getMessages();
+_475();
+},this);
+var _479=bind(function(_47a){
+_47a=_47a||window.event;
+key=_47a.which||_47a.keyCode;
+if(key==13){
+this.buildAndApplyFilter();
+}
+},this);
+var _47b=&quot;display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: &quot;+this.logFont;
+if(_447){
+_47b+=&quot;; height: 10em; border-top: 2px solid black&quot;;
+}else{
+_47b+=&quot;; height: 100%;&quot;;
+}
+_453.style.cssText=_47b;
+if(!_454){
+doc.body.appendChild(_453);
+}
+_47b={&quot;cssText&quot;:&quot;width: 33%; display: inline; font: &quot;+this.logFont};
+_44a(_456,{&quot;value&quot;:&quot;FATAL|ERROR|WARNING|INFO|DEBUG&quot;,&quot;onkeypress&quot;:_479,&quot;style&quot;:_47b});
+_453.appendChild(_456);
+_44a(_457,{&quot;value&quot;:&quot;.*&quot;,&quot;onkeypress&quot;:_479,&quot;style&quot;:_47b});
+_453.appendChild(_457);
+_47b=&quot;width: 8%; display:inline; font: &quot;+this.logFont;
+_458.appendChild(doc.createTextNode(&quot;Filter&quot;));
+_458.onclick=bind(&quot;buildAndApplyFilter&quot;,this);
+_458.style.cssText=_47b;
+_453.appendChild(_458);
+_459.appendChild(doc.createTextNode(&quot;Load&quot;));
+_459.onclick=_478;
+_459.style.cssText=_47b;
+_453.appendChild(_459);
+_45a.appendChild(doc.createTextNode(&quot;Clear&quot;));
+_45a.onclick=_473;
+_45a.style.cssText=_47b;
+_453.appendChild(_45a);
+_45b.appendChild(doc.createTextNode(&quot;Close&quot;));
+_45b.onclick=_474;
+_45b.style.cssText=_47b;
+_453.appendChild(_45b);
+_45c.style.cssText=&quot;overflow: auto; width: 100%&quot;;
+_45d.style.cssText=&quot;width: 100%; height: &quot;+(_447?&quot;8em&quot;:&quot;100%&quot;);
+_45c.appendChild(_45d);
+_453.appendChild(_45c);
+this.buildAndApplyFilter();
+_478();
+if(_447){
+this.win=undefined;
+}else{
+this.win=win;
+}
+this.inline=_447;
+this.closePane=_474;
+this.closed=false;
+return this;
+};
+MochiKit.LoggingPane.LoggingPane.prototype={&quot;logFont&quot;:&quot;8pt Verdana,sans-serif&quot;,&quot;colorTable&quot;:{&quot;ERROR&quot;:&quot;red&quot;,&quot;FATAL&quot;:&quot;darkred&quot;,&quot;WARNING&quot;:&quot;blue&quot;,&quot;INFO&quot;:&quot;black&quot;,&quot;DEBUG&quot;:&quot;green&quot;}};
+MochiKit.LoggingPane.EXPORT_OK=[&quot;LoggingPane&quot;];
+MochiKit.LoggingPane.EXPORT=[&quot;createLoggingPane&quot;];
+MochiKit.LoggingPane.__new__=function(){
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
+MochiKit.Base.nameFunctions(this);
+MochiKit.LoggingPane._loggingPane=null;
+};
+MochiKit.LoggingPane.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Color&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+dojo.require(&quot;MochiKit.DOM&quot;);
+dojo.require(&quot;MochiKit.Style&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+JSAN.use(&quot;MochiKit.DOM&quot;,[]);
+JSAN.use(&quot;MochiKit.Style&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Color depends on MochiKit.Base&quot;;
+}
+try{
+if(typeof (MochiKit.DOM)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Color depends on MochiKit.DOM&quot;;
+}
+try{
+if(typeof (MochiKit.Style)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Color depends on MochiKit.Style&quot;;
+}
+if(typeof (MochiKit.Color)==&quot;undefined&quot;){
+MochiKit.Color={};
+}
+MochiKit.Color.NAME=&quot;MochiKit.Color&quot;;
+MochiKit.Color.VERSION=&quot;1.4&quot;;
+MochiKit.Color.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.Color.toString=function(){
+return this.__repr__();
+};
+MochiKit.Color.Color=function(red,_47d,blue,_47f){
+if(typeof (_47f)==&quot;undefined&quot;||_47f===null){
+_47f=1;
+}
+this.rgb={r:red,g:_47d,b:blue,a:_47f};
+};
+MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_480){
+var rgb=this.rgb;
+var m=MochiKit.Color;
+return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_480);
+},colorWithHue:function(hue){
+var hsl=this.asHSL();
+hsl.h=hue;
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},colorWithSaturation:function(_486){
+var hsl=this.asHSL();
+hsl.s=_486;
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},colorWithLightness:function(_489){
+var hsl=this.asHSL();
+hsl.l=_489;
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},darkerColorWithLevel:function(_48c){
+var hsl=this.asHSL();
+hsl.l=Math.max(hsl.l-_48c,0);
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},lighterColorWithLevel:function(_48f){
+var hsl=this.asHSL();
+hsl.l=Math.min(hsl.l+_48f,1);
+var m=MochiKit.Color;
+return m.Color.fromHSL(hsl);
+},blendedColor:function(_492,_493){
+if(typeof (_493)==&quot;undefined&quot;||_493===null){
+_493=0.5;
+}
+var sf=1-_493;
+var s=this.rgb;
+var d=_492.rgb;
+var df=_493;
+return MochiKit.Color.Color.fromRGB((s.r*sf)+(d.r*df),(s.g*sf)+(d.g*df),(s.b*sf)+(d.b*df),(s.a*sf)+(d.a*df));
+},compareRGB:function(_498){
+var a=this.asRGB();
+var b=_498.asRGB();
+return MochiKit.Base.compare([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a]);
+},isLight:function(){
+return this.asHSL().b&gt;0.5;
+},isDark:function(){
+return (!this.isLight());
+},toHSLString:function(){
+var c=this.asHSL();
+var ccc=MochiKit.Color.clampColorComponent;
+var rval=this._hslString;
+if(!rval){
+var mid=(ccc(c.h,360).toFixed(0)+&quot;,&quot;+ccc(c.s,100).toPrecision(4)+&quot;%&quot;+&quot;,&quot;+ccc(c.l,100).toPrecision(4)+&quot;%&quot;);
+var a=c.a;
+if(a&gt;=1){
+a=1;
+rval=&quot;hsl(&quot;+mid+&quot;)&quot;;
+}else{
+if(a&lt;=0){
+a=0;
+}
+rval=&quot;hsla(&quot;+mid+&quot;,&quot;+a+&quot;)&quot;;
+}
+this._hslString=rval;
+}
+return rval;
+},toRGBString:function(){
+var c=this.rgb;
+var ccc=MochiKit.Color.clampColorComponent;
+var rval=this._rgbString;
+if(!rval){
+var mid=(ccc(c.r,255).toFixed(0)+&quot;,&quot;+ccc(c.g,255).toFixed(0)+&quot;,&quot;+ccc(c.b,255).toFixed(0));
+if(c.a!=1){
+rval=&quot;rgba(&quot;+mid+&quot;,&quot;+c.a+&quot;)&quot;;
+}else{
+rval=&quot;rgb(&quot;+mid+&quot;)&quot;;
+}
+this._rgbString=rval;
+}
+return rval;
+},asRGB:function(){
+return MochiKit.Base.clone(this.rgb);
+},toHexString:function(){
+var m=MochiKit.Color;
+var c=this.rgb;
+var ccc=MochiKit.Color.clampColorComponent;
+var rval=this._hexString;
+if(!rval){
+rval=(&quot;#&quot;+m.toColorPart(ccc(c.r,255))+m.toColorPart(ccc(c.g,255))+m.toColorPart(ccc(c.b,255)));
+this._hexString=rval;
+}
+return rval;
+},asHSV:function(){
+var hsv=this.hsv;
+var c=this.rgb;
+if(typeof (hsv)==&quot;undefined&quot;||hsv===null){
+hsv=MochiKit.Color.rgbToHSV(this.rgb);
+this.hsv=hsv;
+}
+return MochiKit.Base.clone(hsv);
+},asHSL:function(){
+var hsl=this.hsl;
+var c=this.rgb;
+if(typeof (hsl)==&quot;undefined&quot;||hsl===null){
+hsl=MochiKit.Color.rgbToHSL(this.rgb);
+this.hsl=hsl;
+}
+return MochiKit.Base.clone(hsl);
+},toString:function(){
+return this.toRGBString();
+},repr:function(){
+var c=this.rgb;
+var col=[c.r,c.g,c.b,c.a];
+return this.__class__.NAME+&quot;(&quot;+col.join(&quot;, &quot;)+&quot;)&quot;;
+}};
+MochiKit.Base.update(MochiKit.Color.Color,{fromRGB:function(red,_4af,blue,_4b1){
+var _4b2=MochiKit.Color.Color;
+if(arguments.length==1){
+var rgb=red;
+red=rgb.r;
+_4af=rgb.g;
+blue=rgb.b;
+if(typeof (rgb.a)==&quot;undefined&quot;){
+_4b1=undefined;
+}else{
+_4b1=rgb.a;
+}
+}
+return new _4b2(red,_4af,blue,_4b1);
+},fromHSL:function(hue,_4b5,_4b6,_4b7){
+var m=MochiKit.Color;
+return m.Color.fromRGB(m.hslToRGB.apply(m,arguments));
+},fromHSV:function(hue,_4ba,_4bb,_4bc){
+var m=MochiKit.Color;
+return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments));
+},fromName:function(name){
+var _4bf=MochiKit.Color.Color;
+if(name.charAt(0)==&quot;\&quot;&quot;){
+name=name.substr(1,name.length-2);
+}
+var _4c0=_4bf._namedColors[name.toLowerCase()];
+if(typeof (_4c0)==&quot;string&quot;){
+return _4bf.fromHexString(_4c0);
+}else{
+if(name==&quot;transparent&quot;){
+return _4bf.transparentColor();
+}
+}
+return null;
+},fromString:function(_4c1){
+var self=MochiKit.Color.Color;
+var _4c3=_4c1.substr(0,3);
+if(_4c3==&quot;rgb&quot;){
+return self.fromRGBString(_4c1);
+}else{
+if(_4c3==&quot;hsl&quot;){
+return self.fromHSLString(_4c1);
+}else{
+if(_4c1.charAt(0)==&quot;#&quot;){
+return self.fromHexString(_4c1);
+}
+}
+}
+return self.fromName(_4c1);
+},fromHexString:function(_4c4){
+if(_4c4.charAt(0)==&quot;#&quot;){
+_4c4=_4c4.substring(1);
+}
+var _4c5=[];
+var i,hex;
+if(_4c4.length==3){
+for(i=0;i&lt;3;i++){
+hex=_4c4.substr(i,1);
+_4c5.push(parseInt(hex+hex,16)/255);
+}
+}else{
+for(i=0;i&lt;6;i+=2){
+hex=_4c4.substr(i,2);
+_4c5.push(parseInt(hex,16)/255);
+}
+}
+var _4c8=MochiKit.Color.Color;
+return _4c8.fromRGB.apply(_4c8,_4c5);
+},_fromColorString:function(pre,_4ca,_4cb,_4cc){
+if(_4cc.indexOf(pre)===0){
+_4cc=_4cc.substring(_4cc.indexOf(&quot;(&quot;,3)+1,_4cc.length-1);
+}
+var _4cd=_4cc.split(/\s*,\s*/);
+var _4ce=[];
+for(var i=0;i&lt;_4cd.length;i++){
+var c=_4cd[i];
+var val;
+var _4d2=c.substring(c.length-3);
+if(c.charAt(c.length-1)==&quot;%&quot;){
+val=0.01*parseFloat(c.substring(0,c.length-1));
+}else{
+if(_4d2==&quot;deg&quot;){
+val=parseFloat(c)/360;
+}else{
+if(_4d2==&quot;rad&quot;){
+val=parseFloat(c)/(Math.PI*2);
+}else{
+val=_4cb[i]*parseFloat(c);
+}
+}
+}
+_4ce.push(val);
+}
+return this[_4ca].apply(this,_4ce);
+},fromComputedStyle:function(elem,_4d4){
+var d=MochiKit.DOM;
+var cls=MochiKit.Color.Color;
+for(elem=d.getElement(elem);elem;elem=elem.parentNode){
+var _4d7=MochiKit.Style.getStyle.apply(d,arguments);
+if(!_4d7){
+continue;
+}
+var _4d8=cls.fromString(_4d7);
+if(!_4d8){
+break;
+}
+if(_4d8.asRGB().a&gt;0){
+return _4d8;
+}
+}
+return null;
+},fromBackground:function(elem){
+var cls=MochiKit.Color.Color;
+return cls.fromComputedStyle(elem,&quot;backgroundColor&quot;,&quot;background-color&quot;)||cls.whiteColor();
+},fromText:function(elem){
+var cls=MochiKit.Color.Color;
+return cls.fromComputedStyle(elem,&quot;color&quot;,&quot;color&quot;)||cls.blackColor();
+},namedColors:function(){
+return MochiKit.Base.clone(MochiKit.Color.Color._namedColors);
+}});
+MochiKit.Base.update(MochiKit.Color,{clampColorComponent:function(v,_4de){
+v*=_4de;
+if(v&lt;0){
+return 0;
+}else{
+if(v&gt;_4de){
+return _4de;
+}else{
+return v;
+}
+}
+},_hslValue:function(n1,n2,hue){
+if(hue&gt;6){
+hue-=6;
+}else{
+if(hue&lt;0){
+hue+=6;
+}
+}
+var val;
+if(hue&lt;1){
+val=n1+(n2-n1)*hue;
+}else{
+if(hue&lt;3){
+val=n2;
+}else{
+if(hue&lt;4){
+val=n1+(n2-n1)*(4-hue);
+}else{
+val=n1;
+}
+}
+}
+return val;
+},hsvToRGB:function(hue,_4e4,_4e5,_4e6){
+if(arguments.length==1){
+var hsv=hue;
+hue=hsv.h;
+_4e4=hsv.s;
+_4e5=hsv.v;
+_4e6=hsv.a;
+}
+var red;
+var _4e9;
+var blue;
+if(_4e4===0){
+red=_4e5;
+_4e9=_4e5;
+blue=_4e5;
+}else{
+var i=Math.floor(hue*6);
+var f=(hue*6)-i;
+var p=_4e5*(1-_4e4);
+var q=_4e5*(1-(_4e4*f));
+var t=_4e5*(1-(_4e4*(1-f)));
+switch(i){
+case 1:
+red=q;
+_4e9=_4e5;
+blue=p;
+break;
+case 2:
+red=p;
+_4e9=_4e5;
+blue=t;
+break;
+case 3:
+red=p;
+_4e9=q;
+blue=_4e5;
+break;
+case 4:
+red=t;
+_4e9=p;
+blue=_4e5;
+break;
+case 5:
+red=_4e5;
+_4e9=p;
+blue=q;
+break;
+case 6:
+case 0:
+red=_4e5;
+_4e9=t;
+blue=p;
+break;
+}
+}
+return {r:red,g:_4e9,b:blue,a:_4e6};
+},hslToRGB:function(hue,_4f1,_4f2,_4f3){
+if(arguments.length==1){
+var hsl=hue;
+hue=hsl.h;
+_4f1=hsl.s;
+_4f2=hsl.l;
+_4f3=hsl.a;
+}
+var red;
+var _4f6;
+var blue;
+if(_4f1===0){
+red=_4f2;
+_4f6=_4f2;
+blue=_4f2;
+}else{
+var m2;
+if(_4f2&lt;=0.5){
+m2=_4f2*(1+_4f1);
+}else{
+m2=_4f2+_4f1-(_4f2*_4f1);
+}
+var m1=(2*_4f2)-m2;
+var f=MochiKit.Color._hslValue;
+var h6=hue*6;
+red=f(m1,m2,h6+2);
+_4f6=f(m1,m2,h6);
+blue=f(m1,m2,h6-2);
+}
+return {r:red,g:_4f6,b:blue,a:_4f3};
+},rgbToHSV:function(red,_4fd,blue,_4ff){
+if(arguments.length==1){
+var rgb=red;
+red=rgb.r;
+_4fd=rgb.g;
+blue=rgb.b;
+_4ff=rgb.a;
+}
+var max=Math.max(Math.max(red,_4fd),blue);
+var min=Math.min(Math.min(red,_4fd),blue);
+var hue;
+var _504;
+var _505=max;
+if(min==max){
+hue=0;
+_504=0;
+}else{
+var _506=(max-min);
+_504=_506/max;
+if(red==max){
+hue=(_4fd-blue)/_506;
+}else{
+if(_4fd==max){
+hue=2+((blue-red)/_506);
+}else{
+hue=4+((red-_4fd)/_506);
+}
+}
+hue/=6;
+if(hue&lt;0){
+hue+=1;
+}
+if(hue&gt;1){
+hue-=1;
+}
+}
+return {h:hue,s:_504,v:_505,a:_4ff};
+},rgbToHSL:function(red,_508,blue,_50a){
+if(arguments.length==1){
+var rgb=red;
+red=rgb.r;
+_508=rgb.g;
+blue=rgb.b;
+_50a=rgb.a;
+}
+var max=Math.max(red,Math.max(_508,blue));
+var min=Math.min(red,Math.min(_508,blue));
+var hue;
+var _50f;
+var _510=(max+min)/2;
+var _511=max-min;
+if(_511===0){
+hue=0;
+_50f=0;
+}else{
+if(_510&lt;=0.5){
+_50f=_511/(max+min);
+}else{
+_50f=_511/(2-max-min);
+}
+if(red==max){
+hue=(_508-blue)/_511;
+}else{
+if(_508==max){
+hue=2+((blue-red)/_511);
+}else{
+hue=4+((red-_508)/_511);
+}
+}
+hue/=6;
+if(hue&lt;0){
+hue+=1;
+}
+if(hue&gt;1){
+hue-=1;
+}
+}
+return {h:hue,s:_50f,l:_510,a:_50a};
+},toColorPart:function(num){
+num=Math.round(num);
+var _513=num.toString(16);
+if(num&lt;16){
+return &quot;0&quot;+_513;
+}
+return _513;
+},__new__:function(){
+var m=MochiKit.Base;
+this.Color.fromRGBString=m.bind(this.Color._fromColorString,this.Color,&quot;rgb&quot;,&quot;fromRGB&quot;,[1/255,1/255,1/255,1]);
+this.Color.fromHSLString=m.bind(this.Color._fromColorString,this.Color,&quot;hsl&quot;,&quot;fromHSL&quot;,[1/360,0.01,0.01,1]);
+var _515=1/3;
+var _516={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_515,_515,_515],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_515,2*_515,2*_515],magenta:[1,0,1],orange:[1,0.5,0],purple:[0.5,0,0.5],red:[1,0,0],transparent:[0,0,0,0],white:[1,1,1],yellow:[1,1,0]};
+var _517=function(name,r,g,b,a){
+var rval=this.fromRGB(r,g,b,a);
+this[name]=function(){
+return rval;
+};
+return rval;
+};
+for(var k in _516){
+var name=k+&quot;Color&quot;;
+var _520=m.concat([_517,this.Color,name],_516[k]);
+this.Color[name]=m.bind.apply(null,_520);
+}
+var _521=function(){
+for(var i=0;i&lt;arguments.length;i++){
+if(!(arguments[i] instanceof Color)){
+return false;
+}
+}
+return true;
+};
+var _523=function(a,b){
+return a.compareRGB(b);
+};
+m.nameFunctions(this);
+m.registerComparator(this.Color.NAME,_521,_523);
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+}});
+MochiKit.Color.EXPORT=[&quot;Color&quot;];
+MochiKit.Color.EXPORT_OK=[&quot;clampColorComponent&quot;,&quot;rgbToHSL&quot;,&quot;hslToRGB&quot;,&quot;rgbToHSV&quot;,&quot;hsvToRGB&quot;,&quot;toColorPart&quot;];
+MochiKit.Color.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Color);
+MochiKit.Color.Color._namedColors={aliceblue:&quot;#f0f8ff&quot;,antiquewhite:&quot;#faebd7&quot;,aqua:&quot;#00ffff&quot;,aquamarine:&quot;#7fffd4&quot;,azure:&quot;#f0ffff&quot;,beige:&quot;#f5f5dc&quot;,bisque:&quot;#ffe4c4&quot;,black:&quot;#000000&quot;,blanchedalmond:&quot;#ffebcd&quot;,blue:&quot;#0000ff&quot;,blueviolet:&quot;#8a2be2&quot;,brown:&quot;#a52a2a&quot;,burlywood:&quot;#deb887&quot;,cadetblue:&quot;#5f9ea0&quot;,chartreuse:&quot;#7fff00&quot;,chocolate:&quot;#d2691e&quot;,coral:&quot;#ff7f50&quot;,cornflowerblue:&quot;#6495ed&quot;,cornsilk:&quot;#fff8dc&quot;,crimson:&quot;#dc143c&quot;,cyan:&quot;#00ffff&quot;,darkblue:&quot;#00008b&quot;,darkcyan:&quot;#008b8b&quot;,darkgoldenrod:&quot;#b8860b&quot;,darkgray:&quot;#a9a9a9&quot;,darkgreen:&quot;#006400&quot;,darkgrey:&quot;#a9a9a9&quot;,darkkhaki:&quot;#bdb76b&quot;,darkmagenta:&quot;#8b008b&quot;,darkolivegreen:&quot;#556b2f&quot;,darkorange:&quot;#ff8c00&quot;,darkorchid:&quot;#9932cc&quot;,darkred:&quot;#8b0000&quot;,darksalmon:&quot;#e9967a&quot;,darkseagreen:&quot;#8fbc8f&quot;,darkslateblue:&quot;#483d8b&quot;,darkslategray:&quot;#2f4f4f&quot;,darkslategrey:&quot;#2f4f4f&quot;,darkturquoise:&quot;#00ced1&quot;,darkviolet:&quot;#9400d3&quot;,deeppink:&quot;#ff1493&quot;,deepskyblue:&quot;#00bfff&quot;,dimgray:&quot;#696969&quot;,dimgrey:&quot;#696969&quot;,dodgerblue:&quot;#1e90ff&quot;,firebrick:&quot;#b22222&quot;,floralwhite:&quot;#fffaf0&quot;,forestgreen:&quot;#228b22&quot;,fuchsia:&quot;#ff00ff&quot;,gainsboro:&quot;#dcdcdc&quot;,ghostwhite:&quot;#f8f8ff&quot;,gold:&quot;#ffd700&quot;,goldenrod:&quot;#daa520&quot;,gray:&quot;#808080&quot;,green:&quot;#008000&quot;,greenyellow:&quot;#adff2f&quot;,grey:&quot;#808080&quot;,honeydew:&quot;#f0fff0&quot;,hotpink:&quot;#ff69b4&quot;,indianred:&quot;#cd5c5c&quot;,indigo:&quot;#4b0082&quot;,ivory:&quot;#fffff0&quot;,khaki:&quot;#f0e68c&quot;,lavender:&quot;#e6e6fa&quot;,lavenderblush:&quot;#fff0f5&quot;,lawngreen:&quot;#7cfc00&quot;,lemonchiffon:&quot;#fffacd&quot;,lightblue:&quot;#add8e6&quot;,lightcoral:&quot;#f08080&quot;,lightcyan:&quot;#e0ffff&quot;,lightgoldenrodyellow:&quot;#fafad2&quot;,lightgray:&quot;#d3d3d3&quot;,lightgreen:&quot;#90ee90&quot;,lightgrey:&quot;#d3d3d3&quot;,lightpink:&quot;#ffb6c1&quot;,lightsalmon:&quot;#ffa07a&quot;,lightseagreen:&quot;#20b2aa&quot;,lightskyblue:&quot;#87cefa&quot;,lightslategray:&quot;#778899&quot;,lightslategrey:&quot;#778899&quot;,lightsteelblue:&quot;#b0c4de&quot;,lightyellow:&quot;#ffffe0&quot;,lime:&quot;#00ff00&quot;,limegreen:&quot;#32cd32&quot;,linen:&quot;#faf0e6&quot;,magenta:&quot;#ff00ff&quot;,maroon:&quot;#800000&quot;,mediumaquamarine:&quot;#66cdaa&quot;,mediumblue:&quot;#0000cd&quot;,mediumorchid:&quot;#ba55d3&quot;,mediumpurple:&quot;#9370db&quot;,mediumseagreen:&quot;#3cb371&quot;,mediumslateblue:&quot;#7b68ee&quot;,mediumspringgreen:&quot;#00fa9a&quot;,mediumturquoise:&quot;#48d1cc&quot;,mediumvioletred:&quot;#c71585&quot;,midnightblue:&quot;#191970&quot;,mintcream:&quot;#f5fffa&quot;,mistyrose:&quot;#ffe4e1&quot;,moccasin:&quot;#ffe4b5&quot;,navajowhite:&quot;#ffdead&quot;,navy:&quot;#000080&quot;,oldlace:&quot;#fdf5e6&quot;,olive:&quot;#808000&quot;,olivedrab:&quot;#6b8e23&quot;,orange:&quot;#ffa500&quot;,orangered:&quot;#ff4500&quot;,orchid:&quot;#da70d6&quot;,palegoldenrod:&quot;#eee8aa&quot;,palegreen:&quot;#98fb98&quot;,paleturquoise:&quot;#afeeee&quot;,palevioletred:&quot;#db7093&quot;,papayawhip:&quot;#ffefd5&quot;,peachpuff:&quot;#ffdab9&quot;,peru:&quot;#cd853f&quot;,pink:&quot;#ffc0cb&quot;,plum:&quot;#dda0dd&quot;,powderblue:&quot;#b0e0e6&quot;,purple:&quot;#800080&quot;,red:&quot;#ff0000&quot;,rosybrown:&quot;#bc8f8f&quot;,royalblue:&quot;#4169e1&quot;,saddlebrown:&quot;#8b4513&quot;,salmon:&quot;#fa8072&quot;,sandybrown:&quot;#f4a460&quot;,seagreen:&quot;#2e8b57&quot;,seashell:&quot;#fff5ee&quot;,sienna:&quot;#a0522d&quot;,silver:&quot;#c0c0c0&quot;,skyblue:&quot;#87ceeb&quot;,slateblue:&quot;#6a5acd&quot;,slategray:&quot;#708090&quot;,slategrey:&quot;#708090&quot;,snow:&quot;#fffafa&quot;,springgreen:&quot;#00ff7f&quot;,steelblue:&quot;#4682b4&quot;,tan:&quot;#d2b48c&quot;,teal:&quot;#008080&quot;,thistle:&quot;#d8bfd8&quot;,tomato:&quot;#ff6347&quot;,turquoise:&quot;#40e0d0&quot;,violet:&quot;#ee82ee&quot;,wheat:&quot;#f5deb3&quot;,white:&quot;#ffffff&quot;,whitesmoke:&quot;#f5f5f5&quot;,yellow:&quot;#ffff00&quot;,yellowgreen:&quot;#9acd32&quot;};
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Signal&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+dojo.require(&quot;MochiKit.DOM&quot;);
+dojo.require(&quot;MochiKit.Style&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+JSAN.use(&quot;MochiKit.DOM&quot;,[]);
+JSAN.use(&quot;MochiKit.Style&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Signal depends on MochiKit.Base!&quot;;
+}
+try{
+if(typeof (MochiKit.DOM)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Signal depends on MochiKit.DOM!&quot;;
+}
+try{
+if(typeof (MochiKit.Style)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Signal depends on MochiKit.Style!&quot;;
+}
+if(typeof (MochiKit.Signal)==&quot;undefined&quot;){
+MochiKit.Signal={};
+}
+MochiKit.Signal.NAME=&quot;MochiKit.Signal&quot;;
+MochiKit.Signal.VERSION=&quot;1.4&quot;;
+MochiKit.Signal._observers=[];
+MochiKit.Signal.Event=function(src,e){
+this._event=e||window.event;
+this._src=src;
+};
+MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){
+var repr=MochiKit.Base.repr;
+var str=&quot;{event(): &quot;+repr(this.event())+&quot;, src(): &quot;+repr(this.src())+&quot;, type(): &quot;+repr(this.type())+&quot;, target(): &quot;+repr(this.target());
+if(this.type()&amp;&amp;this.type().indexOf(&quot;key&quot;)===0||this.type().indexOf(&quot;mouse&quot;)===0||this.type().indexOf(&quot;click&quot;)!=-1||this.type()==&quot;contextmenu&quot;){
+str+=&quot;, modifier(): &quot;+&quot;{alt: &quot;+repr(this.modifier().alt)+&quot;, ctrl: &quot;+repr(this.modifier().ctrl)+&quot;, meta: &quot;+repr(this.modifier().meta)+&quot;, shift: &quot;+repr(this.modifier().shift)+&quot;, any: &quot;+repr(this.modifier().any)+&quot;}&quot;;
+}
+if(this.type()&amp;&amp;this.type().indexOf(&quot;key&quot;)===0){
+str+=&quot;, key(): {code: &quot;+repr(this.key().code)+&quot;, string: &quot;+repr(this.key().string)+&quot;}&quot;;
+}
+if(this.type()&amp;&amp;(this.type().indexOf(&quot;mouse&quot;)===0||this.type().indexOf(&quot;click&quot;)!=-1||this.type()==&quot;contextmenu&quot;)){
+str+=&quot;, mouse(): {page: &quot;+repr(this.mouse().page)+&quot;, client: &quot;+repr(this.mouse().client);
+if(this.type()!=&quot;mousemove&quot;){
+str+=&quot;, button: {left: &quot;+repr(this.mouse().button.left)+&quot;, middle: &quot;+repr(this.mouse().button.middle)+&quot;, right: &quot;+repr(this.mouse().button.right)+&quot;}}&quot;;
+}else{
+str+=&quot;}&quot;;
+}
+}
+if(this.type()==&quot;mouseover&quot;||this.type()==&quot;mouseout&quot;){
+str+=&quot;, relatedTarget(): &quot;+repr(this.relatedTarget());
+}
+str+=&quot;}&quot;;
+return str;
+},toString:function(){
+return this.__repr__();
+},src:function(){
+return this._src;
+},event:function(){
+return this._event;
+},type:function(){
+return this._event.type||undefined;
+},target:function(){
+return this._event.target||this._event.srcElement;
+},_relatedTarget:null,relatedTarget:function(){
+if(this._relatedTarget!==null){
+return this._relatedTarget;
+}
+var elem=null;
+if(this.type()==&quot;mouseover&quot;){
+elem=(this._event.relatedTarget||this._event.fromElement);
+}else{
+if(this.type()==&quot;mouseout&quot;){
+elem=(this._event.relatedTarget||this._event.toElement);
+}
+}
+if(elem!==null){
+this._relatedTarget=elem;
+return elem;
+}
+return undefined;
+},_modifier:null,modifier:function(){
+if(this._modifier!==null){
+return this._modifier;
+}
+var m={};
+m.alt=this._event.altKey;
+m.ctrl=this._event.ctrlKey;
+m.meta=this._event.metaKey||false;
+m.shift=this._event.shiftKey;
+m.any=m.alt||m.ctrl||m.shift||m.meta;
+this._modifier=m;
+return m;
+},_key:null,key:function(){
+if(this._key!==null){
+return this._key;
+}
+var k={};
+if(this.type()&amp;&amp;this.type().indexOf(&quot;key&quot;)===0){
+if(this.type()==&quot;keydown&quot;||this.type()==&quot;keyup&quot;){
+k.code=this._event.keyCode;
+k.string=(MochiKit.Signal._specialKeys[k.code]||&quot;KEY_UNKNOWN&quot;);
+this._key=k;
+return k;
+}else{
+if(this.type()==&quot;keypress&quot;){
+k.code=0;
+k.string=&quot;&quot;;
+if(typeof (this._event.charCode)!=&quot;undefined&quot;&amp;&amp;this._event.charCode!==0&amp;&amp;!MochiKit.Signal._specialMacKeys[this._event.charCode]){
+k.code=this._event.charCode;
+k.string=String.fromCharCode(k.code);
+}else{
+if(this._event.keyCode&amp;&amp;typeof (this._event.charCode)==&quot;undefined&quot;){
+k.code=this._event.keyCode;
+k.string=String.fromCharCode(k.code);
+}
+}
+this._key=k;
+return k;
+}
+}
+}
+return undefined;
+},_mouse:null,mouse:function(){
+if(this._mouse!==null){
+return this._mouse;
+}
+var m={};
+var e=this._event;
+if(this.type()&amp;&amp;(this.type().indexOf(&quot;mouse&quot;)===0||this.type().indexOf(&quot;click&quot;)!=-1||this.type()==&quot;contextmenu&quot;)){
+m.client=new MochiKit.Style.Coordinates(0,0);
+if(e.clientX||e.clientY){
+m.client.x=(!e.clientX||e.clientX&lt;0)?0:e.clientX;
+m.client.y=(!e.clientY||e.clientY&lt;0)?0:e.clientY;
+}
+m.page=new MochiKit.Style.Coordinates(0,0);
+if(e.pageX||e.pageY){
+m.page.x=(!e.pageX||e.pageX&lt;0)?0:e.pageX;
+m.page.y=(!e.pageY||e.pageY&lt;0)?0:e.pageY;
+}else{
+var de=MochiKit.DOM._document.documentElement;
+var b=MochiKit.DOM._document.body;
+m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
+m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
+}
+if(this.type()!=&quot;mousemove&quot;){
+m.button={};
+m.button.left=false;
+m.button.right=false;
+m.button.middle=false;
+if(e.which){
+m.button.left=(e.which==1);
+m.button.middle=(e.which==2);
+m.button.right=(e.which==3);
+}else{
+m.button.left=!!(e.button&amp;1);
+m.button.right=!!(e.button&amp;2);
+m.button.middle=!!(e.button&amp;4);
+}
+}
+this._mouse=m;
+return m;
+}
+return undefined;
+},stop:function(){
+this.stopPropagation();
+this.preventDefault();
+},stopPropagation:function(){
+if(this._event.stopPropagation){
+this._event.stopPropagation();
+}else{
+this._event.cancelBubble=true;
+}
+},preventDefault:function(){
+if(this._event.preventDefault){
+this._event.preventDefault();
+}else{
+if(this._confirmUnload===null){
+this._event.returnValue=false;
+}
+}
+},_confirmUnload:null,confirmUnload:function(msg){
+if(this.type()==&quot;beforeunload&quot;){
+this._confirmUnload=msg;
+this._event.returnValue=msg;
+}
+}});
+MochiKit.Signal._specialMacKeys={3:&quot;KEY_ENTER&quot;,63289:&quot;KEY_NUM_PAD_CLEAR&quot;,63276:&quot;KEY_PAGE_UP&quot;,63277:&quot;KEY_PAGE_DOWN&quot;,63275:&quot;KEY_END&quot;,63273:&quot;KEY_HOME&quot;,63234:&quot;KEY_ARROW_LEFT&quot;,63232:&quot;KEY_ARROW_UP&quot;,63235:&quot;KEY_ARROW_RIGHT&quot;,63233:&quot;KEY_ARROW_DOWN&quot;,63302:&quot;KEY_INSERT&quot;,63272:&quot;KEY_DELETE&quot;};
+(function(){
+var _532=MochiKit.Signal._specialMacKeys;
+for(i=63236;i&lt;=63242;i++){
+_532[i]=&quot;KEY_F&quot;+(i-63236+1);
+}
+})();
+MochiKit.Signal._specialKeys={8:&quot;KEY_BACKSPACE&quot;,9:&quot;KEY_TAB&quot;,12:&quot;KEY_NUM_PAD_CLEAR&quot;,13:&quot;KEY_ENTER&quot;,16:&quot;KEY_SHIFT&quot;,17:&quot;KEY_CTRL&quot;,18:&quot;KEY_ALT&quot;,19:&quot;KEY_PAUSE&quot;,20:&quot;KEY_CAPS_LOCK&quot;,27:&quot;KEY_ESCAPE&quot;,32:&quot;KEY_SPACEBAR&quot;,33:&quot;KEY_PAGE_UP&quot;,34:&quot;KEY_PAGE_DOWN&quot;,35:&quot;KEY_END&quot;,36:&quot;KEY_HOME&quot;,37:&quot;KEY_ARROW_LEFT&quot;,38:&quot;KEY_ARROW_UP&quot;,39:&quot;KEY_ARROW_RIGHT&quot;,40:&quot;KEY_ARROW_DOWN&quot;,44:&quot;KEY_PRINT_SCREEN&quot;,45:&quot;KEY_INSERT&quot;,46:&quot;KEY_DELETE&quot;,59:&quot;KEY_SEMICOLON&quot;,91:&quot;KEY_WINDOWS_LEFT&quot;,92:&quot;KEY_WINDOWS_RIGHT&quot;,93:&quot;KEY_SELECT&quot;,106:&quot;KEY_NUM_PAD_ASTERISK&quot;,107:&quot;KEY_NUM_PAD_PLUS_SIGN&quot;,109:&quot;KEY_NUM_PAD_HYPHEN-MINUS&quot;,110:&quot;KEY_NUM_PAD_FULL_STOP&quot;,111:&quot;KEY_NUM_PAD_SOLIDUS&quot;,144:&quot;KEY_NUM_LOCK&quot;,145:&quot;KEY_SCROLL_LOCK&quot;,186:&quot;KEY_SEMICOLON&quot;,187:&quot;KEY_EQUALS_SIGN&quot;,188:&quot;KEY_COMMA&quot;,189:&quot;KEY_HYPHEN-MINUS&quot;,190:&quot;KEY_FULL_STOP&quot;,191:&quot;KEY_SOLIDUS&quot;,192:&quot;KEY_GRAVE_ACCENT&quot;,219:&quot;KEY_LEFT_SQUARE_BRACKET&quot;,220:&quot;KEY_REVERSE_SOLIDUS&quot;,221:&quot;KEY_RIGHT_SQUARE_BRACKET&quot;,222:&quot;KEY_APOSTROPHE&quot;};
+(function(){
+var _533=MochiKit.Signal._specialKeys;
+for(var i=48;i&lt;=57;i++){
+_533[i]=&quot;KEY_&quot;+(i-48);
+}
+for(i=65;i&lt;=90;i++){
+_533[i]=&quot;KEY_&quot;+String.fromCharCode(i);
+}
+for(i=96;i&lt;=105;i++){
+_533[i]=&quot;KEY_NUM_PAD_&quot;+(i-96);
+}
+for(i=112;i&lt;=123;i++){
+_533[i]=&quot;KEY_F&quot;+(i-112+1);
+}
+})();
+MochiKit.Signal.Ident=function(_535){
+this.source=_535.source;
+this.signal=_535.signal;
+this.listener=_535.listener;
+this.isDOM=_535.isDOM;
+this.objOrFunc=_535.objOrFunc;
+this.funcOrStr=_535.funcOrStr;
+this.connected=_535.connected;
+};
+MochiKit.Signal.Ident.prototype={};
+MochiKit.Base.update(MochiKit.Signal,{__repr__:function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+},toString:function(){
+return this.__repr__();
+},_unloadCache:function(){
+var self=MochiKit.Signal;
+var _537=self._observers;
+for(var i=0;i&lt;_537.length;i++){
+if(_537[i].signal!==&quot;onload&quot;&amp;&amp;_537[i].signal!==&quot;onunload&quot;){
+self._disconnect(_537[i]);
+}
+}
+},_listener:function(src,sig,func,obj,_53d){
+var self=MochiKit.Signal;
+var E=self.Event;
+if(!_53d){
+if(typeof (func.im_self)==&quot;undefined&quot;){
+return MochiKit.Base.bind(func,obj);
+}else{
+return func;
+}
+}
+obj=obj||src;
+if(typeof (func)==&quot;string&quot;){
+if(sig===&quot;onload&quot;||sig===&quot;onunload&quot;){
+return function(_540){
+obj[func].apply(obj,[new E(src,_540)]);
+var _541=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:obj,funcOrStr:func});
+MochiKit.Signal._disconnect(_541);
+};
+}else{
+return function(_542){
+obj[func].apply(obj,[new E(src,_542)]);
+};
+}
+}else{
+if(sig===&quot;onload&quot;||sig===&quot;onunload&quot;){
+return function(_543){
+func.apply(obj,[new E(src,_543)]);
+var _544=new MochiKit.Signal.Ident({source:src,signal:sig,objOrFunc:func});
+MochiKit.Signal._disconnect(_544);
+};
+}else{
+return function(_545){
+func.apply(obj,[new E(src,_545)]);
+};
+}
+}
+},_browserAlreadyHasMouseEnterAndLeave:function(){
+return /MSIE/.test(navigator.userAgent);
+},_mouseEnterListener:function(src,sig,func,obj){
+var E=MochiKit.Signal.Event;
+return function(_54b){
+var e=new E(src,_54b);
+try{
+e.relatedTarget().nodeName;
+}
+catch(err){
+return;
+}
+e.stop();
+if(MochiKit.DOM.isChildNode(e.relatedTarget(),src)){
+return;
+}
+e.type=function(){
+return sig;
+};
+if(typeof (func)==&quot;string&quot;){
+return obj[func].apply(obj,[e]);
+}else{
+return func.apply(obj,[e]);
+}
+};
+},_getDestPair:function(_54d,_54e){
+var obj=null;
+var func=null;
+if(typeof (_54e)!=&quot;undefined&quot;){
+obj=_54d;
+func=_54e;
+if(typeof (_54e)==&quot;string&quot;){
+if(typeof (_54d[_54e])!=&quot;function&quot;){
+throw new Error(&quot;'funcOrStr' must be a function on 'objOrFunc'&quot;);
+}
+}else{
+if(typeof (_54e)!=&quot;function&quot;){
+throw new Error(&quot;'funcOrStr' must be a function or string&quot;);
+}
+}
+}else{
+if(typeof (_54d)!=&quot;function&quot;){
+throw new Error(&quot;'objOrFunc' must be a function if 'funcOrStr' is not given&quot;);
+}else{
+func=_54d;
+}
+}
+return [obj,func];
+},connect:function(src,sig,_553,_554){
+src=MochiKit.DOM.getElement(src);
+var self=MochiKit.Signal;
+if(typeof (sig)!=&quot;string&quot;){
+throw new Error(&quot;'sig' must be a string&quot;);
+}
+var _556=self._getDestPair(_553,_554);
+var obj=_556[0];
+var func=_556[1];
+if(typeof (obj)==&quot;undefined&quot;||obj===null){
+obj=src;
+}
+var _559=!!(src.addEventListener||src.attachEvent);
+if(_559&amp;&amp;(sig===&quot;onmouseenter&quot;||sig===&quot;onmouseleave&quot;)&amp;&amp;!self._browserAlreadyHasMouseEnterAndLeave()){
+var _55a=self._mouseEnterListener(src,sig.substr(2),func,obj);
+if(sig===&quot;onmouseenter&quot;){
+sig=&quot;onmouseover&quot;;
+}else{
+sig=&quot;onmouseout&quot;;
+}
+}else{
+var _55a=self._listener(src,sig,func,obj,_559);
+}
+if(src.addEventListener){
+src.addEventListener(sig.substr(2),_55a,false);
+}else{
+if(src.attachEvent){
+src.attachEvent(sig,_55a);
+}
+}
+var _55b=new MochiKit.Signal.Ident({source:src,signal:sig,listener:_55a,isDOM:_559,objOrFunc:_553,funcOrStr:_554,connected:true});
+self._observers.push(_55b);
+if(!_559&amp;&amp;typeof (src.__connect__)==&quot;function&quot;){
+var args=MochiKit.Base.extend([_55b],arguments,1);
+src.__connect__.apply(src,args);
+}
+return _55b;
+},_disconnect:function(_55d){
+if(!_55d.connected){
+return;
+}
+_55d.connected=false;
+if(!_55d.isDOM){
+return;
+}
+var src=_55d.source;
+var sig=_55d.signal;
+var _560=_55d.listener;
+if(src.removeEventListener){
+src.removeEventListener(sig.substr(2),_560,false);
+}else{
+if(src.detachEvent){
+src.detachEvent(sig,_560);
+}else{
+throw new Error(&quot;'src' must be a DOM element&quot;);
+}
+}
+},disconnect:function(_561){
+var self=MochiKit.Signal;
+var _563=self._observers;
+var m=MochiKit.Base;
+if(arguments.length&gt;1){
+var src=MochiKit.DOM.getElement(arguments[0]);
+var sig=arguments[1];
+var obj=arguments[2];
+var func=arguments[3];
+for(var i=_563.length-1;i&gt;=0;i--){
+var o=_563[i];
+if(o.source===src&amp;&amp;o.signal===sig&amp;&amp;o.objOrFunc===obj&amp;&amp;o.funcOrStr===func){
+self._disconnect(o);
+if(!self._lock){
+_563.splice(i,1);
+}else{
+self._dirty=true;
+}
+return true;
+}
+}
+}else{
+var idx=m.findIdentical(_563,_561);
+if(idx&gt;=0){
+self._disconnect(_561);
+if(!self._lock){
+_563.splice(idx,1);
+}else{
+self._dirty=true;
+}
+return true;
+}
+}
+return false;
+},disconnectAllTo:function(_56c,_56d){
+var self=MochiKit.Signal;
+var _56f=self._observers;
+var _570=self._disconnect;
+var _571=self._lock;
+var _572=self._dirty;
+if(typeof (_56d)===&quot;undefined&quot;){
+_56d=null;
+}
+for(var i=_56f.length-1;i&gt;=0;i--){
+var _574=_56f[i];
+if(_574.objOrFunc===_56c&amp;&amp;(_56d===null||_574.funcOrStr===_56d)){
+_570(_574);
+if(_571){
+_572=true;
+}else{
+_56f.splice(i,1);
+}
+}
+}
+self._dirty=_572;
+},disconnectAll:function(src,sig){
+src=MochiKit.DOM.getElement(src);
+var m=MochiKit.Base;
+var _578=m.flattenArguments(m.extend(null,arguments,1));
+var self=MochiKit.Signal;
+var _57a=self._disconnect;
+var _57b=self._observers;
+var i,_57d;
+var _57e=self._lock;
+var _57f=self._dirty;
+if(_578.length===0){
+for(i=_57b.length-1;i&gt;=0;i--){
+_57d=_57b[i];
+if(_57d.source===src){
+_57a(_57d);
+if(!_57e){
+_57b.splice(i,1);
+}else{
+_57f=true;
+}
+}
+}
+}else{
+var sigs={};
+for(i=0;i&lt;_578.length;i++){
+sigs[_578[i]]=true;
+}
+for(i=_57b.length-1;i&gt;=0;i--){
+_57d=_57b[i];
+if(_57d.source===src&amp;&amp;_57d.signal in sigs){
+_57a(_57d);
+if(!_57e){
+_57b.splice(i,1);
+}else{
+_57f=true;
+}
+}
+}
+}
+self._dirty=_57f;
+},signal:function(src,sig){
+var self=MochiKit.Signal;
+var _584=self._observers;
+src=MochiKit.DOM.getElement(src);
+var args=MochiKit.Base.extend(null,arguments,2);
+var _586=[];
+self._lock=true;
+for(var i=0;i&lt;_584.length;i++){
+var _588=_584[i];
+if(_588.source===src&amp;&amp;_588.signal===sig&amp;&amp;_588.connected){
+try{
+_588.listener.apply(src,args);
+}
+catch(e){
+_586.push(e);
+}
+}
+}
+self._lock=false;
+if(self._dirty){
+self._dirty=false;
+for(var i=_584.length-1;i&gt;=0;i--){
+if(!_584[i].connected){
+_584.splice(i,1);
+}
+}
+}
+if(_586.length==1){
+throw _586[0];
+}else{
+if(_586.length&gt;1){
+var e=new Error(&quot;Multiple errors thrown in handling 'sig', see errors property&quot;);
+e.errors=_586;
+throw e;
+}
+}
+}});
+MochiKit.Signal.EXPORT_OK=[];
+MochiKit.Signal.EXPORT=[&quot;connect&quot;,&quot;disconnect&quot;,&quot;signal&quot;,&quot;disconnectAll&quot;,&quot;disconnectAllTo&quot;];
+MochiKit.Signal.__new__=function(win){
+var m=MochiKit.Base;
+this._document=document;
+this._window=win;
+this._lock=false;
+this._dirty=false;
+try{
+this.connect(window,&quot;onunload&quot;,this._unloadCache);
+}
+catch(e){
+}
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+MochiKit.Signal.__new__(this);
+if(MochiKit.__export__){
+connect=MochiKit.Signal.connect;
+disconnect=MochiKit.Signal.disconnect;
+disconnectAll=MochiKit.Signal.disconnectAll;
+signal=MochiKit.Signal.signal;
+}
+MochiKit.Base._exportSymbols(this,MochiKit.Signal);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Position&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+dojo.require(&quot;MochiKit.DOM&quot;);
+dojo.require(&quot;MochiKit.Style&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+JSAN.use(&quot;MochiKit.DOM&quot;,[]);
+JSAN.use(&quot;MochiKit.Style&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)==&quot;undefined&quot;||typeof (MochiKit.Style)==&quot;undefined&quot;||typeof (MochiKit.DOM)==&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Style depends on MochiKit.Base, MochiKit.DOM, and MochiKit.Style!&quot;;
+}
+if(typeof (MochiKit.Position)==&quot;undefined&quot;){
+MochiKit.Position={};
+}
+MochiKit.Position.NAME=&quot;MochiKit.Position&quot;;
+MochiKit.Position.VERSION=&quot;1.4&quot;;
+MochiKit.Position.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.Position.toString=function(){
+return this.__repr__();
+};
+MochiKit.Position.EXPORT_OK=[];
+MochiKit.Position.EXPORT=[];
+MochiKit.Base.update(MochiKit.Position,{includeScrollOffsets:false,prepare:function(){
+var _58c=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
+var _58d=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
+this.windowOffset=new MochiKit.Style.Coordinates(_58c,_58d);
+},cumulativeOffset:function(_58e){
+var _58f=0;
+var _590=0;
+do{
+_58f+=_58e.offsetTop||0;
+_590+=_58e.offsetLeft||0;
+_58e=_58e.offsetParent;
+}while(_58e);
+return new MochiKit.Style.Coordinates(_590,_58f);
+},realOffset:function(_591){
+var _592=0;
+var _593=0;
+do{
+_592+=_591.scrollTop||0;
+_593+=_591.scrollLeft||0;
+_591=_591.parentNode;
+}while(_591);
+return new MochiKit.Style.Coordinates(_593,_592);
+},within:function(_594,x,y){
+if(this.includeScrollOffsets){
+return this.withinIncludingScrolloffsets(_594,x,y);
+}
+this.xcomp=x;
+this.ycomp=y;
+this.offset=this.cumulativeOffset(_594);
+if(_594.style.position==&quot;fixed&quot;){
+this.offset.x+=this.windowOffset.x;
+this.offset.y+=this.windowOffset.y;
+}
+return (y&gt;=this.offset.y&amp;&amp;y&lt;this.offset.y+_594.offsetHeight&amp;&amp;x&gt;=this.offset.x&amp;&amp;x&lt;this.offset.x+_594.offsetWidth);
+},withinIncludingScrolloffsets:function(_597,x,y){
+var _59a=this.realOffset(_597);
+this.xcomp=x+_59a.x-this.windowOffset.x;
+this.ycomp=y+_59a.y-this.windowOffset.y;
+this.offset=this.cumulativeOffset(_597);
+return (this.ycomp&gt;=this.offset.y&amp;&amp;this.ycomp&lt;this.offset.y+_597.offsetHeight&amp;&amp;this.xcomp&gt;=this.offset.x&amp;&amp;this.xcomp&lt;this.offset.x+_597.offsetWidth);
+},overlap:function(mode,_59c){
+if(!mode){
+return 0;
+}
+if(mode==&quot;vertical&quot;){
+return ((this.offset.y+_59c.offsetHeight)-this.ycomp)/_59c.offsetHeight;
+}
+if(mode==&quot;horizontal&quot;){
+return ((this.offset.x+_59c.offsetWidth)-this.xcomp)/_59c.offsetWidth;
+}
+},absolutize:function(_59d){
+_59d=MochiKit.DOM.getElement(_59d);
+if(_59d.style.position==&quot;absolute&quot;){
+return;
+}
+MochiKit.Position.prepare();
+var _59e=MochiKit.Position.positionedOffset(_59d);
+var _59f=_59d.clientWidth;
+var _5a0=_59d.clientHeight;
+var _5a1={&quot;position&quot;:_59d.style.position,&quot;left&quot;:_59e.x-parseFloat(_59d.style.left||0),&quot;top&quot;:_59e.y-parseFloat(_59d.style.top||0),&quot;width&quot;:_59d.style.width,&quot;height&quot;:_59d.style.height};
+_59d.style.position=&quot;absolute&quot;;
+_59d.style.top=_59e.y+&quot;px&quot;;
+_59d.style.left=_59e.x+&quot;px&quot;;
+_59d.style.width=_59f+&quot;px&quot;;
+_59d.style.height=_5a0+&quot;px&quot;;
+return _5a1;
+},positionedOffset:function(_5a2){
+var _5a3=0,_5a4=0;
+do{
+_5a3+=_5a2.offsetTop||0;
+_5a4+=_5a2.offsetLeft||0;
+_5a2=_5a2.offsetParent;
+if(_5a2){
+p=MochiKit.Style.getStyle(_5a2,&quot;position&quot;);
+if(p==&quot;relative&quot;||p==&quot;absolute&quot;){
+break;
+}
+}
+}while(_5a2);
+return new MochiKit.Style.Coordinates(_5a4,_5a3);
+},relativize:function(_5a5,_5a6){
+_5a5=MochiKit.DOM.getElement(_5a5);
+if(_5a5.style.position==&quot;relative&quot;){
+return;
+}
+MochiKit.Position.prepare();
+var top=parseFloat(_5a5.style.top||0)-(_5a6[&quot;top&quot;]||0);
+var left=parseFloat(_5a5.style.left||0)-(_5a6[&quot;left&quot;]||0);
+_5a5.style.position=_5a6[&quot;position&quot;];
+_5a5.style.top=top+&quot;px&quot;;
+_5a5.style.left=left+&quot;px&quot;;
+_5a5.style.width=_5a6[&quot;width&quot;];
+_5a5.style.height=_5a6[&quot;height&quot;];
+},clone:function(_5a9,_5aa){
+_5a9=MochiKit.DOM.getElement(_5a9);
+_5aa=MochiKit.DOM.getElement(_5aa);
+_5aa.style.position=&quot;absolute&quot;;
+var _5ab=this.cumulativeOffset(_5a9);
+_5aa.style.top=_5ab.y+&quot;px&quot;;
+_5aa.style.left=_5ab.x+&quot;px&quot;;
+_5aa.style.width=_5a9.offsetWidth+&quot;px&quot;;
+_5aa.style.height=_5a9.offsetHeight+&quot;px&quot;;
+},page:function(_5ac){
+var _5ad=0;
+var _5ae=0;
+var _5af=_5ac;
+do{
+_5ad+=_5af.offsetTop||0;
+_5ae+=_5af.offsetLeft||0;
+if(_5af.offsetParent==document.body&amp;&amp;MochiKit.Style.getStyle(_5af,&quot;position&quot;)==&quot;absolute&quot;){
+break;
+}
+}while(_5af=_5af.offsetParent);
+_5af=_5ac;
+do{
+_5ad-=_5af.scrollTop||0;
+_5ae-=_5af.scrollLeft||0;
+}while(_5af=_5af.parentNode);
+return new MochiKit.Style.Coordinates(_5ae,_5ad);
+}});
+MochiKit.Position.__new__=function(win){
+var m=MochiKit.Base;
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+m.nameFunctions(this);
+};
+MochiKit.Position.__new__(this);
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.Visual&quot;);
+dojo.require(&quot;MochiKit.Base&quot;);
+dojo.require(&quot;MochiKit.DOM&quot;);
+dojo.require(&quot;MochiKit.Style&quot;);
+dojo.require(&quot;MochiKit.Color&quot;);
+dojo.require(&quot;MochiKit.Position&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+JSAN.use(&quot;MochiKit.Base&quot;,[]);
+JSAN.use(&quot;MochiKit.DOM&quot;,[]);
+JSAN.use(&quot;MochiKit.Style&quot;,[]);
+JSAN.use(&quot;MochiKit.Color&quot;,[]);
+JSAN.use(&quot;MochiKit.Position&quot;,[]);
+}
+try{
+if(typeof (MochiKit.Base)===&quot;undefined&quot;||typeof (MochiKit.DOM)===&quot;undefined&quot;||typeof (MochiKit.Style)===&quot;undefined&quot;||typeof (MochiKit.Position)===&quot;undefined&quot;||typeof (MochiKit.Color)===&quot;undefined&quot;){
+throw &quot;&quot;;
+}
+}
+catch(e){
+throw &quot;MochiKit.Visual depends on MochiKit.Base, MochiKit.DOM, MochiKit.Style, MochiKit.Position and MochiKit.Color!&quot;;
+}
+if(typeof (MochiKit.Visual)==&quot;undefined&quot;){
+MochiKit.Visual={};
+}
+MochiKit.Visual.NAME=&quot;MochiKit.Visual&quot;;
+MochiKit.Visual.VERSION=&quot;1.4&quot;;
+MochiKit.Visual.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.Visual.toString=function(){
+return this.__repr__();
+};
+MochiKit.Visual._RoundCorners=function(e,_5b3){
+e=MochiKit.DOM.getElement(e);
+this._setOptions(_5b3);
+if(this.options.__unstable__wrapElement){
+e=this._doWrap(e);
+}
+var _5b4=this.options.color;
+var C=MochiKit.Color.Color;
+if(this.options.color===&quot;fromElement&quot;){
+_5b4=C.fromBackground(e);
+}else{
+if(!(_5b4 instanceof C)){
+_5b4=C.fromString(_5b4);
+}
+}
+this.isTransparent=(_5b4.asRGB().a&lt;=0);
+var _5b6=this.options.bgColor;
+if(this.options.bgColor===&quot;fromParent&quot;){
+_5b6=C.fromBackground(e.offsetParent);
+}else{
+if(!(_5b6 instanceof C)){
+_5b6=C.fromString(_5b6);
+}
+}
+this._roundCornersImpl(e,_5b4,_5b6);
+};
+MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){
+var _5b8=e.parentNode;
+var doc=MochiKit.DOM.currentDocument();
+if(typeof (doc.defaultView)===&quot;undefined&quot;||doc.defaultView===null){
+return e;
+}
+var _5ba=doc.defaultView.getComputedStyle(e,null);
+if(typeof (_5ba)===&quot;undefined&quot;||_5ba===null){
+return e;
+}
+var _5bb=MochiKit.DOM.DIV({&quot;style&quot;:{display:&quot;block&quot;,marginTop:_5ba.getPropertyValue(&quot;padding-top&quot;),marginRight:_5ba.getPropertyValue(&quot;padding-right&quot;),marginBottom:_5ba.getPropertyValue(&quot;padding-bottom&quot;),marginLeft:_5ba.getPropertyValue(&quot;padding-left&quot;),padding:&quot;0px&quot;}});
+_5bb.innerHTML=e.innerHTML;
+e.innerHTML=&quot;&quot;;
+e.appendChild(_5bb);
+return e;
+},_roundCornersImpl:function(e,_5bd,_5be){
+if(this.options.border){
+this._renderBorder(e,_5be);
+}
+if(this._isTopRounded()){
+this._roundTopCorners(e,_5bd,_5be);
+}
+if(this._isBottomRounded()){
+this._roundBottomCorners(e,_5bd,_5be);
+}
+},_renderBorder:function(el,_5c0){
+var _5c1=&quot;1px solid &quot;+this._borderColor(_5c0);
+var _5c2=&quot;border-left: &quot;+_5c1;
+var _5c3=&quot;border-right: &quot;+_5c1;
+var _5c4=&quot;style='&quot;+_5c2+&quot;;&quot;+_5c3+&quot;'&quot;;
+el.innerHTML=&quot;&lt;div &quot;+_5c4+&quot;&gt;&quot;+el.innerHTML+&quot;&lt;/div&gt;&quot;;
+},_roundTopCorners:function(el,_5c6,_5c7){
+var _5c8=this._createCorner(_5c7);
+for(var i=0;i&lt;this.options.numSlices;i++){
+_5c8.appendChild(this._createCornerSlice(_5c6,_5c7,i,&quot;top&quot;));
+}
+el.style.paddingTop=0;
+el.insertBefore(_5c8,el.firstChild);
+},_roundBottomCorners:function(el,_5cb,_5cc){
+var _5cd=this._createCorner(_5cc);
+for(var i=(this.options.numSlices-1);i&gt;=0;i--){
+_5cd.appendChild(this._createCornerSlice(_5cb,_5cc,i,&quot;bottom&quot;));
+}
+el.style.paddingBottom=0;
+el.appendChild(_5cd);
+},_createCorner:function(_5cf){
+var dom=MochiKit.DOM;
+return dom.DIV({style:{backgroundColor:_5cf.toString()}});
+},_createCornerSlice:function(_5d1,_5d2,n,_5d4){
+var _5d5=MochiKit.DOM.SPAN();
+var _5d6=_5d5.style;
+_5d6.backgroundColor=_5d1.toString();
+_5d6.display=&quot;block&quot;;
+_5d6.height=&quot;1px&quot;;
+_5d6.overflow=&quot;hidden&quot;;
+_5d6.fontSize=&quot;1px&quot;;
+var _5d7=this._borderColor(_5d1,_5d2);
+if(this.options.border&amp;&amp;n===0){
+_5d6.borderTopStyle=&quot;solid&quot;;
+_5d6.borderTopWidth=&quot;1px&quot;;
+_5d6.borderLeftWidth=&quot;0px&quot;;
+_5d6.borderRightWidth=&quot;0px&quot;;
+_5d6.borderBottomWidth=&quot;0px&quot;;
+_5d6.height=&quot;0px&quot;;
+_5d6.borderColor=_5d7.toString();
+}else{
+if(_5d7){
+_5d6.borderColor=_5d7.toString();
+_5d6.borderStyle=&quot;solid&quot;;
+_5d6.borderWidth=&quot;0px 1px&quot;;
+}
+}
+if(!this.options.compact&amp;&amp;(n==(this.options.numSlices-1))){
+_5d6.height=&quot;2px&quot;;
+}
+this._setMargin(_5d5,n,_5d4);
+this._setBorder(_5d5,n,_5d4);
+return _5d5;
+},_setOptions:function(_5d8){
+this.options={corners:&quot;all&quot;,color:&quot;fromElement&quot;,bgColor:&quot;fromParent&quot;,blend:true,border:false,compact:false,__unstable__wrapElement:false};
+MochiKit.Base.update(this.options,_5d8);
+this.options.numSlices=(this.options.compact?2:4);
+},_whichSideTop:function(){
+var _5d9=this.options.corners;
+if(this._hasString(_5d9,&quot;all&quot;,&quot;top&quot;)){
+return &quot;&quot;;
+}
+var _5da=(_5d9.indexOf(&quot;tl&quot;)!=-1);
+var _5db=(_5d9.indexOf(&quot;tr&quot;)!=-1);
+if(_5da&amp;&amp;_5db){
+return &quot;&quot;;
+}
+if(_5da){
+return &quot;left&quot;;
+}
+if(_5db){
+return &quot;right&quot;;
+}
+return &quot;&quot;;
+},_whichSideBottom:function(){
+var _5dc=this.options.corners;
+if(this._hasString(_5dc,&quot;all&quot;,&quot;bottom&quot;)){
+return &quot;&quot;;
+}
+var _5dd=(_5dc.indexOf(&quot;bl&quot;)!=-1);
+var _5de=(_5dc.indexOf(&quot;br&quot;)!=-1);
+if(_5dd&amp;&amp;_5de){
+return &quot;&quot;;
+}
+if(_5dd){
+return &quot;left&quot;;
+}
+if(_5de){
+return &quot;right&quot;;
+}
+return &quot;&quot;;
+},_borderColor:function(_5df,_5e0){
+if(_5df==&quot;transparent&quot;){
+return _5e0;
+}else{
+if(this.options.border){
+return this.options.border;
+}else{
+if(this.options.blend){
+return _5e0.blendedColor(_5df);
+}
+}
+}
+return &quot;&quot;;
+},_setMargin:function(el,n,_5e3){
+var _5e4=this._marginSize(n)+&quot;px&quot;;
+var _5e5=(_5e3==&quot;top&quot;?this._whichSideTop():this._whichSideBottom());
+var _5e6=el.style;
+if(_5e5==&quot;left&quot;){
+_5e6.marginLeft=_5e4;
+_5e6.marginRight=&quot;0px&quot;;
+}else{
+if(_5e5==&quot;right&quot;){
+_5e6.marginRight=_5e4;
+_5e6.marginLeft=&quot;0px&quot;;
+}else{
+_5e6.marginLeft=_5e4;
+_5e6.marginRight=_5e4;
+}
+}
+},_setBorder:function(el,n,_5e9){
+var _5ea=this._borderSize(n)+&quot;px&quot;;
+var _5eb=(_5e9==&quot;top&quot;?this._whichSideTop():this._whichSideBottom());
+var _5ec=el.style;
+if(_5eb==&quot;left&quot;){
+_5ec.borderLeftWidth=_5ea;
+_5ec.borderRightWidth=&quot;0px&quot;;
+}else{
+if(_5eb==&quot;right&quot;){
+_5ec.borderRightWidth=_5ea;
+_5ec.borderLeftWidth=&quot;0px&quot;;
+}else{
+_5ec.borderLeftWidth=_5ea;
+_5ec.borderRightWidth=_5ea;
+}
+}
+},_marginSize:function(n){
+if(this.isTransparent){
+return 0;
+}
+var o=this.options;
+if(o.compact&amp;&amp;o.blend){
+var _5ef=[1,0];
+return _5ef[n];
+}else{
+if(o.compact){
+var _5f0=[2,1];
+return _5f0[n];
+}else{
+if(o.blend){
+var _5f1=[3,2,1,0];
+return _5f1[n];
+}else{
+var _5f2=[5,3,2,1];
+return _5f2[n];
+}
+}
+}
+},_borderSize:function(n){
+var o=this.options;
+var _5f5;
+if(o.compact&amp;&amp;(o.blend||this.isTransparent)){
+return 1;
+}else{
+if(o.compact){
+_5f5=[1,0];
+}else{
+if(o.blend){
+_5f5=[2,1,1,1];
+}else{
+if(o.border){
+_5f5=[0,2,0,0];
+}else{
+if(this.isTransparent){
+_5f5=[5,3,2,1];
+}else{
+return 0;
+}
+}
+}
+}
+}
+return _5f5[n];
+},_hasString:function(str){
+for(var i=1;i&lt;arguments.length;i++){
+if(str.indexOf(arguments[i])!=-1){
+return true;
+}
+}
+return false;
+},_isTopRounded:function(){
+return this._hasString(this.options.corners,&quot;all&quot;,&quot;top&quot;,&quot;tl&quot;,&quot;tr&quot;);
+},_isBottomRounded:function(){
+return this._hasString(this.options.corners,&quot;all&quot;,&quot;bottom&quot;,&quot;bl&quot;,&quot;br&quot;);
+},_hasSingleTextChild:function(el){
+return (el.childNodes.length==1&amp;&amp;el.childNodes[0].nodeType==3);
+}};
+MochiKit.Visual.roundElement=function(e,_5fa){
+new MochiKit.Visual._RoundCorners(e,_5fa);
+};
+MochiKit.Visual.roundClass=function(_5fb,_5fc,_5fd){
+var _5fe=MochiKit.DOM.getElementsByTagAndClassName(_5fb,_5fc);
+for(var i=0;i&lt;_5fe.length;i++){
+MochiKit.Visual.roundElement(_5fe[i],_5fd);
+}
+};
+MochiKit.Visual.tagifyText=function(_600,_601){
+_601=_601||&quot;position:relative&quot;;
+if(/MSIE/.test(navigator.userAgent)){
+_601+=&quot;;zoom:1&quot;;
+}
+_600=MochiKit.DOM.getElement(_600);
+var ma=MochiKit.Base.map;
+ma(function(_603){
+if(_603.nodeType==3){
+ma(function(_604){
+_600.insertBefore(MochiKit.DOM.SPAN({style:_601},_604==&quot; &quot;?String.fromCharCode(160):_604),_603);
+},_603.nodeValue.split(&quot;&quot;));
+MochiKit.DOM.removeElement(_603);
+}
+},_600.childNodes);
+};
+MochiKit.Visual.forceRerendering=function(_605){
+try{
+_605=MochiKit.DOM.getElement(_605);
+var n=document.createTextNode(&quot; &quot;);
+_605.appendChild(n);
+_605.removeChild(n);
+}
+catch(e){
+}
+};
+MochiKit.Visual.multiple=function(_607,_608,_609){
+_609=MochiKit.Base.update({speed:0.1,delay:0},_609);
+var _60a=_609.delay;
+var _60b=0;
+MochiKit.Base.map(function(_60c){
+_609.delay=_60b*_609.speed+_60a;
+new _608(_60c,_609);
+_60b+=1;
+},_607);
+};
+MochiKit.Visual.PAIRS={&quot;slide&quot;:[&quot;slideDown&quot;,&quot;slideUp&quot;],&quot;blind&quot;:[&quot;blindDown&quot;,&quot;blindUp&quot;],&quot;appear&quot;:[&quot;appear&quot;,&quot;fade&quot;],&quot;size&quot;:[&quot;grow&quot;,&quot;shrink&quot;]};
+MochiKit.Visual.toggle=function(_60d,_60e,_60f){
+_60d=MochiKit.DOM.getElement(_60d);
+_60e=(_60e||&quot;appear&quot;).toLowerCase();
+_60f=MochiKit.Base.update({queue:{position:&quot;end&quot;,scope:(_60d.id||&quot;global&quot;),limit:1}},_60f);
+var v=MochiKit.Visual;
+v[MochiKit.Style.getStyle(_60d,&quot;display&quot;)!=&quot;none&quot;?v.PAIRS[_60e][1]:v.PAIRS[_60e][0]](_60d,_60f);
+};
+MochiKit.Visual.Transitions={};
+MochiKit.Visual.Transitions.linear=function(pos){
+return pos;
+};
+MochiKit.Visual.Transitions.sinoidal=function(pos){
+return (-Math.cos(pos*Math.PI)/2)+0.5;
+};
+MochiKit.Visual.Transitions.reverse=function(pos){
+return 1-pos;
+};
+MochiKit.Visual.Transitions.flicker=function(pos){
+return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
+};
+MochiKit.Visual.Transitions.wobble=function(pos){
+return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
+};
+MochiKit.Visual.Transitions.pulse=function(pos,_617){
+if(!_617){
+return (Math.floor(pos*10)%2===0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10)));
+}
+return (Math.round((pos%(1/_617))*_617)==0?((pos*_617*2)-Math.floor(pos*_617*2)):1-((pos*_617*2)-Math.floor(pos*_617*2)));
+};
+MochiKit.Visual.Transitions.none=function(pos){
+return 0;
+};
+MochiKit.Visual.Transitions.full=function(pos){
+return 1;
+};
+MochiKit.Visual.ScopedQueue=function(){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls();
+}
+this.__init__();
+};
+MochiKit.Base.update(MochiKit.Visual.ScopedQueue.prototype,{__init__:function(){
+this.effects=[];
+this.interval=null;
+},add:function(_61b){
+var _61c=new Date().getTime();
+var _61d=(typeof (_61b.options.queue)==&quot;string&quot;)?_61b.options.queue:_61b.options.queue.position;
+var ma=MochiKit.Base.map;
+switch(_61d){
+case &quot;front&quot;:
+ma(function(e){
+if(e.state==&quot;idle&quot;){
+e.startOn+=_61b.finishOn;
+e.finishOn+=_61b.finishOn;
+}
+},this.effects);
+break;
+case &quot;end&quot;:
+var _620;
+ma(function(e){
+var i=e.finishOn;
+if(i&gt;=(_620||i)){
+_620=i;
+}
+},this.effects);
+_61c=_620||_61c;
+break;
+case &quot;break&quot;:
+ma(function(e){
+e.finalize();
+},this.effects);
+break;
+}
+_61b.startOn+=_61c;
+_61b.finishOn+=_61c;
+if(!_61b.options.queue.limit||this.effects.length&lt;_61b.options.queue.limit){
+this.effects.push(_61b);
+}
+if(!this.interval){
+this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40);
+}
+},startLoop:function(func,_625){
+return setInterval(func,_625);
+},remove:function(_626){
+this.effects=MochiKit.Base.filter(function(e){
+return e!=_626;
+},this.effects);
+if(!this.effects.length){
+this.stopLoop(this.interval);
+this.interval=null;
+}
+},stopLoop:function(_628){
+clearInterval(_628);
+},loop:function(){
+var _629=new Date().getTime();
+MochiKit.Base.map(function(_62a){
+_62a.loop(_629);
+},this.effects);
+}});
+MochiKit.Visual.Queues={instances:{},get:function(_62b){
+if(typeof (_62b)!=&quot;string&quot;){
+return _62b;
+}
+if(!this.instances[_62b]){
+this.instances[_62b]=new MochiKit.Visual.ScopedQueue();
+}
+return this.instances[_62b];
+}};
+MochiKit.Visual.Queue=MochiKit.Visual.Queues.get(&quot;global&quot;);
+MochiKit.Visual.DefaultOptions={transition:MochiKit.Visual.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:&quot;parallel&quot;};
+MochiKit.Visual.Base=function(){
+};
+MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_62c){
+var v=MochiKit.Visual;
+this.options=MochiKit.Base.setdefault(_62c,v.DefaultOptions);
+this.currentFrame=0;
+this.state=&quot;idle&quot;;
+this.startOn=this.options.delay*1000;
+this.finishOn=this.startOn+(this.options.duration*1000);
+this.event(&quot;beforeStart&quot;);
+if(!this.options.sync){
+v.Queues.get(typeof (this.options.queue)==&quot;string&quot;?&quot;global&quot;:this.options.queue.scope).add(this);
+}
+},loop:function(_62e){
+if(_62e&gt;=this.startOn){
+if(_62e&gt;=this.finishOn){
+return this.finalize();
+}
+var pos=(_62e-this.startOn)/(this.finishOn-this.startOn);
+var _630=Math.round(pos*this.options.fps*this.options.duration);
+if(_630&gt;this.currentFrame){
+this.render(pos);
+this.currentFrame=_630;
+}
+}
+},render:function(pos){
+if(this.state==&quot;idle&quot;){
+this.state=&quot;running&quot;;
+this.event(&quot;beforeSetup&quot;);
+this.setup();
+this.event(&quot;afterSetup&quot;);
+}
+if(this.state==&quot;running&quot;){
+if(this.options.transition){
+pos=this.options.transition(pos);
+}
+pos*=(this.options.to-this.options.from);
+pos+=this.options.from;
+this.event(&quot;beforeUpdate&quot;);
+this.update(pos);
+this.event(&quot;afterUpdate&quot;);
+}
+},cancel:function(){
+if(!this.options.sync){
+MochiKit.Visual.Queues.get(typeof (this.options.queue)==&quot;string&quot;?&quot;global&quot;:this.options.queue.scope).remove(this);
+}
+this.state=&quot;finished&quot;;
+},finalize:function(){
+this.render(1);
+this.cancel();
+this.event(&quot;beforeFinish&quot;);
+this.finish();
+this.event(&quot;afterFinish&quot;);
+},setup:function(){
+},finish:function(){
+},update:function(_632){
+},event:function(_633){
+if(this.options[_633+&quot;Internal&quot;]){
+this.options[_633+&quot;Internal&quot;](this);
+}
+if(this.options[_633]){
+this.options[_633](this);
+}
+},repr:function(){
+return &quot;[&quot;+this.__class__.NAME+&quot;, options:&quot;+MochiKit.Base.repr(this.options)+&quot;]&quot;;
+}};
+MochiKit.Visual.Parallel=function(_634,_635){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_634,_635);
+}
+this.__init__(_634,_635);
+};
+MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__class__:MochiKit.Visual.Parallel,__init__:function(_637,_638){
+this.effects=_637||[];
+this.start(_638);
+},update:function(_639){
+MochiKit.Base.map(function(_63a){
+_63a.render(_639);
+},this.effects);
+},finish:function(){
+MochiKit.Base.map(function(_63b){
+_63b.finalize();
+},this.effects);
+}});
+MochiKit.Visual.Opacity=function(_63c,_63d){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_63c,_63d);
+}
+this.__init__(_63c,_63d);
+};
+MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__class__:MochiKit.Visual.Opacity,__init__:function(_63f,_640){
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+this.element=MochiKit.DOM.getElement(_63f);
+if(this.element.currentStyle&amp;&amp;(!this.element.currentStyle.hasLayout)){
+s.setStyle(this.element,{zoom:1});
+}
+_640=b.update({from:s.getStyle(this.element,&quot;opacity&quot;)||0,to:1},_640);
+this.start(_640);
+},update:function(_643){
+MochiKit.Style.setStyle(this.element,{&quot;opacity&quot;:_643});
+}});
+MochiKit.Visual.Move=function(_644,_645){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_644,_645);
+}
+this.__init__(_644,_645);
+};
+MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__class__:MochiKit.Visual.Move,__init__:function(_647,_648){
+this.element=MochiKit.DOM.getElement(_647);
+_648=MochiKit.Base.update({x:0,y:0,mode:&quot;relative&quot;},_648);
+this.start(_648);
+},setup:function(){
+MochiKit.DOM.makePositioned(this.element);
+var s=this.element.style;
+var _64a=s.visibility;
+var _64b=s.display;
+if(_64b==&quot;none&quot;){
+s.visibility=&quot;hidden&quot;;
+s.display=&quot;&quot;;
+}
+this.originalLeft=parseFloat(MochiKit.Style.getStyle(this.element,&quot;left&quot;)||&quot;0&quot;);
+this.originalTop=parseFloat(MochiKit.Style.getStyle(this.element,&quot;top&quot;)||&quot;0&quot;);
+if(this.options.mode==&quot;absolute&quot;){
+this.options.x-=this.originalLeft;
+this.options.y-=this.originalTop;
+}
+if(_64b==&quot;none&quot;){
+s.visibility=_64a;
+s.display=_64b;
+}
+},update:function(_64c){
+MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_64c+this.originalLeft)+&quot;px&quot;,top:Math.round(this.options.y*_64c+this.originalTop)+&quot;px&quot;});
+}});
+MochiKit.Visual.Scale=function(_64d,_64e,_64f){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_64d,_64e,_64f);
+}
+this.__init__(_64d,_64e,_64f);
+};
+MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__class__:MochiKit.Visual.Scale,__init__:function(_651,_652,_653){
+this.element=MochiKit.DOM.getElement(_651);
+_653=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:&quot;box&quot;,scaleFrom:100,scaleTo:_652},_653);
+this.start(_653);
+},setup:function(){
+this.restoreAfterFinish=this.options.restoreAfterFinish||false;
+this.elementPositioning=MochiKit.Style.getStyle(this.element,&quot;position&quot;);
+var ma=MochiKit.Base.map;
+var b=MochiKit.Base.bind;
+this.originalStyle={};
+ma(b(function(k){
+this.originalStyle[k]=this.element.style[k];
+},this),[&quot;top&quot;,&quot;left&quot;,&quot;width&quot;,&quot;height&quot;,&quot;fontSize&quot;]);
+this.originalTop=this.element.offsetTop;
+this.originalLeft=this.element.offsetLeft;
+var _657=MochiKit.Style.getStyle(this.element,&quot;font-size&quot;)||&quot;100%&quot;;
+ma(b(function(_658){
+if(_657.indexOf(_658)&gt;0){
+this.fontSize=parseFloat(_657);
+this.fontSizeType=_658;
+}
+},this),[&quot;em&quot;,&quot;px&quot;,&quot;%&quot;]);
+this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
+if(/^content/.test(this.options.scaleMode)){
+this.dims=[this.element.scrollHeight,this.element.scrollWidth];
+}else{
+if(this.options.scaleMode==&quot;box&quot;){
+this.dims=[this.element.offsetHeight,this.element.offsetWidth];
+}else{
+this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
+}
+}
+},update:function(_659){
+var _65a=(this.options.scaleFrom/100)+(this.factor*_659);
+if(this.options.scaleContent&amp;&amp;this.fontSize){
+MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_65a+this.fontSizeType});
+}
+this.setDimensions(this.dims[0]*_65a,this.dims[1]*_65a);
+},finish:function(){
+if(this.restoreAfterFinish){
+MochiKit.Style.setStyle(this.element,this.originalStyle);
+}
+},setDimensions:function(_65b,_65c){
+var d={};
+var r=Math.round;
+if(/MSIE/.test(navigator.userAgent)){
+r=Math.ceil;
+}
+if(this.options.scaleX){
+d.width=r(_65c)+&quot;px&quot;;
+}
+if(this.options.scaleY){
+d.height=r(_65b)+&quot;px&quot;;
+}
+if(this.options.scaleFromCenter){
+var topd=(_65b-this.dims[0])/2;
+var _660=(_65c-this.dims[1])/2;
+if(this.elementPositioning==&quot;absolute&quot;){
+if(this.options.scaleY){
+d.top=this.originalTop-topd+&quot;px&quot;;
+}
+if(this.options.scaleX){
+d.left=this.originalLeft-_660+&quot;px&quot;;
+}
+}else{
+if(this.options.scaleY){
+d.top=-topd+&quot;px&quot;;
+}
+if(this.options.scaleX){
+d.left=-_660+&quot;px&quot;;
+}
+}
+}
+MochiKit.Style.setStyle(this.element,d);
+}});
+MochiKit.Visual.Highlight=function(_661,_662){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_661,_662);
+}
+this.__init__(_661,_662);
+};
+MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__class__:MochiKit.Visual.Highlight,__init__:function(_664,_665){
+this.element=MochiKit.DOM.getElement(_664);
+_665=MochiKit.Base.update({startcolor:&quot;#ffff99&quot;},_665);
+this.start(_665);
+},setup:function(){
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+if(s.getStyle(this.element,&quot;display&quot;)==&quot;none&quot;){
+this.cancel();
+return;
+}
+this.oldStyle={backgroundImage:s.getStyle(this.element,&quot;background-image&quot;)};
+s.setStyle(this.element,{backgroundImage:&quot;none&quot;});
+if(!this.options.endcolor){
+this.options.endcolor=MochiKit.Color.Color.fromBackground(this.element).toHexString();
+}
+if(b.isUndefinedOrNull(this.options.restorecolor)){
+this.options.restorecolor=s.getStyle(this.element,&quot;background-color&quot;);
+}
+this._base=b.map(b.bind(function(i){
+return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
+},this),[0,1,2]);
+this._delta=b.map(b.bind(function(i){
+return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
+},this),[0,1,2]);
+},update:function(_66a){
+var m=&quot;#&quot;;
+MochiKit.Base.map(MochiKit.Base.bind(function(i){
+m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_66a));
+},this),[0,1,2]);
+MochiKit.Style.setStyle(this.element,{backgroundColor:m});
+},finish:function(){
+MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor}));
+}});
+MochiKit.Visual.ScrollTo=function(_66d,_66e){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_66d,_66e);
+}
+this.__init__(_66d,_66e);
+};
+MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__class__:MochiKit.Visual.ScrollTo,__init__:function(_670,_671){
+this.element=MochiKit.DOM.getElement(_670);
+this.start(_671);
+},setup:function(){
+var p=MochiKit.Position;
+p.prepare();
+var _673=p.cumulativeOffset(this.element);
+if(this.options.offset){
+_673.y+=this.options.offset;
+}
+var max;
+if(window.innerHeight){
+max=window.innerHeight-window.height;
+}else{
+if(document.documentElement&amp;&amp;document.documentElement.clientHeight){
+max=document.documentElement.clientHeight-document.body.scrollHeight;
+}else{
+if(document.body){
+max=document.body.clientHeight-document.body.scrollHeight;
+}
+}
+}
+this.scrollStart=p.windowOffset.y;
+this.delta=(_673.y&gt;max?max:_673.y)-this.scrollStart;
+},update:function(_675){
+var p=MochiKit.Position;
+p.prepare();
+window.scrollTo(p.windowOffset.x,this.scrollStart+(_675*this.delta));
+}});
+MochiKit.Visual.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
+MochiKit.Visual.Morph=function(_677,_678){
+var cls=arguments.callee;
+if(!(this instanceof cls)){
+return new cls(_677,_678);
+}
+this.__init__(_677,_678);
+};
+MochiKit.Visual.Morph.prototype=new MochiKit.Visual.Base();
+MochiKit.Base.update(MochiKit.Visual.Morph.prototype,{__class__:MochiKit.Visual.Morph,__init__:function(_67a,_67b){
+this.element=MochiKit.DOM.getElement(_67a);
+this.start(_67b);
+},setup:function(){
+var b=MochiKit.Base;
+var _67d=this.options.style;
+this.styleStart={};
+this.styleEnd={};
+this.units={};
+var _67e,unit;
+for(var s in _67d){
+_67e=_67d[s];
+s=b.camelize(s);
+if(MochiKit.Visual.CSS_LENGTH.test(_67e)){
+var _681=_67e.match(/^([\+\-]?[0-9\.]+)(.*)$/);
+_67e=parseFloat(_681[1]);
+unit=(_681.length==3)?_681[2]:null;
+this.styleEnd[s]=_67e;
+this.units[s]=unit;
+_67e=MochiKit.Style.getStyle(this.element,s);
+_681=_67e.match(/^([\+\-]?[0-9\.]+)(.*)$/);
+_67e=parseFloat(_681[1]);
+this.styleStart[s]=_67e;
+}else{
+var c=MochiKit.Color.Color;
+_67e=c.fromString(_67e);
+if(_67e){
+this.units[s]=&quot;color&quot;;
+this.styleEnd[s]=_67e.toHexString();
+_67e=MochiKit.Style.getStyle(this.element,s);
+this.styleStart[s]=c.fromString(_67e).toHexString();
+this.styleStart[s]=b.map(b.bind(function(i){
+return parseInt(this.styleStart[s].slice(i*2+1,i*2+3),16);
+},this),[0,1,2]);
+this.styleEnd[s]=b.map(b.bind(function(i){
+return parseInt(this.styleEnd[s].slice(i*2+1,i*2+3),16);
+},this),[0,1,2]);
+}
+}
+}
+},update:function(_685){
+var _686;
+for(var s in this.styleStart){
+if(this.units[s]==&quot;color&quot;){
+var m=&quot;#&quot;;
+var _689=this.styleStart[s];
+var end=this.styleEnd[s];
+MochiKit.Base.map(MochiKit.Base.bind(function(i){
+m+=MochiKit.Color.toColorPart(Math.round(_689[i]+(end[i]-_689[i])*_685));
+},this),[0,1,2]);
+this.element.style[s]=m;
+}else{
+_686=this.styleStart[s]+Math.round((this.styleEnd[s]-this.styleStart[s])*_685*1000)/1000+this.units[s];
+this.element.style[s]=_686;
+}
+}
+}});
+MochiKit.Visual.fade=function(_68c,_68d){
+var s=MochiKit.Style;
+var _68f=s.getStyle(_68c,&quot;opacity&quot;);
+_68d=MochiKit.Base.update({from:s.getStyle(_68c,&quot;opacity&quot;)||1,to:0,afterFinishInternal:function(_690){
+if(_690.options.to!==0){
+return;
+}
+s.hideElement(_690.element);
+s.setStyle(_690.element,{&quot;opacity&quot;:_68f});
+}},_68d);
+return new MochiKit.Visual.Opacity(_68c,_68d);
+};
+MochiKit.Visual.appear=function(_691,_692){
+var s=MochiKit.Style;
+var v=MochiKit.Visual;
+_692=MochiKit.Base.update({from:(s.getStyle(_691,&quot;display&quot;)==&quot;none&quot;?0:s.getStyle(_691,&quot;opacity&quot;)||0),to:1,afterFinishInternal:function(_695){
+v.forceRerendering(_695.element);
+},beforeSetupInternal:function(_696){
+s.setStyle(_696.element,{&quot;opacity&quot;:_696.options.from});
+s.showElement(_696.element);
+}},_692);
+return new v.Opacity(_691,_692);
+};
+MochiKit.Visual.puff=function(_697,_698){
+var s=MochiKit.Style;
+var v=MochiKit.Visual;
+_697=MochiKit.DOM.getElement(_697);
+var _69b={position:s.getStyle(_697,&quot;position&quot;),top:_697.style.top,left:_697.style.left,width:_697.style.width,height:_697.style.height,opacity:s.getStyle(_697,&quot;opacity&quot;)};
+_698=MochiKit.Base.update({beforeSetupInternal:function(_69c){
+MochiKit.Position.absolutize(_69c.effects[0].element);
+},afterFinishInternal:function(_69d){
+s.hideElement(_69d.effects[0].element);
+s.setStyle(_69d.effects[0].element,_69b);
+},scaleContent:true,scaleFromCenter:true},_698);
+return new v.Parallel([new v.Scale(_697,200,{sync:true,scaleFromCenter:_698.scaleFromCenter,scaleContent:_698.scaleContent,restoreAfterFinish:true}),new v.Opacity(_697,{sync:true,to:0})],_698);
+};
+MochiKit.Visual.blindUp=function(_69e,_69f){
+var d=MochiKit.DOM;
+_69e=d.getElement(_69e);
+var _6a1=d.makeClipping(_69e);
+_69f=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_6a2){
+MochiKit.Style.hideElement(_6a2.element);
+d.undoClipping(_6a2.element,_6a1);
+}},_69f);
+return new MochiKit.Visual.Scale(_69e,0,_69f);
+};
+MochiKit.Visual.blindDown=function(_6a3,_6a4){
+var d=MochiKit.DOM;
+var s=MochiKit.Style;
+_6a3=d.getElement(_6a3);
+var _6a7=s.getElementDimensions(_6a3);
+var _6a8;
+_6a4=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6a7.h,originalWidth:_6a7.w},restoreAfterFinish:true,afterSetupInternal:function(_6a9){
+_6a8=d.makeClipping(_6a9.element);
+s.setStyle(_6a9.element,{height:&quot;0px&quot;});
+s.showElement(_6a9.element);
+},afterFinishInternal:function(_6aa){
+d.undoClipping(_6aa.element,_6a8);
+}},_6a4);
+return new MochiKit.Visual.Scale(_6a3,100,_6a4);
+};
+MochiKit.Visual.switchOff=function(_6ab,_6ac){
+var d=MochiKit.DOM;
+_6ab=d.getElement(_6ab);
+var _6ae=MochiKit.Style.getStyle(_6ab,&quot;opacity&quot;);
+var _6af;
+_6ac=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_6b0){
+d.makePositioned(_6b0.element);
+_6af=d.makeClipping(_6b0.element);
+},afterFinishInternal:function(_6b1){
+MochiKit.Style.hideElement(_6b1.element);
+d.undoClipping(_6b1.element,_6af);
+d.undoPositioned(_6b1.element);
+MochiKit.Style.setStyle(_6b1.element,{&quot;opacity&quot;:_6ae});
+}},_6ac);
+var v=MochiKit.Visual;
+return new v.appear(_6ab,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_6b3){
+new v.Scale(_6b3.element,1,_6ac);
+}});
+};
+MochiKit.Visual.dropOut=function(_6b4,_6b5){
+var d=MochiKit.DOM;
+var s=MochiKit.Style;
+_6b4=d.getElement(_6b4);
+var _6b8={top:s.getStyle(_6b4,&quot;top&quot;),left:s.getStyle(_6b4,&quot;left&quot;),opacity:s.getStyle(_6b4,&quot;opacity&quot;)};
+_6b5=MochiKit.Base.update({duration:0.5,distance:100,beforeSetupInternal:function(_6b9){
+d.makePositioned(_6b9.effects[0].element);
+},afterFinishInternal:function(_6ba){
+s.hideElement(_6ba.effects[0].element);
+d.undoPositioned(_6ba.effects[0].element);
+s.setStyle(_6ba.effects[0].element,_6b8);
+}},_6b5);
+var v=MochiKit.Visual;
+return new v.Parallel([new v.Move(_6b4,{x:0,y:_6b5.distance,sync:true}),new v.Opacity(_6b4,{sync:true,to:0})],_6b5);
+};
+MochiKit.Visual.shake=function(_6bc,_6bd){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_6bc=d.getElement(_6bc);
+_6bd=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_6c1){
+d.undoPositioned(_6c1.element);
+s.setStyle(_6c1.element,_6c2);
+}},_6bd);
+var _6c2={top:s.getStyle(_6bc,&quot;top&quot;),left:s.getStyle(_6bc,&quot;left&quot;)};
+return new v.Move(_6bc,{x:20,y:0,duration:0.05,afterFinishInternal:function(_6c3){
+new v.Move(_6c3.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6c4){
+new v.Move(_6c4.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6c5){
+new v.Move(_6c5.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_6c6){
+new v.Move(_6c6.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_6c7){
+new v.Move(_6c7.element,_6bd);
+}});
+}});
+}});
+}});
+}});
+};
+MochiKit.Visual.slideDown=function(_6c8,_6c9){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+_6c8=d.getElement(_6c8);
+if(!_6c8.firstChild){
+throw &quot;MochiKit.Visual.slideDown must be used on a element with a child&quot;;
+}
+d.removeEmptyTextNodes(_6c8);
+var _6cd=s.getStyle(_6c8.firstChild,&quot;bottom&quot;)||0;
+var _6ce=s.getElementDimensions(_6c8);
+var _6cf;
+_6c9=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_6ce.h,originalWidth:_6ce.w},restoreAfterFinish:true,afterSetupInternal:function(_6d0){
+d.makePositioned(_6d0.element);
+d.makePositioned(_6d0.element.firstChild);
+if(/Opera/.test(navigator.userAgent)){
+s.setStyle(_6d0.element,{top:&quot;&quot;});
+}
+_6cf=d.makeClipping(_6d0.element);
+s.setStyle(_6d0.element,{height:&quot;0px&quot;});
+s.showElement(_6d0.element);
+},afterUpdateInternal:function(_6d1){
+s.setStyle(_6d1.element.firstChild,{bottom:(_6d1.dims[0]-_6d1.element.clientHeight)+&quot;px&quot;});
+},afterFinishInternal:function(_6d2){
+d.undoClipping(_6d2.element,_6cf);
+if(/MSIE/.test(navigator.userAgent)){
+d.undoPositioned(_6d2.element);
+d.undoPositioned(_6d2.element.firstChild);
+}else{
+d.undoPositioned(_6d2.element.firstChild);
+d.undoPositioned(_6d2.element);
+}
+s.setStyle(_6d2.element.firstChild,{bottom:_6cd});
+}},_6c9);
+return new MochiKit.Visual.Scale(_6c8,100,_6c9);
+};
+MochiKit.Visual.slideUp=function(_6d3,_6d4){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+var s=MochiKit.Style;
+_6d3=d.getElement(_6d3);
+if(!_6d3.firstChild){
+throw &quot;MochiKit.Visual.slideUp must be used on a element with a child&quot;;
+}
+d.removeEmptyTextNodes(_6d3);
+var _6d8=s.getStyle(_6d3.firstChild,&quot;bottom&quot;);
+var _6d9;
+_6d4=b.update({scaleContent:false,scaleX:false,scaleMode:&quot;box&quot;,scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_6da){
+d.makePositioned(_6da.element);
+d.makePositioned(_6da.element.firstChild);
+if(/Opera/.test(navigator.userAgent)){
+s.setStyle(_6da.element,{top:&quot;&quot;});
+}
+_6d9=d.makeClipping(_6da.element);
+s.showElement(_6da.element);
+},afterUpdateInternal:function(_6db){
+s.setStyle(_6db.element.firstChild,{bottom:(_6db.dims[0]-_6db.element.clientHeight)+&quot;px&quot;});
+},afterFinishInternal:function(_6dc){
+s.hideElement(_6dc.element);
+d.undoClipping(_6dc.element,_6d9);
+d.undoPositioned(_6dc.element.firstChild);
+d.undoPositioned(_6dc.element);
+s.setStyle(_6dc.element.firstChild,{bottom:_6d8});
+}},_6d4);
+return new MochiKit.Visual.Scale(_6d3,0,_6d4);
+};
+MochiKit.Visual.squish=function(_6dd,_6de){
+var d=MochiKit.DOM;
+var b=MochiKit.Base;
+var _6e1;
+_6de=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_6e2){
+_6e1=d.makeClipping(_6e2.element);
+},afterFinishInternal:function(_6e3){
+MochiKit.Style.hideElement(_6e3.element);
+d.undoClipping(_6e3.element,_6e1);
+}},_6de);
+return new MochiKit.Visual.Scale(_6dd,/Opera/.test(navigator.userAgent)?1:0,_6de);
+};
+MochiKit.Visual.grow=function(_6e4,_6e5){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_6e4=d.getElement(_6e4);
+_6e5=MochiKit.Base.update({direction:&quot;center&quot;,moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full,scaleContent:true,scaleFromCenter:false},_6e5);
+var _6e9={top:_6e4.style.top,left:_6e4.style.left,height:_6e4.style.height,width:_6e4.style.width,opacity:s.getStyle(_6e4,&quot;opacity&quot;)};
+var dims=s.getElementDimensions(_6e4);
+var _6eb,_6ec;
+var _6ed,_6ee;
+switch(_6e5.direction){
+case &quot;top-left&quot;:
+_6eb=_6ec=_6ed=_6ee=0;
+break;
+case &quot;top-right&quot;:
+_6eb=dims.w;
+_6ec=_6ee=0;
+_6ed=-dims.w;
+break;
+case &quot;bottom-left&quot;:
+_6eb=_6ed=0;
+_6ec=dims.h;
+_6ee=-dims.h;
+break;
+case &quot;bottom-right&quot;:
+_6eb=dims.w;
+_6ec=dims.h;
+_6ed=-dims.w;
+_6ee=-dims.h;
+break;
+case &quot;center&quot;:
+_6eb=dims.w/2;
+_6ec=dims.h/2;
+_6ed=-dims.w/2;
+_6ee=-dims.h/2;
+break;
+}
+var _6ef=MochiKit.Base.update({beforeSetupInternal:function(_6f0){
+s.setStyle(_6f0.effects[0].element,{height:&quot;0px&quot;});
+s.showElement(_6f0.effects[0].element);
+},afterFinishInternal:function(_6f1){
+d.undoClipping(_6f1.effects[0].element);
+d.undoPositioned(_6f1.effects[0].element);
+s.setStyle(_6f1.effects[0].element,_6e9);
+}},_6e5);
+return new v.Move(_6e4,{x:_6eb,y:_6ec,duration:0.01,beforeSetupInternal:function(_6f2){
+s.hideElement(_6f2.element);
+d.makeClipping(_6f2.element);
+d.makePositioned(_6f2.element);
+},afterFinishInternal:function(_6f3){
+new v.Parallel([new v.Opacity(_6f3.element,{sync:true,to:1,from:0,transition:_6e5.opacityTransition}),new v.Move(_6f3.element,{x:_6ed,y:_6ee,sync:true,transition:_6e5.moveTransition}),new v.Scale(_6f3.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_6e5.scaleTransition,scaleContent:_6e5.scaleContent,scaleFromCenter:_6e5.scaleFromCenter,restoreAfterFinish:true})],_6ef);
+}});
+};
+MochiKit.Visual.shrink=function(_6f4,_6f5){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_6f4=d.getElement(_6f4);
+_6f5=MochiKit.Base.update({direction:&quot;center&quot;,moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none,scaleContent:true,scaleFromCenter:false},_6f5);
+var _6f9={top:_6f4.style.top,left:_6f4.style.left,height:_6f4.style.height,width:_6f4.style.width,opacity:s.getStyle(_6f4,&quot;opacity&quot;)};
+var dims=s.getElementDimensions(_6f4);
+var _6fb,_6fc;
+switch(_6f5.direction){
+case &quot;top-left&quot;:
+_6fb=_6fc=0;
+break;
+case &quot;top-right&quot;:
+_6fb=dims.w;
+_6fc=0;
+break;
+case &quot;bottom-left&quot;:
+_6fb=0;
+_6fc=dims.h;
+break;
+case &quot;bottom-right&quot;:
+_6fb=dims.w;
+_6fc=dims.h;
+break;
+case &quot;center&quot;:
+_6fb=dims.w/2;
+_6fc=dims.h/2;
+break;
+}
+var _6fd;
+var _6fe=MochiKit.Base.update({beforeStartInternal:function(_6ff){
+_6fd=d.makePositioned(_6ff.effects[0].element);
+d.makeClipping(_6ff.effects[0].element);
+},afterFinishInternal:function(_700){
+s.hideElement(_700.effects[0].element);
+d.undoClipping(_700.effects[0].element,_6fd);
+d.undoPositioned(_700.effects[0].element);
+s.setStyle(_700.effects[0].element,_6f9);
+}},_6f5);
+return new v.Parallel([new v.Opacity(_6f4,{sync:true,to:0,from:1,transition:_6f5.opacityTransition}),new v.Scale(_6f4,/Opera/.test(navigator.userAgent)?1:0,{sync:true,transition:_6f5.scaleTransition,scaleContent:_6f5.scaleContent,scaleFromCenter:_6f5.scaleFromCenter,restoreAfterFinish:true}),new v.Move(_6f4,{x:_6fb,y:_6fc,sync:true,transition:_6f5.moveTransition})],_6fe);
+};
+MochiKit.Visual.pulsate=function(_701,_702){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var b=MochiKit.Base;
+var _706=MochiKit.Style.getStyle(_701,&quot;opacity&quot;);
+_702=b.update({duration:3,from:0,afterFinishInternal:function(_707){
+MochiKit.Style.setStyle(_707.element,{&quot;opacity&quot;:_706});
+}},_702);
+var _708=_702.transition||v.Transitions.sinoidal;
+var _709=b.bind(function(pos){
+return _708(1-v.Transitions.pulse(pos,_702.pulses));
+},_708);
+b.bind(_709,_708);
+return new v.Opacity(_701,b.update({transition:_709},_702));
+};
+MochiKit.Visual.fold=function(_70b,_70c){
+var d=MochiKit.DOM;
+var v=MochiKit.Visual;
+var s=MochiKit.Style;
+_70b=d.getElement(_70b);
+var _710={top:_70b.style.top,left:_70b.style.left,width:_70b.style.width,height:_70b.style.height};
+var _711=d.makeClipping(_70b);
+_70c=MochiKit.Base.update({scaleContent:false,scaleX:false,afterFinishInternal:function(_712){
+new v.Scale(_70b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_713){
+s.hideElement(_713.element);
+d.undoClipping(_713.element,_711);
+s.setStyle(_713.element,_710);
+}});
+}},_70c);
+return new v.Scale(_70b,5,_70c);
+};
+MochiKit.Visual.Color=MochiKit.Color.Color;
+MochiKit.Visual.getElementsComputedStyle=MochiKit.DOM.computedStyle;
+MochiKit.Visual.__new__=function(){
+var m=MochiKit.Base;
+m.nameFunctions(this);
+this.EXPORT_TAGS={&quot;:common&quot;:this.EXPORT,&quot;:all&quot;:m.concat(this.EXPORT,this.EXPORT_OK)};
+};
+MochiKit.Visual.EXPORT=[&quot;roundElement&quot;,&quot;roundClass&quot;,&quot;tagifyText&quot;,&quot;multiple&quot;,&quot;toggle&quot;,&quot;Parallel&quot;,&quot;Opacity&quot;,&quot;Move&quot;,&quot;Scale&quot;,&quot;Highlight&quot;,&quot;ScrollTo&quot;,&quot;Morph&quot;,&quot;fade&quot;,&quot;appear&quot;,&quot;puff&quot;,&quot;blindUp&quot;,&quot;blindDown&quot;,&quot;switchOff&quot;,&quot;dropOut&quot;,&quot;shake&quot;,&quot;slideDown&quot;,&quot;slideUp&quot;,&quot;squish&quot;,&quot;grow&quot;,&quot;shrink&quot;,&quot;pulsate&quot;,&quot;fold&quot;];
+MochiKit.Visual.EXPORT_OK=[&quot;Base&quot;,&quot;PAIRS&quot;];
+MochiKit.Visual.__new__();
+MochiKit.Base._exportSymbols(this,MochiKit.Visual);
+if(typeof (MochiKit)==&quot;undefined&quot;){
+MochiKit={};
+}
+if(typeof (MochiKit.MochiKit)==&quot;undefined&quot;){
+MochiKit.MochiKit={};
+}
+MochiKit.MochiKit.NAME=&quot;MochiKit.MochiKit&quot;;
+MochiKit.MochiKit.VERSION=&quot;1.4&quot;;
+MochiKit.MochiKit.__repr__=function(){
+return &quot;[&quot;+this.NAME+&quot; &quot;+this.VERSION+&quot;]&quot;;
+};
+MochiKit.MochiKit.toString=function(){
+return this.__repr__();
+};
+MochiKit.MochiKit.SUBMODULES=[&quot;Base&quot;,&quot;Iter&quot;,&quot;Logging&quot;,&quot;DateTime&quot;,&quot;Format&quot;,&quot;Async&quot;,&quot;DOM&quot;,&quot;Selector&quot;,&quot;Style&quot;,&quot;LoggingPane&quot;,&quot;Color&quot;,&quot;Signal&quot;,&quot;Position&quot;,&quot;Visual&quot;];
+if(typeof (JSAN)!=&quot;undefined&quot;||typeof (dojo)!=&quot;undefined&quot;){
+if(typeof (dojo)!=&quot;undefined&quot;){
+dojo.provide(&quot;MochiKit.MochiKit&quot;);
+dojo.require(&quot;MochiKit.*&quot;);
+}
+if(typeof (JSAN)!=&quot;undefined&quot;){
+(function(lst){
+for(var i=0;i&lt;lst.length;i++){
+JSAN.use(&quot;MochiKit.&quot;+lst[i],[]);
+}
+})(MochiKit.MochiKit.SUBMODULES);
+}
+(function(){
+var _717=MochiKit.Base.extend;
+var self=MochiKit.MochiKit;
+var _719=self.SUBMODULES;
+var _71a=[];
+var _71b=[];
+var _71c={};
+var i,k,m,all;
+for(i=0;i&lt;_719.length;i++){
+m=MochiKit[_719[i]];
+_717(_71a,m.EXPORT);
+_717(_71b,m.EXPORT_OK);
+for(k in m.EXPORT_TAGS){
+_71c[k]=_717(_71c[k],m.EXPORT_TAGS[k]);
+}
+all=m.EXPORT_TAGS[&quot;:all&quot;];
+if(!all){
+all=_717(null,m.EXPORT,m.EXPORT_OK);
+}
+var j;
+for(j=0;j&lt;all.length;j++){
+k=all[j];
+self[k]=m[k];
+}
+}
+self.EXPORT=_71a;
+self.EXPORT_OK=_71b;
+self.EXPORT_TAGS=_71c;
+}());
+}else{
+if(typeof (MochiKit.__compat__)==&quot;undefined&quot;){
+MochiKit.__compat__=true;
+}
+(function(){
+if(typeof (document)==&quot;undefined&quot;){
+return;
+}
+var _722=document.getElementsByTagName(&quot;script&quot;);
+var _723=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;;
+var base=null;
+var _725=null;
+var _726={};
+var i;
+for(i=0;i&lt;_722.length;i++){
+var src=_722[i].getAttribute(&quot;src&quot;);
+if(!src){
+continue;
+}
+_726[src]=true;
+if(src.match(/MochiKit.js$/)){
+base=src.substring(0,src.lastIndexOf(&quot;MochiKit.js&quot;));
+_725=_722[i];
+}
+}
+if(base===null){
+return;
+}
+var _729=MochiKit.MochiKit.SUBMODULES;
+for(var i=0;i&lt;_729.length;i++){
+if(MochiKit[_729[i]]){
+continue;
+}
+var uri=base+_729[i]+&quot;.js&quot;;
+if(uri in _726){
+continue;
+}
+if(document.documentElement&amp;&amp;document.documentElement.namespaceURI==_723){
+var s=document.createElementNS(_723,&quot;script&quot;);
+s.setAttribute(&quot;id&quot;,&quot;MochiKit_&quot;+base+_729[i]);
+s.setAttribute(&quot;src&quot;,uri);
+s.setAttribute(&quot;type&quot;,&quot;application/x-javascript&quot;);
+_725.parentNode.appendChild(s);
+}else{
+document.write(&quot;&lt;script src=\&quot;&quot;+uri+&quot;\&quot; type=\&quot;text/javascript\&quot;&gt;&lt;/script&gt;&quot;);
+}
+}
+})();
+}
+
+</diff>
      <filename>xpi/chrome/content/test/library/MochiKit.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,371 +1,371 @@
-/**
- * SimpleTest, a partial Test.Simple/Test.More API compatible test library.
- *
- * Why?
- *
- * Test.Simple doesn't work on IE &lt; 6.
- * TODO:
- *  * Support the Test.Simple API used by MochiKit, to be able to test MochiKit 
- * itself against IE 5.5
- *
-**/
-
-if (typeof(SimpleTest) == &quot;undefined&quot;) {
-    var SimpleTest = {};
-}
-
-// Check to see if the TestRunner is present and has logging
-if (typeof(parent) != &quot;undefined&quot; &amp;&amp; parent.TestRunner) {
-    SimpleTest._logEnabled = parent.TestRunner.logEnabled;
-}
-
-SimpleTest._tests = [];
-SimpleTest._stopOnLoad = true;
-
-/**
- * Something like assert.
-**/
-SimpleTest.ok = function (condition, name, diag) {
-    var test = {'result': !!condition, 'name': name, 'diag': diag || &quot;&quot;};
-    if (SimpleTest._logEnabled) {
-        var msg = test.result ? &quot;PASS&quot; : &quot;FAIL&quot;;
-        msg += &quot; | &quot; + test.name;
-        if (test.result) {
-            parent.TestRunner.logger.log(msg);
-        } else {
-            msg += &quot; | &quot; + test.diag;
-            parent.TestRunner.logger.error(msg);
-        }
-    }
-    SimpleTest._tests.push(test);
-};
-
-/**
- * Roughly equivalent to ok(a==b, name)
-**/
-SimpleTest.is = function (a, b, name) {
-    var repr = MochiKit.Base.repr;
-    SimpleTest.ok(a == b, name, &quot;got &quot; + repr(a) + &quot;, expected &quot; + repr(b));
-};
-
-
-/**
- * Makes a test report, returns it as a DIV element.
-**/
-SimpleTest.report = function () {
-    var DIV = MochiKit.DOM.DIV;
-    var passed = 0;
-    var failed = 0;
-    var results = MochiKit.Base.map(
-        function (test) {
-            var cls, msg;
-            if (test.result) {
-                passed++;
-                cls = &quot;test_ok&quot;;
-                msg = &quot;ok - &quot; + test.name;
-            } else {
-                failed++;
-                cls = &quot;test_not_ok&quot;;
-                msg = &quot;not ok - &quot; + test.name + &quot; &quot; + test.diag;
-            }
-            return DIV({&quot;class&quot;: cls}, msg);
-        },
-        SimpleTest._tests
-    );
-    var summary_class = ((failed == 0) ? 'all_pass' : 'some_fail');
-    return DIV({'class': 'tests_report'},
-        DIV({'class': 'tests_summary ' + summary_class},
-            DIV({'class': 'tests_passed'}, &quot;Passed: &quot; + passed),
-            DIV({'class': 'tests_failed'}, &quot;Failed: &quot; + failed)),
-        results
-    );
-};
-
-/**
- * Toggle element visibility
-**/
-SimpleTest.toggle = function(el) {
-    if (MochiKit.Style.getStyle(el, 'display') == 'block') {
-        el.style.display = 'none';
-    } else {
-        el.style.display = 'block';
-    }
-};
-
-/**
- * Toggle visibility for divs with a specific class.
-**/
-SimpleTest.toggleByClass = function (cls) {
-    var elems = getElementsByTagAndClassName('div', cls);
-    MochiKit.Base.map(SimpleTest.toggle, elems);
-};
-
-/**
- * Shows the report in the browser
-**/
-
-SimpleTest.showReport = function() {
-    var togglePassed = A({'href': '#'}, &quot;Toggle passed tests&quot;);
-    var toggleFailed = A({'href': '#'}, &quot;Toggle failed tests&quot;);
-    togglePassed.onclick = partial(SimpleTest.toggleByClass, 'test_ok');
-    toggleFailed.onclick = partial(SimpleTest.toggleByClass, 'test_not_ok');
-    var body = document.getElementsByTagName(&quot;body&quot;)[0];
-    var firstChild = body.childNodes[0];
-    var addNode;
-    if (firstChild) {
-        addNode = function (el) {
-            body.insertBefore(el, firstChild);
-        };
-    } else {
-        addNode = function (el) {
-            body.appendChild(el)
-        };
-    }
-    addNode(togglePassed);
-    addNode(SPAN(null, &quot; &quot;));
-    addNode(toggleFailed);
-    addNode(SimpleTest.report());
-};
-
-/**
- * Tells SimpleTest to don't finish the test when the document is loaded,
- * useful for asynchronous tests.
- *
- * When SimpleTest.waitForExplicitFinish is called,
- * explicit SimpleTest.finish() is required.
-**/
-SimpleTest.waitForExplicitFinish = function () {
-    SimpleTest._stopOnLoad = false;
-};
-
-/**
- * Talks to the TestRunner if being ran on a iframe and the parent has a 
- * TestRunner object.
-**/
-SimpleTest.talkToRunner = function () {
-		var chromeWindow = 
-			Components.classes[&quot;@mozilla.org/appshell/window-mediator;1&quot;].
-				getService(Components.interfaces.nsIWindowMediator).
-				getMostRecentWindow(&quot;navigator:browser&quot;);
-
-    if (chromeWindow.TestRunner) {
-        chromeWindow.TestRunner.testFinished(document);
-    }
-};
-
-/**
- * Finishes the tests. This is automatically called, except when 
- * SimpleTest.waitForExplicitFinish() has been invoked.
-**/
-SimpleTest.finish = function () {
-    SimpleTest.showReport();
-    SimpleTest.talkToRunner();
-};
-
-
-addLoadEvent(function() {
-    if (SimpleTest._stopOnLoad) {
-        SimpleTest.finish();
-    }
-});
-
-//  --------------- Test.Builder/Test.More isDeeply() -----------------
-
-
-SimpleTest.DNE = {dne: 'Does not exist'};
-SimpleTest.LF = &quot;\r\n&quot;;
-SimpleTest._isRef = function (object) {
-    var type = typeof(object);
-    return type == 'object' || type == 'function';
-};
-
-
-SimpleTest._deepCheck = function (e1, e2, stack, seen) {
-    var ok = false;
-    // Either they're both references or both not.
-    var sameRef = !(!SimpleTest._isRef(e1) ^ !SimpleTest._isRef(e2));
-    if (e1 == null &amp;&amp; e2 == null) {
-        ok = true;
-    } else if (e1 != null ^ e2 != null) {
-        ok = false;
-    } else if (e1 == SimpleTest.DNE ^ e2 == SimpleTest.DNE) {
-        ok = false;
-    } else if (sameRef &amp;&amp; e1 == e2) {
-        // Handles primitives and any variables that reference the same
-        // object, including functions.
-        ok = true;
-    } else if (SimpleTest.isa(e1, 'Array') &amp;&amp; SimpleTest.isa(e2, 'Array')) {
-        ok = SimpleTest._eqArray(e1, e2, stack, seen);
-    } else if (typeof e1 == &quot;object&quot; &amp;&amp; typeof e2 == &quot;object&quot;) {
-        ok = SimpleTest._eqAssoc(e1, e2, stack, seen);
-    } else {
-        // If we get here, they're not the same (function references must
-        // always simply rererence the same function).
-        stack.push({ vals: [e1, e2] });
-        ok = false;
-    }
-    return ok;
-};
-
-SimpleTest._eqArray = function (a1, a2, stack, seen) {
-    // Return if they're the same object.
-    if (a1 == a2) return true;
-
-    // JavaScript objects have no unique identifiers, so we have to store
-    // references to them all in an array, and then compare the references
-    // directly. It's slow, but probably won't be much of an issue in
-    // practice. Start by making a local copy of the array to as to avoid
-    // confusing a reference seen more than once (such as [a, a]) for a
-    // circular reference.
-    for (var j = 0; j &lt; seen.length; j++) {
-        if (seen[j][0] == a1) {
-            return seen[j][1] == a2;
-        }
-    }
-
-    // If we get here, we haven't seen a1 before, so store it with reference
-    // to a2.
-    seen.push([ a1, a2 ]);
-
-    var ok = true;
-    // Only examines enumerable attributes. Only works for numeric arrays!
-    // Associative arrays return 0. So call _eqAssoc() for them, instead.
-    var max = a1.length &gt; a2.length ? a1.length : a2.length;
-    if (max == 0) return SimpleTest._eqAssoc(a1, a2, stack, seen);
-    for (var i = 0; i &lt; max; i++) {
-        var e1 = i &gt; a1.length - 1 ? SimpleTest.DNE : a1[i];
-        var e2 = i &gt; a2.length - 1 ? SimpleTest.DNE : a2[i];
-        stack.push({ type: 'Array', idx: i, vals: [e1, e2] });
-        if (ok = SimpleTest._deepCheck(e1, e2, stack, seen)) {
-            stack.pop();
-        } else {
-            break;
-        }
-    }
-    return ok;
-};
-
-SimpleTest._eqAssoc = function (o1, o2, stack, seen) {
-    // Return if they're the same object.
-    if (o1 == o2) return true;
-
-    // JavaScript objects have no unique identifiers, so we have to store
-    // references to them all in an array, and then compare the references
-    // directly. It's slow, but probably won't be much of an issue in
-    // practice. Start by making a local copy of the array to as to avoid
-    // confusing a reference seen more than once (such as [a, a]) for a
-    // circular reference.
-    seen = seen.slice(0);
-    for (var j = 0; j &lt; seen.length; j++) {
-        if (seen[j][0] == o1) {
-            return seen[j][1] == o2;
-        }
-    }
-
-    // If we get here, we haven't seen o1 before, so store it with reference
-    // to o2.
-    seen.push([ o1, o2 ]);
-
-    // They should be of the same class.
-
-    var ok = true;
-    // Only examines enumerable attributes.
-    var o1Size = 0; for (var i in o1) o1Size++;
-    var o2Size = 0; for (var i in o2) o2Size++;
-    var bigger = o1Size &gt; o2Size ? o1 : o2;
-    for (var i in bigger) {
-        var e1 = o1[i] == undefined ? SimpleTest.DNE : o1[i];
-        var e2 = o2[i] == undefined ? SimpleTest.DNE : o2[i];
-        stack.push({ type: 'Object', idx: i, vals: [e1, e2] });
-        if (ok = SimpleTest._deepCheck(e1, e2, stack, seen)) {
-            stack.pop();
-        } else {
-            break;
-        }
-    }
-    return ok;
-};
-
-SimpleTest._formatStack = function (stack) {
-    var variable = '$Foo';
-    for (var i = 0; i &lt; stack.length; i++) {
-        var entry = stack[i];
-        var type = entry['type'];
-        var idx = entry['idx'];
-        if (idx != null) {
-            if (/^\d+$/.test(idx)) {
-                // Numeric array index.
-                variable += '[' + idx + ']';
-            } else {
-                // Associative array index.
-                idx = idx.replace(&quot;'&quot;, &quot;\\'&quot;);
-                variable += &quot;['&quot; + idx + &quot;']&quot;;
-            }
-        }
-    }
-
-    var vals = stack[stack.length-1]['vals'].slice(0, 2);
-    var vars = [
-        variable.replace('$Foo',     'got'),
-        variable.replace('$Foo',     'expected')
-    ];
-
-    var out = &quot;Structures begin differing at:&quot; + SimpleTest.LF;
-    for (var i = 0; i &lt; vals.length; i++) {
-        var val = vals[i];
-        if (val == null) {
-            val = 'undefined';
-        } else {
-             val == SimpleTest.DNE ? &quot;Does not exist&quot; : &quot;'&quot; + val + &quot;'&quot;;
-        }
-    }
-
-    out += vars[0] + ' = ' + vals[0] + SimpleTest.LF;
-    out += vars[1] + ' = ' + vals[1] + SimpleTest.LF;
-    
-    return '    ' + out;
-};
-
-
-SimpleTest.isDeeply = function (it, as, name) {
-    var ok;
-    // ^ is the XOR operator.
-    if (SimpleTest._isRef(it) ^ SimpleTest._isRef(as)) {
-        // One's a reference, one isn't.
-        ok = false;
-    } else if (!SimpleTest._isRef(it) &amp;&amp; !SimpleTest._isRef(as)) {
-        // Neither is an object.
-        ok = SimpleTest.is(it, as, name);
-    } else {
-        // We have two objects. Do a deep comparison.
-        var stack = [], seen = [];
-        if ( SimpleTest._deepCheck(it, as, stack, seen)) {
-            ok = SimpleTest.ok(true, name);
-        } else {
-            ok = SimpleTest.ok(false, name, SimpleTest._formatStack(stack));
-        }
-    }
-    return ok;
-};
-
-SimpleTest.typeOf = function (object) {
-    var c = Object.prototype.toString.apply(object);
-    var name = c.substring(8, c.length - 1);
-    if (name != 'Object') return name;
-    // It may be a non-core class. Try to extract the class name from
-    // the constructor function. This may not work in all implementations.
-    if (/function ([^(\s]+)/.test(Function.toString.call(object.constructor))) {
-        return RegExp.$1;
-    }
-    // No idea. :-(
-    return name;
-};
-
-SimpleTest.isa = function (object, clas) {
-    return SimpleTest.typeOf(object) == clas;
-};
-
-// Global symbols:
-var ok = SimpleTest.ok;
-var is = SimpleTest.is;
-var isDeeply = SimpleTest.isDeeply;
+/**
+ * SimpleTest, a partial Test.Simple/Test.More API compatible test library.
+ *
+ * Why?
+ *
+ * Test.Simple doesn't work on IE &lt; 6.
+ * TODO:
+ *  * Support the Test.Simple API used by MochiKit, to be able to test MochiKit 
+ * itself against IE 5.5
+ *
+**/
+
+if (typeof(SimpleTest) == &quot;undefined&quot;) {
+    var SimpleTest = {};
+}
+
+// Check to see if the TestRunner is present and has logging
+if (typeof(parent) != &quot;undefined&quot; &amp;&amp; parent.TestRunner) {
+    SimpleTest._logEnabled = parent.TestRunner.logEnabled;
+}
+
+SimpleTest._tests = [];
+SimpleTest._stopOnLoad = true;
+
+/**
+ * Something like assert.
+**/
+SimpleTest.ok = function (condition, name, diag) {
+    var test = {'result': !!condition, 'name': name, 'diag': diag || &quot;&quot;};
+    if (SimpleTest._logEnabled) {
+        var msg = test.result ? &quot;PASS&quot; : &quot;FAIL&quot;;
+        msg += &quot; | &quot; + test.name;
+        if (test.result) {
+            parent.TestRunner.logger.log(msg);
+        } else {
+            msg += &quot; | &quot; + test.diag;
+            parent.TestRunner.logger.error(msg);
+        }
+    }
+    SimpleTest._tests.push(test);
+};
+
+/**
+ * Roughly equivalent to ok(a==b, name)
+**/
+SimpleTest.is = function (a, b, name) {
+    var repr = MochiKit.Base.repr;
+    SimpleTest.ok(a == b, name, &quot;got &quot; + repr(a) + &quot;, expected &quot; + repr(b));
+};
+
+
+/**
+ * Makes a test report, returns it as a DIV element.
+**/
+SimpleTest.report = function () {
+    var DIV = MochiKit.DOM.DIV;
+    var passed = 0;
+    var failed = 0;
+    var results = MochiKit.Base.map(
+        function (test) {
+            var cls, msg;
+            if (test.result) {
+                passed++;
+                cls = &quot;test_ok&quot;;
+                msg = &quot;ok - &quot; + test.name;
+            } else {
+                failed++;
+                cls = &quot;test_not_ok&quot;;
+                msg = &quot;not ok - &quot; + test.name + &quot; &quot; + test.diag;
+            }
+            return DIV({&quot;class&quot;: cls}, msg);
+        },
+        SimpleTest._tests
+    );
+    var summary_class = ((failed == 0) ? 'all_pass' : 'some_fail');
+    return DIV({'class': 'tests_report'},
+        DIV({'class': 'tests_summary ' + summary_class},
+            DIV({'class': 'tests_passed'}, &quot;Passed: &quot; + passed),
+            DIV({'class': 'tests_failed'}, &quot;Failed: &quot; + failed)),
+        results
+    );
+};
+
+/**
+ * Toggle element visibility
+**/
+SimpleTest.toggle = function(el) {
+    if (MochiKit.Style.getStyle(el, 'display') == 'block') {
+        el.style.display = 'none';
+    } else {
+        el.style.display = 'block';
+    }
+};
+
+/**
+ * Toggle visibility for divs with a specific class.
+**/
+SimpleTest.toggleByClass = function (cls) {
+    var elems = getElementsByTagAndClassName('div', cls);
+    MochiKit.Base.map(SimpleTest.toggle, elems);
+};
+
+/**
+ * Shows the report in the browser
+**/
+
+SimpleTest.showReport = function() {
+    var togglePassed = A({'href': '#'}, &quot;Toggle passed tests&quot;);
+    var toggleFailed = A({'href': '#'}, &quot;Toggle failed tests&quot;);
+    togglePassed.onclick = partial(SimpleTest.toggleByClass, 'test_ok');
+    toggleFailed.onclick = partial(SimpleTest.toggleByClass, 'test_not_ok');
+    var body = document.getElementsByTagName(&quot;body&quot;)[0];
+    var firstChild = body.childNodes[0];
+    var addNode;
+    if (firstChild) {
+        addNode = function (el) {
+            body.insertBefore(el, firstChild);
+        };
+    } else {
+        addNode = function (el) {
+            body.appendChild(el)
+        };
+    }
+    addNode(togglePassed);
+    addNode(SPAN(null, &quot; &quot;));
+    addNode(toggleFailed);
+    addNode(SimpleTest.report());
+};
+
+/**
+ * Tells SimpleTest to don't finish the test when the document is loaded,
+ * useful for asynchronous tests.
+ *
+ * When SimpleTest.waitForExplicitFinish is called,
+ * explicit SimpleTest.finish() is required.
+**/
+SimpleTest.waitForExplicitFinish = function () {
+    SimpleTest._stopOnLoad = false;
+};
+
+/**
+ * Talks to the TestRunner if being ran on a iframe and the parent has a 
+ * TestRunner object.
+**/
+SimpleTest.talkToRunner = function () {
+		var chromeWindow = 
+			Components.classes[&quot;@mozilla.org/appshell/window-mediator;1&quot;].
+				getService(Components.interfaces.nsIWindowMediator).
+				getMostRecentWindow(&quot;navigator:browser&quot;);
+
+    if (chromeWindow.TestRunner) {
+        chromeWindow.TestRunner.testFinished(document);
+    }
+};
+
+/**
+ * Finishes the tests. This is automatically called, except when 
+ * SimpleTest.waitForExplicitFinish() has been invoked.
+**/
+SimpleTest.finish = function () {
+    SimpleTest.showReport();
+    SimpleTest.talkToRunner();
+};
+
+
+addLoadEvent(function() {
+    if (SimpleTest._stopOnLoad) {
+        SimpleTest.finish();
+    }
+});
+
+//  --------------- Test.Builder/Test.More isDeeply() -----------------
+
+
+SimpleTest.DNE = {dne: 'Does not exist'};
+SimpleTest.LF = &quot;\r\n&quot;;
+SimpleTest._isRef = function (object) {
+    var type = typeof(object);
+    return type == 'object' || type == 'function';
+};
+
+
+SimpleTest._deepCheck = function (e1, e2, stack, seen) {
+    var ok = false;
+    // Either they're both references or both not.
+    var sameRef = !(!SimpleTest._isRef(e1) ^ !SimpleTest._isRef(e2));
+    if (e1 == null &amp;&amp; e2 == null) {
+        ok = true;
+    } else if (e1 != null ^ e2 != null) {
+        ok = false;
+    } else if (e1 == SimpleTest.DNE ^ e2 == SimpleTest.DNE) {
+        ok = false;
+    } else if (sameRef &amp;&amp; e1 == e2) {
+        // Handles primitives and any variables that reference the same
+        // object, including functions.
+        ok = true;
+    } else if (SimpleTest.isa(e1, 'Array') &amp;&amp; SimpleTest.isa(e2, 'Array')) {
+        ok = SimpleTest._eqArray(e1, e2, stack, seen);
+    } else if (typeof e1 == &quot;object&quot; &amp;&amp; typeof e2 == &quot;object&quot;) {
+        ok = SimpleTest._eqAssoc(e1, e2, stack, seen);
+    } else {
+        // If we get here, they're not the same (function references must
+        // always simply rererence the same function).
+        stack.push({ vals: [e1, e2] });
+        ok = false;
+    }
+    return ok;
+};
+
+SimpleTest._eqArray = function (a1, a2, stack, seen) {
+    // Return if they're the same object.
+    if (a1 == a2) return true;
+
+    // JavaScript objects have no unique identifiers, so we have to store
+    // references to them all in an array, and then compare the references
+    // directly. It's slow, but probably won't be much of an issue in
+    // practice. Start by making a local copy of the array to as to avoid
+    // confusing a reference seen more than once (such as [a, a]) for a
+    // circular reference.
+    for (var j = 0; j &lt; seen.length; j++) {
+        if (seen[j][0] == a1) {
+            return seen[j][1] == a2;
+        }
+    }
+
+    // If we get here, we haven't seen a1 before, so store it with reference
+    // to a2.
+    seen.push([ a1, a2 ]);
+
+    var ok = true;
+    // Only examines enumerable attributes. Only works for numeric arrays!
+    // Associative arrays return 0. So call _eqAssoc() for them, instead.
+    var max = a1.length &gt; a2.length ? a1.length : a2.length;
+    if (max == 0) return SimpleTest._eqAssoc(a1, a2, stack, seen);
+    for (var i = 0; i &lt; max; i++) {
+        var e1 = i &gt; a1.length - 1 ? SimpleTest.DNE : a1[i];
+        var e2 = i &gt; a2.length - 1 ? SimpleTest.DNE : a2[i];
+        stack.push({ type: 'Array', idx: i, vals: [e1, e2] });
+        if (ok = SimpleTest._deepCheck(e1, e2, stack, seen)) {
+            stack.pop();
+        } else {
+            break;
+        }
+    }
+    return ok;
+};
+
+SimpleTest._eqAssoc = function (o1, o2, stack, seen) {
+    // Return if they're the same object.
+    if (o1 == o2) return true;
+
+    // JavaScript objects have no unique identifiers, so we have to store
+    // references to them all in an array, and then compare the references
+    // directly. It's slow, but probably won't be much of an issue in
+    // practice. Start by making a local copy of the array to as to avoid
+    // confusing a reference seen more than once (such as [a, a]) for a
+    // circular reference.
+    seen = seen.slice(0);
+    for (var j = 0; j &lt; seen.length; j++) {
+        if (seen[j][0] == o1) {
+            return seen[j][1] == o2;
+        }
+    }
+
+    // If we get here, we haven't seen o1 before, so store it with reference
+    // to o2.
+    seen.push([ o1, o2 ]);
+
+    // They should be of the same class.
+
+    var ok = true;
+    // Only examines enumerable attributes.
+    var o1Size = 0; for (var i in o1) o1Size++;
+    var o2Size = 0; for (var i in o2) o2Size++;
+    var bigger = o1Size &gt; o2Size ? o1 : o2;
+    for (var i in bigger) {
+        var e1 = o1[i] == undefined ? SimpleTest.DNE : o1[i];
+        var e2 = o2[i] == undefined ? SimpleTest.DNE : o2[i];
+        stack.push({ type: 'Object', idx: i, vals: [e1, e2] });
+        if (ok = SimpleTest._deepCheck(e1, e2, stack, seen)) {
+            stack.pop();
+        } else {
+            break;
+        }
+    }
+    return ok;
+};
+
+SimpleTest._formatStack = function (stack) {
+    var variable = '$Foo';
+    for (var i = 0; i &lt; stack.length; i++) {
+        var entry = stack[i];
+        var type = entry['type'];
+        var idx = entry['idx'];
+        if (idx != null) {
+            if (/^\d+$/.test(idx)) {
+                // Numeric array index.
+                variable += '[' + idx + ']';
+            } else {
+                // Associative array index.
+                idx = idx.replace(&quot;'&quot;, &quot;\\'&quot;);
+                variable += &quot;['&quot; + idx + &quot;']&quot;;
+            }
+        }
+    }
+
+    var vals = stack[stack.length-1]['vals'].slice(0, 2);
+    var vars = [
+        variable.replace('$Foo',     'got'),
+        variable.replace('$Foo',     'expected')
+    ];
+
+    var out = &quot;Structures begin differing at:&quot; + SimpleTest.LF;
+    for (var i = 0; i &lt; vals.length; i++) {
+        var val = vals[i];
+        if (val == null) {
+            val = 'undefined';
+        } else {
+             val == SimpleTest.DNE ? &quot;Does not exist&quot; : &quot;'&quot; + val + &quot;'&quot;;
+        }
+    }
+
+    out += vars[0] + ' = ' + vals[0] + SimpleTest.LF;
+    out += vars[1] + ' = ' + vals[1] + SimpleTest.LF;
+    
+    return '    ' + out;
+};
+
+
+SimpleTest.isDeeply = function (it, as, name) {
+    var ok;
+    // ^ is the XOR operator.
+    if (SimpleTest._isRef(it) ^ SimpleTest._isRef(as)) {
+        // One's a reference, one isn't.
+        ok = false;
+    } else if (!SimpleTest._isRef(it) &amp;&amp; !SimpleTest._isRef(as)) {
+        // Neither is an object.
+        ok = SimpleTest.is(it, as, name);
+    } else {
+        // We have two objects. Do a deep comparison.
+        var stack = [], seen = [];
+        if ( SimpleTest._deepCheck(it, as, stack, seen)) {
+            ok = SimpleTest.ok(true, name);
+        } else {
+            ok = SimpleTest.ok(false, name, SimpleTest._formatStack(stack));
+        }
+    }
+    return ok;
+};
+
+SimpleTest.typeOf = function (object) {
+    var c = Object.prototype.toString.apply(object);
+    var name = c.substring(8, c.length - 1);
+    if (name != 'Object') return name;
+    // It may be a non-core class. Try to extract the class name from
+    // the constructor function. This may not work in all implementations.
+    if (/function ([^(\s]+)/.test(Function.toString.call(object.constructor))) {
+        return RegExp.$1;
+    }
+    // No idea. :-(
+    return name;
+};
+
+SimpleTest.isa = function (object, clas) {
+    return SimpleTest.typeOf(object) == clas;
+};
+
+// Global symbols:
+var ok = SimpleTest.ok;
+var is = SimpleTest.is;
+var isDeeply = SimpleTest.isDeeply;</diff>
      <filename>xpi/chrome/content/test/library/SimpleTest.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,166 +1,166 @@
-/**
- * TestRunner: A test runner for SimpleTest
- * TODO:
- * 
- *  * Avoid moving iframes: That causes reloads on mozilla and opera.
- *
- *
-**/
-var TestRunner = {};
-TestRunner.logEnabled = false;
-TestRunner._iframes = {};
-TestRunner._iframeDocuments = {};
-TestRunner._iframeRows = {};
-TestRunner._currentTest = 0;
-TestRunner._urls = [];
-TestRunner._testsDiv = DIV();
-TestRunner._progressDiv = DIV();
-TestRunner._summaryDiv = DIV(null, 
-    H1(null, &quot;Tests Summary&quot;),
-    TABLE(null, 
-        THEAD(null, 
-            TR(null,
-                TH(null, &quot;Test&quot;), 
-                TH(null, &quot;Passed&quot;), 
-                TH(null, &quot;Failed&quot;)
-            )
-        ),
-        TBODY()
-    )
-);
-
-var chromeWindow = 
-	Components.classes[&quot;@mozilla.org/appshell/window-mediator;1&quot;].
-		getService(Components.interfaces.nsIWindowMediator).
-		getMostRecentWindow(&quot;navigator:browser&quot;);
-chromeWindow.TestRunner = TestRunner;
-
-/**
- * This function is called after generating the summary.
-**/
-TestRunner.onComplete = null;
-
-/**
- * If logEnabled is true, this is the logger that will be used.
-**/
-TestRunner.logger = MochiKit.Logging.logger;
-
-/**
- * Toggle element visibility
-**/
-TestRunner._toggle = function(el) {
-    if (el.className == &quot;noshow&quot;) {
-        el.className = &quot;&quot;;
-        el.style.cssText = &quot;&quot;;
-    } else {
-        el.className = &quot;noshow&quot;;
-        el.style.cssText = &quot;width:0px; height:0px; border:0px;&quot;;
-    }
-};
-
-
-/**
- * Creates the iframe that contains a test
-**/
-TestRunner._makeIframe = function (url) {
-    var iframe = document.createElement('iframe');
-    iframe.src = url;
-    iframe.name = url;
-    iframe.width = &quot;500&quot;;
-    iframe.setAttribute('type', 'content');
-    var tbody = TestRunner._summaryDiv.getElementsByTagName(&quot;tbody&quot;)[0];
-    var tr = TR(null, TD({'colspan': '3'}, iframe));
-    iframe._row = tr;
-    tbody.appendChild(tr);
-    return iframe;
-};
-
-/**
- * TestRunner entry point.
- *
- * The arguments are the URLs of the test to be ran.
- *
-**/
-TestRunner.runTests = function (/*url...*/) {
-    if (TestRunner.logEnabled)
-        TestRunner.logger.log(&quot;SimpleTest START&quot;);
-  
-    var body = document.getElementsByTagName(&quot;body&quot;)[0];
-    appendChildNodes(body,
-        TestRunner._testsDiv,
-        TestRunner._progressDiv,
-        TestRunner._summaryDiv
-    );
-    for (var i = 0; i &lt; arguments.length; i++) {
-        TestRunner._urls.push(arguments[i]); 
-    }
-    TestRunner.runNextTest();
-};
-
-/**
- * Run the next test. If no test remains, calls makeSummary
-**/
-TestRunner.runNextTest = function() {
-    if (TestRunner._currentTest &lt; TestRunner._urls.length) {
-        var url = TestRunner._urls[TestRunner._currentTest];
-        var progress = SPAN(null,
-            &quot;Running &quot;, A({href:url}, url), &quot;...&quot;
-        );
-        
-        if (TestRunner.logEnabled)
-            TestRunner.logger.log(scrapeText(progress));
-        
-        TestRunner._progressDiv.appendChild(progress);
-        TestRunner._iframes[url] = TestRunner._makeIframe(url);
-    }  else {
-        TestRunner.makeSummary();
-        if (TestRunner.onComplete)
-            TestRunner.onComplete();
-    }
-};
-
-/**
- * This stub is called by SimpleTest when a test is finished.
-**/
-TestRunner.testFinished = function (doc) {
-    appendChildNodes(TestRunner._progressDiv, SPAN(null, &quot;Done&quot;), BR());
-    var finishedURL = TestRunner._urls[TestRunner._currentTest];
-    
-    if (TestRunner.logEnabled)
-        TestRunner.logger.debug(&quot;SimpleTest finished &quot; + finishedURL);
-    
-    TestRunner._iframeDocuments[finishedURL] = doc;
-    // TestRunner._iframes[finishedURL].style.display = &quot;none&quot;;
-    TestRunner._toggle(TestRunner._iframes[finishedURL]);
-    TestRunner._currentTest++;
-    TestRunner.runNextTest();
-};
-
-/**
- * Display the summary in the browser
-**/
-TestRunner.makeSummary = function() {
-    if (TestRunner.logEnabled)
-        TestRunner.logger.log(&quot;SimpleTest FINISHED&quot;);
-    var rows = [];
-    for (var url in TestRunner._iframeDocuments) {
-        var doc = TestRunner._iframeDocuments[url];
-        var nOK = withDocument(doc,
-            partial(getElementsByTagAndClassName, 'div', 'test_ok')
-        ).length;
-        var nNotOK = withDocument(doc,
-            partial(getElementsByTagAndClassName, 'div', 'test_not_ok')
-        ).length;
-        var toggle = partial(TestRunner._toggle, TestRunner._iframes[url]);
-        var jsurl = &quot;TestRunner._toggle(TestRunner._iframes['&quot; + url + &quot;'])&quot;;
-        var row = TR(
-            {'style': {'backgroundColor': nNotOK &gt; 0 ? &quot;#f00&quot;:&quot;#0f0&quot;}}, 
-            TD(null, url),
-            TD(null, nOK),
-            TD(null, nNotOK)
-        );
-        row.onclick = toggle;
-        var tbody = TestRunner._summaryDiv.getElementsByTagName(&quot;tbody&quot;)[0];
-        tbody.insertBefore(row, TestRunner._iframes[url]._row)
-    }
-};
+/**
+ * TestRunner: A test runner for SimpleTest
+ * TODO:
+ * 
+ *  * Avoid moving iframes: That causes reloads on mozilla and opera.
+ *
+ *
+**/
+var TestRunner = {};
+TestRunner.logEnabled = false;
+TestRunner._iframes = {};
+TestRunner._iframeDocuments = {};
+TestRunner._iframeRows = {};
+TestRunner._currentTest = 0;
+TestRunner._urls = [];
+TestRunner._testsDiv = DIV();
+TestRunner._progressDiv = DIV();
+TestRunner._summaryDiv = DIV(null, 
+    H1(null, &quot;Tests Summary&quot;),
+    TABLE(null, 
+        THEAD(null, 
+            TR(null,
+                TH(null, &quot;Test&quot;), 
+                TH(null, &quot;Passed&quot;), 
+                TH(null, &quot;Failed&quot;)
+            )
+        ),
+        TBODY()
+    )
+);
+
+var chromeWindow = 
+	Components.classes[&quot;@mozilla.org/appshell/window-mediator;1&quot;].
+		getService(Components.interfaces.nsIWindowMediator).
+		getMostRecentWindow(&quot;navigator:browser&quot;);
+chromeWindow.TestRunner = TestRunner;
+
+/**
+ * This function is called after generating the summary.
+**/
+TestRunner.onComplete = null;
+
+/**
+ * If logEnabled is true, this is the logger that will be used.
+**/
+TestRunner.logger = MochiKit.Logging.logger;
+
+/**
+ * Toggle element visibility
+**/
+TestRunner._toggle = function(el) {
+    if (el.className == &quot;noshow&quot;) {
+        el.className = &quot;&quot;;
+        el.style.cssText = &quot;&quot;;
+    } else {
+        el.className = &quot;noshow&quot;;
+        el.style.cssText = &quot;width:0px; height:0px; border:0px;&quot;;
+    }
+};
+
+
+/**
+ * Creates the iframe that contains a test
+**/
+TestRunner._makeIframe = function (url) {
+    var iframe = document.createElement('iframe');
+    iframe.src = url;
+    iframe.name = url;
+    iframe.width = &quot;500&quot;;
+    iframe.setAttribute('type', 'content');
+    var tbody = TestRunner._summaryDiv.getElementsByTagName(&quot;tbody&quot;)[0];
+    var tr = TR(null, TD({'colspan': '3'}, iframe));
+    iframe._row = tr;
+    tbody.appendChild(tr);
+    return iframe;
+};
+
+/**
+ * TestRunner entry point.
+ *
+ * The arguments are the URLs of the test to be ran.
+ *
+**/
+TestRunner.runTests = function (/*url...*/) {
+    if (TestRunner.logEnabled)
+        TestRunner.logger.log(&quot;SimpleTest START&quot;);
+  
+    var body = document.getElementsByTagName(&quot;body&quot;)[0];
+    appendChildNodes(body,
+        TestRunner._testsDiv,
+        TestRunner._progressDiv,
+        TestRunner._summaryDiv
+    );
+    for (var i = 0; i &lt; arguments.length; i++) {
+        TestRunner._urls.push(arguments[i]); 
+    }
+    TestRunner.runNextTest();
+};
+
+/**
+ * Run the next test. If no test remains, calls makeSummary
+**/
+TestRunner.runNextTest = function() {
+    if (TestRunner._currentTest &lt; TestRunner._urls.length) {
+        var url = TestRunner._urls[TestRunner._currentTest];
+        var progress = SPAN(null,
+            &quot;Running &quot;, A({href:url}, url), &quot;...&quot;
+        );
+        
+        if (TestRunner.logEnabled)
+            TestRunner.logger.log(scrapeText(progress));
+        
+        TestRunner._progressDiv.appendChild(progress);
+        TestRunner._iframes[url] = TestRunner._makeIframe(url);
+    }  else {
+        TestRunner.makeSummary();
+        if (TestRunner.onComplete)
+            TestRunner.onComplete();
+    }
+};
+
+/**
+ * This stub is called by SimpleTest when a test is finished.
+**/
+TestRunner.testFinished = function (doc) {
+    appendChildNodes(TestRunner._progressDiv, SPAN(null, &quot;Done&quot;), BR());
+    var finishedURL = TestRunner._urls[TestRunner._currentTest];
+    
+    if (TestRunner.logEnabled)
+        TestRunner.logger.debug(&quot;SimpleTest finished &quot; + finishedURL);
+    
+    TestRunner._iframeDocuments[finishedURL] = doc;
+    // TestRunner._iframes[finishedURL].style.display = &quot;none&quot;;
+    TestRunner._toggle(TestRunner._iframes[finishedURL]);
+    TestRunner._currentTest++;
+    TestRunner.runNextTest();
+};
+
+/**
+ * Display the summary in the browser
+**/
+TestRunner.makeSummary = function() {
+    if (TestRunner.logEnabled)
+        TestRunner.logger.log(&quot;SimpleTest FINISHED&quot;);
+    var rows = [];
+    for (var url in TestRunner._iframeDocuments) {
+        var doc = TestRunner._iframeDocuments[url];
+        var nOK = withDocument(doc,
+            partial(getElementsByTagAndClassName, 'div', 'test_ok')
+        ).length;
+        var nNotOK = withDocument(doc,
+            partial(getElementsByTagAndClassName, 'div', 'test_not_ok')
+        ).length;
+        var toggle = partial(TestRunner._toggle, TestRunner._iframes[url]);
+        var jsurl = &quot;TestRunner._toggle(TestRunner._iframes['&quot; + url + &quot;'])&quot;;
+        var row = TR(
+            {'style': {'backgroundColor': nNotOK &gt; 0 ? &quot;#f00&quot;:&quot;#0f0&quot;}}, 
+            TD(null, url),
+            TD(null, nOK),
+            TD(null, nNotOK)
+        );
+        row.onclick = toggle;
+        var tbody = TestRunner._summaryDiv.getElementsByTagName(&quot;tbody&quot;)[0];
+        tbody.insertBefore(row, TestRunner._iframes[url]._row)
+    }
+};</diff>
      <filename>xpi/chrome/content/test/library/TestRunner.js</filename>
    </modified>
    <modified>
      <filename>xpi/chrome/content/test/library/test.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,125 +1,125 @@
-// ---- [Test Support] -----------------------------------------
-function withXHR(process, exp, responseText){
-	var org = XMLHttpRequest;
-	try{
-		XMLHttpRequest = function(){
-			// getContents&#12363;&#12425;&#12398;&#21628;&#12403;&#20986;&#12375;&#12395;&#12399;&#12514;&#12483;&#12463;&#12434;&#36969;&#29992;&#12375;&#12394;&#12356;
-			for(var stack = Components.stack ; stack ; stack = stack.caller)
-				if(stack.name == 'getContents')
-					return new org();
-		};
-		XMLHttpRequest.prototype = {
-			statusText : 'OK',
-			status : 200,
-			readyState : 4,
-			responseText : responseText,
-			
-			open : function(method, url, async, username, password){
-				this.method = method.toUpperCase();
-				if(this.method == 'GET')
-					this.test(parseQueryString(broad(createURI(url)).query));
-			},
-			send : function(text){
-				if(this.method != 'GET')
-					this.test(parseQueryString(text));
-				
-				this.onload(this);
-				this.onreadystatechange(this);
-			},
-			test : function(act){
-				typeof(exp)=='function'? exp(act) : sameObject(act, exp);
-			},
-			getAllResponseHeaders : function(){},
-			setRequestHeader : function(){},
-			onload : function(req){},
-			onreadystatechange : function(req){},
-		};
-		
-		process();
-	} finally {
-		XMLHttpRequest = org;
-	}
-}
-
-function sameObject(act, exp, msg){
-	for(var p in exp){
-		var exv = exp[p];
-		var acv = act[p];
-		var m = msg + ': ' + p;
-		
-		// &#27491;&#35215;&#34920;&#29694;&#12363;
-		if(exv.test) {
-			ok(exv.test(acv), m);
-		} else if(exv.QueryInterface) {
-			ok(acv instanceof exv, m);
-		} else if(typeof(exv) == 'function') {
-			exv(acv, m);
-		} else if(typeof(exv) == 'object') {
-			sameObject(acv, exv, m);
-		} else {
-			is(acv, exv, m);
-		}
-	}
-}
-
-
-function autoReload(paths){
-	paths = paths || [];
-	
-	var baseUri = IOService.newURI(location.href, null, null);
-	Array.forEach(document.getElementsByTagNameNS(XUL_NS,'script'), function(script){
-		var src = script.getAttribute('src');
-		if(!src)
-			return;
-		
-		paths.push(IOService.newURI(src, null, baseUri).spec);
-	})
-	Array.forEach(document.getElementsByTagName('script'), function(script){
-		script.src &amp;&amp; paths.push(script.src);
-	})
-	Array.forEach(document.styleSheets, function(style){
-		style.href &amp;&amp; paths.push(style.href);
-	})
-	paths.push(location.href);
-	
-	function getModifiedTime(path){
-		var file = getLocalFile(path);
-		return file? file.lastModifiedTime : 0;
-	}
-	
-	var original = {};
-	paths.forEach(function(path){
-		original[path] = getModifiedTime(path);
-	});
-	
-	var intervalId = setInterval(function(){
-		paths.forEach(function(path){
-			if(original[path] != getModifiedTime(path))
-				location.reload();
-		});
-	}, 1000)
-}
-
-function getTestFile(path){
-	var file = getContentDir();
-	file.append('test');
-	
-	if(path)
-		file.setRelativeDescriptor(file, path);
-	
-	return file;
-}
-
-function copy(src, target){
-	if(!src.exists())
-		return;
-	
-	remove(target);
-	src.copyTo(target.parent, target.leafName);
-	
-	return target;
-}
-
-function remove(file){
-	file.exists() &amp;&amp; file.remove(false);
-}
+// ---- [Test Support] -----------------------------------------
+function withXHR(process, exp, responseText){
+	var org = XMLHttpRequest;
+	try{
+		XMLHttpRequest = function(){
+			// getContents&#12363;&#12425;&#12398;&#21628;&#12403;&#20986;&#12375;&#12395;&#12399;&#12514;&#12483;&#12463;&#12434;&#36969;&#29992;&#12375;&#12394;&#12356;
+			for(var stack = Components.stack ; stack ; stack = stack.caller)
+				if(stack.name == 'getContents')
+					return new org();
+		};
+		XMLHttpRequest.prototype = {
+			statusText : 'OK',
+			status : 200,
+			readyState : 4,
+			responseText : responseText,
+			
+			open : function(method, url, async, username, password){
+				this.method = method.toUpperCase();
+				if(this.method == 'GET')
+					this.test(parseQueryString(broad(createURI(url)).query));
+			},
+			send : function(text){
+				if(this.method != 'GET')
+					this.test(parseQueryString(text));
+				
+				this.onload(this);
+				this.onreadystatechange(this);
+			},
+			test : function(act){
+				typeof(exp)=='function'? exp(act) : sameObject(act, exp);
+			},
+			getAllResponseHeaders : function(){},
+			setRequestHeader : function(){},
+			onload : function(req){},
+			onreadystatechange : function(req){},
+		};
+		
+		process();
+	} finally {
+		XMLHttpRequest = org;
+	}
+}
+
+function sameObject(act, exp, msg){
+	for(var p in exp){
+		var exv = exp[p];
+		var acv = act[p];
+		var m = msg + ': ' + p;
+		
+		// &#27491;&#35215;&#34920;&#29694;&#12363;
+		if(exv.test) {
+			ok(exv.test(acv), m);
+		} else if(exv.QueryInterface) {
+			ok(acv instanceof exv, m);
+		} else if(typeof(exv) == 'function') {
+			exv(acv, m);
+		} else if(typeof(exv) == 'object') {
+			sameObject(acv, exv, m);
+		} else {
+			is(acv, exv, m);
+		}
+	}
+}
+
+
+function autoReload(paths){
+	paths = paths || [];
+	
+	var baseUri = IOService.newURI(location.href, null, null);
+	Array.forEach(document.getElementsByTagNameNS(XUL_NS,'script'), function(script){
+		var src = script.getAttribute('src');
+		if(!src)
+			return;
+		
+		paths.push(IOService.newURI(src, null, baseUri).spec);
+	})
+	Array.forEach(document.getElementsByTagName('script'), function(script){
+		script.src &amp;&amp; paths.push(script.src);
+	})
+	Array.forEach(document.styleSheets, function(style){
+		style.href &amp;&amp; paths.push(style.href);
+	})
+	paths.push(location.href);
+	
+	function getModifiedTime(path){
+		var file = getLocalFile(path);
+		return file? file.lastModifiedTime : 0;
+	}
+	
+	var original = {};
+	paths.forEach(function(path){
+		original[path] = getModifiedTime(path);
+	});
+	
+	var intervalId = setInterval(function(){
+		paths.forEach(function(path){
+			if(original[path] != getModifiedTime(path))
+				location.reload();
+		});
+	}, 1000)
+}
+
+function getTestFile(path){
+	var file = getContentDir();
+	file.append('test');
+	
+	if(path)
+		file.setRelativeDescriptor(file, path);
+	
+	return file;
+}
+
+function copy(src, target){
+	if(!src.exists())
+		return;
+	
+	remove(target);
+	src.copyTo(target.parent, target.leafName);
+	
+	return target;
+}
+
+function remove(file){
+	file.exists() &amp;&amp; file.remove(false);
+}</diff>
      <filename>xpi/chrome/content/test/test.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,183 +1,183 @@
-&lt;html&gt;
-&lt;head&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
-	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
-	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;/head&gt;
-&lt;body&gt;
-
-&lt;pre id=&quot;test&quot;&gt;
-&lt;/pre&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
-try {
-	// chrome://tombloo/content/test/test_Components.html
-	
-	
-	// createMock
-	var BaseWebProgressListener = createMock('@mozilla.org/appshell/component/browser-status-filter;1');
-	ok(BaseWebProgressListener.STATE_TRANSFERRING);
-	
-	var listner = new BaseWebProgressListener();
-	ok(listner);
-	is(listner.STATE_TRANSFERRING, BaseWebProgressListener.STATE_TRANSFERRING);
-	is(listner.QueryInterface(Ci.nsIWebProgressListener), listner);
-	ok(! (listner instanceof Ci.nsIWebProgressListener), 'createMock&#12391;&#29983;&#25104;&#12375;&#12383;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12399;instanceof&#12364;&#36890;&#12425;&#12394;&#12356;');
-	
-	// createQueryInterface
-	var mock = {QueryInterface : createQueryInterface([Ci.nsIScriptError])};
-	is(mock.QueryInterface(Ci.nsIScriptError), mock);
-	try{
-		mock.QueryInterface(ILocalFile);
-	} catch (e){
-		is(e, Components.results.NS_NOINTERFACE);
-	}
-	
-	// createConstructor
-	var str = 'ABCD';
-	is(new InputStream(new StringInputStream(str)).read(str.length), 'ABCD');
-	
-	ok(PrefBranch.instanceOf(new PrefBranch()), 'createConstructor: instanceOf');
-	
-	// getService
-	is(typeof(Components.classes['not_found']), 'undefined');
-	ok(getService() === null);
-	ok(getService('hohoho') === null);
-	ok(getService('/consoleservice;1', Ci.nsIConsoleService).logStringMessage);
-	
-	
-	// getInterfaces
-	var uri = createURI('http://google.com');
-	var ifcs = getInterfaces(uri);
-	ok(ifcs.length &gt;= 6, 'getInterfaces: &#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#25968;(Firefox 2/3&#12391;&#36949;&#12358;)');
-	
-	
-	// broad
-	var uri = createURI('http://google.com');
-	var channel = broad(IOService.newChannelFromURI(uri));
-	ok(channel.setRequestHeader != null) // nsIHttpChannel;
-	ok(channel.setUploadStream != null)  // nsIUploadChannel;
-	
-	var uri = createURI('http://google.com');
-	var channel = broad(IOService.newChannelFromURI(uri), [Ci.nsIHttpChannel]);
-	ok(channel.setRequestHeader != null) // nsIHttpChannel;
-	ok(channel.setUploadStream == null)  // nsIUploadChannel;
-	
-	// getService
-	ok(getService('/consoleservice;1', Ci.nsIConsoleService));
-	ok(getService('not_found', null) === null);
-	
-	// createURI
-	is(createURI('C:\\').spec, 'file:///C:/');
-	is(createURI(new LocalFile('C:\\')).spec, 'file:///C:/');
-	is(createURI('file:///C:/').spec, 'file:///C:/');
-	is(createURI('http://google.com').spec, 'http://google.com/', 'URI&#12395;&#12394;&#12427;&#12392;&#26368;&#24460;&#12395;&#12473;&#12521;&#12483;&#12471;&#12517;&#12364;&#20184;&#21152;&#12373;&#12428;&#12427;');
-	
-	
-	// notify
-	notify('TITLE', 'MESSAGE', notify.ICON_DOWNLOAD);
-	
-	
-	// preference
-	is(getPrefType('foobar'), 'undefined');
-	
-	var key = 'extensions.tombloo.test_bool';
-	setPrefValue(key, true);
-	ok(getPrefValue(key));
-	is(typeof(getPrefValue(key)), 'boolean');
-	
-	var key = 'extensions.tombloo.test_number';
-	setPrefValue(key, 300);
-	is(getPrefValue(key), 300);
-	is(typeof(getPrefValue(key)), 'number');
-	
-	var key = 'extensions.tombloo.test_string';
-	setPrefValue(key, '&#12354;&#12356;&#12358;&#12360;&#12362;');
-	is(getPrefValue(key), '&#12354;&#12356;&#12358;&#12360;&#12362;');
-	is(typeof(getPrefValue(key)), 'string');
-	
-	
-	ok(getDownloadDir().exists());
-	ok(getProfileDir().exists());
-	
-	// 
-	// ok(  findCacheFile('http://f4.wretch.yimg.com/moblog/4/1939118735.jpg'), '&#12461;&#12515;&#12483;&#12471;&#12517;&#12501;&#12449;&#12452;&#12523;&#12364;(&#28961;&#12356;&#22580;&#21512;&#12418;&#12354;&#12426;)');
-	// log(findCacheFile('http://pics8.blog.yam.com/6/userfile/i/ivanaki0929/album/146b685908d2dc.jpg'));
-	ok(! findCacheFile('http://google.com/notFound.jpg'));
-	
-	is(sanitizeHTML(
-		'&lt;body&gt;&lt;style&gt;body{color:red}&lt;/style&gt;&lt;/body&gt;'), 
-		'');
-	is(sanitizeHTML(
-		'&lt;object&gt;&lt;/object&gt;&lt;script&gt;alert(3)&lt;\/script&gt;&lt;embed&gt;&lt;/embed&gt;'), 
-		'');
-	is(sanitizeHTML(
-		'&lt;input&lt;script src=&quot;alert(3)&quot;&lt;\/script&gt;'), 
-		'&lt;INPUT/&gt;');
-	is(sanitizeHTML(
-		'&lt;pre&gt;CODE&lt;pre/&gt;'), 
-		'&lt;PRE&gt;CODE&lt;PRE/&gt;&lt;/PRE&gt;',
-		'&#35492;&#12387;&#12383;pre&#12479;&#12464;');
-	if(navigator.userAgent.match('Firefox/3')){
-		is(sanitizeHTML(
-			'TEXT&lt;title&gt;HELLO BLOG&lt;/tile&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot;&gt;'), 
-			'TEXTHELLO BLOG');
-		is(sanitizeHTML(
-			'&lt;a href=&quot;javascript:alert(4)&quot;&gt;yahoo&lt;/a&gt;'), 
-			'&lt;A href=&quot;javascript:alert(4)&quot;&gt;yahoo&lt;/A&gt;');
-		is(sanitizeHTML(
-			'&lt;a href=&quot;javascrip&amp;#116;:alert(3)&quot;&gt;YAHOO&lt;/a&gt;'), 
-			'&lt;A href=&quot;javascript:alert(3)&quot;&gt;YAHOO&lt;/A&gt;',
-			'&#25968;&#20516;&#23455;&#20307;&#21442;&#29031;&#12434;&#20351;&#12387;&#12383;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#22475;&#12417;&#36796;&#12415;');
-		is(sanitizeHTML(
-			'&lt;a href=&quot;javascrip&amp;#116:alert(3)&quot;&gt;YAHOO&lt;/a&gt;'), 
-			'&lt;A href=&quot;javascript:alert(3)&quot;&gt;YAHOO&lt;/A&gt;',
-			'&#25968;&#20516;&#23455;&#20307;&#21442;&#29031;&#12434;&#20351;&#12387;&#12383;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#22475;&#12417;&#36796;&#12415;(&#26411;&#23614;&#12475;&#12511;&#12467;&#12525;&#12531;&#12398;&#30465;&#30053;)');
-		is(sanitizeHTML(
-			'&lt;form action=&quot;foo.cgi&quot;&gt;&lt;input type=&quot;submit&quot;&gt;&lt;/form&gt;'), 
-			'&lt;FORM&gt;&lt;INPUT type=&quot;submit&quot;/&gt;&lt;/FORM&gt;');
-	} else {
-		is(sanitizeHTML(
-			'TEXT&lt;title&gt;HELLO BLOG&lt;/tile&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot;&gt;'), 
-			'TEXT');
-		is(sanitizeHTML(
-			'&lt;a href=&quot;javascript:alert(4)&quot;&gt;yahoo&lt;/a&gt;'), 
-			'&lt;A&gt;yahoo&lt;/A&gt;');
-		is(sanitizeHTML(
-			'&lt;a href=&quot;javascrip&amp;#116;:alert(3)&quot;&gt;YAHOO&lt;/a&gt;'), 
-			'&lt;A&gt;YAHOO&lt;/A&gt;',
-			'&#25968;&#20516;&#23455;&#20307;&#21442;&#29031;&#12434;&#20351;&#12387;&#12383;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#22475;&#12417;&#36796;&#12415;');
-		is(sanitizeHTML(
-			'&lt;a href=&quot;javascrip&amp;#116:alert(3)&quot;&gt;YAHOO&lt;/a&gt;'), 
-			'&lt;A&gt;YAHOO&lt;/A&gt;',
-			'&#25968;&#20516;&#23455;&#20307;&#21442;&#29031;&#12434;&#20351;&#12387;&#12383;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#22475;&#12417;&#36796;&#12415;(&#26411;&#23614;&#12475;&#12511;&#12467;&#12525;&#12531;&#12398;&#30465;&#30053;)');
-		is(sanitizeHTML(
-			'&lt;form action=&quot;foo.cgi&quot;&gt;&lt;input type=&quot;submit&quot;&gt;&lt;/form&gt;'), 
-			'&lt;FORM action=&quot;foo.cgi&quot;&gt;&lt;INPUT type=&quot;submit&quot;/&gt;&lt;/FORM&gt;');
-	}
-	
-	
-	/*
-	&#27491;&#24120;&#21205;&#20316;&#12289;&#12486;&#12473;&#12488;&#12398;&#12383;&#12417;&#12395;getContents&#12364;&#24517;&#35201;
-	var file = getDownloadDir();
-	file.append('test_putContents.txt');
-	putContents(file, '&#12354;&#12356;&#12358;&#12360;&#12362;', 'UTF-16');
-	*/
-	
-	// 
-	ok(parseFloat(AppInfo.version) &gt; 1.5, 'Firefox&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12434;&#30906;&#35469;');
-	
-} catch (err) {
-	var s = [];
-	s.push('TEST SUITE FAILURE!');
-	for(var prop in err)
-		s.push(prop + ':  ' + err[prop]);
-	ok(false, s.join('\n'));
-}
-&lt;/script&gt;
-
-&lt;/body&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
+	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
+	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;pre id=&quot;test&quot;&gt;
+&lt;/pre&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+try {
+	// chrome://tombloo/content/test/test_Components.html
+	
+	
+	// createMock
+	var BaseWebProgressListener = createMock('@mozilla.org/appshell/component/browser-status-filter;1');
+	ok(BaseWebProgressListener.STATE_TRANSFERRING);
+	
+	var listner = new BaseWebProgressListener();
+	ok(listner);
+	is(listner.STATE_TRANSFERRING, BaseWebProgressListener.STATE_TRANSFERRING);
+	is(listner.QueryInterface(Ci.nsIWebProgressListener), listner);
+	ok(! (listner instanceof Ci.nsIWebProgressListener), 'createMock&#12391;&#29983;&#25104;&#12375;&#12383;&#12458;&#12502;&#12472;&#12455;&#12463;&#12488;&#12399;instanceof&#12364;&#36890;&#12425;&#12394;&#12356;');
+	
+	// createQueryInterface
+	var mock = {QueryInterface : createQueryInterface([Ci.nsIScriptError])};
+	is(mock.QueryInterface(Ci.nsIScriptError), mock);
+	try{
+		mock.QueryInterface(ILocalFile);
+	} catch (e){
+		is(e, Components.results.NS_NOINTERFACE);
+	}
+	
+	// createConstructor
+	var str = 'ABCD';
+	is(new InputStream(new StringInputStream(str)).read(str.length), 'ABCD');
+	
+	ok(PrefBranch.instanceOf(new PrefBranch()), 'createConstructor: instanceOf');
+	
+	// getService
+	is(typeof(Components.classes['not_found']), 'undefined');
+	ok(getService() === null);
+	ok(getService('hohoho') === null);
+	ok(getService('/consoleservice;1', Ci.nsIConsoleService).logStringMessage);
+	
+	
+	// getInterfaces
+	var uri = createURI('http://google.com');
+	var ifcs = getInterfaces(uri);
+	ok(ifcs.length &gt;= 6, 'getInterfaces: &#12452;&#12531;&#12479;&#12501;&#12455;&#12540;&#12473;&#25968;(Firefox 2/3&#12391;&#36949;&#12358;)');
+	
+	
+	// broad
+	var uri = createURI('http://google.com');
+	var channel = broad(IOService.newChannelFromURI(uri));
+	ok(channel.setRequestHeader != null) // nsIHttpChannel;
+	ok(channel.setUploadStream != null)  // nsIUploadChannel;
+	
+	var uri = createURI('http://google.com');
+	var channel = broad(IOService.newChannelFromURI(uri), [Ci.nsIHttpChannel]);
+	ok(channel.setRequestHeader != null) // nsIHttpChannel;
+	ok(channel.setUploadStream == null)  // nsIUploadChannel;
+	
+	// getService
+	ok(getService('/consoleservice;1', Ci.nsIConsoleService));
+	ok(getService('not_found', null) === null);
+	
+	// createURI
+	is(createURI('C:\\').spec, 'file:///C:/');
+	is(createURI(new LocalFile('C:\\')).spec, 'file:///C:/');
+	is(createURI('file:///C:/').spec, 'file:///C:/');
+	is(createURI('http://google.com').spec, 'http://google.com/', 'URI&#12395;&#12394;&#12427;&#12392;&#26368;&#24460;&#12395;&#12473;&#12521;&#12483;&#12471;&#12517;&#12364;&#20184;&#21152;&#12373;&#12428;&#12427;');
+	
+	
+	// notify
+	notify('TITLE', 'MESSAGE', notify.ICON_DOWNLOAD);
+	
+	
+	// preference
+	is(getPrefType('foobar'), 'undefined');
+	
+	var key = 'extensions.tombloo.test_bool';
+	setPrefValue(key, true);
+	ok(getPrefValue(key));
+	is(typeof(getPrefValue(key)), 'boolean');
+	
+	var key = 'extensions.tombloo.test_number';
+	setPrefValue(key, 300);
+	is(getPrefValue(key), 300);
+	is(typeof(getPrefValue(key)), 'number');
+	
+	var key = 'extensions.tombloo.test_string';
+	setPrefValue(key, '&#12354;&#12356;&#12358;&#12360;&#12362;');
+	is(getPrefValue(key), '&#12354;&#12356;&#12358;&#12360;&#12362;');
+	is(typeof(getPrefValue(key)), 'string');
+	
+	
+	ok(getDownloadDir().exists());
+	ok(getProfileDir().exists());
+	
+	// 
+	// ok(  findCacheFile('http://f4.wretch.yimg.com/moblog/4/1939118735.jpg'), '&#12461;&#12515;&#12483;&#12471;&#12517;&#12501;&#12449;&#12452;&#12523;&#12364;(&#28961;&#12356;&#22580;&#21512;&#12418;&#12354;&#12426;)');
+	// log(findCacheFile('http://pics8.blog.yam.com/6/userfile/i/ivanaki0929/album/146b685908d2dc.jpg'));
+	ok(! findCacheFile('http://google.com/notFound.jpg'));
+	
+	is(sanitizeHTML(
+		'&lt;body&gt;&lt;style&gt;body{color:red}&lt;/style&gt;&lt;/body&gt;'), 
+		'');
+	is(sanitizeHTML(
+		'&lt;object&gt;&lt;/object&gt;&lt;script&gt;alert(3)&lt;\/script&gt;&lt;embed&gt;&lt;/embed&gt;'), 
+		'');
+	is(sanitizeHTML(
+		'&lt;input&lt;script src=&quot;alert(3)&quot;&lt;\/script&gt;'), 
+		'&lt;INPUT/&gt;');
+	is(sanitizeHTML(
+		'&lt;pre&gt;CODE&lt;pre/&gt;'), 
+		'&lt;PRE&gt;CODE&lt;PRE/&gt;&lt;/PRE&gt;',
+		'&#35492;&#12387;&#12383;pre&#12479;&#12464;');
+	if(navigator.userAgent.match('Firefox/3')){
+		is(sanitizeHTML(
+			'TEXT&lt;title&gt;HELLO BLOG&lt;/tile&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot;&gt;'), 
+			'TEXTHELLO BLOG');
+		is(sanitizeHTML(
+			'&lt;a href=&quot;javascript:alert(4)&quot;&gt;yahoo&lt;/a&gt;'), 
+			'&lt;A href=&quot;javascript:alert(4)&quot;&gt;yahoo&lt;/A&gt;');
+		is(sanitizeHTML(
+			'&lt;a href=&quot;javascrip&amp;#116;:alert(3)&quot;&gt;YAHOO&lt;/a&gt;'), 
+			'&lt;A href=&quot;javascript:alert(3)&quot;&gt;YAHOO&lt;/A&gt;',
+			'&#25968;&#20516;&#23455;&#20307;&#21442;&#29031;&#12434;&#20351;&#12387;&#12383;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#22475;&#12417;&#36796;&#12415;');
+		is(sanitizeHTML(
+			'&lt;a href=&quot;javascrip&amp;#116:alert(3)&quot;&gt;YAHOO&lt;/a&gt;'), 
+			'&lt;A href=&quot;javascript:alert(3)&quot;&gt;YAHOO&lt;/A&gt;',
+			'&#25968;&#20516;&#23455;&#20307;&#21442;&#29031;&#12434;&#20351;&#12387;&#12383;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#22475;&#12417;&#36796;&#12415;(&#26411;&#23614;&#12475;&#12511;&#12467;&#12525;&#12531;&#12398;&#30465;&#30053;)');
+		is(sanitizeHTML(
+			'&lt;form action=&quot;foo.cgi&quot;&gt;&lt;input type=&quot;submit&quot;&gt;&lt;/form&gt;'), 
+			'&lt;FORM&gt;&lt;INPUT type=&quot;submit&quot;/&gt;&lt;/FORM&gt;');
+	} else {
+		is(sanitizeHTML(
+			'TEXT&lt;title&gt;HELLO BLOG&lt;/tile&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot;&gt;'), 
+			'TEXT');
+		is(sanitizeHTML(
+			'&lt;a href=&quot;javascript:alert(4)&quot;&gt;yahoo&lt;/a&gt;'), 
+			'&lt;A&gt;yahoo&lt;/A&gt;');
+		is(sanitizeHTML(
+			'&lt;a href=&quot;javascrip&amp;#116;:alert(3)&quot;&gt;YAHOO&lt;/a&gt;'), 
+			'&lt;A&gt;YAHOO&lt;/A&gt;',
+			'&#25968;&#20516;&#23455;&#20307;&#21442;&#29031;&#12434;&#20351;&#12387;&#12383;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#22475;&#12417;&#36796;&#12415;');
+		is(sanitizeHTML(
+			'&lt;a href=&quot;javascrip&amp;#116:alert(3)&quot;&gt;YAHOO&lt;/a&gt;'), 
+			'&lt;A&gt;YAHOO&lt;/A&gt;',
+			'&#25968;&#20516;&#23455;&#20307;&#21442;&#29031;&#12434;&#20351;&#12387;&#12383;&#12473;&#12463;&#12522;&#12503;&#12488;&#12398;&#22475;&#12417;&#36796;&#12415;(&#26411;&#23614;&#12475;&#12511;&#12467;&#12525;&#12531;&#12398;&#30465;&#30053;)');
+		is(sanitizeHTML(
+			'&lt;form action=&quot;foo.cgi&quot;&gt;&lt;input type=&quot;submit&quot;&gt;&lt;/form&gt;'), 
+			'&lt;FORM action=&quot;foo.cgi&quot;&gt;&lt;INPUT type=&quot;submit&quot;/&gt;&lt;/FORM&gt;');
+	}
+	
+	
+	/*
+	&#27491;&#24120;&#21205;&#20316;&#12289;&#12486;&#12473;&#12488;&#12398;&#12383;&#12417;&#12395;getContents&#12364;&#24517;&#35201;
+	var file = getDownloadDir();
+	file.append('test_putContents.txt');
+	putContents(file, '&#12354;&#12356;&#12358;&#12360;&#12362;', 'UTF-16');
+	*/
+	
+	// 
+	ok(parseFloat(AppInfo.version) &gt; 1.5, 'Firefox&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12434;&#30906;&#35469;');
+	
+} catch (err) {
+	var s = [];
+	s.push('TEST SUITE FAILURE!');
+	for(var prop in err)
+		s.push(prop + ':  ' + err[prop]);
+	ok(false, s.join('\n'));
+}
+&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>xpi/chrome/content/test/test_Components.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,165 +1,165 @@
-&lt;html&gt;
-&lt;head&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
-	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
-	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;/head&gt;
-&lt;body&gt;
-
-&lt;pre id=&quot;test&quot;&gt;
-&lt;/pre&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/30_Tombloo.Service.js&quot;&gt;&lt;/script&gt;
-
-&lt;script type=&quot;text/javascript&quot;&gt;
-try {
-	// chrome://tombloo/content/test/test_Database.html
-	
-	var file = copy(
-		getTestFile('tombloo_test.sqlite'), 
-		getTestFile('tombloo_test.temp.sqlite'));
-	
-	// PRAGMA user_version
-	var db = new Database(file);
-	is(db.version, 0);
-	db.version = 1;
-	is(db.version, 1);
-	
-	// vacuum
-	db.vacuum();
-	
-	var def = {
-		name : 'video',
-		fields : {
-			id      : 'INTEGER PRIMARY KEY',
-			host    : 'TEXT',
-		}
-	}
-	
-	is(Entity.createInsertSQL(def), 
-		'INSERT INTO video ( id, host ) VALUES ( :id, :host )');
-	is(Entity.createUpdateSQL(def),
-		'UPDATE video SET host=:host WHERE id = :id');
-	is(Entity.createInitializeSQL(def),
-		'CREATE TABLE IF NOT EXISTS video ( id INTEGER PRIMARY KEY, host TEXT )');
-	
-	var def = {
-		name : 'video',
-		fields : {
-			id      : 'INTEGER PRIMARY KEY',
-			host    : 'TEXT',
-			date    : 'TIMESTAMP',
-			capTion : 'TEXT',
-			source  : 'TEXT',
-			player  : 'TEXT',
-			tags    : 'LIST',
-		}
-	}
-	
-	var Video = Entity(def);
-	Video.db = db;
-	Video.initialize();
-	Video.deinitialize();
-	Video.initialize();
-	
-	ok( db.tableExists('video'));
-	ok(!db.tableExists('no_such_table'));
-	
-	Video.deleteAll();
-	is(Video.findAll().length, 0, '&#20840;&#21066;&#38500;&#12373;&#12428;&#12383;&#12363;');
-	
-	var video = new Video({
-		id : 1,
-		host    : 'HOST_1',
-		date    : new Date(2007, 6, 20),
-		capTion : 'CAPTION',
-		tags    : [1,2,3],
-	});
-	video.save();
-	is(Video.findAll().length, 1, 'save');
-	
-	var video = Video.findByHost('HOST_1')[0];
-	is(video.date.getDate(), 20, '&#26085;&#20184;&#12398;&#20445;&#23384;&#12392;&#24489;&#20803;&#12364;&#34892;&#12360;&#12427;&#12363;');
-	is(video.tags[2], 3, '&#12522;&#12473;&#12488;&#12398;&#20445;&#23384;&#12392;&#24489;&#20803;&#12364;&#34892;&#12360;&#12427;&#12363;');
-	
-	
-	var video = new Video({
-		id : 2,
-		host : 'HOST_2',
-		date : new Date(2007, 1, 1),
-		capTion : 'CAPTION',
-	});
-	video.save();
-	is(Video.findAll().length, 2, 'save');
-	
-	
-	is(Video.findByHost('HOST_1').length, 1);
-	is(Video.findByHostAndCapTion(['HOST_1', 'CAPTION']).length, 1);
-	
-	is(Video.findByCapTion({
-		capTion:'CAPTION', 
-		limit:1, 
-		offset:1,
-		order:'id DESC'})[0].host, 'HOST_1');
-	
-	is(Video.countByHost('HOST_1'), 1);
-	is(Video.countByHost({host:'HOST_1'}), 1);
-	
-	
-	// &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;
-	db.transaction(function(){
-		var video = new Video({id : 3});
-		video.save();
-		
-		// &#12456;&#12521;&#12540;&#12434;&#36215;&#12371;&#12375;&#12525;&#12540;&#12523;&#12496;&#12483;&#12463;&#12373;&#12379;&#12427;
-		throw 'ERROR';
-	}).addErrback(function(err){
-		is(err.message, 'ERROR');
-	});
-	is(Video.findById(3).length, 0, '&#12525;&#12540;&#12523;&#12496;&#12483;&#12463;&#12373;&#12428;&#12383;&#12363;');
-
-	db.transaction(function(){
-		var video = new Video({id : 3});
-		video.save();
-		
-		return 'OK';
-	}).addCallback(function(res){
-		is(res, 'OK', '&#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;&#32080;&#26524;&#20516;&#12364;&#36820;&#12373;&#12428;&#12427;&#12363;');
-	});
-	is(Video.findById(3).length, 1, '&#12467;&#12511;&#12483;&#12488;&#12373;&#12428;&#12383;&#12363;');
-	
-	
-	// &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;(&#20491;&#21029;&#12513;&#12477;&#12483;&#12489;)
-	db.beginTransaction();
-	db.beginTransaction();
-	ok(true, 'beginTransaction: &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;&#20869;&#12391;&#21628;&#12403;&#20986;&#12375;&#12390;&#12418;&#12456;&#12521;&#12540;&#12364;&#36215;&#12365;&#12394;&#12356;&#12363;');
-	
-	db.commitTransaction();
-	db.commitTransaction();
-	ok(true, 'commitTransaction: &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;&#22806;&#12391;&#21628;&#12403;&#20986;&#12375;&#12390;&#12418;&#12456;&#12521;&#12540;&#12364;&#36215;&#12365;&#12394;&#12356;&#12363;');
-	
-	db.rollbackTransaction();
-	ok(true, 'rollbackTransaction: &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;&#22806;&#12391;&#21628;&#12403;&#20986;&#12375;&#12390;&#12418;&#12456;&#12521;&#12540;&#12364;&#36215;&#12365;&#12394;&#12356;&#12363;');
-	
-} catch (err) {
-	var s = [];
-	s.push('TEST SUITE FAILURE!');
-	for(var prop in err)
-		s.push(prop + ':  ' + err[prop]);
-	ok(false, s.join('\n'));
-	
-} finally{
-	db.close();
-}
-&lt;/script&gt;
-
-&lt;/body&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
+	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
+	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;pre id=&quot;test&quot;&gt;
+&lt;/pre&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/30_Tombloo.Service.js&quot;&gt;&lt;/script&gt;
+
+&lt;script type=&quot;text/javascript&quot;&gt;
+try {
+	// chrome://tombloo/content/test/test_Database.html
+	
+	var file = copy(
+		getTestFile('tombloo_test.sqlite'), 
+		getTestFile('tombloo_test.temp.sqlite'));
+	
+	// PRAGMA user_version
+	var db = new Database(file);
+	is(db.version, 0);
+	db.version = 1;
+	is(db.version, 1);
+	
+	// vacuum
+	db.vacuum();
+	
+	var def = {
+		name : 'video',
+		fields : {
+			id      : 'INTEGER PRIMARY KEY',
+			host    : 'TEXT',
+		}
+	}
+	
+	is(Entity.createInsertSQL(def), 
+		'INSERT INTO video ( id, host ) VALUES ( :id, :host )');
+	is(Entity.createUpdateSQL(def),
+		'UPDATE video SET host=:host WHERE id = :id');
+	is(Entity.createInitializeSQL(def),
+		'CREATE TABLE IF NOT EXISTS video ( id INTEGER PRIMARY KEY, host TEXT )');
+	
+	var def = {
+		name : 'video',
+		fields : {
+			id      : 'INTEGER PRIMARY KEY',
+			host    : 'TEXT',
+			date    : 'TIMESTAMP',
+			capTion : 'TEXT',
+			source  : 'TEXT',
+			player  : 'TEXT',
+			tags    : 'LIST',
+		}
+	}
+	
+	var Video = Entity(def);
+	Video.db = db;
+	Video.initialize();
+	Video.deinitialize();
+	Video.initialize();
+	
+	ok( db.tableExists('video'));
+	ok(!db.tableExists('no_such_table'));
+	
+	Video.deleteAll();
+	is(Video.findAll().length, 0, '&#20840;&#21066;&#38500;&#12373;&#12428;&#12383;&#12363;');
+	
+	var video = new Video({
+		id : 1,
+		host    : 'HOST_1',
+		date    : new Date(2007, 6, 20),
+		capTion : 'CAPTION',
+		tags    : [1,2,3],
+	});
+	video.save();
+	is(Video.findAll().length, 1, 'save');
+	
+	var video = Video.findByHost('HOST_1')[0];
+	is(video.date.getDate(), 20, '&#26085;&#20184;&#12398;&#20445;&#23384;&#12392;&#24489;&#20803;&#12364;&#34892;&#12360;&#12427;&#12363;');
+	is(video.tags[2], 3, '&#12522;&#12473;&#12488;&#12398;&#20445;&#23384;&#12392;&#24489;&#20803;&#12364;&#34892;&#12360;&#12427;&#12363;');
+	
+	
+	var video = new Video({
+		id : 2,
+		host : 'HOST_2',
+		date : new Date(2007, 1, 1),
+		capTion : 'CAPTION',
+	});
+	video.save();
+	is(Video.findAll().length, 2, 'save');
+	
+	
+	is(Video.findByHost('HOST_1').length, 1);
+	is(Video.findByHostAndCapTion(['HOST_1', 'CAPTION']).length, 1);
+	
+	is(Video.findByCapTion({
+		capTion:'CAPTION', 
+		limit:1, 
+		offset:1,
+		order:'id DESC'})[0].host, 'HOST_1');
+	
+	is(Video.countByHost('HOST_1'), 1);
+	is(Video.countByHost({host:'HOST_1'}), 1);
+	
+	
+	// &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;
+	db.transaction(function(){
+		var video = new Video({id : 3});
+		video.save();
+		
+		// &#12456;&#12521;&#12540;&#12434;&#36215;&#12371;&#12375;&#12525;&#12540;&#12523;&#12496;&#12483;&#12463;&#12373;&#12379;&#12427;
+		throw 'ERROR';
+	}).addErrback(function(err){
+		is(err.message, 'ERROR');
+	});
+	is(Video.findById(3).length, 0, '&#12525;&#12540;&#12523;&#12496;&#12483;&#12463;&#12373;&#12428;&#12383;&#12363;');
+
+	db.transaction(function(){
+		var video = new Video({id : 3});
+		video.save();
+		
+		return 'OK';
+	}).addCallback(function(res){
+		is(res, 'OK', '&#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;&#32080;&#26524;&#20516;&#12364;&#36820;&#12373;&#12428;&#12427;&#12363;');
+	});
+	is(Video.findById(3).length, 1, '&#12467;&#12511;&#12483;&#12488;&#12373;&#12428;&#12383;&#12363;');
+	
+	
+	// &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;(&#20491;&#21029;&#12513;&#12477;&#12483;&#12489;)
+	db.beginTransaction();
+	db.beginTransaction();
+	ok(true, 'beginTransaction: &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;&#20869;&#12391;&#21628;&#12403;&#20986;&#12375;&#12390;&#12418;&#12456;&#12521;&#12540;&#12364;&#36215;&#12365;&#12394;&#12356;&#12363;');
+	
+	db.commitTransaction();
+	db.commitTransaction();
+	ok(true, 'commitTransaction: &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;&#22806;&#12391;&#21628;&#12403;&#20986;&#12375;&#12390;&#12418;&#12456;&#12521;&#12540;&#12364;&#36215;&#12365;&#12394;&#12356;&#12363;');
+	
+	db.rollbackTransaction();
+	ok(true, 'rollbackTransaction: &#12488;&#12521;&#12531;&#12470;&#12463;&#12471;&#12519;&#12531;&#22806;&#12391;&#21628;&#12403;&#20986;&#12375;&#12390;&#12418;&#12456;&#12521;&#12540;&#12364;&#36215;&#12365;&#12394;&#12356;&#12363;');
+	
+} catch (err) {
+	var s = [];
+	s.push('TEST SUITE FAILURE!');
+	for(var prop in err)
+		s.push(prop + ':  ' + err[prop]);
+	ok(false, s.join('\n'));
+	
+} finally{
+	db.close();
+}
+&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>xpi/chrome/content/test/test_Database.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,64 +1,64 @@
-&lt;html&gt;
-&lt;head&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
-	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
-	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;/head&gt;
-&lt;body&gt;
-
-&lt;pre id=&quot;test&quot;&gt;
-&lt;/pre&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
-try {
-	// chrome://tombloo/content/test/test_MochiKit.html
-	
-	var callback = function(a, b){
-		alert(a);
-		alert(b);
-	}
-	
-	var d = new Deferred(function(){
-		alert('CANCELED');
-	})
-	
-	d.addCallback(function(value){
-		alert('A' + value);
-		
-		var d = new Deferred(function(){
-			alert('CANCELED - A');
-		});
-		setTimeout(function(){
-			d.callback(2);
-		}, 2000);
-		return d;
-	});
-	d.addCallback(function(value){
-		alert('B' + value);
-		
-		var d = new Deferred();
-		d.canceller = function(){
-			alert('CANCELED - B');
-		};
-		setTimeout(function(){
-			// d.cancel();
-			d.callback(3);
-		}, 2000);
-		return d;
-	});
-	d.addCallback(callback, 100);
-	d.callback(1);
-	
-} catch (err) {
-	var s = [];
-	s.push('TEST SUITE FAILURE!');
-	for(var prop in err)
-		s.push(prop + ':  ' + err[prop]);
-	ok(false, s.join('\n'));
-}
-&lt;/script&gt;
-
-&lt;/body&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
+	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
+	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;pre id=&quot;test&quot;&gt;
+&lt;/pre&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+try {
+	// chrome://tombloo/content/test/test_MochiKit.html
+	
+	var callback = function(a, b){
+		alert(a);
+		alert(b);
+	}
+	
+	var d = new Deferred(function(){
+		alert('CANCELED');
+	})
+	
+	d.addCallback(function(value){
+		alert('A' + value);
+		
+		var d = new Deferred(function(){
+			alert('CANCELED - A');
+		});
+		setTimeout(function(){
+			d.callback(2);
+		}, 2000);
+		return d;
+	});
+	d.addCallback(function(value){
+		alert('B' + value);
+		
+		var d = new Deferred();
+		d.canceller = function(){
+			alert('CANCELED - B');
+		};
+		setTimeout(function(){
+			// d.cancel();
+			d.callback(3);
+		}, 2000);
+		return d;
+	});
+	d.addCallback(callback, 100);
+	d.callback(1);
+	
+} catch (err) {
+	var s = [];
+	s.push('TEST SUITE FAILURE!');
+	for(var prop in err)
+		s.push(prop + ':  ' + err[prop]);
+	ok(false, s.join('\n'));
+}
+&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>xpi/chrome/content/test/test_MochiKit.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,162 +1,162 @@
-&lt;html&gt;
-&lt;head&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
-	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
-	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;/head&gt;
-&lt;body&gt;
-
-&lt;pre id=&quot;test&quot;&gt;
-&lt;/pre&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
-try {
-	// chrome://tombloo/content/test/test_Progress.html
-	
-	
-	// &#22522;&#26412;&#12486;&#12473;&#12488; - &#31354;
-	var p = new Progress();
-	is(p.name, '');
-	is(p.max, 100);
-	is(p.value, 0);
-	is(p.percentage, 0);
-	is(p.canceled, false);
-	
-	p.value = 10;
-	is(p.value, 10);
-	
-	p.max = 10;
-	is(p.max, 10);
-	
-	p.cancel();
-	is(p.canceled, true);
-	
-	
-	// &#22522;&#26412;&#12486;&#12473;&#12488; - &#36890;&#24120;
-	var p = new Progress('P', 50, 14);
-	is(p.name, 'P');
-	is(p.max, 50);
-	p.value++;
-	is(p.value, 15);
-	is(p.percentage, 30);
-	is(p.completed, false);
-	
-	p.complete();
-	is(p.value, 50);
-	is(p.percentage, 100);
-	is(p.completed, true, '&#23436;&#20102;&#12377;&#12427;&#12363;');
-	
-	p.value=100;
-	is(p.value, 50, '&#26368;&#22823;&#20516;&#12434;&#36229;&#12360;&#12394;&#12356;&#12371;&#12392;');
-
-	p.value=25;;
-	is(p.completed, false, '&#20516;&#12398;&#22793;&#26356;&#12391;&#23436;&#20102;&#12391;&#12394;&#12367;&#12394;&#12427;&#12363;');
-	
-	p.max = 0;
-	is(p.value, 0, '&#26368;&#22823;&#20516;&#12398;&#22793;&#26356;&#12391;&#20516;&#12418;&#22793;&#12431;&#12427;&#12363;');
-	is(p.completed, true, '&#23436;&#20102;&#12395;&#12394;&#12427;&#12363;');
-	is(p.percentage, 100, 'max&#12364;0&#12398;&#12392;&#12365;&#12399;100%&#12392;&#12377;&#12427;');
-	
-	var p = new Progress('P', 0, 0);
-	var called = 0;
-	p.addProgressListener(function(target, trigger){
-		called++;
-	});
-	p.complete();
-	is(called, 1, '&#26368;&#22823;&#20516;&#12364;0&#12398;&#12479;&#12473;&#12463;&#12364;&#23436;&#20102;&#12377;&#12427;&#12371;&#12392;');
-	p.complete();
-	is(called, 1, '&#35079;&#25968;&#22238;&#23436;&#20102;&#12375;&#12394;&#12356;&#12371;&#12392;');
-	
-	// &#20837;&#12428;&#23376;&#12486;&#12473;&#12488; - 1
-	var p = new Progress('P');
-	var c1 = new Progress('C1', 50, 0);
-	var c2 = new Progress('C2', 40, 0);
-	
-	p.addChild(c1);
-	p.addChild(c2, 300);
-	
-	is(p.value, 0);
-	
-	c1.addProgressListener(function(prog){
-		is(prog.value, 50, '&#12503;&#12525;&#12464;&#12524;&#12473;&#12522;&#12473;&#12490;&#12540;');
-	});
-	c1.complete();
-	is(c1.value, 50);
-	is(c1.percentage, 100, '&#23436;&#20102;&#12375;&#12383;&#12503;&#12525;&#12464;&#12524;&#12473;&#12398;&#12497;&#12540;&#12475;&#12531;&#12486;&#12540;&#12472;');
-	
-	is(p.percentage, 25);
-	
-	p.addProgressListener(function(prog){
-		is(prog.percentage, 62, '&#12503;&#12525;&#12464;&#12524;&#12473;&#12522;&#12473;&#12490;&#12540; - &#35242;');
-	});
-	c2.value = 20;
-	is(c2.value, 20);
-	is(c2.percentage, 50);
-	
-	is(p.percentage, 62); // 25 + 37
-	
-	// 
-	var p = new Progress('P');
-	var called = false;
-	p.addProgressListener(function(prog){
-		ok(!called, '&#23436;&#20102;&#12364;2&#24230;&#21628;&#12400;&#12428;&#12394;&#12356;&#12371;&#12392;');
-		called = true;
-	});
-	p.complete();
-	p.complete();
-	
-	var p = new Progress('P');
-	p.addProgressListener(function(prog){
-		ok(false, '&#12461;&#12515;&#12531;&#12475;&#12523;&#24460;&#12399;&#23436;&#20102;&#12364;&#12400;&#12428;&#12394;&#12356;&#12371;&#12392;');
-	});
-	p.cancel();
-	p.complete();
-	
-	// &#20837;&#12428;&#23376;&#12486;&#12473;&#12488; - &#12461;&#12515;&#12531;&#12475;&#12523;
-	var p = new Progress('P');
-	var c1 = new Progress('C1', 50, 0);
-	var c2 = new Progress('C2', 40, 0);
-	
-	p.addChild(c1);
-	p.addChild(c2);
-	
-	is(p.canceled, false);
-	is(c1.canceled, false);
-	is(c2.canceled, false);
-	
-	c1.addCancelListener(function(prog){
-		ok(c1.canceled, '&#12461;&#12515;&#12531;&#12475;&#12523;&#12522;&#12473;&#12490;&#12540;');
-	});
-	p.addCancelListener(function(prog){
-		ok(true, '&#12461;&#12515;&#12531;&#12475;&#12523;&#12522;&#12473;&#12490;&#12540; - parent');
-	});
-	c1.cancel();
-	is(p.canceled, true);
-	is(c1.canceled, true);
-	is(c2.canceled, true);
-	
-	var p = openProgressDialog(new Progress('Task'));
-	setTimeout(function(){
-		if(p.canceled || p.completed)
-			return;
-		
-		p.value+=50;
-		setTimeout(arguments.callee, 2000);
-	}, 2000);
-	
-} catch (err) {
-	var s = [];
-	s.push('TEST SUITE FAILURE!');
-	for(var prop in err)
-		s.push(prop + ':  ' + err[prop]);
-	ok(false, s.join('\n'));
-}
-&lt;/script&gt;
-
-&lt;/body&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
+	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
+	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;pre id=&quot;test&quot;&gt;
+&lt;/pre&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+try {
+	// chrome://tombloo/content/test/test_Progress.html
+	
+	
+	// &#22522;&#26412;&#12486;&#12473;&#12488; - &#31354;
+	var p = new Progress();
+	is(p.name, '');
+	is(p.max, 100);
+	is(p.value, 0);
+	is(p.percentage, 0);
+	is(p.canceled, false);
+	
+	p.value = 10;
+	is(p.value, 10);
+	
+	p.max = 10;
+	is(p.max, 10);
+	
+	p.cancel();
+	is(p.canceled, true);
+	
+	
+	// &#22522;&#26412;&#12486;&#12473;&#12488; - &#36890;&#24120;
+	var p = new Progress('P', 50, 14);
+	is(p.name, 'P');
+	is(p.max, 50);
+	p.value++;
+	is(p.value, 15);
+	is(p.percentage, 30);
+	is(p.completed, false);
+	
+	p.complete();
+	is(p.value, 50);
+	is(p.percentage, 100);
+	is(p.completed, true, '&#23436;&#20102;&#12377;&#12427;&#12363;');
+	
+	p.value=100;
+	is(p.value, 50, '&#26368;&#22823;&#20516;&#12434;&#36229;&#12360;&#12394;&#12356;&#12371;&#12392;');
+
+	p.value=25;;
+	is(p.completed, false, '&#20516;&#12398;&#22793;&#26356;&#12391;&#23436;&#20102;&#12391;&#12394;&#12367;&#12394;&#12427;&#12363;');
+	
+	p.max = 0;
+	is(p.value, 0, '&#26368;&#22823;&#20516;&#12398;&#22793;&#26356;&#12391;&#20516;&#12418;&#22793;&#12431;&#12427;&#12363;');
+	is(p.completed, true, '&#23436;&#20102;&#12395;&#12394;&#12427;&#12363;');
+	is(p.percentage, 100, 'max&#12364;0&#12398;&#12392;&#12365;&#12399;100%&#12392;&#12377;&#12427;');
+	
+	var p = new Progress('P', 0, 0);
+	var called = 0;
+	p.addProgressListener(function(target, trigger){
+		called++;
+	});
+	p.complete();
+	is(called, 1, '&#26368;&#22823;&#20516;&#12364;0&#12398;&#12479;&#12473;&#12463;&#12364;&#23436;&#20102;&#12377;&#12427;&#12371;&#12392;');
+	p.complete();
+	is(called, 1, '&#35079;&#25968;&#22238;&#23436;&#20102;&#12375;&#12394;&#12356;&#12371;&#12392;');
+	
+	// &#20837;&#12428;&#23376;&#12486;&#12473;&#12488; - 1
+	var p = new Progress('P');
+	var c1 = new Progress('C1', 50, 0);
+	var c2 = new Progress('C2', 40, 0);
+	
+	p.addChild(c1);
+	p.addChild(c2, 300);
+	
+	is(p.value, 0);
+	
+	c1.addProgressListener(function(prog){
+		is(prog.value, 50, '&#12503;&#12525;&#12464;&#12524;&#12473;&#12522;&#12473;&#12490;&#12540;');
+	});
+	c1.complete();
+	is(c1.value, 50);
+	is(c1.percentage, 100, '&#23436;&#20102;&#12375;&#12383;&#12503;&#12525;&#12464;&#12524;&#12473;&#12398;&#12497;&#12540;&#12475;&#12531;&#12486;&#12540;&#12472;');
+	
+	is(p.percentage, 25);
+	
+	p.addProgressListener(function(prog){
+		is(prog.percentage, 62, '&#12503;&#12525;&#12464;&#12524;&#12473;&#12522;&#12473;&#12490;&#12540; - &#35242;');
+	});
+	c2.value = 20;
+	is(c2.value, 20);
+	is(c2.percentage, 50);
+	
+	is(p.percentage, 62); // 25 + 37
+	
+	// 
+	var p = new Progress('P');
+	var called = false;
+	p.addProgressListener(function(prog){
+		ok(!called, '&#23436;&#20102;&#12364;2&#24230;&#21628;&#12400;&#12428;&#12394;&#12356;&#12371;&#12392;');
+		called = true;
+	});
+	p.complete();
+	p.complete();
+	
+	var p = new Progress('P');
+	p.addProgressListener(function(prog){
+		ok(false, '&#12461;&#12515;&#12531;&#12475;&#12523;&#24460;&#12399;&#23436;&#20102;&#12364;&#12400;&#12428;&#12394;&#12356;&#12371;&#12392;');
+	});
+	p.cancel();
+	p.complete();
+	
+	// &#20837;&#12428;&#23376;&#12486;&#12473;&#12488; - &#12461;&#12515;&#12531;&#12475;&#12523;
+	var p = new Progress('P');
+	var c1 = new Progress('C1', 50, 0);
+	var c2 = new Progress('C2', 40, 0);
+	
+	p.addChild(c1);
+	p.addChild(c2);
+	
+	is(p.canceled, false);
+	is(c1.canceled, false);
+	is(c2.canceled, false);
+	
+	c1.addCancelListener(function(prog){
+		ok(c1.canceled, '&#12461;&#12515;&#12531;&#12475;&#12523;&#12522;&#12473;&#12490;&#12540;');
+	});
+	p.addCancelListener(function(prog){
+		ok(true, '&#12461;&#12515;&#12531;&#12475;&#12523;&#12522;&#12473;&#12490;&#12540; - parent');
+	});
+	c1.cancel();
+	is(p.canceled, true);
+	is(c1.canceled, true);
+	is(c2.canceled, true);
+	
+	var p = openProgressDialog(new Progress('Task'));
+	setTimeout(function(){
+		if(p.canceled || p.completed)
+			return;
+		
+		p.value+=50;
+		setTimeout(arguments.callee, 2000);
+	}, 2000);
+	
+} catch (err) {
+	var s = [];
+	s.push('TEST SUITE FAILURE!');
+	for(var prop in err)
+		s.push(prop + ':  ' + err[prop]);
+	ok(false, s.join('\n'));
+}
+&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>xpi/chrome/content/test/test_Progress.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,314 +1,314 @@
-&lt;html&gt;
-&lt;head&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
-	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
-	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;pre id=&quot;test&quot;&gt;
-&lt;/pre&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_model.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/30_Tombloo.Service.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/31_Tombloo.Service.extractors.js&quot;&gt;&lt;/script&gt;
-
-&lt;script type=&quot;text/javascript&quot;&gt;
-try {
-	// chrome://tombloo/content/test/test_Tombloo.Service.extractors.html
-	
-	
-	SimpleTest.waitForExplicitFinish();
-	
-	var d = succeed();
-	var exts = Tombloo.Service.extractors;
-	
-	
-	// ---- [Test Support] -----------------------------------------
-	function arrangeContext(ctx, doc){
-		update(ctx, createURI(ctx.href));
-		ctx.title = doc.getElementsByTagName('title')[0].textContent.trim();
-		ctx.document = doc;
-	}
-	
-	function basicExtractorTest(name, url, exp){
-		var ext = exts[name];
-		var ctx = {href : url};
-		var doc;
-		if(url)
-			d.addCallback(request, url);
-		d.addCallback(function(res){
-			log('Test: ' + name);
-			
-			if(url){
-				doc = convertToHTMLDocument(res.responseText);
-				arrangeContext(ctx, doc);
-			}
-			
-			return withDocument(doc, function(){
-				if(typeof(exp)=='function')
-					exp = exp(ext, ctx, doc);
-				
-				return ext.extract(ctx);
-			});
-		});
-		d.addCallback(function(res){
-			withDocument(doc, function(){
-				res.page = ctx.title;
-				res.pageUrl = ctx.href;
-				
-				exp &amp;&amp; sameObject(res, exp, name + ': extract');
-				ok(ext.check(ctx), name + ': check');
-			});
-			return res;
-		});
-	}
-	
-	//	href  : 'http://www.tumblr.com/dashboard/iframe?src=http%3A%2F%2Fto.tumblr.com%2Fpost%2F38249621&amp;pid=38249621&amp;rk=exgZK6NR', 
-	/*	
-	basicExtractorTest('Quote - Twitter', 'http://twitter.com/ku/statuses/833768036', {
-		type    : 'quote',
-		page    : 'Twitter / ku: http://getfirebug.com/ does...',
-		pageUrl : 'http://twitter.com/ku/statuses/833768036',
-		item    : 'Twitter / ku',
-		itemUrl : 'http://twitter.com/ku/statuses/833768036',
-		body    : '&lt;a href=&quot;http://getfirebug.com/&quot;&gt;http://getfirebug.com/&lt;/a&gt; does not respond......', 
-	});
-	
-	basicExtractorTest('Quote - inyo.jp', 'http://inyo.jp/quote/4528124a65fc7d03ca14a8b073ea49c964b463a0', {
-		type    : 'quote',
-		pageUrl : 'http://inyo.jp/quote/4528124a65fc7d03ca14a8b073ea49c964b463a0',
-		item    : 'Predicting The Future',
-		itemUrl : 'http://inyo.jp/quote/4528124a65fc7d03ca14a8b073ea49c964b463a0',
-		body    : 'the best way to predict the future is to invent it.', 
-	});
-	
-	
-	basicExtractorTest(
-		'Photo - Amazon', 
-		'http://www.amazon.co.jp/Master-Puppets-Metallica/dp/B000002H33/ref=sr_1_1?ie=UTF8&amp;s=music&amp;qid=1213360790&amp;sr=8-1', 
-		function(ext, ctx, doc){
-			ctx.target = {
-				id    : 'prodImage', 
-				style : {},
-			};
-			
-			return {
-				type    : 'photo',
-				page    : 'Master of Puppets',
-				pageUrl : 'http://amazon.co.jp/o/ASIN/B000002H33',
-				item    : 'Master of Puppets',
-				itemUrl : 'http://ecx.images-amazon.com/images/I/418MR1SQNKL.jpg', 
-			}
-		});
-	
-	basicExtractorTest('Photo - webshots', 'http://good-times.webshots.com/photo/2222898030101141911OEtlZo', {
-		type      : 'photo',
-		page      : 'cat cat cat cat cat cat cat cat cat cat cat pictures from friends &amp; fun photos on webshots',
-		pageUrl   : 'http://good-times.webshots.com/photo/2222898030101141911OEtlZo',
-		item      : 'cat cat cat cat cat cat cat cat cat cat cat',
-		itemUrl   : 'http://image16.webshots.com/16/8/98/3/2222898030101141911OEtlZo_fs.jpg', 
-		author    : 'mosbatboys',
-		authorUrl : 'http://community.webshots.com/user/mosbatboys/profile',
-	});
-	
-	basicExtractorTest(
-		'Photo - FFFFOUND!', 
-		'http://ffffound.com/', 
-		function(ext, ctx, doc){
-			ctx.onLink = true;
-			ctx.target = {};
-			ctx.link = {href : 'http://ffffound.com/image/b7c72b4d23e1805a10441824072e0eff5790b9d0'};
-			
-			return {
-				type      : 'photo',
-				page      : 'FFFFOUND!',
-				pageUrl   : 'http://ffffound.com/image/b7c72b4d23e1805a10441824072e0eff5790b9d0',
-				item      : 'REDRAW CMS',
-				itemUrl   : 'http://img.ffffound.com/static-data/assets/6/b7c72b4d23e1805a10441824072e0eff5790b9d0.jpg', 
-				author    : 'kssssk',
-				authorUrl : new RegExp('/home/kssssk/found/'),
-			}
-		});
-	
-	basicExtractorTest(
-		'Photo - FFFFOUND!', 
-		'http://ffffound.com/image/b7c72b4d23e1805a10441824072e0eff5790b9d0', 
-		function(ext, ctx, doc){
-			ctx.target = $x('id(&quot;assetib7c72b4d23e1805a10441824072e0eff5790b9d0-img&quot;)');
-			
-			return {
-				type      : 'photo',
-				page      : 'FFFFOUND!',
-				pageUrl   : 'http://ffffound.com/image/b7c72b4d23e1805a10441824072e0eff5790b9d0',
-				item      : 'REDRAW CMS',
-				itemUrl   : 'http://img.ffffound.com/static-data/assets/6/b7c72b4d23e1805a10441824072e0eff5790b9d0.jpg', 
-				author    : 'kssssk',
-				authorUrl : new RegExp('/home/kssssk/found/'),
-			}
-		});
-	
-	basicExtractorTest('Video - Vimeo', 'http://www.vimeo.com/752979', {
-		type      : 'video',
-		page      : 'White &amp; Nerdy on Vimeo',
-		pageUrl   : 'http://www.vimeo.com/752979',
-		item      : 'White &amp; Nerdy',
-		itemUrl   : 'http://www.vimeo.com/752979',
-		author    : 'waymoby',
-		authorUrl : '/weirdal',
-	});
-	
-	basicExtractorTest('Video - YouTube', 'http://jp.youtube.com/watch?v=rorBOzwR3Tc', {
-		type      : 'video',
-		page      : 'YouTube - KORG DS-10 #001',
-		pageUrl   : 'http://jp.youtube.com/watch?v=rorBOzwR3Tc',
-		item      : 'KORG DS-10 #001',
-		itemUrl   : 'http://jp.youtube.com/watch?v=rorBOzwR3Tc',
-		author    : 'aqi',
-		authorUrl : new RegExp('/user/aqi'),
-	});
-	
-	basicExtractorTest('Video - Google Video', 'http://video.google.com/videoplay?docid=3342755205038857742', {
-		type      : 'video',
-		page      : 'Little Nemo - 1984 Pilot',
-		item      : 'Little Nemo - 1984 Pilot',
-		pageUrl   : 'http://video.google.com/videoplay?docid=3342755205038857742',
-		itemUrl   : 'http://video.google.com/videoplay?docid=3342755205038857742',
-	});
-	
-	basicExtractorTest('Video - MySpaceTV', 'http://vids.myspace.com/index.cfm?fuseaction=vids.individual&amp;VideoID=21937552', {
-		type    : 'video',
-		page    : /MySpaceTV.+/,
-		pageUrl : 'http://vids.myspace.com/index.cfm?fuseaction=vids.individual&amp;videoid=21937552',
-		item    : 'Venetian Acrobat Son',
-		itemUrl : 'http://vids.myspace.com/index.cfm?fuseaction=vids.individual&amp;videoid=21937552',
-		body    : /^&lt;object.*object&gt;$/,
-	});
-	
-	basicExtractorTest('Video - Dailymotion', 'http://www.dailymotion.com/cluster/animals/featured/video/x5oeer_last-of-the-scottish-wildcats-dvd-p_animals', {
-		type      : 'video',
-		page      : 'Dailymotion - Last of the Scottish Wildcats DVD preview trailer, a video from coffeefilms. cat, chat, chats, animal, endangered',
-		pageUrl   : 'http://www.dailymotion.com/video/x5oeer_last-of-the-scottish-wildcats-dvd-p_animals',
-		item      : 'Last of the Scottish Wildcats DVD preview trailer',
-		itemUrl   : 'http://www.dailymotion.com/video/x5oeer_last-of-the-scottish-wildcats-dvd-p_animals',
-		author    : 'coffeefilms',
-		authorUrl : 'http://www.dailymotion.com/coffeefilms',
-		body      : /^&lt;object.*object&gt;$/,
-	});
-	
-	basicExtractorTest('Video - Rimo', 'http://rimo.tv/ja/ch/95269', {
-		type    : 'video',
-		page    : 'Rimo - 200806 Music channel',
-		pageUrl : 'http://rimo.tv/ja/ch/95269',
-		item    : '200806 Music channel',
-		itemUrl : 'http://rimo.tv/ja/ch/95269',
-		body    : /^&lt;object.*object&gt;$/,
-	});
-	
-	basicExtractorTest('Video - Rimo', 'http://rimo.tv/channel/show?url=http%3A%2F%2Fdocopenhagen.blogspot.com%2F2006%2F12%2Ftop-50-music-videos-of-2006.html', {
-		type    : 'video',
-		page    : '&#12300;DoCopenhagen: Top 50 Music Videos Of 2006&#12301;&#12398;&#21205;&#30011;&#12434;&#12414;&#12392;&#12417;&#12390;Rimo&#12391;&#35211;&#12427; - Rimo',
-		pageUrl : 'http://rimo.tv/channel/show?url=http%3A%2F%2Fdocopenhagen.blogspot.com%2F2006%2F12%2Ftop-50-music-videos-of-2006.html',
-		item    : 'DoCopenhagen: Top 50 Music Videos Of 2006',
-		itemUrl : 'http://rimo.tv/channel/show?url=http%3A%2F%2Fdocopenhagen.blogspot.com%2F2006%2F12%2Ftop-50-music-videos-of-2006.html',
-		body    : /^&lt;object.*object&gt;$/,
-	});
-	
-	
-	basicExtractorTest('ReBlog - Tumblr', 'http://to.tumblr.com/post/38249621', {
-		type  : 'reblog',
-		page    : 'to',
-		pageUrl : 'http://to.tumblr.com/post/38249621',
-		item    : 'to',
-		itemUrl : 'http://to.tumblr.com/post/38249621',
-		token   : {
-			token : 'exgZK6NR',
-			id    : '38249621',
-		},
-	});
-	
-	basicExtractorTest(
-		'ReBlog - Tumblr link', 
-		null, 
-		function(ext, ctx, doc){
-			ctx.link = {href : 'http://to.tumblr.com/post/38249621'};
-			
-			return {
-				type  : 'reblog',
-				page    : 'to',
-				pageUrl : 'http://to.tumblr.com/post/38249621',
-				item    : 'to',
-				itemUrl : 'http://to.tumblr.com/post/38249621',
-				token   : {
-					token : 'exgZK6NR',
-					id    : '38249621',
-				},
-			}
-		});
-	
-	basicExtractorTest(
-		'Photo - Flickr', 
-		null, 
-		function(ext, ctx, doc){
-			ctx.onImage = true;
-			ctx.target = {src:'http://farm4.static.flickr.com/3151/2569321947_04353b1f27_s.jpg'};
-			
-			return {
-				type      : 'photo',
-				page      : 'awkwardfeet on Flickr',
-				pageUrl   : 'http://www.flickr.com/photos/le_carabinier/2569321947/',
-				item      : 'awkwardfeet',
-				itemUrl   : 'http://farm4.static.flickr.com/3151/2569321947_a245340e65_o.jpg', 
-				author    : 'Sean Marc Lee &#26446;&#33606;&#23665;',
-				authorUrl : 'http://www.flickr.com/photos/le_carabinier/',
-			}
-		});
-	
-	basicExtractorTest('Photo - Upload from Cache', 'http://www.sqlite.org/', 
-		function(ext, ctx, doc){
-			ctx.onImage = true;
-			ctx.document = document;
-			ctx.target = {
-				tagName : 'img',
-				src     : 'http://www.sqlite.org/images/SQLite.gif',
-			};
-			
-			return {
-				type    : 'photo',
-				page    : 'SQLite Home Page',
-				pageUrl : 'http://www.sqlite.org/',
-				item    : 'SQLite Home Page',
-				itemUrl : 'http://www.sqlite.org/images/SQLite.gif',
-				file    : ILocalFile,
-			}
-		});
-	*/
-	
-	
-	d.addErrback(function(e){
-		log(e)
-		ok(false);
-	});
-	d.addBoth(function(){
-		SimpleTest.finish()
-	});
-} catch (err) {
-	var s = [];
-	s.push('TEST SUITE FAILURE!');
-	for(var prop in err)
-		s.push(prop + ':  ' + err[prop]);
-	ok(false, s.join('\n'));
-	
-	SimpleTest.finish()
-}
-&lt;/script&gt;
-
-&lt;/body&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
+	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
+	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;pre id=&quot;test&quot;&gt;
+&lt;/pre&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_model.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/30_Tombloo.Service.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/31_Tombloo.Service.extractors.js&quot;&gt;&lt;/script&gt;
+
+&lt;script type=&quot;text/javascript&quot;&gt;
+try {
+	// chrome://tombloo/content/test/test_Tombloo.Service.extractors.html
+	
+	
+	SimpleTest.waitForExplicitFinish();
+	
+	var d = succeed();
+	var exts = Tombloo.Service.extractors;
+	
+	
+	// ---- [Test Support] -----------------------------------------
+	function arrangeContext(ctx, doc){
+		update(ctx, createURI(ctx.href));
+		ctx.title = doc.getElementsByTagName('title')[0].textContent.trim();
+		ctx.document = doc;
+	}
+	
+	function basicExtractorTest(name, url, exp){
+		var ext = exts[name];
+		var ctx = {href : url};
+		var doc;
+		if(url)
+			d.addCallback(request, url);
+		d.addCallback(function(res){
+			log('Test: ' + name);
+			
+			if(url){
+				doc = convertToHTMLDocument(res.responseText);
+				arrangeContext(ctx, doc);
+			}
+			
+			return withDocument(doc, function(){
+				if(typeof(exp)=='function')
+					exp = exp(ext, ctx, doc);
+				
+				return ext.extract(ctx);
+			});
+		});
+		d.addCallback(function(res){
+			withDocument(doc, function(){
+				res.page = ctx.title;
+				res.pageUrl = ctx.href;
+				
+				exp &amp;&amp; sameObject(res, exp, name + ': extract');
+				ok(ext.check(ctx), name + ': check');
+			});
+			return res;
+		});
+	}
+	
+	//	href  : 'http://www.tumblr.com/dashboard/iframe?src=http%3A%2F%2Fto.tumblr.com%2Fpost%2F38249621&amp;pid=38249621&amp;rk=exgZK6NR', 
+	/*	
+	basicExtractorTest('Quote - Twitter', 'http://twitter.com/ku/statuses/833768036', {
+		type    : 'quote',
+		page    : 'Twitter / ku: http://getfirebug.com/ does...',
+		pageUrl : 'http://twitter.com/ku/statuses/833768036',
+		item    : 'Twitter / ku',
+		itemUrl : 'http://twitter.com/ku/statuses/833768036',
+		body    : '&lt;a href=&quot;http://getfirebug.com/&quot;&gt;http://getfirebug.com/&lt;/a&gt; does not respond......', 
+	});
+	
+	basicExtractorTest('Quote - inyo.jp', 'http://inyo.jp/quote/4528124a65fc7d03ca14a8b073ea49c964b463a0', {
+		type    : 'quote',
+		pageUrl : 'http://inyo.jp/quote/4528124a65fc7d03ca14a8b073ea49c964b463a0',
+		item    : 'Predicting The Future',
+		itemUrl : 'http://inyo.jp/quote/4528124a65fc7d03ca14a8b073ea49c964b463a0',
+		body    : 'the best way to predict the future is to invent it.', 
+	});
+	
+	
+	basicExtractorTest(
+		'Photo - Amazon', 
+		'http://www.amazon.co.jp/Master-Puppets-Metallica/dp/B000002H33/ref=sr_1_1?ie=UTF8&amp;s=music&amp;qid=1213360790&amp;sr=8-1', 
+		function(ext, ctx, doc){
+			ctx.target = {
+				id    : 'prodImage', 
+				style : {},
+			};
+			
+			return {
+				type    : 'photo',
+				page    : 'Master of Puppets',
+				pageUrl : 'http://amazon.co.jp/o/ASIN/B000002H33',
+				item    : 'Master of Puppets',
+				itemUrl : 'http://ecx.images-amazon.com/images/I/418MR1SQNKL.jpg', 
+			}
+		});
+	
+	basicExtractorTest('Photo - webshots', 'http://good-times.webshots.com/photo/2222898030101141911OEtlZo', {
+		type      : 'photo',
+		page      : 'cat cat cat cat cat cat cat cat cat cat cat pictures from friends &amp; fun photos on webshots',
+		pageUrl   : 'http://good-times.webshots.com/photo/2222898030101141911OEtlZo',
+		item      : 'cat cat cat cat cat cat cat cat cat cat cat',
+		itemUrl   : 'http://image16.webshots.com/16/8/98/3/2222898030101141911OEtlZo_fs.jpg', 
+		author    : 'mosbatboys',
+		authorUrl : 'http://community.webshots.com/user/mosbatboys/profile',
+	});
+	
+	basicExtractorTest(
+		'Photo - FFFFOUND!', 
+		'http://ffffound.com/', 
+		function(ext, ctx, doc){
+			ctx.onLink = true;
+			ctx.target = {};
+			ctx.link = {href : 'http://ffffound.com/image/b7c72b4d23e1805a10441824072e0eff5790b9d0'};
+			
+			return {
+				type      : 'photo',
+				page      : 'FFFFOUND!',
+				pageUrl   : 'http://ffffound.com/image/b7c72b4d23e1805a10441824072e0eff5790b9d0',
+				item      : 'REDRAW CMS',
+				itemUrl   : 'http://img.ffffound.com/static-data/assets/6/b7c72b4d23e1805a10441824072e0eff5790b9d0.jpg', 
+				author    : 'kssssk',
+				authorUrl : new RegExp('/home/kssssk/found/'),
+			}
+		});
+	
+	basicExtractorTest(
+		'Photo - FFFFOUND!', 
+		'http://ffffound.com/image/b7c72b4d23e1805a10441824072e0eff5790b9d0', 
+		function(ext, ctx, doc){
+			ctx.target = $x('id(&quot;assetib7c72b4d23e1805a10441824072e0eff5790b9d0-img&quot;)');
+			
+			return {
+				type      : 'photo',
+				page      : 'FFFFOUND!',
+				pageUrl   : 'http://ffffound.com/image/b7c72b4d23e1805a10441824072e0eff5790b9d0',
+				item      : 'REDRAW CMS',
+				itemUrl   : 'http://img.ffffound.com/static-data/assets/6/b7c72b4d23e1805a10441824072e0eff5790b9d0.jpg', 
+				author    : 'kssssk',
+				authorUrl : new RegExp('/home/kssssk/found/'),
+			}
+		});
+	
+	basicExtractorTest('Video - Vimeo', 'http://www.vimeo.com/752979', {
+		type      : 'video',
+		page      : 'White &amp; Nerdy on Vimeo',
+		pageUrl   : 'http://www.vimeo.com/752979',
+		item      : 'White &amp; Nerdy',
+		itemUrl   : 'http://www.vimeo.com/752979',
+		author    : 'waymoby',
+		authorUrl : '/weirdal',
+	});
+	
+	basicExtractorTest('Video - YouTube', 'http://jp.youtube.com/watch?v=rorBOzwR3Tc', {
+		type      : 'video',
+		page      : 'YouTube - KORG DS-10 #001',
+		pageUrl   : 'http://jp.youtube.com/watch?v=rorBOzwR3Tc',
+		item      : 'KORG DS-10 #001',
+		itemUrl   : 'http://jp.youtube.com/watch?v=rorBOzwR3Tc',
+		author    : 'aqi',
+		authorUrl : new RegExp('/user/aqi'),
+	});
+	
+	basicExtractorTest('Video - Google Video', 'http://video.google.com/videoplay?docid=3342755205038857742', {
+		type      : 'video',
+		page      : 'Little Nemo - 1984 Pilot',
+		item      : 'Little Nemo - 1984 Pilot',
+		pageUrl   : 'http://video.google.com/videoplay?docid=3342755205038857742',
+		itemUrl   : 'http://video.google.com/videoplay?docid=3342755205038857742',
+	});
+	
+	basicExtractorTest('Video - MySpaceTV', 'http://vids.myspace.com/index.cfm?fuseaction=vids.individual&amp;VideoID=21937552', {
+		type    : 'video',
+		page    : /MySpaceTV.+/,
+		pageUrl : 'http://vids.myspace.com/index.cfm?fuseaction=vids.individual&amp;videoid=21937552',
+		item    : 'Venetian Acrobat Son',
+		itemUrl : 'http://vids.myspace.com/index.cfm?fuseaction=vids.individual&amp;videoid=21937552',
+		body    : /^&lt;object.*object&gt;$/,
+	});
+	
+	basicExtractorTest('Video - Dailymotion', 'http://www.dailymotion.com/cluster/animals/featured/video/x5oeer_last-of-the-scottish-wildcats-dvd-p_animals', {
+		type      : 'video',
+		page      : 'Dailymotion - Last of the Scottish Wildcats DVD preview trailer, a video from coffeefilms. cat, chat, chats, animal, endangered',
+		pageUrl   : 'http://www.dailymotion.com/video/x5oeer_last-of-the-scottish-wildcats-dvd-p_animals',
+		item      : 'Last of the Scottish Wildcats DVD preview trailer',
+		itemUrl   : 'http://www.dailymotion.com/video/x5oeer_last-of-the-scottish-wildcats-dvd-p_animals',
+		author    : 'coffeefilms',
+		authorUrl : 'http://www.dailymotion.com/coffeefilms',
+		body      : /^&lt;object.*object&gt;$/,
+	});
+	
+	basicExtractorTest('Video - Rimo', 'http://rimo.tv/ja/ch/95269', {
+		type    : 'video',
+		page    : 'Rimo - 200806 Music channel',
+		pageUrl : 'http://rimo.tv/ja/ch/95269',
+		item    : '200806 Music channel',
+		itemUrl : 'http://rimo.tv/ja/ch/95269',
+		body    : /^&lt;object.*object&gt;$/,
+	});
+	
+	basicExtractorTest('Video - Rimo', 'http://rimo.tv/channel/show?url=http%3A%2F%2Fdocopenhagen.blogspot.com%2F2006%2F12%2Ftop-50-music-videos-of-2006.html', {
+		type    : 'video',
+		page    : '&#12300;DoCopenhagen: Top 50 Music Videos Of 2006&#12301;&#12398;&#21205;&#30011;&#12434;&#12414;&#12392;&#12417;&#12390;Rimo&#12391;&#35211;&#12427; - Rimo',
+		pageUrl : 'http://rimo.tv/channel/show?url=http%3A%2F%2Fdocopenhagen.blogspot.com%2F2006%2F12%2Ftop-50-music-videos-of-2006.html',
+		item    : 'DoCopenhagen: Top 50 Music Videos Of 2006',
+		itemUrl : 'http://rimo.tv/channel/show?url=http%3A%2F%2Fdocopenhagen.blogspot.com%2F2006%2F12%2Ftop-50-music-videos-of-2006.html',
+		body    : /^&lt;object.*object&gt;$/,
+	});
+	
+	
+	basicExtractorTest('ReBlog - Tumblr', 'http://to.tumblr.com/post/38249621', {
+		type  : 'reblog',
+		page    : 'to',
+		pageUrl : 'http://to.tumblr.com/post/38249621',
+		item    : 'to',
+		itemUrl : 'http://to.tumblr.com/post/38249621',
+		token   : {
+			token : 'exgZK6NR',
+			id    : '38249621',
+		},
+	});
+	
+	basicExtractorTest(
+		'ReBlog - Tumblr link', 
+		null, 
+		function(ext, ctx, doc){
+			ctx.link = {href : 'http://to.tumblr.com/post/38249621'};
+			
+			return {
+				type  : 'reblog',
+				page    : 'to',
+				pageUrl : 'http://to.tumblr.com/post/38249621',
+				item    : 'to',
+				itemUrl : 'http://to.tumblr.com/post/38249621',
+				token   : {
+					token : 'exgZK6NR',
+					id    : '38249621',
+				},
+			}
+		});
+	
+	basicExtractorTest(
+		'Photo - Flickr', 
+		null, 
+		function(ext, ctx, doc){
+			ctx.onImage = true;
+			ctx.target = {src:'http://farm4.static.flickr.com/3151/2569321947_04353b1f27_s.jpg'};
+			
+			return {
+				type      : 'photo',
+				page      : 'awkwardfeet on Flickr',
+				pageUrl   : 'http://www.flickr.com/photos/le_carabinier/2569321947/',
+				item      : 'awkwardfeet',
+				itemUrl   : 'http://farm4.static.flickr.com/3151/2569321947_a245340e65_o.jpg', 
+				author    : 'Sean Marc Lee &#26446;&#33606;&#23665;',
+				authorUrl : 'http://www.flickr.com/photos/le_carabinier/',
+			}
+		});
+	
+	basicExtractorTest('Photo - Upload from Cache', 'http://www.sqlite.org/', 
+		function(ext, ctx, doc){
+			ctx.onImage = true;
+			ctx.document = document;
+			ctx.target = {
+				tagName : 'img',
+				src     : 'http://www.sqlite.org/images/SQLite.gif',
+			};
+			
+			return {
+				type    : 'photo',
+				page    : 'SQLite Home Page',
+				pageUrl : 'http://www.sqlite.org/',
+				item    : 'SQLite Home Page',
+				itemUrl : 'http://www.sqlite.org/images/SQLite.gif',
+				file    : ILocalFile,
+			}
+		});
+	*/
+	
+	
+	d.addErrback(function(e){
+		log(e)
+		ok(false);
+	});
+	d.addBoth(function(){
+		SimpleTest.finish()
+	});
+} catch (err) {
+	var s = [];
+	s.push('TEST SUITE FAILURE!');
+	for(var prop in err)
+		s.push(prop + ':  ' + err[prop]);
+	ok(false, s.join('\n'));
+	
+	SimpleTest.finish()
+}
+&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>xpi/chrome/content/test/test_Tombloo.Service.extractors.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,201 +1,201 @@
-&lt;html&gt;
-&lt;head&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
-	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
-	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;/head&gt;
-&lt;body&gt;
-
-&lt;pre id=&quot;test&quot;&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
-try {
-	// chrome://tombloo/content/test/test_Tombloo.html
-	
-	// Instance Methods
-	// var tombloo = new Tombloo();
-	
-	var Tag = Tombloo.Tag;
-	var Photo = Tombloo.Photo;
-	
-	var info = Photo.getImageInfo('1358142_500.jpg');
-	is(info.id, 1358142);
-	is(info.revision, null);
-	is(info.size, 500);
-	is(info.extension, 'jpg');
-	
-	var info = Photo.getImageInfo('1767102_r1_500.gif');
-	is(info.id, '1767102_r1');
-	is(info.size, 500);
-	is(info.extension, 'gif');
-	
-	var info = Photo.getImageInfo('http://data.tumblr.com/3821653_100.gif');
-	is(info.id, 3821653);
-	is(info.size, 100);
-	
-	var info = Photo.getImageInfo('0ddGiMjzE1f0l8cm8jhW75xR_250.jpg');
-	is(info.id, '0ddGiMjzE1f0l8cm8jhW75xR');
-	is(info.size, 250);
-	
-	
-	// &#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12486;&#12473;&#12488;
-	var file = copy(
-		getTestFile('tombloo_test.sqlite'), 
-		getTestFile('tombloo_test.temp.sqlite'));
-	
-	Tombloo.db = new Database(file);
-	is(Tombloo.root.path, getTestFile().path, 'Tombloo&#12398;&#12487;&#12540;&#12479;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12364;&#12486;&#12473;&#12488;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12395;&#35373;&#23450;&#12373;&#12428;&#12383;&#12363;');
-	
-	ok(Photo.db, '&#12456;&#12531;&#12486;&#12451;&#12486;&#12451;&#12398;db&#12418;&#21021;&#26399;&#21270;&#12373;&#12428;&#12390;&#12356;&#12427;&#12363;');
-	
-	Tombloo.Photo.deleteAll();
-	Tombloo.Video.deleteAll();
-	Tombloo.Regular.deleteAll();
-	Tombloo.Quote.deleteAll();
-	Tombloo.Link.deleteAll();
-	Tombloo.Conversation.deleteAll();
-	
-	is(Tombloo.Photo.countByUser('to'), 0);
-	is(Tombloo.Video.countByUser('to'), 0);
-	is(Tombloo.Regular.countByUser('to'), 0);
-	is(Tombloo.Quote.countByUser('to'), 0);
-	is(Tombloo.Link.countByUser('to'), 0);
-	is(Tombloo.Conversation.countByUser('to'), 0);
-	
-	var photo = new Photo({
-		id : 1, 
-		user : 'to',
-		date : new Date(2007, 6, 20),
-		body : 'ABCDEFG',
-		imageId : '12126918_r1',
-		extension : 'jpg',
-		tags : ['test', 'beautiful'],
-		
-		url : 'http://', // &#19981;&#35201;&#12503;&#12525;&#12497;&#12486;&#12451;
-	});
-	photo.save();
-	is(Photo.countByUser('to'), 1, '&#20445;&#23384;&#12373;&#12428;&#34892;&#12364;&#22679;&#12360;&#12427;&#12363;');
-	
-	ok(photo.checkFile(500), '&#12501;&#12449;&#12452;&#12523;&#12364;&#23384;&#22312;&#12377;&#12427;&#12363;');
-	is(photo.getFile(500).exists(), true, '&#12501;&#12449;&#12452;&#12523;&#12364;&#23384;&#22312;&#12377;&#12427;&#12363;');
-	
-	var tags = Tag.findById(1);
-	is(tags.length, 2, '&#12479;&#12464;&#12364;&#20445;&#23384;&#12373;&#12428;&#12390;&#12356;&#12427;&#12363;');
-	is(tags[0].tag, 'test');
-	
-	
-	var photos = Photo.findByUser('to');
-	is(photos.length, 1, '&#26908;&#32034;&#12395;&#12498;&#12483;&#12488;&#12377;&#12427;&#12363;');
-	
-	var photos = Photo.findByUser('to');
-	is(photos.length, 1, '&#26908;&#32034;&#12395;&#12498;&#12483;&#12488;&#12377;&#12427;&#12363;');
-	
-	is(photos[0].id, 1);
-	is(photos[0].date.getDate(), 20, '&#26085;&#20184;&#22411;&#12391;&#21462;&#24471;&#12391;&#12365;&#12427;&#12363;');
-	is(photos[0].user, 'to');
-	is(photos[0].tags.length, 2, '&#38306;&#36899;&#12456;&#12531;&#12486;&#12451;&#12486;&#12451;(&#12479;&#12464;)&#12364;&#21462;&#24471;&#12391;&#12365;&#12427;&#12363;');
-	is(photos[0].tags[0].tag, 'test');
-	
-	photo.body = '&#12354;&#12356;&#12358;&#12360;&#12362;';
-	photo.save();
-	
-	var photos = Photo.findByUser('to');
-	is(photos[0].body, '&#12354;&#12356;&#12358;&#12360;&#12362;', '&#26085;&#26412;&#35486;&#12364;&#20445;&#23384;&#12373;&#12428;&#12427;&#12363;');
-	
-	// &#38917;&#30446;&#12434;&#20840;&#37096;&#22475;&#12417;&#12394;&#12356;&#12391;&#20445;&#23384;
-	var photo = new Photo({
-		id : 2, 
-		user : '02',
-		file75 : 'ABCDEFG', // &#25968;&#20516;&#12501;&#12451;&#12540;&#12523;&#12489;&#12395;&#25991;&#23383;&#26360;&#12365;&#36796;&#12415;
-	});
-	photo.save();
-	
-	// &#12518;&#12540;&#12470;&#12540;&#19968;&#35239;&#12398;&#21462;&#24471;
-	is(Photo.findUsers().length, 2);
-	is(Photo.findUsers()[0], '02');
-	is(Photo.findUsers()[1], 'to');
-	
-	
-	
-	// &#26356;&#26032;
-	var photo = Photo.findByUser('02')[0];
-	is(photo.id, 2);
-	is(photo.file75, 'ABCDEFG', '&#25968;&#20516;&#12501;&#12451;&#12540;&#12489;&#12363;&#12425;&#25991;&#23383;&#12434;&#21462;&#24471;&#12391;&#12365;&#12427;&#12363;');
-	is(photo.temporary, false);
-	photo.file500 = 1;
-	photo.save(); // update
-	
-	var photo = Photo.findByUser('02')[0];
-	is(photo.id, 2);
-	is(photo.file500, 1, 'update&#12373;&#12428;&#12390;&#12356;&#12427;&#12363;');
-	
-	// &#21066;&#38500;
-	photo.remove();
-	is(Tombloo.Photo.countByUser('02'), 0);
-	
-	photo.save(); // insert
-	is(Tombloo.Photo.countByUser('02'), 1);
-	
-	ok(!photo.checkFile(500), '&#12501;&#12449;&#12452;&#12523;&#12364;&#23384;&#22312;&#12375;&#12394;&#12356;&#12371;&#12392;');
-	
-	
-	// Tombloo.Post.insert
-	Tombloo.Post.insert({
-		id : 3, 
-		type : 'photo',
-		tags : ['tag1', 'tag2'],
-	});
-	var photo = Tombloo.Photo.findById(3)[0];
-	is(photo.id, 3);
-	is(photo.tags[1].tag, 'tag2');
-	
-	Tombloo.Post.insert({
-		id : 4, 
-		type : 'photo',
-		tags : [],
-	});
-	var photo = Tombloo.Photo.findById(4)[0];
-	is(photo.tags.length, 0, '&#31354;&#12479;&#12464;&#12398;&#20445;&#23384;&#12392;&#24489;&#20803;&#12364;&#12391;&#12365;&#12427;&#12363;');
-	
-	
-	// VIEW
-	is(Tombloo.Post.countByUser('02'), 1, 'VIEW&#12398;&#12459;&#12454;&#12531;&#12488;&#12289;Photo&#12479;&#12452;&#12503;&#12398;&#12415;');
-	
-	Tombloo.Video.insert({id : 2, user : '02'});
-	is(Tombloo.Post.countByUser('02'), 2);
-	
-	Tombloo.Regular.insert({id : 2, user : '02'});
-	is(Tombloo.Post.countByUser('02'), 3);
-	
-	Tombloo.Quote.insert({id : 2, user : '02'});
-	is(Tombloo.Post.countByUser('02'), 4);
-	
-	Tombloo.Link.insert({id : 2, user : '02'});
-	is(Tombloo.Post.countByUser('02'), 5);
-	
-	Tombloo.Conversation.insert({id : 2, user : '02'});
-	is(Tombloo.Post.countByUser('02'), 6);
-	
-	
-} catch (err) {
-	var s = [];
-	s.push('TEST SUITE FAILURE!');
-	for(var prop in err)
-		s.push(prop + ':  ' + err[prop]);
-	ok(false, s.join('\n'));
-	
-} finally{
-	Tombloo.db &amp;&amp; Tombloo.db.close();
-}
-&lt;/script&gt;
-&lt;/pre&gt;
-
-&lt;/body&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
+	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
+	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;pre id=&quot;test&quot;&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+try {
+	// chrome://tombloo/content/test/test_Tombloo.html
+	
+	// Instance Methods
+	// var tombloo = new Tombloo();
+	
+	var Tag = Tombloo.Tag;
+	var Photo = Tombloo.Photo;
+	
+	var info = Photo.getImageInfo('1358142_500.jpg');
+	is(info.id, 1358142);
+	is(info.revision, null);
+	is(info.size, 500);
+	is(info.extension, 'jpg');
+	
+	var info = Photo.getImageInfo('1767102_r1_500.gif');
+	is(info.id, '1767102_r1');
+	is(info.size, 500);
+	is(info.extension, 'gif');
+	
+	var info = Photo.getImageInfo('http://data.tumblr.com/3821653_100.gif');
+	is(info.id, 3821653);
+	is(info.size, 100);
+	
+	var info = Photo.getImageInfo('0ddGiMjzE1f0l8cm8jhW75xR_250.jpg');
+	is(info.id, '0ddGiMjzE1f0l8cm8jhW75xR');
+	is(info.size, 250);
+	
+	
+	// &#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12486;&#12473;&#12488;
+	var file = copy(
+		getTestFile('tombloo_test.sqlite'), 
+		getTestFile('tombloo_test.temp.sqlite'));
+	
+	Tombloo.db = new Database(file);
+	is(Tombloo.root.path, getTestFile().path, 'Tombloo&#12398;&#12487;&#12540;&#12479;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12364;&#12486;&#12473;&#12488;&#12487;&#12451;&#12524;&#12463;&#12488;&#12522;&#12395;&#35373;&#23450;&#12373;&#12428;&#12383;&#12363;');
+	
+	ok(Photo.db, '&#12456;&#12531;&#12486;&#12451;&#12486;&#12451;&#12398;db&#12418;&#21021;&#26399;&#21270;&#12373;&#12428;&#12390;&#12356;&#12427;&#12363;');
+	
+	Tombloo.Photo.deleteAll();
+	Tombloo.Video.deleteAll();
+	Tombloo.Regular.deleteAll();
+	Tombloo.Quote.deleteAll();
+	Tombloo.Link.deleteAll();
+	Tombloo.Conversation.deleteAll();
+	
+	is(Tombloo.Photo.countByUser('to'), 0);
+	is(Tombloo.Video.countByUser('to'), 0);
+	is(Tombloo.Regular.countByUser('to'), 0);
+	is(Tombloo.Quote.countByUser('to'), 0);
+	is(Tombloo.Link.countByUser('to'), 0);
+	is(Tombloo.Conversation.countByUser('to'), 0);
+	
+	var photo = new Photo({
+		id : 1, 
+		user : 'to',
+		date : new Date(2007, 6, 20),
+		body : 'ABCDEFG',
+		imageId : '12126918_r1',
+		extension : 'jpg',
+		tags : ['test', 'beautiful'],
+		
+		url : 'http://', // &#19981;&#35201;&#12503;&#12525;&#12497;&#12486;&#12451;
+	});
+	photo.save();
+	is(Photo.countByUser('to'), 1, '&#20445;&#23384;&#12373;&#12428;&#34892;&#12364;&#22679;&#12360;&#12427;&#12363;');
+	
+	ok(photo.checkFile(500), '&#12501;&#12449;&#12452;&#12523;&#12364;&#23384;&#22312;&#12377;&#12427;&#12363;');
+	is(photo.getFile(500).exists(), true, '&#12501;&#12449;&#12452;&#12523;&#12364;&#23384;&#22312;&#12377;&#12427;&#12363;');
+	
+	var tags = Tag.findById(1);
+	is(tags.length, 2, '&#12479;&#12464;&#12364;&#20445;&#23384;&#12373;&#12428;&#12390;&#12356;&#12427;&#12363;');
+	is(tags[0].tag, 'test');
+	
+	
+	var photos = Photo.findByUser('to');
+	is(photos.length, 1, '&#26908;&#32034;&#12395;&#12498;&#12483;&#12488;&#12377;&#12427;&#12363;');
+	
+	var photos = Photo.findByUser('to');
+	is(photos.length, 1, '&#26908;&#32034;&#12395;&#12498;&#12483;&#12488;&#12377;&#12427;&#12363;');
+	
+	is(photos[0].id, 1);
+	is(photos[0].date.getDate(), 20, '&#26085;&#20184;&#22411;&#12391;&#21462;&#24471;&#12391;&#12365;&#12427;&#12363;');
+	is(photos[0].user, 'to');
+	is(photos[0].tags.length, 2, '&#38306;&#36899;&#12456;&#12531;&#12486;&#12451;&#12486;&#12451;(&#12479;&#12464;)&#12364;&#21462;&#24471;&#12391;&#12365;&#12427;&#12363;');
+	is(photos[0].tags[0].tag, 'test');
+	
+	photo.body = '&#12354;&#12356;&#12358;&#12360;&#12362;';
+	photo.save();
+	
+	var photos = Photo.findByUser('to');
+	is(photos[0].body, '&#12354;&#12356;&#12358;&#12360;&#12362;', '&#26085;&#26412;&#35486;&#12364;&#20445;&#23384;&#12373;&#12428;&#12427;&#12363;');
+	
+	// &#38917;&#30446;&#12434;&#20840;&#37096;&#22475;&#12417;&#12394;&#12356;&#12391;&#20445;&#23384;
+	var photo = new Photo({
+		id : 2, 
+		user : '02',
+		file75 : 'ABCDEFG', // &#25968;&#20516;&#12501;&#12451;&#12540;&#12523;&#12489;&#12395;&#25991;&#23383;&#26360;&#12365;&#36796;&#12415;
+	});
+	photo.save();
+	
+	// &#12518;&#12540;&#12470;&#12540;&#19968;&#35239;&#12398;&#21462;&#24471;
+	is(Photo.findUsers().length, 2);
+	is(Photo.findUsers()[0], '02');
+	is(Photo.findUsers()[1], 'to');
+	
+	
+	
+	// &#26356;&#26032;
+	var photo = Photo.findByUser('02')[0];
+	is(photo.id, 2);
+	is(photo.file75, 'ABCDEFG', '&#25968;&#20516;&#12501;&#12451;&#12540;&#12489;&#12363;&#12425;&#25991;&#23383;&#12434;&#21462;&#24471;&#12391;&#12365;&#12427;&#12363;');
+	is(photo.temporary, false);
+	photo.file500 = 1;
+	photo.save(); // update
+	
+	var photo = Photo.findByUser('02')[0];
+	is(photo.id, 2);
+	is(photo.file500, 1, 'update&#12373;&#12428;&#12390;&#12356;&#12427;&#12363;');
+	
+	// &#21066;&#38500;
+	photo.remove();
+	is(Tombloo.Photo.countByUser('02'), 0);
+	
+	photo.save(); // insert
+	is(Tombloo.Photo.countByUser('02'), 1);
+	
+	ok(!photo.checkFile(500), '&#12501;&#12449;&#12452;&#12523;&#12364;&#23384;&#22312;&#12375;&#12394;&#12356;&#12371;&#12392;');
+	
+	
+	// Tombloo.Post.insert
+	Tombloo.Post.insert({
+		id : 3, 
+		type : 'photo',
+		tags : ['tag1', 'tag2'],
+	});
+	var photo = Tombloo.Photo.findById(3)[0];
+	is(photo.id, 3);
+	is(photo.tags[1].tag, 'tag2');
+	
+	Tombloo.Post.insert({
+		id : 4, 
+		type : 'photo',
+		tags : [],
+	});
+	var photo = Tombloo.Photo.findById(4)[0];
+	is(photo.tags.length, 0, '&#31354;&#12479;&#12464;&#12398;&#20445;&#23384;&#12392;&#24489;&#20803;&#12364;&#12391;&#12365;&#12427;&#12363;');
+	
+	
+	// VIEW
+	is(Tombloo.Post.countByUser('02'), 1, 'VIEW&#12398;&#12459;&#12454;&#12531;&#12488;&#12289;Photo&#12479;&#12452;&#12503;&#12398;&#12415;');
+	
+	Tombloo.Video.insert({id : 2, user : '02'});
+	is(Tombloo.Post.countByUser('02'), 2);
+	
+	Tombloo.Regular.insert({id : 2, user : '02'});
+	is(Tombloo.Post.countByUser('02'), 3);
+	
+	Tombloo.Quote.insert({id : 2, user : '02'});
+	is(Tombloo.Post.countByUser('02'), 4);
+	
+	Tombloo.Link.insert({id : 2, user : '02'});
+	is(Tombloo.Post.countByUser('02'), 5);
+	
+	Tombloo.Conversation.insert({id : 2, user : '02'});
+	is(Tombloo.Post.countByUser('02'), 6);
+	
+	
+} catch (err) {
+	var s = [];
+	s.push('TEST SUITE FAILURE!');
+	for(var prop in err)
+		s.push(prop + ':  ' + err[prop]);
+	ok(false, s.join('\n'));
+	
+} finally{
+	Tombloo.db &amp;&amp; Tombloo.db.close();
+}
+&lt;/script&gt;
+&lt;/pre&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>xpi/chrome/content/test/test_Tombloo.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,267 +1,267 @@
-&lt;html&gt;
-&lt;head&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
-	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
-	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
-	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-&lt;/head&gt;
-&lt;body&gt;
-
-&lt;pre id=&quot;test&quot;&gt;
-&lt;/pre&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
-try {
-	
-	SimpleTest.waitForExplicitFinish();
-	
-	var d = succeed();
-	
-	// chrome://tombloo/content/test/test_Tumblr.html
-	
-	is(Tumblr.normalizeHost('to.tumblr.com'), 'to.tumblr.com');
-	is(Tumblr.normalizeHost('to'), 'to.tumblr.com');
-	
-	var reqs = Tumblr.splitRequests(130);
-	is(reqs.length, 3);
-	is(reqs[0][0], 0);
-	is(reqs[0][1], 50);
-	is(reqs[1][0], 50);
-	is(reqs[1][1], 50);
-	is(reqs[2][0], 100);
-	is(reqs[2][1], 30);
-	
-	var reqs = Tumblr.splitRequests(35);
-	is(reqs.length, 1);
-	is(reqs[0][0], 0);
-	is(reqs[0][1], 35);
-	
-	var fields = {
-		'post[type]' : 'photo', 
-		'post[two]'  : '' + (&lt;data&gt;&lt;![CDATA[
-&lt;p&gt;&lt;a href=&quot;http://too.tumblr.com/post/25307827&quot;&gt;too&lt;/a&gt;:&lt;/p&gt;
-
-&lt;blockquote&gt;&lt;p&gt;&lt;a href=&quot;http://too.tumblr.com/post/24601328&quot;&gt;too&lt;/a&gt;:&lt;/p&gt;
-
-&lt;blockquote&gt;TEST&lt;/blockquote&gt;
-
-&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;
-
-&lt;p&gt;&lt;/p&gt;
-		]]&gt;&lt;/data&gt;),
-	}
-	is(Tumblr.trimReblogInfo(fields)['post[two]'], 'TEST');
-	
-	var fields = {
-		'post[type]' : 'link', 
-		'post[three]'  : '' + (&lt;data&gt;&lt;![CDATA[
-	&lt;p&gt;&lt;a href=&quot;http://too.tumblr.com/post/25310565&quot;&gt;too&lt;/a&gt;:&lt;/p&gt;
-
-&lt;blockquote&gt;&lt;img src=&quot;http://mozshot.nemui.org/shot?http://cxx.tumblr.com/post/24916599&quot; /&gt;&lt;/blockquote&gt;
-
-&lt;p&gt;&lt;/p&gt;
-		]]&gt;&lt;/data&gt;),
-	}
-	is(Tumblr.trimReblogInfo(fields)['post[three]'], '&lt;img src=&quot;http://mozshot.nemui.org/shot?http://cxx.tumblr.com/post/24916599&quot; /&gt;');
-	
-	var fields = {
-		'post[type]' : 'quote', 
-		'post[two]'  : '&lt;a href=&quot;http://www.tumblr.com/dashboard&quot;&gt;Tumblr&lt;/a&gt; (via &lt;a href=&quot;http://too.tumblr.com/&quot;&gt;too&lt;/a&gt;)',
-	}
-	is(Tumblr.trimReblogInfo(fields)['post[two]'], '&lt;a href=&quot;http://www.tumblr.com/dashboard&quot;&gt;Tumblr&lt;/a&gt;');
-	
-	
-	// getReblogToken
-	sameObject(
-		Tumblr.getReblogToken('http://www.tumblr.com/dashboard/iframe?src=http%3A%2F%2Fpootee.tumblr.com%2Fpost%2F31573890&amp;amp;pid=31573890&amp;amp;rk=Vm1AnAen'), {
-			token : 'Vm1AnAen',
-			id    : '31573890',
-		});
-	sameObject(
-		Tumblr.getReblogToken('http://www.tumblr.com/reblog/31573890/Vm1AnAen?redirect_to=%2Fdashboard'), {
-			token : 'Vm1AnAen',
-			id    : '31573890',
-		});
-	sameObject(
-		Tumblr.getReblogToken('http://www.tumblr.com/reblog/31573890/Vm1AnAen'), {
-			token : 'Vm1AnAen',
-			id    : '31573890',
-		});
-	
-	/*
-	TEST OK
-	d.addCallback(request, 'http://to.tumblr.com/post/34424030');
-	d.addCallback(function(res){
-		sameObject(
-			Tumblr.getReblogToken(convertToHTMLDocument(res.responseText)), {
-				token : 'z514XaLi',
-				id    : '34424030',
-			});
-	})
-	*/
-	
-	
-	/* 
-	// remove
-	d.addCallback(bind('remove', Tumblr), 18344636);
-	
-	// &#29694;&#22312;Tumblr&#19981;&#35519;&#12398;&#12383;&#12417;&#36890;&#12425;&#12394;&#12356;&#21487;&#33021;&#24615;&#12354;&#12426;
-	d.addCallback(bind('getInfo', Tumblr), 'to', 'photo');
-	d.addCallback(function(info){
-		is(info.type, 'photo');
-		is(info.start, 0);
-		is(info.name, 'to');
-		is(info.title, 'to');
-		is(info.timezone, 'Asia/Tokyo');
-		ok(info.total &gt; 1000);
-		alert(info.total);
-	});
-	
-	d.addCallback(bind('getInfo', Tumblr), 'to');
-	d.addCallback(function(info){
-		is(info.type, '');
-		is(info.name, 'to');
-		is(info.title, 'to');
-		is(info.timezone, 'Asia/Tokyo');
-		ok(info.total &gt; 15000);
-	});
-	
-	// 2&#12506;&#12540;&#12472;&#21462;&#24471;
-	d.addCallback(bind('read', Tumblr), 'to', 'photo', 70);
-	d.addCallback(function(res){
-		is(res.length, 70);
-		is(res[0].type, 'photo');
-		is(res[0].user, 'to');
-		ok(res[0].date);
-		ok(res[0].imageId);
-	});
-	
-	// 1&#12506;&#12540;&#12472;&#21462;&#24471;
-	d.addCallback(bind('read', Tumblr), 'to', 'photo', 25);
-	d.addCallback(function(res){
-		is(res.length, 25);
-	});
-	
-	// &#36884;&#20013;&#32066;&#20102; / &#12509;&#12473;&#12488;No / &#12454;&#12455;&#12452;&#12488;
-	d.addCallback(bind('read', Tumblr), 'to', 'photo', 70, function(post, postNum){
-		if(postNum&gt;=5)
-			throw StopProcess;
-		ok(post.date);
-		log(post.date);
-		
-		return wait(0.2)
-	});
-	d.addCallback(function(res){
-		is(res.length, 5);
-	});
-	
-	// getLoggedInUser
-	var info = {};
-	d.addCallback(bind('getLoggedInUser', Tumblr));
-	d.addCallback(function(user){
-		is(user, 'too', '&#12518;&#12540;&#12470;&#12540;&#21517;&#12398;&#30906;&#35469;');
-		info.name = user;
-	});
-	d.addErrback(function(e){
-		is(e.message, 'Not loggedin.', '&#26410;&#12525;&#12464;&#12452;&#12531;');
-	});
-	
-	
-	// getInfo
-	d.addCallback(function(){
-		return Tumblr.getInfo(info.name);
-	});
-	d.addCallback(function(i){
-		is(i.type, '');
-		is(i.name, 'too');
-		is(i.title, 'too');
-		is(i.timezone, 'Asia/Tokyo');
-		
-		info = i;
-	});
-	
-	// reblog
-	d.addCallback(bind('reblog', Tumblr), 18865379);
-	d.addCallback(function(){
-		return Tumblr.getInfo(info.name);
-	});
-	d.addCallback(function(i){
-		is(i.total, info.total+1, 'reblog&#12364;&#25104;&#21151;&#12375;&#20214;&#25968;&#12364;&#22679;&#12360;&#12390;&#12356;&#12427;&#12363;');
-		
-		info = i;
-	});
-	
-	Tumblr.Photo.post({
-		title : 'SQLite home page',
-		url : 'http://www.sqlite.org/',
-		body : '&lt;a href=&quot;http://www.sqlite.org/&quot;&gt;SQLite home page&lt;/a&gt;',
-		source : 'http://www.sqlite.org/sqlite.gif',
-	});
-	Tumblr.Quote.post({
-		body : 'Database',
-		source : '&lt;a href=&quot;http://www.sqlite.org/&quot;&gt;SQLite home page&lt;/a&gt;',
-	});
-	Tumblr.Link.post({
-		title : 'SQLite home page',
-		source : 'http://www.sqlite.org/',
-		body : '&#12354;&#12356;&#12358;&#12360;&#12362;',
-	});
-	Tumblr.Video.post({
-		source : 'http://jp.youtube.com/watch?v=4wZGsYzegi4',
-		body : '&lt;a href=&quot;http://jp.youtube.com/watch?v=4wZGsYzegi4&quot;&gt;YouTube - &#12354;&#12356;&#12358;&#12360;&#12362;&lt;/a&gt;',
-	});
-	Tumblr.Regular.post({
-		title : 'TITLE',
-		body : '&#12354;&#12356;&#12358;&#12360;&#12362;',
-	});
-	Tumblr.Conversation.post({
-		title : 'TITLE',
-		body : 'Z:1\nX:2',
-	});
-	
-	d.addCallback(function(){
-		return Tumblr.getCurrentUser();
-	}).addCallback(function(user){
-		ok(user.length &gt; 0, '&#12525;&#12464;&#12452;&#12531;&#12518;&#12540;&#12470;&#12540;&#21517;&#12434;&#21462;&#24471;&#12391;&#12365;&#12427;&#12363;?');
-	});
-	
-	
-	d.addCallback(function(){
-		return Tumblr.logout();
-	});
-	
-	d.addCallback(function(){
-		return Tumblr.login('user@mail.com', 'password');
-	});
-	*/
-	
-	
-	d.addErrback(function(e){
-		log(e)
-		ok(false);
-	});
-	d.addBoth(function(){
-		SimpleTest.finish()
-	});
-	
-	
-} catch (err) {
-	var s = [];
-	s.push('TEST SUITE FAILURE!');
-	for(var prop in err)
-		s.push(prop + ':  ' + err[prop]);
-	ok(false, s.join('\n'));
-	
-	SimpleTest.finish()
-}
-&lt;/script&gt;
-
-&lt;/body&gt;
-&lt;/html&gt;
+&lt;html&gt;
+&lt;head&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/MochiKit.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;library/SimpleTest.js&quot;&gt;&lt;/script&gt;
+	&lt;script type=&quot;text/javascript&quot; src=&quot;test.js&quot;&gt;&lt;/script&gt;
+	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;library/test.css&quot;&gt;
+	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;pre id=&quot;test&quot;&gt;
+&lt;/pre&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_Components.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/00_MochiKit.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/01_utility.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Progress.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/10_Database.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tumblr.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../library/20_Tombloo.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+try {
+	
+	SimpleTest.waitForExplicitFinish();
+	
+	var d = succeed();
+	
+	// chrome://tombloo/content/test/test_Tumblr.html
+	
+	is(Tumblr.normalizeHost('to.tumblr.com'), 'to.tumblr.com');
+	is(Tumblr.normalizeHost('to'), 'to.tumblr.com');
+	
+	var reqs = Tumblr.splitRequests(130);
+	is(reqs.length, 3);
+	is(reqs[0][0], 0);
+	is(reqs[0][1], 50);
+	is(reqs[1][0], 50);
+	is(reqs[1][1], 50);
+	is(reqs[2][0], 100);
+	is(reqs[2][1], 30);
+	
+	var reqs = Tumblr.splitRequests(35);
+	is(reqs.length, 1);
+	is(reqs[0][0], 0);
+	is(reqs[0][1], 35);
+	
+	var fields = {
+		'post[type]' : 'photo', 
+		'post[two]'  : '' + (&lt;data&gt;&lt;![CDATA[
+&lt;p&gt;&lt;a href=&quot;http://too.tumblr.com/post/25307827&quot;&gt;too&lt;/a&gt;:&lt;/p&gt;
+
+&lt;blockquote&gt;&lt;p&gt;&lt;a href=&quot;http://too.tumblr.com/post/24601328&quot;&gt;too&lt;/a&gt;:&lt;/p&gt;
+
+&lt;blockquote&gt;TEST&lt;/blockquote&gt;
+
+&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;&lt;/p&gt;
+		]]&gt;&lt;/data&gt;),
+	}
+	is(Tumblr.trimReblogInfo(fields)['post[two]'], 'TEST');
+	
+	var fields = {
+		'post[type]' : 'link', 
+		'post[three]'  : '' + (&lt;data&gt;&lt;![CDATA[
+	&lt;p&gt;&lt;a href=&quot;http://too.tumblr.com/post/25310565&quot;&gt;too&lt;/a&gt;:&lt;/p&gt;
+
+&lt;blockquote&gt;&lt;img src=&quot;http://mozshot.nemui.org/shot?http://cxx.tumblr.com/post/24916599&quot; /&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;&lt;/p&gt;
+		]]&gt;&lt;/data&gt;),
+	}
+	is(Tumblr.trimReblogInfo(fields)['post[three]'], '&lt;img src=&quot;http://mozshot.nemui.org/shot?http://cxx.tumblr.com/post/24916599&quot; /&gt;');
+	
+	var fields = {
+		'post[type]' : 'quote', 
+		'post[two]'  : '&lt;a href=&quot;http://www.tumblr.com/dashboard&quot;&gt;Tumblr&lt;/a&gt; (via &lt;a href=&quot;http://too.tumblr.com/&quot;&gt;too&lt;/a&gt;)',
+	}
+	is(Tumblr.trimReblogInfo(fields)['post[two]'], '&lt;a href=&quot;http://www.tumblr.com/dashboard&quot;&gt;Tumblr&lt;/a&gt;');
+	
+	
+	// getReblogToken
+	sameObject(
+		Tumblr.getReblogToken('http://www.tumblr.com/dashboard/iframe?src=http%3A%2F%2Fpootee.tumblr.com%2Fpost%2F31573890&amp;amp;pid=31573890&amp;amp;rk=Vm1AnAen'), {
+			token : 'Vm1AnAen',
+			id    : '31573890',
+		});
+	sameObject(
+		Tumblr.getReblogToken('http://www.tumblr.com/reblog/31573890/Vm1AnAen?redirect_to=%2Fdashboard'), {
+			token : 'Vm1AnAen',
+			id    : '31573890',
+		});
+	sameObject(
+		Tumblr.getReblogToken('http://www.tumblr.com/reblog/31573890/Vm1AnAen'), {
+			token : 'Vm1AnAen',
+			id    : '31573890',
+		});
+	
+	/*
+	TEST OK
+	d.addCallback(request, 'http://to.tumblr.com/post/34424030');
+	d.addCallback(function(res){
+		sameObject(
+			Tumblr.getReblogToken(convertToHTMLDocument(res.responseText)), {
+				token : 'z514XaLi',
+				id    : '34424030',
+			});
+	})
+	*/
+	
+	
+	/* 
+	// remove
+	d.addCallback(bind('remove', Tumblr), 18344636);
+	
+	// &#29694;&#22312;Tumblr&#19981;&#35519;&#12398;&#12383;&#12417;&#36890;&#12425;&#12394;&#12356;&#21487;&#33021;&#24615;&#12354;&#12426;
+	d.addCallback(bind('getInfo', Tumblr), 'to', 'photo');
+	d.addCallback(function(info){
+		is(info.type, 'photo');
+		is(info.start, 0);
+		is(info.name, 'to');
+		is(info.title, 'to');
+		is(info.timezone, 'Asia/Tokyo');
+		ok(info.total &gt; 1000);
+		alert(info.total);
+	});
+	
+	d.addCallback(bind('getInfo', Tumblr), 'to');
+	d.addCallback(function(info){
+		is(info.type, '');
+		is(info.name, 'to');
+		is(info.title, 'to');
+		is(info.timezone, 'Asia/Tokyo');
+		ok(info.total &gt; 15000);
+	});
+	
+	// 2&#12506;&#12540;&#12472;&#21462;&#24471;
+	d.addCallback(bind('read', Tumblr), 'to', 'photo', 70);
+	d.addCallback(function(res){
+		is(res.length, 70);
+		is(res[0].type, 'photo');
+		is(res[0].user, 'to');
+		ok(res[0].date);
+		ok(res[0].imageId);
+	});
+	
+	// 1&#12506;&#12540;&#12472