// mouseover script
// @param なし
// @return なし
jQuery(function imgOver() {
    jQuery('img, form input:image').each(function() {
        var node = this;
        if(node.src.match("_off.")) {
            node.originalSrc = node.src;
            node.temporarySrc = node.originalSrc.replace(/_off/,'');
            node.rolloverSrc = node.temporarySrc.replace(/(\.gif|\.jpg|\.png)/,'_on'+"$1");
            node.activeSrc = node.temporarySrc.replace(/(\.gif|\.jpg|\.png)/,'_active'+"$1");
            //画像のプリロード処理開始
            preloadImage(node.rolloverSrc);
            //Mouseover
            node.onmouseover = function() {
                if(this.className!='active') {
                    this.src = this.rolloverSrc;
                }
            }
            //Mouseout
            node.onmouseout = function() {
                if(this.className!='active') {
                    this.src = this.originalSrc;
                }
            }
        }
    });
});

// 画像のプリロードを行う関数
// @param string 画像のパス
// @return なし
preloadImages = [];
preloadImage = function(path) {
    var pre = preloadImages;
    var len = pre.length;
    pre[len] = new Image();
    pre[len].src = path;
}


//データ表示テーブルの最後のthとtdにクラスを追加
/*
jQuery(function addTrClass() {
    jQuery('table tr:first-child td').addClass('top');
    jQuery("table tr:last-child td").addClass('bot');
});
*/

//外部リンクにクラス名「external」、target="_blank"を追加
jQuery(function addBlankExtLink() {
    var selfDomain = document.domain;
    jQuery('a').each(function() {
        if((this.href.indexOf(selfDomain)==-1) && (this.href.indexOf('mailto')==-1) && (this.href.indexOf('http://www.adobe.com/')==-1)) {
            jQuery(this).addClass('external');
            jQuery(this).attr('target','_blank');
        }
    });
});

//ページスクロール
jQuery(function pagetop() {
        jQuery('#pagetop a').click(function () {
            jQuery(this).blur();

			if (window.opera)
			{
				jQuery('html').animate({ scrollTop: 0 }, 'fast');
			}else{
				jQuery('html,body').animate({ scrollTop: 0 }, 'fast');
			}
            return false;
        });
});


//店舗写真
jQuery(document).ready( function() {
jQuery(".shop_photo_thumb a").click( function() {
  var changeSrc = jQuery(this).attr("href");
  var changeTxt = jQuery(this).attr("title");
  jQuery(".target img").attr("src", changeSrc);
  jQuery(".targtxt").html(changeTxt);
  return false;
});
})

//プルダウン
function navi(obj) {
 url = obj.options[obj.selectedIndex].value;
 if(url != "") {
   location.href = url;
  }
}

//料金表
function Open30(){
	    win=window.open("/images/mainteprice30.gif","new","resizable=yes,menubar=no,directories=no,status=no,location=no,scrollbars=no,toolbar=no,width=620,height=205,left=10,top=10");
}
function Open24(){
	    win=window.open("/images/mainteprice241812.gif","new","resizable=yes,menubar=no,directories=no,status=no,location=no,scrollbars=no,toolbar=no,width=620,height=595,left=10,top=10");
}
function OpenShaken(){
	    win=window.open("/images/mainteprice_shaken.gif","new","resizable=yes,menubar=no,directories=no,status=no,location=no,scrollbars=no,toolbar=no,width=620,height=795,left=10,top=10");
}
