﻿function MM_openBrWindow(theURL,winName,features) { //v2.0
 window.open(theURL,winName,features);
}
// マウスオーバー
function initRollOverImages() {
  var image_cache = new Object();
  $("img.swap").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_on;
    $(this).hover(
      function() { this.src = imgsrc_on; },
      function() { this.src = imgsrc; });
  });
}


// スムーススクロール
$(document).ready(function() {
 $("body").ScrollToAnchors(300);
 $('.BTN').click(function(){
		location.href = this.href;
	   	return false;
	   	});

});

// _blank
function initOpenNewWindow() {
var popupEvent = function(event) {
		var option = this.href.replace(/^[^\?]+\??/,'').replace(/&/g, ',');
		if(option!=null){
		window.open(this.href, this.rel, option).focus();
		}else if(option==null){
		window.open(this.href);
		}
		event.preventDefault();
		event.stopPropagation();
	}
	$("a.popup").each(function(i) {
		$(this).click(popupEvent);
		$(this).keypress(popupEvent);
	});
}

$(document).ready(initOpenNewWindow);
$(document).ready(initRollOverImages);


