// $Id$
(function ($) {
  // aricle全体をリンクに
  Drupal.behaviors.headerLink = {
    attach: function (context, settings) {
      $('article.node-teaser header', context).click(function () {
        var anchorTags = this.getElementsByTagName("a");
        window.location = anchorTags[0].href;
      });
    }
  };
  
  // 特徴をAJAXで絞り込み検索
  Drupal.behaviors.ajaxFeatureFilter = {
    attach: function (context, settings) {
      $("#views-exposed-form-search-page .subject", context).click(function () {
        // $("#edit-submit-search").click();
      });
    }
  };
  
  // 賃貸空き室情報をcolorbox
  Drupal.behaviors.DetailColorbox = {
    attach: function (context, settings) {
      try{
        $(".rent_colorbox").each(function() {
            nid = $(this).attr("alt");
            $(this).colorbox({inline:true, href:"#rent_body_" + nid});
            }
          );
      }catch( e ){
        alert( e );  // バグの内容をダイアログで表示する
      }
    }
  };
  
  // サポートチャットをcolorbox
  Drupal.behaviors.SupportChatColorbox = {
    attach: function (context, settings) {
      try{
        $(".supportchat").each(function() {
              $(this).colorbox();
            }
          );
      }catch( e ){
        alert( e );  // バグの内容をダイアログで表示する
      }
    }
  };
      
})(jQuery);
;

