
var Global = Class.create();

Global.prototype = {
  // コンストラクタ
  initialize: function(){

  },
  group_list: function(){
    $('mainContent').innerHTML ="";
    new Ajax.Request( 'global_group_list.php',
		      {
                        method: 'post',
                        onComplete: getResponse
		      });
    function getResponse(req){
      $('mainContent').innerHTML = req.responseText;
    }
  },
  news_detail: function(_id){
    var $params = "id=" + _id;
    new Ajax.Request( 'global_news.php',
		      {
                        method: 'post',
                        postBody: $params,
                        onComplete: getResponse
		      });
    function getResponse(req){
      $('news_detail_zone').innerHTML = req.responseText;
      $('bodyMain').style.display = "none";
    }
  },
  return_top: function(){
    $('news_detail_zone').innerHTML = "";
    $('bodyMain').style.display = "block";

  },
  logout: function(){
    new Ajax.Request( 'logout.php',
		      {
                        method: 'get',
                        onComplete: getResponse
		      });
    function getResponse(req){
      location.href="./index.php";
    }

  },
  blog_list: function(){
    $('mainContent').innerHTML ="";
    new Ajax.Request( 'global_blog_list.php',
		      {
                        method: 'post',
                        onComplete: getResponse
		      });
    function getResponse(req){
      $('mainContent').innerHTML = req.responseText;
    }
  },
  event_list: function(_date){
    $('mainContent').innerHTML ="";
    if( _date ){
      var $params = "date=" + _date;
    }else{
      var $params = "years=" + $('current_years').value;
    }
    new Ajax.Request( 'global_event_list.php',
		      {
                        method: 'post',
                        postBody: $params,
                        onComplete: getResponse
		      });
    function getResponse(req){
      $('mainContent').innerHTML = req.responseText;
    }
  },
  event_list2: function( _years ){
    var $params = "years=" + _years;
    new Ajax.Request( 'global_event_list.php',
		      {
                        method: 'post',
                        postBody: $params,
                        onComplete: getResponse
		      });
    function getResponse(req){
      $('mainContent').innerHTML = req.responseText;
    }
  },
  comment_list: function(){
    new Ajax.Request( 'global_comment_list.php',
		      {
			method: 'post',
			onComplete: getResponse
		      });
    function getResponse(req){
      $('mainContent').innerHTML = req.responseText;
    }
  }
};

var global = new Global();