$(function() {
  var classNames = {
    hide : 'hide',
    visible : 'visible'
  };
  var mobile_phone = $('#mobile_phone'),
      outerLink = $('#enter, #box_section h1'),
      fitButton = function() {
        var body = $("body"),
            x = body.outerWidth(),
            y = body.outerHeight();

        if(x < 600 || y < 480){
          mobile_phone.removeClass(classNames.hide).addClass(classNames.visible); 
        } else {
          mobile_phone.removeClass(classNames.visible).addClass(classNames.hide);
        }
    };
  //mobile message
  $(window).resize(function(){
    if (!timer) {
      var timer = setTimeout(function () {
        fitButton();
      },55);
    } else {
      clearTimeout(timer);
    }
  });
  fitButton();

  //link—Ìˆæ‚Ì•’²®
  outerLink.click(function () {
    var $this = $(this),
        href = $this.children('a').attr('href');
    if (!href) {
      return false;
    } else {
      location.href = href;
      return false;
    }
  }).hover(function () {
    $(this).css({'opacity': '0.8','cursor': 'pointer'});
  },function () {
    $(this).css('opacity', '1');
  });
});




