Commits

Sachirou Inoue committed f1be8b7

Refactor CSS. And add HTML5 history API.

  • Participants
  • Parent commits ec46eaf

Comments (0)

Files changed (12)

 /.bundle
 /vendor
 /.sass-cache
-/compiler.jar
+/compiler.jar
+*.swp
+*.swo
+*~
 source :gemcutter
 
-gem 'sinatra', '1.2.6'
-gem 'haml', '3.1.2'
-gem 'rack-rewrite'
+gem 'sinatra', '~>1.3.2'
+gem 'haml', '3.1.4'
+gem 'rack-rewrite'
+
+group :development do
+  gem 'shotgun'
+end
 GEM
   remote: http://rubygems.org/
   specs:
-    haml (3.1.2)
-    rack (1.3.1)
+    haml (3.1.4)
+    rack (1.4.1)
+    rack-protection (1.2.0)
+      rack
     rack-rewrite (1.1.0)
-    sinatra (1.2.6)
-      rack (~> 1.1)
-      tilt (< 2.0, >= 1.2.2)
-    tilt (1.3.2)
+    shotgun (0.9)
+      rack (>= 1.0)
+    sinatra (1.3.2)
+      rack (~> 1.3, >= 1.3.6)
+      rack-protection (~> 1.2)
+      tilt (~> 1.3, >= 1.3.3)
+    tilt (1.3.3)
 
 PLATFORMS
   ruby
 
 DEPENDENCIES
-  haml (= 3.1.2)
+  haml (= 3.1.4)
   rack-rewrite
-  sinatra (= 1.2.6)
+  shotgun
+  sinatra (~> 1.3.2)
 require 'rubygems'
 require 'sinatra'
 require 'haml'
-#require 'sass'
-#require 'coffee-script'
-
 
 set :haml, :format => :html5
 set :haml, :ugly => true
   haml :"#{params[:splat][0]}"
 end
 
-
 get %r{/([^.]+)(?:\.html?)?} do
   path = params[:captures][0]
   @subtitle = {:contents => 'サイトマップ',
     :staff => 'スタッフ・施設紹介'}[path]
   @contents = :"#{path}"
   haml :template
-end
+end

public/es5.g.js

-(function(){var d=Array.prototype;if(!Array.isArray)Array.isArray=function(c){return Object.prototype.toString.call(c)==="[object Array]"};if(!d.every)d.every=function(c,b){for(var a=this.length-1;a>=0;a-=1)if(typeof this[a]!=="undefined"&&!c.call(b,this[a],a,this))return false;return true};if(!d.filter)d.filter=function(c,b){for(var a=[],e=0,f=this.length;e<f;e+=1)typeof this[e]!=="undefined"&&c.call(b,this[e],e,this)&&a.push(this[e]);return a};if(!d.forEach)d.forEach=function(c,b){for(var a=this.length-
-1;a>=0;a-=1)typeof this[a]!=="undefined"&&c.call(b,this[a],a,this);return this};if(!d.indexOf)d.indexOf=function(c,b){var a,e=this.length;for(b=b||0;b<0;)b+=e-1;for(a=b;a<e;a+=1)if(this[a]===c)return a;return-1};if(!d.lastIndexOf)d.lastIndexOf=function(c,b){var a;a=this.length;if(typeof b==="undefined")b=a-1;for(;b<0;)b+=a-1;for(a=b;a>=0;a-=1)if(this[a]===c)return a;return-1};if(!d.map)d.map=function(c,b){for(var a=this.length,e=Array(a);a>=0;a-=1)if(typeof this[a]!=="undefined")e[a]=c.call(b,this[a],
-a,this);return e};if(!d.reduce)d.reduce=function(c,b){var a=0,e=this.length;if(typeof b==="undefined"){b=this[0];a=1}for(;a<e;a+=1)if(typeof this[a]!=="undefined")b=c.call(null,b,this[a],a,this);return b};if(!d.reduceRight)d.reduceRight=function(c,b){var a=this.length-1;if(typeof b!=="undefined"){b=this[a];a-=1}for(;a>=0;a-=1)if(typeof this[a]!=="undefined")b=c.call(null,b,this[a],a,this);return b};if(!d.some)d.some=function(c,b){for(var a=this.length-1;a>=0;a-=1)if(typeof this[a]!=="undefined"&&
-c.call(b,this[a],a,this))return true;return false};if(!String.prototype.trim)String.prototype.trim=function(){for(var c=this.replace(/^\s\s*/,""),b=/\s/,a=c.length;b.test(c.charAt(a-=1)););return c.slice(0,a+1)};if(!Object.keys)Object.keys=function(c){var b,a=[];for(b in c)c.hasOwnProperty(b)&&a.push(b);return a};if(!Date.now)Date.now=function(){return(new Date).getTime()};if(!Date.prototype.toISOString)Date.prototype.toISOString=function(){return(this.getUTCFullYear()<1E3?this.getUTCFullYear()<100?
-this.getUTCFullYear()<10?"000":"00":"0":"")+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1<10?"0":"")+(this.getUTCMonth()+1)+"-"+(this.getUTCDate()<10?"0":"")+this.getUTCDate()+"T"+(this.getUTCHours()<10?"0":"")+this.getUTCHours()+":"+(this.getUTCMinutes()<10?"0":"")+this.getUTCMinutes()+":"+(this.getUTCSeconds()<10?"0":"")+this.getUTCSeconds()+"Z"};if(!Function.prototype.bind)Function.prototype.bind=function(c){function b(){return e.apply(this instanceof f?this:c||window,a.concat(Array.prototype.slice.call(arguments)))}
-var a=Array.prototype.slice.call(arguments,1),e=this,f=function(){};if(typeof this!=="function")throw new TypeError("Function.prototype.bind - what is trying to be fBound is not callable");f.prototype=this.prototype;b.prototype=new f;return b}})();

public/es5.js

-// @description Define ES5 extention by ES3
-// @author ne_Sachirou http://c4se.sakura.ne.jp/profile/ne.html
-// @site https://gist.github.com/1018954
-// @date 2011
-// @license Public Domain
-
-//java -jar compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --js_output_file es5.g.js --js es5.js
-
-(function () {
-'use strict';
-
-var Array_prototype = Array.prototype;
-
-
-if (!Array.isArray) {
-    Array.isArray = function (obj) { // @param Object:
-                                     // @return Boolean: obj is an Array or not
-        return Object.prototype.toString.call(obj) === '[object Array]';
-    };
-}
-
-
-if (!Array_prototype.every) {
-    Array_prototype.every = function (fun,   // @param Function:
-                                      obj) { // @param Object: this in fun
-                                             // @return Boolean:
-        var i = this.length - 1;
-
-        for (; i >= 0; i -= 1) {
-            if (typeof this[i] !== 'undefined' &&
-                !fun.call(obj, this[i], i, this)) {
-                return false;
-            }
-        }
-        return true;
-    };
-}
-
-
-if (!Array_prototype.filter) {
-    Array_prototype.filter = function (fun,   // @param Function:
-                                       obj) { // @param Object: this in fun
-                                              // @return Array:
-        var arr = [],
-            i = 0,
-            len = this.length;
-
-        for (; i < len; i += 1) {
-            if (typeof this[i] !== 'undefined' &&
-                fun.call(obj, this[i], i, this)) {
-                arr.push(this[i]);
-            }
-        }
-        return arr;
-    };
-}
-
-
-if (!Array_prototype.forEach) {
-    Array_prototype.forEach = function (fun,   // @param Function:
-                                        obj) { // @param Object: this in fun
-                                               // @return Array: this
-        var i = this.length - 1;
-
-        for (; i >= 0; i -= 1) {
-            if (typeof this[i] !== 'undefined') {
-                fun.call(obj, this[i], i, this);
-            }
-        }
-        return this;
-    };
-}
-
-
-if (!Array_prototype.indexOf) {
-    Array_prototype.indexOf = function (val,   // @param Object:
-                                        num) { // @param Number=0:
-                                               // @return Number: not found = -1
-        var i,
-            len = this.length;
-
-        num = num || 0;
-        while (num < 0) {
-            num += len - 1;
-        }
-        for (i = num; i < len; i += 1) {
-            if (this[i] === val) {
-                return i;
-            }
-        }
-        return -1;
-    };
-}
-
-
-if (!Array_prototype.lastIndexOf) {
-    Array_prototype.lastIndexOf = function (val,   // @param Object:
-                                            num) { // @param Number=(this.length-1):
-                                                   // @return Number: not found = -1
-        var i,
-            len = this.length;
-
-        if (typeof num === 'undefined') {
-            num = len - 1;
-        }
-        while (num < 0) {
-            num += len - 1;
-        }
-        i = num;
-        for (; i >= 0; i -= 1) {
-            if (this[i] === val) {
-                return i;
-            }
-        }
-        return -1;
-    };
-}
-
-
-if (!Array_prototype.map) {
-    Array_prototype.map = function (fun,   // @param Function:
-                                    obj) { // @param Object: this in fun
-                                           // @return Array:
-        var i = this.length,
-            arr = new Array(i);
-
-        for (; i >= 0; i -= 1) {
-            if (typeof this[i] !== 'undefined') {
-                arr[i] = fun.call(obj, this[i], i, this);
-            }
-        }
-        return arr;
-    };
-}
-
-
-if (!Array_prototype.reduce) {
-    Array_prototype.reduce = function (fun,   // @param Function:
-                                       val) { // @param Object:
-                                              // @return Object:
-        var i = 0,
-            len = this.length;
-
-        if (typeof val === 'undefined') {
-            val = this[0];
-            i = 1;
-        }
-        for (; i < len; i += 1) {
-            if (typeof this[i] !== 'undefined') {
-                val = fun.call(null, val, this[i], i, this);
-            }
-        }
-        return val;
-    };
-}
-
-
-if (!Array_prototype.reduceRight) {
-    Array_prototype.reduceRight = function (fun,   // @param Function:
-                                            val) { // @param Object:
-                                                   // @return Object:
-        var i = this.length - 1;
-
-        if (typeof val !== 'undefined') {
-            val = this[i];
-            i -= 1;
-        }
-        for (; i >= 0; i -= 1) {
-            if (typeof this[i] !== 'undefined') {
-                val = fun.call(null, val, this[i], i, this);
-            }
-        }
-        return val;
-    };
-}
-
-
-if (!Array_prototype.some) {
-    Array_prototype.some = function (fun,   // @param Function:
-                                     obj) { // @param Object:
-                                            // @return Boolean:
-        var i = this.length - 1;
-
-        for (; i >= 0; i -= 1) {
-            if (typeof this[i] !== 'undefined' &&
-                fun.call(obj, this[i], i, this)) {
-                return true;
-            }
-        }
-        return false;
-    };
-}
-
-
-// http://blog.stevenlevithan.com/archives/faster-trim-javascript
-if (!String.prototype.trim) {
-    String.prototype.trim = function () { // @return String:
-        var str = this.replace(/^\s\s*/, ''),
-            ws = /\s/,
-            i = str.length;
-
-        while (ws.test(str.charAt(i -= 1))) {
-        }
-        return str.slice(0, i + 1);
-    };
-}
-
-
-if (!Object.keys) {
-    Object.keys = function (obj) { // @param Object:
-                                   // @return Array[String]:
-        var key, result = [];
-
-        for (key in obj) {
-            if (obj.hasOwnProperty(key)) {
-                result.push(key);
-            }
-        }
-        return result;
-    };
-}
-
-
-if (!Date.now) {
-    Date.now = function () {
-        return new Date().getTime();
-    };
-}
-
-
-if (!Date.prototype.toISOString) {
-    Date.prototype.toISOString = function () {
-        return (this.getUTCFullYear() < 1000 ?
-                this.getUTCFullYear() < 100 ?
-             this.getUTCFullYear() < 10 ?
-                '000' :
-                '00' :
-                '0' :
-                '') + this.getUTCFullYear() + '-' +
-               (this.getUTCMonth() + 1 < 10 ? '0' : '') + (this.getUTCMonth() + 1) + '-' +
-               (this.getUTCDate() < 10 ? '0' : '') + this.getUTCDate() + 'T' +
-               (this.getUTCHours() < 10 ? '0' : '') + this.getUTCHours() + ':' +
-               (this.getUTCMinutes() < 10 ? '0' : '') + this.getUTCMinutes() + ':' +
-               (this.getUTCSeconds() < 10 ? '0' : '') + this.getUTCSeconds() + 'Z';
-    };
-}
-
-
-// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind
-if (!Function.prototype.bind) {
-    Function.prototype.bind = function (oThis) {
-        var aArgs = Array.prototype.slice.call(arguments, 1), 
-            fToBind = this, 
-            fNOP = function () {};
-
-        function fBound() {
-            return fToBind.apply(this instanceof fNOP ? this : oThis || window,
-                                 aArgs.concat(Array.prototype.slice.call(arguments)));
-        };
-
-        // closest thing possible to the ECMAScript 5 internal IsCallable function
-        if (typeof this !== "function") {
-            throw new TypeError("Function.prototype.bind - what is trying to be fBound is not callable");
-        }
-
-        fNOP.prototype = this.prototype;
-        fBound.prototype = new fNOP();
-        return fBound;
-    };
-}
-
-}());

public/es5.min.js

+/*
+ MIT License 2011 ne_Sachirou
+ author: ne_Sachirou http://c4se.tk/profile/ne.html
+ site: http://gist.github.com/1018954
+ date: 2011 - 2012
+ license: Code in this file is in Public Domain
+   es5.js
+     Public Domain by ne_Sachirou
+   json2.js
+     Public Domain
+   JavaScript-XPath 0.1.8
+     (c) 2007 Cybozu Labs, Inc.
+     MIT License
+     http://coderepos.org/share/wiki/JavaScript-XPath
+*/
+(function(i){var f=Array.prototype;if(!Array.isArray)Array.isArray=function(g){return"[object Array]"===Object.prototype.toString.call(g)};if(!f.every)f.every=function(g,e){var d;for(d=this.length-1;0<=d;d-=1)if(void 0!==this[d]&&!g.call(e,this[d],d,this))return!1;return!0};if(!f.filter)f.filter=function(g,e){var d=[],l,f=this.length;for(l=0;l<f;l+=1)void 0!==this[l]&&g.call(e,this[l],l,this)&&d.push(this[l]);return d};if(!f.forEach)f.forEach=function(g,e){var d;for(d=this.length-1;0<=d;d-=1)void 0!==
+this[d]&&g.call(e,this[d],d,this);return this};if(!f.indexOf)f.indexOf=function(g,e){for(var d,l=this.length,e=e||0;0>e;)e+=l-1;for(d=e;d<l;d+=1)if(this[d]===g)return d;return-1};if(!f.lastIndexOf)f.lastIndexOf=function(g,e){var d;d=this.length;for(void 0===e&&(e=d-1);0>e;)e+=d-1;for(d=e;0<=d;d-=1)if(this[d]===g)return d;return-1};if(!f.map)f.map=function(g,e){var d,l=Array(d);for(d=this.length;0<=d;d-=1)void 0!==this[d]&&(l[d]=g.call(e,this[d],d,this));return l};if(!f.reduce)f.reduce=function(g,
+e){var d=0,l=this.length;void 0===e&&(e=this[0],d=1);for(;d<l;d+=1)"undefined"!==typeof this[d]&&(e=g.call(null,e,this[d],d,this));return e};if(!f.reduceRight)f.reduceRight=function(g,e){var d=this.length-1;void 0!==e&&(e=this[d],d-=1);for(;0<=d;d-=1)void 0!==this[d]&&(e=g.call(null,e,this[d],d,this));return e};if(!f.some)f.some=function(g,e){var d;for(d=this.length-1;0<=d;d-=1)if(void 0!==this[d]&&g.call(e,this[d],d,this))return!0;return!1};if(!String.prototype.trim)String.prototype.trim=function(){for(var g=
+this.replace(/^\s\s*/,""),e=/\s/,d=g.length;e.test(g.charAt(d-=1)););return g.slice(0,d+1)};if(!Object.keys)Object.keys=function(g){var e,d=[];for(e in g)g.hasOwnProperty(e)&&d.push(e);return d};if(!Date.now)Date.now=function(){return(new Date).getTime()};Date.ISO||function(){var g=Math.round,e=Math.pow,d=Date.prototype.toISOString?function(d){return d}:function(){function d(e){return 10>e?"0"+e:e}function f(d){return 2>d.length?"00"+d:3>d.length?"0"+d:3<d.length?g(d/e(10,d.length-3)):d}Date.prototype.toISOString=
+function(){return"".concat(this.getUTCFullYear(),"-",d(this.getUTCMonth()+1),"-",d(this.getUTCDate()),"T",d(this.getUTCHours()),":",d(this.getUTCMinutes()),":",d(this.getUTCSeconds()),".",f(""+this.getUTCMilliseconds()),"Z")};return function(d){return d}}();Date.ISO=function(e){var e=/^(\d{4})([-\/](\d{2})([-\/](\d{2})(T(\d{2}):(\d{2})(:(\d{2})(\.(\d+))?)?(Z|((\+|-)(\d{2}):(\d{2}))))?)?)?$/.exec(e),g=new Date,f,i,r;if(null===e)throw Error("Invalid ISO String");g.setUTCFullYear(+e[1]);g.setUTCMonth(e[3]?
+(e[3]>>0)-1:0);g.setUTCDate(e[5]>>0);g.setUTCHours(e[7]>>0);g.setUTCMinutes(e[8]>>0);g.setUTCSeconds(e[10]>>0);g.setUTCMilliseconds(e[12]>>0);e[13]&&"Z"!==e[13]&&(f=e[16]>>0,i=e[17]>>0,r="+"===e[15],g.setUTCHours((e[7]>>0)+r?-f:f),g.setUTCMinutes((e[8]>>0)+r?-i:i));return d(g)}}();if(!Function.prototype.bind)Function.prototype.bind=function(g){function e(){return f.apply(this instanceof s?this:g||i,d.concat(Array.prototype.slice.call(arguments)))}var d=Array.prototype.slice.call(arguments,1),f=this,
+s=function(){};if("function"!==typeof this)throw new TypeError("Function.prototype.bind - what is trying to be fBound is not callable");s.prototype=this.prototype;e.prototype=new s;return e}})(this);var JSON;JSON||(JSON={});
+(function(){function i(d){return 10>d?"0"+d:d}function f(e){d.lastIndex=0;return d.test(e)?'"'+e.replace(d,function(d){var e=m[d];return"string"===typeof e?e:"\\u"+("0000"+d.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function g(d,e){var i,j,o,n,m=l,p,h=e[d];h&&"object"===typeof h&&"function"===typeof h.toJSON&&(h=h.toJSON(d));"function"===typeof q&&(h=q.call(e,d,h));switch(typeof h){case "string":return f(h);case "number":return isFinite(h)?""+h:"null";case "boolean":case "null":return""+h;
+case "object":if(!h)return"null";l+=s;p=[];if("[object Array]"===Object.prototype.toString.apply(h)){n=h.length;for(i=0;i<n;i+=1)p[i]=g(i,h)||"null";o=0===p.length?"[]":l?"[\n"+l+p.join(",\n"+l)+"\n"+m+"]":"["+p.join(",")+"]";l=m;return o}if(q&&"object"===typeof q){n=q.length;for(i=0;i<n;i+=1)"string"===typeof q[i]&&(j=q[i],(o=g(j,h))&&p.push(f(j)+(l?": ":":")+o))}else for(j in h)Object.prototype.hasOwnProperty.call(h,j)&&(o=g(j,h))&&p.push(f(j)+(l?": ":":")+o);o=0===p.length?"{}":l?"{\n"+l+p.join(",\n"+
+l)+"\n"+m+"}":"{"+p.join(",")+"}";l=m;return o}}if("function"!==typeof Date.prototype.toJSON)Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()};var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l,s,m={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},q;if("function"!==typeof JSON.stringify)JSON.stringify=function(d,e,f){var j;s=l="";if("number"===typeof f)for(j=0;j<f;j+=1)s+=" ";else"string"===typeof f&&(s=f);if((q=e)&&"function"!==typeof e&&("object"!==typeof e||"number"!==typeof e.length))throw Error("JSON.stringify");return g("",
+{"":d})};if("function"!==typeof JSON.parse)JSON.parse=function(d,g){function f(d,e){var j,i,h=d[e];if(h&&"object"===typeof h)for(j in h)Object.prototype.hasOwnProperty.call(h,j)&&(i=f(h,j),void 0!==i?h[j]=i:delete h[j]);return g.call(d,e,h)}var j,d=""+d;e.lastIndex=0;e.test(d)&&(d=d.replace(e,function(d){return"\\u"+("0000"+d.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(d.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+d+")"),"function"===typeof g?f({"":j},""):j;throw new SyntaxError("JSON.parse");}})();(function(){var i={targetFrame:void 0,exportInstaller:!1,useNative:!0,useInnerText:!0},f;if(window.jsxpath)f=window.jsxpath;else{var g=document.getElementsByTagName("script"),g=g[g.length-1].src;f={};if(g=g.match(/\?(.*)$/))for(var g=g[1].split("&"),e=0,d=g.length;e<d;e++){var l=g[e].split("=")[0];if(void 0!=configValue&&("false"==configValue||/^-?d+$/.test(configValue)))configValue=eval(configValue);f[l]=configValue}}for(var s in i)s in f||(f[s]=i[s]);f.hasNative=!(!document.implementation||!document.implementation.hasFeature||
+!document.implementation.hasFeature("XPath",null));if(!f.hasNative||!f.useNative||f.exportInstaller){var m,q,r,v,w,j,o,n,x,p,h,t,u,z,C=new function(){var a=navigator.userAgent;if(void 0==RegExp){0<=a.indexOf("Opera")?this.opera=!0:0<=a.indexOf("Netscape")?this.netscape=!0:0==a.indexOf("Mozilla/")?this.mozilla=!0:this.unknown=!0;if(0<=a.indexOf("Gecko/"))this.gecko=!0;if(0<=a.indexOf("Win"))this.windows=!0;else if(0<=a.indexOf("Mac"))this.mac=!0;else if(0<=a.indexOf("Linux"))this.linux=!0;else if(0<=
+a.indexOf("BSD"))this.bsd=!0;else if(0<=a.indexOf("SunOS"))this.sunos=!0}else{if(/AppleWebKit\/(\d+(?:\.\d+)*)/.test(a))this.applewebkit=RegExp.$1,4==RegExp.$1.charAt(0)?this.applewebkit2=!0:this.applewebkit3=!0;else if("object"==typeof Components&&(/Gecko\/(\d{8})/.test(a)||"Gecko"==navigator.product&&/^(\d{8})$/.test(navigator.productSub)))this.gecko=RegExp.$1;if("object"==typeof opera&&"function"==typeof opera.version)this.opera=opera.version(),this["opera"+this.opera[0]+this.opera[2]]=!0;else if("object"==
+typeof opera&&/Opera[\/ ](\d+\.\d+)/.test(a))this.opera=RegExp.$1;else if(!this.ie)if(/Safari\/(\d+(?:\.\d+)*)/.test(a))this.safari=RegExp.$1;else if(/NetFront\/(\d+(?:\.\d+)*)/.test(a))this.netfront=RegExp.$1;else if(/Konqueror\/(\d+(?:\.\d+)*)/.test(a))this.konqueror=RegExp.$1;else if(0>a.indexOf("(compatible;")&&/^Mozilla\/(\d+\.\d+)/.test(a)){this.mozilla=RegExp.$1;if(/\([^(]*rv:(\d+(?:\.\d+)*).*?\)/.test(a))this.mozillarv=RegExp.$1;if(/Firefox\/(\d+(?:\.\d+)*)/.test(a))this.firefox=RegExp.$1;
+else if(/Netscape\d?\/(\d+(?:\.\d+)*)/.test(a))this.netscape=RegExp.$1}else this.unknown=!0;if(0<=a.indexOf("Win 9x 4.90"))this.windows="ME";else if(/Win(?:dows)? ?(NT ?(\d+\.\d+)?|\d+|ME|Vista|XP)/.test(a))if(this.windows=RegExp.$1,RegExp.$2)this.winnt=RegExp.$2;else switch(RegExp.$1){case "2000":this.winnt="5.0";break;case "XP":this.winnt="5.1";break;case "Vista":this.winnt="6.0"}else if(0<=a.indexOf("Mac"))this.mac=!0;else if(0<=a.indexOf("Linux"))this.linux=!0;else if(/(\w*BSD)/.test(a))this.bsd=
+RegExp.$1;else if(0<=a.indexOf("SunOS"))this.sunos=!0}},A=function(a){for(var b=A.prototype,a=a.match(b.regs.token),c=0,k=a.length;c<k;c++)b.regs.strip.test(a[c])&&a.splice(c,1);for(var d in b)a[d]=b[d];a.index=0;return a};A.prototype.regs={token:/\$?(?:(?![0-9-])[\w-]+:)?(?![0-9-])[\w-]+|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|(?![0-9-])[\w-]+:\*|\s+|./g,strip:/^\s/};A.prototype.peek=function(a){return this[this.index+(a||0)]};A.prototype.next=function(){return this[this.index++]};
+A.prototype.back=function(){this.index--};A.prototype.empty=function(){return this.length<=this.index};var y=function(a,b,c){this.node=a;this.position=b||1;this.last=c||1},i=function(){};i.prototype.number=function(a){a=this.evaluate(a);return a.isNodeSet?a.number():+a};i.prototype.string=function(a){a=this.evaluate(a);return a.isNodeSet?a.string():""+a};i.prototype.bool=function(a){a=this.evaluate(a);return a.isNodeSet?a.bool():!!a};var B=function(){};B.parsePredicates=function(a,b){for(;"["==a.peek();){a.next();
+if(a.empty())throw Error("missing predicate expr");var c=m.parse(a);b.predicate(c);if(a.empty())throw Error("unclosed predicate expr");if("]"!=a.next())throw a.back(),Error("bad token: "+a.next());}};B.prototyps=new i;B.prototype.evaluatePredicates=function(a,b){var c,k,d,e,g;g=this.reverse;c=this.predicates;a.sort();for(var f=b||0,j=c.length;f<j;f++){k=c[f];var i=[];d=a.list();for(var h=0,l=d.length;h<l;h++){e=g?l-h:h+1;exrs=k.evaluate(new y(d[h],e,l));switch(typeof exrs){case "number":exrs=e==exrs;
+break;case "string":exrs=!!exrs;break;case "object":exrs=exrs.bool()}exrs||i.push(h)}h=i.length-1;for(l=0;h>=l;h--)a.del(i[h])}return a};if(!window.BinaryExpr&&window.defaultConfig)window.BinaryExpr=null;m=function(a,b,c){this.op=a;this.left=b;this.right=c;this.datatype=m.ops[a][2];this.needContextPosition=b.needContextPosition||c.needContextPosition;this.needContextNode=b.needContextNode||c.needContextNode;if("="==this.op)if(!c.needContextNode&&!c.needContextPosition&&"nodeset"!=c.datatype&&"void"!=
+c.datatype&&b.quickAttr)this.quickAttr=!0,this.attrName=b.attrName,this.attrValueExpr=c;else if(!b.needContextNode&&!b.needContextPosition&&"nodeset"!=b.datatype&&"void"!=b.datatype&&c.quickAttr)this.quickAttr=!0,this.attrName=c.attrName,this.attrValueExpr=b};m.compare=function(a,b,c,k,d){var e,g,c=c.evaluate(d),k=k.evaluate(d);if(c.isNodeSet&&k.isNodeSet){e=c.list();a=k.list();k=0;for(c=e.length;k<c;k++){d=0;for(g=a.length;d<g;d++)if(b(n.to("string",e[k]),n.to("string",a[d])))return!0}return!1}if(c.isNodeSet||
+k.isNodeSet){c.isNodeSet?(g=c,e=k):(g=k,e=c);c=g.list();a=typeof e;k=0;for(d=c.length;k<d;k++)if(b(n.to(a,c[k]),e))return!0;return!1}return"="==a||"!="==a?"boolean"==typeof c||"boolean"==typeof k?b(!!c,!!k):"number"==typeof c||"number"==typeof k?b(+c,+k):b(c,k):b(+c,+k)};m.ops={div:[6,function(a,b,c){return a.number(c)/b.number(c)},"number"],mod:[6,function(a,b,c){return a.number(c)%b.number(c)},"number"],"*":[6,function(a,b,c){return a.number(c)*b.number(c)},"number"],"+":[5,function(a,b,c){return a.number(c)+
+b.number(c)},"number"],"-":[5,function(a,b,c){return a.number(c)-b.number(c)},"number"],"<":[4,function(a,b,c){return m.compare("<",function(a,b){return a<b},a,b,c)},"boolean"],">":[4,function(a,b,c){return m.compare(">",function(a,b){return a>b},a,b,c)},"boolean"],"<=":[4,function(a,b,c){return m.compare("<=",function(a,b){return a<=b},a,b,c)},"boolean"],">=":[4,function(a,b,c){return m.compare(">=",function(a,b){return a>=b},a,b,c)},"boolean"],"=":[3,function(a,b,c){return m.compare("=",function(a,
+b){return a==b},a,b,c)},"boolean"],"!=":[3,function(a,b,c){return m.compare("!=",function(a,b){return a!=b},a,b,c)},"boolean"],and:[2,function(a,b,c){return a.bool(c)&&b.bool(c)},"boolean"],or:[1,function(a,b,c){return a.bool(c)||b.bool(c)},"boolean"]};m.parse=function(a){for(var b,c,k,d=[];;){if(a.empty())throw Error("missing right expression");k=t.parse(a);b=a.next();if(!b)break;c=(c=this.ops[b])&&c[0];if(!c){a.back();break}for(;d.length&&c<=this.ops[d[d.length-1]][0];)k=new m(d.pop(),d.pop(),k);
+d.push(k,b)}for(;d.length;)k=new m(d.pop(),d.pop(),k);return k};m.prototype=new i;m.prototype.evaluate=function(a){return m.ops[this.op][1](this.left,this.right,a)};m.prototype.show=function(a){var a=a||"",b;b=""+(a+"binary: "+this.op+"\n");a+="    ";b+=this.left.show(a);return b+=this.right.show(a)};if(!window.UnaryExpr&&window.defaultConfig)window.UnaryExpr=null;t=function(a,b){this.op=a;this.expr=b;this.needContextPosition=b.needContextPosition;this.needContextNode=b.needContextNode};t.ops={"-":1};
+t.parse=function(a){return this.ops[a.peek()]?new t(a.next(),t.parse(a)):u.parse(a)};t.prototype=new i;t.prototype.datatype="number";t.prototype.evaluate=function(a){return-this.expr.number(a)};t.prototype.show=function(a){var a=a||"",b;b=""+(a+"unary: "+this.op+"\n");return b+=this.expr.show(a+"    ")};if(!window.UnionExpr&&window.defaultConfig)window.UnionExpr=null;u=function(){this.paths=[]};u.ops={"|":1};u.parse=function(a){var b,c;c=p.parse(a);if(!this.ops[a.peek()])return c;b=new u;for(b.path(c);this.ops[a.next()];){if(a.empty())throw Error("missing next union location path");
+b.path(p.parse(a))}a.back();return b};u.prototype=new i;u.prototype.datatype="nodeset";u.prototype.evaluate=function(a){for(var b=this.paths,c=new j,k=0,d=b.length;k<d;k++){var e=b[k].evaluate(a);if(!e.isNodeSet)throw Error("PathExpr must be nodeset");c.merge(e)}return c};u.prototype.path=function(a){this.paths.push(a);if(a.needContextPosition)this.needContextPosition=!0;if(a.needContextNode)this.needContextNode=!0};u.prototype.show=function(a){var a=a||"",b;b=""+(a+"union:\n");for(var a=a+"    ",
+c=0;c<this.paths.length;c++)b+=this.paths[c].show(a);return b};if(!window.PathExpr&&window.defaultConfig)window.PathExpr=null;p=function(a){this.filter=a;this.steps=[];this.datatype=a.datatype;this.needContextPosition=a.needContextPosition;this.needContextNode=a.needContextNode};p.ops={"//":1,"/":1};p.parse=function(a){var b,c,k;if(this.ops[a.peek()]){b=a.next();c=a.peek();if("/"==b&&(a.empty()||"."!=c&&".."!=c&&"@"!=c&&"*"!=c&&!/(?![0-9])[\w]/.test(c)))return q.root();k=new p(q.root());if(a.empty())throw Error("missing next location step");
+c=h.parse(a);k.step(b,c)}else if(c=q.parse(a))if(this.ops[a.peek()])k=new p(c);else return c;else c=h.parse(a),k=new p(q.context()),k.step("/",c);for(;this.ops[a.peek()];){b=a.next();if(a.empty())throw Error("missing next location step");k.step(b,h.parse(a))}return k};p.prototype=new i;p.prototype.evaluate=function(a){var b=this.filter.evaluate(a);if(!b.isNodeSet)throw Exception("Filter nodeset must be nodeset type");for(var a=this.steps,c=0,k=a.length;c<k&&b.length;c++){var d=a[c][1],e=b.iterator(d.reverse),
+g=b,f;if(!d.needContextPosition&&"following"==d.axis){for(f=e();b=e();f=b)if(C.applewebkit2){var g=!1,h=b;do if(h==f){g=!0;break}while(h=h.parentNode);if(!g)break}else try{if(!f.contains(b))break}catch(j){if(!(b.compareDocumentPosition(f)&8))break}b=d.evaluate(new y(f))}else if(!d.needContextPosition&&"preceding"==d.axis)f=e(),b=d.evaluate(new y(f));else{f=e();h=0;for(b=d.evaluate(new y(f),!1,g,h);f=e();)h++,b.merge(d.evaluate(new y(f),!1,g,h))}}return b};p.prototype.step=function(a,b){b.op=a;this.steps.push([a,
+b]);this.quickAttr=!1;if(1==this.steps.length&&"/"==a&&"attribute"==b.axis){var c=b.test;if(!c.notOnlyElement&&"*"!=c.name)this.quickAttr=!0,this.attrName=c.name}};p.prototype.show=function(a){var a=a||"",b;b=""+(a+"path:\n");a+="    ";b=b+(a+"filter:\n")+this.filter.show(a+"    ");if(this.steps.length){b+=a+"steps:\n";for(var a=a+"    ",c=0;c<this.steps.length;c++){var d=this.steps[c];b+=a+"operator: "+d[0]+"\n";b+=d[1].show(a)}}return b};if(!window.FilterExpr&&window.defaultConfig)window.FilterExpr=
+null;q=function(a){this.primary=a;this.predicates=[];this.datatype=a.datatype;this.needContextPosition=a.needContextPosition;this.needContextNode=a.needContextNode};q.parse=function(a){var b,c;b=a.peek();c=b.charAt(0);switch(c){case "$":b=z.parse(a);break;case "(":a.next();b=m.parse(a);if(a.empty())throw Error('unclosed "("');if(")"!=a.next())throw a.back(),Error("bad token: "+a.next());break;case '"':case "'":b=v.parse(a);break;default:if(isNaN(+b))if(!o.types[b]&&/(?![0-9])[\w]/.test(c)&&"("==a.peek(1))b=
+r.parse(a);else return null;else b=x.parse(a)}if("["!=a.peek())return b;b=new q(b);B.parsePredicates(a,b);return b};q.root=function(){return new r("root-node")};q.context=function(){return new r("context-node")};q.prototype=new B;q.prototype.evaluate=function(a){a=this.primary.evaluate(a);if(!a.isNodeSet){if(this.predicates.length)throw Error("Primary result must be nodeset type if filter have predicate expression");return a}return this.evaluatePredicates(a)};q.prototype.predicate=function(a){this.predicates.push(a)};
+q.prototype.show=function(a){var a=a||"",b;b=""+(a+"filter: \n");a+="    ";b+=this.primary.show(a);if(this.predicates.length){b+=a+"predicates: \n";for(var a=a+"    ",c=0;c<this.predicates.length;c++)b+=this.predicates[c].show(a)}return b};if(!window.NodeUtil&&window.defaultConfig)window.NodeUtil=null;n={to:function(a,b){var c,d=b.nodeType;if(1==d&&f.useInnerText&&!C.applewebkit2)c=b.textContent,c=void 0==c||null==c?b.innerText:c,c=void 0==c||null==c?"":c;if("string"!=typeof c)if(9==d||1==d){b=9==
+d?b.documentElement:b.firstChild;for(c="",stack=[],e=0;b;){do 1!=b.nodeType&&(c+=b.nodeValue),stack[e++]=b;while(b=b.firstChild);for(;e&&!(b=stack[--e].nextSibling););}}else c=b.nodeValue;switch(a){case "number":return+c;case "boolean":return!!c;default:return c}},attrPropMap:{name:"name","class":"className",dir:"dir",id:"id",name:"name",title:"title"},attrMatch:function(a,b,c){return!b||null==c&&a.hasAttribute&&a.hasAttribute(b)||null!=c&&a.getAttribute&&a.getAttribute(b)==c?!0:!1},getDescendantNodes:function(a,
+b,c,d,e,g,f){g&&g.delDescendant(b,f);if(e&&"id"==d&&b.getElementById)(b=b.getElementById(e))&&a.match(b)&&c.push(b);else if(e&&"name"==d&&b.getElementsByName)for(var g=b.getElementsByName(e),f=0,h=g.length;f<h;f++)b=g[f],(C.opera?b.name==e&&a.match(b):a.match(b))&&c.push(b);else if(e&&"class"==d&&b.getElementsByClassName){g=b.getElementsByClassName(e);f=0;for(h=g.length;f<h;f++)b=g[f],b.className==e&&a.match(b)&&c.push(b)}else if(a.notOnlyElement)(function(b){for(var g=arguments.callee,f=b.firstChild;f;f=
+f.nextSibling)n.attrMatch(f,d,e)&&a.match(f.nodeType)&&c.push(f),g(f)})(b);else if(g=a.name,b.getElementsByTagName&&(g=b.getElementsByTagName(g)))for(f=0;b=g[f++];)n.attrMatch(b,d,e)&&c.push(b);return c},getChildNodes:function(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)n.attrMatch(b,d,e)&&a.match(b)&&c.push(b);return c}};if(!window.Step&&window.defaultConfig)window.Step=null;h=function(a,b){this.axis=a;this.reverse=h.axises[a][0];this.func=h.axises[a][1];this.test=b;this.predicates=[];this._quickAttr=
+h.axises[a][2]};h.axises={ancestor:[!0,function(a,b,c,d,e,f,g){for(;b=b.parentNode;)f&&1==b.nodeType&&f.reserveDelByNode(b,g,!0),a.match(b)&&c.unshift(b);return c}],"ancestor-or-self":[!0,function(a,b,c,d,e,f,g){do f&&1==b.nodeType&&f.reserveDelByNode(b,g,!0),a.match(b)&&c.unshift(b);while(b=b.parentNode);return c}],attribute:[!1,function(a,b,c){if(b=b.attributes)if(a.notOnlyElement&&0==a.type||"*"==a.name)for(var a=0,d=b.length;a<d;a++){var e=b[a];c.push(e)}else(e=b.getNamedItem(a.name))&&c.push(e);
+return c}],child:[!1,n.getChildNodes,!0],descendant:[!1,n.getDescendantNodes,!0],"descendant-or-self":[!1,function(a,b,c,d,e,f,g){n.attrMatch(b,d,e)&&a.match(b)&&c.push(b);return n.getDescendantNodes(a,b,c,d,e,f,g)},!0],following:[!1,function(a,b,c,d,e){do for(var f=b;f=f.nextSibling;)n.attrMatch(f,d,e)&&a.match(f)&&c.push(f),c=n.getDescendantNodes(a,f,c,d,e);while(b=b.parentNode);return c},!0],"following-sibling":[!1,function(a,b,c,d,e,f,g){for(;b=b.nextSibling;)f&&1==b.nodeType&&f.reserveDelByNode(b,
+g),a.match(b)&&c.push(b);return c}],namespace:[!1,function(a,b,c){return c}],parent:[!1,function(a,b,c){if(9==b.nodeType)return c;if(2==b.nodeType)return c.push(b.ownerElement),c;b=b.parentNode;a.match(b)&&c.push(b);return c}],preceding:[!0,function(a,b,c,d,e){var f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){for(var j=[],b=f[g];b=b.previousSibling;)j.unshift(b);for(var i=0,l=j.length;i<l;i++)b=j[i],n.attrMatch(b,d,e)&&a.match(b)&&c.push(b),c=n.getDescendantNodes(a,b,
+c,d,e)}return c},!0],"preceding-sibling":[!0,function(a,b,c,d,e,f,g){for(;b=b.previousSibling;)f&&1==b.nodeType&&f.reserveDelByNode(b,g,!0),a.match(b)&&c.unshift(b);return c}],self:[!1,function(a,b,c){a.match(b)&&c.push(b);return c}]};h.parse=function(a){var b,c;if("."==a.peek())b=this.self(),a.next();else if(".."==a.peek())b=this.parent(),a.next();else{if("@"==a.peek()){if(b="attribute",a.next(),a.empty())throw Error("missing attribute name");}else if("::"==a.peek(1)){if(!/(?![0-9])[\w]/.test(a.peek().charAt(0)))throw Error("bad token: "+
+a.next());b=a.next();a.next();if(!this.axises[b])throw Error("invalid axis: "+b);if(a.empty())throw Error("missing node name");}else b="child";c=a.peek();if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("==a.peek(1)){if(!o.types[c])throw Error("invalid node type: "+c);c=o.parse(a)}else c=w.parse(a);else if("*"==c)c=w.parse(a);else throw Error("bad token: "+a.next());b=new h(b,c)}B.parsePredicates(a,b);return b};h.self=function(){return new h("self",new o("node"))};h.parent=function(){return new h("parent",
+new o("node"))};h.prototype=new B;h.prototype.evaluate=function(a,b,c,d){var e=a.node;if(!b&&"//"==this.op)if(!this.needContextPosition&&"child"==this.axis)this.quickAttr?(a=this.attrValueExpr?this.attrValueExpr.string(a):null,d=n.getDescendantNodes(this.test,e,new j,this.attrName,a,c,d),d=this.evaluatePredicates(d,1)):(d=n.getDescendantNodes(this.test,e,new j,null,null,c,d),d=this.evaluatePredicates(d));else{e=new h("descendant-or-self",new o("node"));c=e.evaluate(a,!1,c,d).list();d=null;e.op="/";
+a=0;for(e=c.length;a<e;a++)d?d.merge(this.evaluate(new y(c[a]),!0)):d=this.evaluate(new y(c[a]),!0);d=d||new j}else this.needContextPosition&&(d=c=null),this.quickAttr?(a=this.attrValueExpr?this.attrValueExpr.string(a):null,d=this.func(this.test,e,new j,this.attrName,a,c,d),d=this.evaluatePredicates(d,1)):(d=this.func(this.test,e,new j,null,null,c,d),d=this.evaluatePredicates(d)),c&&c.doDel();return d};h.prototype.predicate=function(a){this.predicates.push(a);if(a.needContextPosition||"number"==a.datatype||
+"void"==a.datatype)this.needContextPosition=!0;if(this._quickAttr&&1==this.predicates.length&&a.quickAttr)this.attrName=a.attrName,this.attrValueExpr=a.attrValueExpr,this.quickAttr=!0};h.prototype.show=function(a){var a=a||"",b;b=""+(a+"step: \n");a+="    ";this.axis&&(b+=a+"axis: "+this.axis+"\n");b+=this.test.show(a);if(this.predicates.length){b+=a+"predicates: \n";for(var a=a+"    ",c=0;c<this.predicates.length;c++)b+=this.predicates[c].show(a)}return b};if(!window.NodeType&&window.defaultConfig)window.NodeType=
+null;o=function(a,b){this.name=a;this.literal=b;switch(a){case "comment":this.type=8;break;case "text":this.type=3;break;case "processing-instruction":this.type=7;break;case "node":this.type=0}};o.types={comment:1,text:1,"processing-instruction":1,node:1};o.parse=function(a){var b,c,d;b=a.next();a.next();if(a.empty())throw Error("bad nodetype");d=a.peek().charAt(0);if('"'==d||"'"==d)c=v.parse(a);if(a.empty())throw Error("bad nodetype");if(")"!=a.next())throw a.back(),Error("bad token "+a.next());
+return new o(b,c)};o.prototype=new i;o.prototype.notOnlyElement=!0;o.prototype.match=function(a){return!this.type||this.type==a.nodeType};o.prototype.show=function(a){var a=a||"",b;b=""+(a+"nodetype: "+this.type+"\n");this.literal&&(b+=this.literal.show(a+"    "));return b};if(!window.NameTest&&window.defaultConfig)window.NameTest=null;w=function(a){this.name=a.toLowerCase()};w.parse=function(a){return"*"!=a.peek()&&":"==a.peek(1)&&"*"==a.peek(2)?new w(a.next()+a.next()+a.next()):new w(a.next())};
+w.prototype=new i;w.prototype.match=function(a){var b=a.nodeType;if(1==b||2==b)if("*"==this.name||this.name==a.nodeName.toLowerCase())return!0;return!1};w.prototype.show=function(a){return a=""+((a||"")+"nametest: "+this.name+"\n")};if(!window.VariableReference&&window.defaultConfig)window.VariableReference=null;z=function(a){this.name=a.substring(1)};z.parse=function(a){a=a.next();if(2>a.length)throw Error("unnamed variable reference");return new z(a)};z.prototype=new i;z.prototype.datatype="void";
+z.prototype.show=function(a){return a=""+((a||"")+"variable: "+this.name+"\n")};if(!window.Literal&&window.defaultConfig)window.Literal=null;v=function(a){this.text=a.substring(1,a.length-1)};v.parse=function(a){a=a.next();if(2>a.length)throw Error("unclosed literal string");return new v(a)};v.prototype=new i;v.prototype.datatype="string";v.prototype.evaluate=function(){return this.text};v.prototype.show=function(a){return a=""+((a||"")+"literal: "+this.text+"\n")};if(!window.Number&&window.defaultConfig)window.Number=
+null;x=function(a){this.digit=+a};x.parse=function(a){return new x(a.next())};x.prototype=new i;x.prototype.datatype="number";x.prototype.evaluate=function(){return this.digit};x.prototype.show=function(a){return a=""+((a||"")+"number: "+this.digit+"\n")};if(!window.FunctionCall&&window.defaultConfig)window.FunctionCall=null;r=function(a){var b=r.funcs[a];if(!b)throw Error(a+" is not a function");this.name=a;this.func=b[0];this.args=[];this.datatype=b[1];if(b[2])this.needContextPosition=!0;this.needContextNodeInfo=
+b[3];this.needContextNode=this.needContextNodeInfo[0]};r.funcs={"context-node":[function(){if(0!=arguments.length)throw Error("Function context-node expects ()");var a;a=new j;a.push(this.node);return a},"nodeset",!1,[!0]],"root-node":[function(){if(0!=arguments.length)throw Error("Function root-node expects ()");var a,b;a=new j;b=this.node;9==b.nodeType?a.push(b):a.push(b.ownerDocument);return a},"nodeset",!1,[]],last:[function(){if(0!=arguments.length)throw Error("Function last expects ()");return this.last},
+"number",!0,[]],position:[function(){if(0!=arguments.length)throw Error("Function position expects ()");return this.position},"number",!0,[]],count:[function(a){if(1!=arguments.length||!(a=a.evaluate(this)).isNodeSet)throw Error("Function count expects (nodeset)");return a.length},"number",!1,[]],id:[function(a){var b,c,e,f,g,h;if(1!=arguments.length)throw Error("Function id expects (object)");b=this.node;h=9==b.nodeType?b:b.ownerDocument;a=a.string(this);b=a.split(/\s+/);c=new j;for(e=0,d=b.length;e<
+d;e++)if(f=b[e],g=h.getElementById(f),C.opera&&g&&g.id!=f)for(var i=h.getElementsByName(f),l=0,m=i.length;l<m;l++)g=i[l],g.id==f&&c.push(g);else g&&c.push(g);c.isSorted=!1;return c},"nodeset",!1,[]],"local-name":[function(a){var b;switch(arguments.length){case 0:b=this.node;break;case 1:if((a=a.evaluate(this)).isNodeSet){b=a.first();break}default:throw Error("Function local-name expects (nodeset?)");}return""+b.nodeName.toLowerCase()},"string",!1,[!0,!1]],name:[function(a){return r.funcs["local-name"][0].apply(this,
+arguments)},"string",!1,[!0,!1]],"namespace-uri":[function(){return""},"string",!1,[!0,!1]],string:[function(a){switch(arguments.length){case 0:a=n.to("string",this.node);break;case 1:a=a.string(this);break;default:throw Error("Function string expects (object?)");}return a},"string",!1,[!0,!1]],concat:[function(a,b){if(2>arguments.length)throw Error("Function concat expects (string, string[, ...])");for(var c="",d=0,e=arguments.length;d<e;d++)c+=arguments[d].string(this);return c},"string",!1,[]],
+"starts-with":[function(a,b){if(2!=arguments.length)throw Error("Function starts-with expects (string, string)");a=a.string(this);b=b.string(this);return 0==a.indexOf(b)},"boolean",!1,[]],contains:[function(a,b){if(2!=arguments.length)throw Error("Function contains expects (string, string)");a=a.string(this);b=b.string(this);return-1!=a.indexOf(b)},"boolean",!1,[]],substring:[function(a,b,c){var d,e,a=a.string(this),b=b.number(this);switch(arguments.length){case 2:c=a.length-b+1;break;case 3:c=c.number(this);
+break;default:throw Error("Function substring expects (string, string)");}b=Math.round(b);c=Math.round(c);d=b-1;e=b+c-1;return Infinity==e?a.substring(0>d?0:d):a.substring(0>d?0:d,e)},"string",!1,[]],"substring-before":[function(a,b){var c;if(2!=arguments.length)throw Error("Function substring-before expects (string, string)");a=a.string(this);b=b.string(this);c=a.indexOf(b);return-1==c?"":a.substring(0,c)},"string",!1,[]],"substring-after":[function(a,b){if(2!=arguments.length)throw Error("Function substring-after expects (string, string)");
+var a=a.string(this),b=b.string(this),c=a.indexOf(b);return-1==c?"":a.substring(c+b.length)},"string",!1,[]],"string-length":[function(a){switch(arguments.length){case 0:a=n.to("string",this.node);break;case 1:a=a.string(this);break;default:throw Error("Function string-length expects (string?)");}return a.length},"number",!1,[!0,!1]],"normalize-space":[function(a){switch(arguments.length){case 0:a=n.to("string",this.node);break;case 1:a=a.string(this);break;default:throw Error("Function normalize-space expects (string?)");
+}return a.replace(/\s+/g," ").replace(/^ /,"").replace(/ $/,"")},"string",!1,[!0,!1]],translate:[function(a,b,c){if(3!=arguments.length)throw Error("Function translate expects (string, string, string)");for(var a=a.string(this),b=b.string(this),c=c.string(this),d=[],e=0,f=b.length;e<f;e++){var g=b.charAt(e);d[g]||(d[g]=c.charAt(e)||"")}for(var h="",e=0,f=a.length;e<f;e++)var g=a.charAt(e),i=d[g],h=h+(void 0!=i?i:g);return h},"string",!1,[]],"boolean":[function(a){if(1!=arguments.length)throw Error("Function boolean expects (object)");
+return a.bool(this)},"boolean",!1,[]],not:[function(a){if(1!=arguments.length)throw Error("Function not expects (object)");return!a.bool(this)},"boolean",!1,[]],"true":[function(){if(0!=arguments.length)throw Error("Function true expects ()");return!0},"boolean",!1,[]],"false":[function(){if(0!=arguments.length)throw Error("Function false expects ()");return!1},"boolean",!1,[]],lang:[function(){return!1},"boolean",!1,[]],number:[function(a){switch(arguments.length){case 0:a=n.to("number",this.node);
+break;case 1:a=a.number(this);break;default:throw Error("Function number expects (object?)");}return a},"number",!1,[!0,!1]],sum:[function(a){var b,c,d,e;if(1!=arguments.length||!(a=a.evaluate(this)).isNodeSet)throw Error("Function sum expects (nodeset)");b=a.list();c=0;for(d=0,e=b.length;d<e;d++)c+=n.to("number",b[d]);return c},"number",!1,[]],floor:[function(a){if(1!=arguments.length)throw Error("Function floor expects (number)");a=a.number(this);return Math.floor(a)},"number",!1,[]],ceiling:[function(a){if(1!=
+arguments.length)throw Error("Function ceiling expects (number)");a=a.number(this);return Math.ceil(a)},"number",!1,[]],round:[function(a){if(1!=arguments.length)throw Error("Function round expects (number)");a=a.number(this);return Math.round(a)},"number",!1,[]]};r.parse=function(a){var b,c=new r(a.next());for(a.next();")"!=a.peek();){if(a.empty())throw Error("missing function argument list");b=m.parse(a);c.arg(b);if(","!=a.peek())break;a.next()}if(a.empty())throw Error("unclosed function argument list");
+if(")"!=a.next())throw a.back(),Error("bad token: "+a.next());return c};r.prototype=new i;r.prototype.evaluate=function(a){return this.func.apply(a,this.args)};r.prototype.arg=function(a){this.args.push(a);if(a.needContextPosition)this.needContextPosition=!0;var b=this.args;if(a.needContextNode)b.needContexNode=!0;this.needContextNode=b.needContextNode||this.needContextNodeInfo[b.length]};r.prototype.show=function(a){var a=a||"",b;b=""+(a+"function: "+this.name+"\n");a+="    ";if(this.args.length){b+=
+a+"arguments: \n";for(var a=a+"    ",c=0;c<this.args.length;c++)b+=this.args[c].show(a)}return b};var D={uuid:1,get:function(a){return a.__jsxpath_id__||(a.__jsxpath_id__=this.uuid++)}};if(!window.NodeSet&&window.defaultConfig)window.NodeSet=null;j=function(){this.length=0;this.nodes=[];this.seen={};this.idIndexMap=null;this.reserveDels=[]};j.prototype.isNodeSet=!0;j.prototype.isSorted=!0;j.prototype.merge=function(a){this.isSorted=!1;if(a.only)return this.push(a.only);if(this.only){var b=this.only;
+delete this.only;this.push(b);this.length--}for(var a=a.nodes,b=0,c=a.length;b<c;b++)this._add(a[b])};j.prototype.sort=function(){if(!this.only&&!this.sortOff&&!this.isSorted)this.isSorted=!0,this.idIndexMap=null,this.nodes.sort(function(a,b){if(a==b)return 0;if(a.compareDocumentPosition){var c=a.compareDocumentPosition(b);return c&2?1:c&4?-1:0}for(var c=a,d=b,e=a,f=b,g=0,h=0;e=e.parentNode;)g++;for(;f=f.parentNode;)h++;if(g>h){for(;g--!=h;)c=c.parentNode;if(c==d)return 1}else if(h>g){for(;h--!=g;)d=
+d.parentNode;if(c==d)return-1}for(;(e=c.parentNode)!=(f=d.parentNode);)c=e,d=f;for(;c=c.nextSibling;)if(c==d)return-1;return 1})};j.prototype.reserveDelByNodeID=function(a,b,c){if(a=this.createIdIndexMap()[a])(c&&this.length-b-1>a||!c&&b<a)&&this.reserveDels.push({value:a,order:String.fromCharCode(a),toString:function(){return this.order},valueOf:function(){return this.value}})};j.prototype.reserveDelByNode=function(a,b,c){this.reserveDelByNodeID(D.get(a),b,c)};j.prototype.doDel=function(){if(this.reserveDels.length){for(var a=
+65536>this.length?this.reserveDels.sort(function(a,b){return b-a}):this.reserveDels.sort(function(a,b){return b-a}),b=0,c=a.length;b<c;b++)this.del(a[b]);this.reserveDels=[];this.idIndexMap=null}};j.prototype.createIdIndexMap=function(){if(this.idIndexMap)return this.idIndexMap;for(var a=this.idIndexMap={},b=this.nodes,c=0,d=b.length;c<d;c++){var e=D.get(b[c]);a[e]=c}return a};j.prototype.del=function(a){this.length--;this.only?delete this.only:(a=this.nodes.splice(a,1)[0],this._first==a&&(delete this._first,
+delete this._firstSourceIndex,delete this._firstSubIndex),delete this.seen[D.get(a)])};j.prototype.delDescendant=function(a,b){if(!this.only){var c=a.nodeType;if(!(1!=c&&9!=c||C.applewebkit2)){if(!a.contains)if(1==c)var d=a,a={contains:function(a){return a.compareDocumentPosition(d)&8}};else a={contains:function(){return!0}};for(var c=this.nodes,e=b+1;e<c.length;e++)a.contains(c[e])&&(this.del(e),e--)}}};j.prototype._add=function(a,b){var c=this.seen,d=D.get(a);if(c[d])return!0;c[d]=!0;this.length++;
+b?this.nodes.unshift(a):this.nodes.push(a)};j.prototype.unshift=function(a){if(this.length){if(this.only){var b=this.only;delete this.only;this.unshift(b);this.length--}return this._add(a,!0)}this.length++;this.only=a};j.prototype.push=function(a){if(this.length){if(this.only){var b=this.only;delete this.only;this.push(b);this.length--}return this._add(a)}this.length++;this.only=a};j.prototype.first=function(){if(this.only)return this.only;1<this.nodes.length&&this.sort();return this.nodes[0]};j.prototype.list=
+function(){if(this.only)return[this.only];this.sort();return this.nodes};j.prototype.string=function(){var a=this.only||this.first();return a?n.to("string",a):""};j.prototype.bool=function(){return!(!this.length&&!this.only)};j.prototype.number=function(){return+this.string()};j.prototype.iterator=function(a){this.sort();var b=this;if(a)return c=0,function(){var a=b.length-c++-1;return b.only&&0==a?b.only:b.nodes[a]};var c=0;return function(){return b.only&&0==c++?b.only:b.nodes[c++]}};var i=function(a){var a=
+a||this,b=a.document;a.XPathExpression=function(b){if(!b.length)throw a.Error("no expression");b=this.lexer=A(b);if(b.empty())throw a.Error("no expression");this.expr=m.parse(b);if(!b.empty())throw a.Error("bad token: "+b.next());};a.XPathExpression.prototype.evaluate=function(b,d){return new a.XPathResult(this.expr.evaluate(new y(b)),d)};a.XPathResult=function(a,b){if(0==b)switch(typeof a){case "object":b++;case "boolean":b++;case "string":b++;case "number":b++}this.resultType=b;switch(b){case 1:this.numberValue=
+a.isNodeSet?a.number():+a;break;case 2:this.stringValue=a.isNodeSet?a.string():""+a;break;case 3:this.booleanValue=a.isNodeSet?a.bool():!!a;break;case 4:case 5:case 6:case 7:this.nodes=a.list();this.snapshotLength=a.length;this.index=0;this.invalidIteratorState=!1;break;case 8:case 9:this.singleNodeValue=a.first()}};a.XPathResult.prototype.iterateNext=function(){return this.nodes[this.index++]};a.XPathResult.prototype.snapshotItem=function(a){return this.nodes[a]};a.XPathResult.ANY_TYPE=0;a.XPathResult.NUMBER_TYPE=
+1;a.XPathResult.STRING_TYPE=2;a.XPathResult.BOOLEAN_TYPE=3;a.XPathResult.UNORDERED_NODE_ITERATOR_TYPE=4;a.XPathResult.ORDERED_NODE_ITERATOR_TYPE=5;a.XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE=6;a.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE=7;a.XPathResult.ANY_UNORDERED_NODE_TYPE=8;a.XPathResult.FIRST_ORDERED_NODE_TYPE=9;b.createExpression=function(b){return new a.XPathExpression(b,null)};b.evaluate=function(a,d,e,f){return b.createExpression(a,null).evaluate(d,f)}},E;if(f.targetFrame&&(s=document.getElementById(f.targetFrame)))E=
+s.contentWindow;if(f.exportInstaller)window.install=i;if(!f.hasNative||!f.useNative)i(E||window)}})();

public/reset-min.css

+/*
+Copyright (c) 2011, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.com/yui/license.html
+version: 2.9.0
+*/
+html{color:#000;background:#FFF}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,select,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,button,caption,cite,code,dfn,em,input,optgroup,option,select,strong,textarea,th,var{font:inherit}del,ins{text-decoration:none}li{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:baseline}sub{vertical-align:baseline}legend{color:#000}
 b {
   color: #c00; }
 
-.navbaritem {
+#navbar {}
+
+#navbar .navbaritem {
   height: 31px;
   text-align: center;
-  cursor: pointer;
   background-image: url("navbaritem_bg.png");
   background-repeat: repeat-x;
   background-position: 0 0; }
 
+#navbar .navbaritem:hover,
+#navbar .navbaritem:focus {
+  background-position: 0 -31px; }
+
+#navbar .navbaritem a {
+  display: block;
+  width: 100%;
+  height: 100%; }
+
 .float-left {
   float: left;
   padding-right: 1em; }

public/style.scss

-@charset "utf-8";
-
-#header {
-  background-color: #acf;
-}
-
-h2.caps {
-  color: #30f;
-}
-
-b {
-  color: #900;
-}
-
-.navbaritem {
-  height: 31px;
-  text-align: center;
-  cursor: pointer;
-  background: {
-    image: url("navbaritem_bg.png");
-    repeat: repeat-x;
-    position: 0 0;
-  }
-}
-
-.float-left {
-  float: left;
-  padding-right: 1em;
-}
-
-.return {
-  clear: both;
-}
 (function (scope) {
 
-var contentshtml = {};
+/*
+ * @param {String} hrefStr
+ * @return {String}
+ */
+function replaceHrefString (hrefStr) {
+  return hrefStr.replace(/^.*(\/[^\/]*)$/, function (str, mtch1) {
+      return mtch1;
+    });
+}
 
 
 /**
- * @param String
+ * @param {String} targetLocation
  */
-function move_page(pagename) {
-    var xhr = new XMLHttpRequest(),
-        node = uu.klass('contents')[0];
+function movePage (targetLocation) {
+
+  function insertContents (contentsHTML) {
+    uu.query('.contents')[0].innerHTML = contentsHTML;
+  }
 
-    if ('/' + pagename === location.pathname) {
-        return true;
-    }
-    if (pagename === '') {
-        pagename = 'index';
-    }
-    if (contentshtml[pagename]) {
-        node.innerHTML = contentshtml[pagename];
-    } else {
-        xhr.open('GET', 'contents/' + pagename, true);
-        xhr.onreadystatechange = function (evt) {
-            if (xhr.readyState < 4) {
-                //node.innerHTML += '.';
-            } else if (xhr.readyState === 4 && xhr.status === 200) {
-                contentshtml[pagename] = xhr.responseText;
-                //uu.fx.hide(node, 0);
-                node.innerHTML = contentshtml[pagename];
-                assign_anchorclick();
-                uu.fx.show(node, 100);
-            } else {
-                location.href = './' + pagename;
-            }
-        };
-        uu.fx.hide(node, 100);
-        //node.innerHTML = 'loading';
-        //uu.fx.show(node, 0);
-        xhr.send();
-    }
+  var cache = movePage.contentsCache,
+      contentsName;
+
+  if (cache[targetLocation]) {
+    insertContents(cache[targetLocation]);
+  }
+  contentsName = '/contents' + replaceHrefString(targetLocation);
+  if (contentsName[contentsName.length - 1] === '/') {
+    contentsName += 'index';
+  }
+  uu.ajax(contentsName,
+    {
+      timeout: 10
+    },
+    function (response) {
+      if (!response.ok) {
+        location.href = targetLocation;
+        return;
+      }
+      cache[targetLocation] = response.rv;
+      insertContents(response.rv);
+    });
 }
+movePage.contentsCache = {};
 
 
 /**
- * @param String
+ * @param {MouseEvent} evt
  */
-function click_navbaritem(href) {
-    var pagename = href.match(/\/([^\/]*)$/)[1] || '';
-
-    move_page(pagename);
-    history.pushState(null, null, pagename);
+function clickItem (evt) {
+  evt.preventDefault();
+  if (evt.target.href === location.href) {
+    return;
+  }
+  movePage(evt.target.href);
+  history.pushState({}, 'せとメンタルクリニック', evt.target.href);
 }
 
 
-function assign_anchorclick() {console.log('assigning');
-    uu.query('a').forEach(function (node) {
-        var href = node.href;
-
-        if (!/^http:\/\//.test(href) && !uu.klass.has(node, 'assigned')) {
-            uu.event(node, 'click', function (evt) {
-                click_navbaritem(node.href);
-                evt.preventDefault();
-            });
-            uu.klass(node, 'assigned');
-        }
-    });
+/**
+ * @param {Event} evt window.onpopstate event
+ */
+function backHistory (evt) {
+  movePage('.' + replaceHrefString(location.href));
 }
 
 
-uu.ready(function () {
-    uu.klass('navbaritem').forEach(function (node) {
-        uu.event(node, 'mouseover', function (evt) {
-            uu.css(node, {'background-position': '0 -31px'});
-        });
-        uu.event(node, 'mouseout', function (evt) {
-            uu.css(node, {'background-position': '0 0'});
-        });
-        uu.event(node, 'click', function (evt) {
-            var href = uu.query('a', node)[0].href;
-            //if (history.pushState) {
-            //    click_navbaritem(href);
-            //    evt.preventDefault();
-            //} else {
-                location.href = href;
-            //}
-        });
-    });
-    //if (history.pushState) {
-    //    assign_anchorclick();
-    //}
-});
-
-//window.addEventListener('popstate', function (evt) {
-//    move_page(location.pathname);
-//}, false);
+if (history.pushState) {
+  uu.query('#navbar .navbaritem a').forEach(function (node) {
+    uu.click(node, clickItem);
+  });
+  window.addEventListener('popstate', backHistory, false);
+}
 
-}(this));
+}(this));

views/template.haml

     %link{:rev => 'made', :href => 'mailto:utakata.c4se+seto-mental@gmail.com'}/
     %link{:rel => 'author', :href => 'http://c4se.tk/profile/ne.html'}/
     %link{:rel => 'copyright', :title => 'CC by', :href => 'http://creativecommons.org/licenses/by/3.0/'}/
-    %link{:rel => 'stylesheet', :href => 'http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css'}/
+    %link{:rel => 'stylesheet', :href => 'reset-min.css'}/
     %link{:rel => 'stylesheet', :href => 'bluetrip/css/screen.css', :media => 'screen, projection'}/
     %link{:rel => 'stylesheet', :href => 'bluetrip/css/print.css', :media => 'print'}/
     <!--[if IE]>
             ==#{haml @contents}
       %hr.space
       #footer.span-24 (C) 2011 <a href="http://c4se.tk/profile/ne.html">ne_Sachirou</a>
-    %script{:src => 'es5.g.js'}
+    %script{:src => 'es5.min.js'}
     %script{:src => 'uupaa.js'}
-    %script{:src => 'ui.js'}
+    %script{:src => 'ui.js'}