//上部ダイアログ：オープン／クローズ処理 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

$(document).ready(function() {	

 //select all the a tag with name equal to modal
 $('a[name=modal]').click(function(e) {

  //Cancel the link behavior
  e.preventDefault();

  //aタグを取得
  var id = $(this).attr('href');
  
  //スクリーンの幅と高さを取得
  var maskHeight = $(document).height();
  var maskWidth = $(window).width();

  //Set heigth and width to mask to fill up the whole screen
  $('#mask').css({'width':maskWidth,'height':maskHeight});
		
  //背景のフェードイン：速度、不透明度
  $('#mask').fadeIn(200);
  $('#mask').fadeTo("200",0.7);

  //スクリーンの幅と高さをセット
  var winH = $(window).height();
  var winW = $(window).width();

  //ウィンドウの位置：真ん中へ
  $(id).css('top',  winH/2-$(id).height()/2 + 420);
  $(id).css('center', winW/2-$(id).width()/2);

  //ダイアログのフェードイン：速度
  $(id).fadeIn(400);

  //フラッシュ消去
  $('#FlashID').css("display","none");

 });


 //閉じる処理
 $('.window .close').click(function (e) {

  //Cancel the link behavior
  e.preventDefault();

  $('#mask').hide();
  $('.window').hide();
  $('#FlashID').css("display","");
 });


 //背景がクリックされたときの処理
 $('#mask').click(function () {
  $(this).hide();
  $('.window').hide();
  $('#FlashID').css("display","");
 });

});


//ご葬儀の疑問ダイアログ：オープン／クローズ処理 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

$(document).ready(function() {	

 //select all the a tag with name equal to modal
 $('a[name=modal2]').click(function(e) {

  //Cancel the link behavior
  e.preventDefault();

  //aタグを取得
  var id = $(this).attr('href');
  
  //スクリーンの幅と高さを取得
  var maskHeight = $(document).height();
  var maskWidth = $(window).width();

  //Set heigth and width to mask to fill up the whole screen
  $('#mask').css({'width':maskWidth,'height':maskHeight});
		
  //背景のフェードイン速度、不透明度
  $('#mask').fadeIn(200);
  $('#mask').fadeTo("200",0.7);

  //スクリーンの幅と高さをセット
  var winH = $(window).height();
  var winW = $(window).width();

  //ウィンドウの位置：真ん中へ
  $(id).css('top',  winH/2-$(id).height()/2 + 3750);
  $(id).css('center', winW/2-$(id).width()/2);

  //ダイアログのフェードイン速度
  $(id).fadeIn(400);

  //フラッシュ消去
  $('#FlashID').css("display","none");

 });


 //閉じる処理
 $('.window .close').click(function (e) {

  //Cancel the link behavior
  e.preventDefault();

  $('#mask').hide();
  $('.window').hide();
  $('#FlashID').css("display","");
 });


 //背景がクリックされたときの処理
 $('#mask').click(function () {
  $(this).hide();
  $('.window').hide();
  $('#FlashID').css("display","");
 });

});


//お客様の声ダイアログ：オープン／クローズ処理 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

$(document).ready(function() {	

 //select all the a tag with name equal to modal
 $('a[name=modal3]').click(function(e) {

  //Cancel the link behavior
  e.preventDefault();

  //aタグを取得
  var id = $(this).attr('href');
  
  //スクリーンの幅と高さを取得
  var maskHeight = $(document).height();
  var maskWidth = $(window).width();

  //Set heigth and width to mask to fill up the whole screen
  $('#mask').css({'width':maskWidth,'height':maskHeight});
		
  //背景のフェードイン速度、不透明度
  $('#mask').fadeIn(200);
  $('#mask').fadeTo("200",0.7);

  //スクリーンの幅と高さをセット
  var winH = $(window).height();
  var winW = $(window).width();

  //ウィンドウの位置：真ん中へ
  $(id).css('top',  winH/2-$(id).height()/2 + 3300);
  $(id).css('center', winW/2-$(id).width()/2);

  //ダイアログのフェードイン速度
  $(id).fadeIn(400);

  //フラッシュ消去
  $('#FlashID').css("display","none");

 });


 //閉じる処理
 $('.window .close').click(function (e) {

  //Cancel the link behavior
  e.preventDefault();

  $('#mask').hide();
  $('.window').hide();
  $('#FlashID').css("display","");
 });


 //背景がクリックされたときの処理
 $('#mask').click(function () {
  $(this).hide();
  $('.window').hide();
  $('#FlashID').css("display","");
 });

});

