//p = console.log;

$(function(){
  var conf = {
    className : 'btn',
    postfix : '_on'
  };
  $('.'+conf.className).each(function(){
    this.originalSrc = this.src;
    this.rolloverSrc = this.originalSrc.replace(/(\.gif|\.jpg|\.png)/, conf.postfix+"$1");
    preloadImage(this.rolloverSrc);
  }).hover(function(){
    this.src = this.rolloverSrc;
  },function(){
    this.src = this.originalSrc;
  });
});

//プリロード
preloadedImages = [];
function preloadImage(url){
	var p = preloadedImages;
	var l = p.length;
	p[l] = new Image();
	p[l].src = url;
}

/*画像フェード*/
$(function(){
	$(".fade").hover(
		function(){
			$(this).fadeTo(120, 0.7);
		},
		function(){
			$(this).fadeTo(120, 1.0);
		}
	);
});
/*
function rsvWin() {
	window.open('/reservation/', 'reservation', 'width=740, height=500, menubar=no, toolbar=no, scrollbars=yes');
}
*/
