/*
 * yuga.js 0.7.1 - 優雅なWeb制作のためのJS
 *
 * Copyright (c) 2009 Kyosuke Nakamura (kyosuke.jp)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Since:     2006-10-30
 * Modified:  2009-01-27
 *
 * jQuery 1.3.1
 * ThickBox 3.1
 */
(function(a){a(function(){a.yuga.externalLink();a.yuga.scroll()});a.yuga={Uri:function(b){var c=this;this.originalPath=b;this.absolutePath=function(){var a=document.createElement("span");a.innerHTML='<a href="'+b+'" />';return a.firstChild.href}();var h={schema:2,username:5,password:6,host:7,path:9,query:10,fragment:11},g=/^((\w+):)?(\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/.exec(this.absolutePath),f;for(f in h)this[f]=g[h[f]];this.querys={};this.query&&a.each(c.query.split("&"),
function(){var a=this.split("=");2==a.length&&(c.querys[a[0]]=a[1])})},externalLink:function(b){var b=a.extend({windowOpen:!0,externalClass:"externalLink",addIconSrc:""},b),c=new a.yuga.Uri(location.href),c=a('a[href^="http://"]').not('a[href^="'+c.schema+"://"+c.host+'/"]').not("a.noAddExternalLink");c.addClass(b.externalClass);b.windowOpen&&a("."+b.externalClass).click(function(){window.open(this.href,"_blank");return!1});b.addIconSrc&&c.not(":has(img)").after(a('<img src="'+b.addIconSrc+'" class="externalIcon" />'))},
scroll:function(b){var c=function(){function c(){if(d.stepCount==e.step)location.href=d.hrefdata.absolutePath,window.scrollTo(document.body.scrollLeft||document.documentElement.scrollLeft,d.endY);else if(d.lastY==g())d.stepCount++,window.scrollTo(document.body.scrollLeft||document.documentElement.scrollLeft,f()),d.lastY=f(),i=setTimeout(c,e.ms);else if(g()+(!a.browser.safari&&!a.browser.opera?document.documentElement.clientHeight||document.body.clientHeight||document.body.scrollHeight:window.innerHeight)==
(document.documentElement.scrollHeight||document.body.scrollHeight))location.href=d.hrefdata.absolutePath}function g(){return document.body.scrollTop||document.documentElement.scrollTop}function f(){return Math.floor(j(d.startY,d.endY,d.stepCount,e.step,e.easing))}function j(a,d,c,b,h){c/=b;return(d-a)*(c+h/(100*Math.PI)*Math.sin(Math.PI*c))+a}var e=a.extend({easing:100,step:30,fps:60,fragment:""},b);e.ms=Math.floor(1E3/e.fps);var i,d={stepCount:0,startY:0,endY:0,lastY:0};return{set:function(b){this.stop();
if(void 0==b.startY)b.startY=g();d=a.extend(d,b);d.lastY=d.startY;i=setTimeout(c,e.ms)},stop:function(){clearTimeout(i);d.stepCount=0}}}();a("a[href^=#], area[href^=#]").not("a[href=#], area[href=#], a.disable_yuga_scroll").each(function(){this.hrefdata=new a.yuga.Uri(this.getAttribute("href"))}).click(function(){var b=a("#"+this.hrefdata.fragment);0==b.length&&(b=a("a[name="+this.hrefdata.fragment+"]"));if(b.length)return c.set({endY:b.offset().top,hrefdata:this.hrefdata}),!1})}}})(jQuery);
