/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
 *
 * http://www.lockon.co.jp/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 gCssUA = navigator.userAgent.toUpperCase();
gCssBrw = navigator.appName.toUpperCase();

with (document) {
		write("<style type=\"text/css\"><!--");


//WIN-IE
	if (gCssUA.indexOf("WIN") != -1 && gCssUA.indexOf("MSIE") != -1) {
		write(".fs10 {font-size: 62.5%; line-height: 150%; letter-spacing:1px;}");
		write(".fs12 {font-size: 75%; line-height: 150%; letter-spacing:1.5px;}");
		write(".fs14 {font-size: 87.5%; line-height: 150%; letter-spacing:2px;}");
		write(".fs18 {font-size: 117.5%; line-height: 130%; letter-spacing:2.5px;}");
		write(".fs22 {font-size: 137.5%; line-height: 130%; letter-spacing:3px;}");
		write(".fs24 {font-size: 150%; line-height: 130%; letter-spacing:3px;}");
		write(".fs30 {font-size: 187.5%; line-height: 125%; letter-spacing:3.5px;}");
		write(".fs10n {font-size: 62.5%; letter-spacing:1px;}");
		write(".fs12n {font-size: 75%; letter-spacing:1.5px;}");
		write(".fs14n {font-size: 87.5%; letter-spacing:2px;}");
		write(".fs18n {font-size: 117.5%; letter-spacing:2.5px;}");
		write(".fs22n {font-size: 137.5%; letter-spacing:1px;}");
		write(".fs24n {font-size: 150%; letter-spacing:1px;}");
		write(".fs30n {font-size: 187.5%; letter-spacing:1px;}");
		write(".fs12st {font-size: 75%; line-height: 150%; letter-spacing:1.5px; font-weight: bold;}");
	}

//WIN-NN
	if (gCssUA.indexOf("WIN") != -1 && gCssBrw.indexOf("NETSCAPE") != -1) {
		write(".fs10 {font-size:72%; line-height:130%;}");
		write(".fs12 {font-size: 75%; line-height: 150%;}");
		write(".fs14 {font-size: 87.5%; line-height: 140%;}");
		write(".fs18 {font-size: 117.5%; line-height: 130%;}");
		write(".fs22 {font-size: 137.5%; line-height: 130%;}");
		write(".fs24 {font-size: 150%; line-height: 130%;}");
		write(".fs30 {font-size: 187.5%; line-height: 120%;}");
		write(".fs10n {font-size:72%;}");
		write(".fs12n {font-size: 75%;}");
		write(".fs14n {font-size: 87.5%;}");
		write(".fs18n {font-size: 117.5%;}");
		write(".fs22n {font-size: 137.5%;}");
		write(".fs24n {font-size: 150%;}");
		write(".fs30n {font-size: 187.5%;}");
		write(".fs12st {font-size: 75%; line-height: 150%; font-weight: bold;}");
	}

//WIN-NN4.x
	if ( navigator.appName == "Netscape" && navigator.appVersion.substr(0,2) == "4." ) {
		write(".fs10 {font-size:90%; line-height: 130%;}");
		write(".fs12 {font-size: 100%; line-height: 140%;}");
		write(".fs14 {font-size: 110%; line-height: 135%;}");
		write(".fs18 {font-size: 130%; line-height: 175%;}");
		write(".fs24 {font-size: 190%; line-height: 240%;}");
		write(".fs30 {font-size: 240%; line-height: 285%;}");
		write(".fs10n {font-size:90%;}");
		write(".fs12n {font-size: 100%;}");
		write(".fs14n {font-size: 110%;}");
		write(".fs18n {font-size: 130%;}");
		write(".fs24n {font-size: 190%;}");
		write(".fs30n {font-size: 240%;}");
		write(".fs12st {font-size: 100%; line-height: 140%; font-weight: bold;}");
	}

//MAC
	if (gCssUA.indexOf("MAC") != -1) {
		write(".fs10 {font-size: 10px; line-height: 14px;}");
		write(".fs12 {font-size: 12px; line-height: 18px;}");
		write(".fs14 {font-size: 14px; line-height: 18px;}");
		write(".fs18 {font-size: 18px; line-height: 23px;}");
		write(".fs22 {font-size: 22px; line-height: 27px;}");
		write(".fs24 {font-size: 24px; line-height: 30px;}");
		write(".fs30 {font-size: 30px; line-height: 35px;}");
		write(".fs10n {font-size: 10px;}");
		write(".fs12n {font-size: 12px;}");
		write(".fs14n {font-size: 14px;}");
		write(".fs18n {font-size: 18px;}");
		write(".fs22n {font-size: 22px;}");
		write(".fs24n {font-size: 24px;}");
		write(".fs30n {font-size: 30px;}");
		write(".fs12st {font-size: 12px; line-height: 18px; font-weight: bold;}");
	}

	write("--></style>");
}
// UTF-8
/**
 * scrollsmoothly.js
 * Copyright (c) 2008 KAZUMiX
 * http://d.hatena.ne.jp/KAZUMiX/20080418/scrollsmoothly
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * 更新履歴
 * 2009/02/12
 * スクロール先が画面左上にならない場合の挙動を修正
 * 2008/04/18
 * 公開
 *
*/

(function(){
   var easing = 0.25;
   var interval = 20;
   var d = document;
   var targetX = 0;
   var targetY = 0;
   var targetHash = '';
   var scrolling = false;
   var splitHref = location.href.split('#');
   var currentHref_WOHash = splitHref[0];
   var incomingHash = splitHref[1];
   var prevX = null;
   var prevY = null;

   // ドキュメント読み込み完了時にinit()を実行する
   addEvent(window, 'load', init);

   // ドキュメント読み込み完了時の処理
   function init(){
     // ページ内リンクにイベントを設定する
     setOnClickHandler();
     // 外部からページ内リンク付きで呼び出された場合
     if(incomingHash){
       if(window.attachEvent && !window.opera){
         // IEの場合はちょっと待ってからスクロール
         setTimeout(function(){scrollTo(0,0);setScroll('#'+incomingHash);},50);
       }else{
         // IE以外はそのままGO
         scrollTo(0, 0);
         setScroll('#'+incomingHash);
       }
     }
   }

   // イベントを追加する関数
   function addEvent(eventTarget, eventName, func){
     if(eventTarget.addEventListener){
       // モダンブラウザ
       eventTarget.addEventListener(eventName, func, false);
     }else if(window.attachEvent){
       // IE
       eventTarget.attachEvent('on'+eventName, function(){func.apply(eventTarget);});
     }
   }
   
   function setOnClickHandler(){
     var links = d.links;
     for(var i=0; i<links.length; i++){
       // ページ内リンクならスクロールさせる
       var link = links[i];
       var splitLinkHref = link.href.split('#');
       if(currentHref_WOHash == splitLinkHref[0] && d.getElementById(splitLinkHref[1])){
         addEvent(link, 'click', startScroll);
       }
     }
   }

   function startScroll(event){
     // リンクのデフォルト動作を殺す
     if(event){ // モダンブラウザ
       event.preventDefault();
       //alert('modern');
     }else if(window.event){ // IE
       window.event.returnValue = false;
       //alert('ie');
     }
     // thisは呼び出し元になってる
     setScroll(this.hash);
   }

   function setScroll(hash){
     // ハッシュからターゲット要素の座標をゲットする
     var targetEle = d.getElementById(hash.substr(1));
     if(!targetEle)return;
     //alert(scrollSize.height);
     // スクロール先座標をセットする
     var ele = targetEle;
     var x = 0;
     var y = 0;
     while(ele){
       x += ele.offsetLeft;
       y += ele.offsetTop;
       ele = ele.offsetParent;
     }
     var maxScroll = getScrollMaxXY();
     targetX = Math.min(x, maxScroll.x);
     targetY = Math.min(y, maxScroll.y);
     targetHash = hash;
     // スクロール停止中ならスクロール開始
     if(!scrolling){
       scrolling = true;
       scroll();
     }
   }

   function scroll(){
     var currentX = d.documentElement.scrollLeft||d.body.scrollLeft;
     var currentY = d.documentElement.scrollTop||d.body.scrollTop;
     var vx = (targetX - currentX) * easing;
     var vy = (targetY - currentY) * easing;
     var nextX = currentX + vx;
     var nextY = currentY + vy;
     if((Math.abs(vx) < 1 && Math.abs(vy) < 1)
       || (prevX === currentX && prevY === currentY)){
       // 目標座標付近に到達していたら終了
       scrollTo(targetX, targetY);
       scrolling = false;
       location.hash = targetHash;
       prevX = prevY = null;
       return;
     }else{
       // 繰り返し
       scrollTo(parseInt(nextX), parseInt(nextY));
       prevX = currentX;
       prevY = currentY;
       setTimeout(function(){scroll()},interval);
     }
   }
   
   function getDocumentSize(){
     return {width:Math.max(document.body.scrollWidth, document.documentElement.scrollWidth), height:Math.max(document.body.scrollHeight, document.documentElement.scrollHeight)};
   }

   function getWindowSize(){
     var result = {};
     if(window.innerWidth){
       var box = d.createElement('div');
       with(box.style){
         position = 'absolute';
         top = '0px';
         left = '0px';
         width = '100%';
         height = '100%';
         margin = '0px';
         padding = '0px';
         border = 'none';
         visibility = 'hidden';
       }
       d.body.appendChild(box);
       var width = box.offsetWidth;
       var height = box.offsetHeight;
       d.body.removeChild(box);
       result = {width:width, height:height};
     }else{
       result = {width:d.documentElement.clientWidth || d.body.clientWidth, height:d.documentElement.clientHeight || d.body.clientHeight};
     }
     return result;
   }
   
   function getScrollMaxXY() {
     if(window.scrollMaxX && window.scrollMaxY){
       return {x:window.scrollMaxX, y:window.scrollMaxY};
     }
     var documentSize = getDocumentSize();
     var windowSize = getWindowSize();
     return {x:documentSize.width - windowSize.width, y:documentSize.height - windowSize.height};
   }
   
 }());

