﻿/*                                                             */
/*                     junmoving.co.jp                         */
/*                                                             */
/*                        公開ページ                           */
/*                Javascript関数定義 [共通]                    */
/*                                                             */
/*         2011 (c) e-pokke Inc.  All rights reserved.         */
/*                                                             */

// ----- 送信・変更時の確認 -----
var change_flag = 0;
var send_flag = 0;

function check_submit() {
  if ( send_flag == 1 ) {
    alert('ただいま送信中です。\n「OK」ボタンをクリックしてお待ちください。');
    return false;
  }

  send_flag = 1;

  return true;
}

// ----- ミニカレンダーの表示 -----
function view_mini_calendar(ym) {
  new Ajax.Updater(
    'cal-mini' ,
    '/mitumori/mini_calendar.cgi' ,
    { method     : 'post' ,
      parameters : 'Mode=view&ym=' + ym ,
      onFailure  : function() {
        $( 'cal-mini' ).innerHTML = '通信エラーが発生しました。';
      }
    }
  );
}

// ----- ブログリストの表示 -----
function view_blog_list() {
  new Ajax.Updater(
    'BlogBox' ,
    '/side2_new01_blog.php' ,
    { method     : 'get' ,
      parameters : '' ,
      onFailure  : function() {
        $( 'BlogBox' ).innerHTML = '通信エラーが発生しました。';
      }
    }
  );
}

// ----- 指定エリアの表示・非表示(visibility) -----
function change_visibility(id) {
  obj = $(id);
  if ( obj ) {
    if ( obj.style.visibility == 'hidden' || obj.style.visibility == '' ) {
      obj.style.visibility = 'visible';
    }
    else {
      obj.style.visibility = 'hidden';
    }
  }
}

// ----- 別ウィンドウの表示 -----
function openwin(url,width,height,target) {
  if (url != '') {
    var x = parseInt( window.screen.width/2-width/2 );
    var y = parseInt( window.screen.height/2-height/2 );
    window.open(url,target,"toolbar=no,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height+",left="+x+",top="+y+",screenX="+x+",screenY="+y);
  }
}

// ---------- End of File ----------

