
/**********************************************************
smartRollover

リンク画像のファイル名を_offと_onで書き出すだけでロールオーバー効果

thanks:  Author: LiosK  http://liosk.blog103.fc2.com/blog-entry-19.html
**********************************************************/

(function(onLoad) {
    try {
        window.addEventListener('load', onLoad, false);
    } catch (e) {
        window.attachEvent('onload', onLoad);
    }
})(function() {
    var over = function() { this.src = this.src.replace('_off.', '_on.'); };
    var out  = function() { this.src = this.src.replace('_on.', '_off.'); };
    var img = document.getElementsByTagName('img');
    for (var i = 0, l = img.length; i < l; i++) {
        if (!img[i].src.match(/_off\./)) continue;
        img[i].onmouseover = over;
        img[i].onmouseout  = out;
    }
});


/**********************************************************
 pageScroll jquery

ページをスムーズにスクロール（ href属性値が#で始まるものが対象 ）

**********************************************************/
function pageScroll() {
    $("a[href*=#]").click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 500);
                return false;
            }
        }
    });
}



$(document).ready(pageScroll); 


/**************************************************************

フォトイメージのスワップ用 jquery
旧サイトの商品ページ用　（2010/6末までの商品対象）

*******************************************************************/

$(function(){
    $("#thumPic a").click (function(){
        $(".zoom-small-image img").attr("src",$(this).attr("href"));
        return false;
    })
})

/*
$(function(){
    $("#thumPic a").click (function(){
        $("#mainPic img").attr("src",$(this).attr("href"));
        return false;
    })
})
*/

/***********************************************************/

$(document).ready(function(){
  var path_arr = document.URL.split('/');
  path_arr.shift();
  path_arr.shift();
  path_arr.shift();
  var link;
  while(path_arr.length){
    link=$('#navi').find('a[href^=/'+path_arr.join('/')+']');
    if(link.length){
      link.css({
        fontWeight: 'bold',
        color: 'red'
      });
      break;
    }
    path_arr.pop();
  }
});



