alertHonda = {
  
  resizeBg: function(){
    var w = document.body.clientWidth / 2;
    popWidth = document.getElementById('alertMain').offsetWidth;
    popHeight = document.getElementById('alertMain').offsetHeight;
    var ww = popWidth / 2;
    var www = w - ww;
    document.getElementById('alertMain').style.left = w - ww;
    //document.getElementById('alertMain').style.top = document.body.scrollTop + 100;
    document.getElementById('alertBg').style.top = document.body.scrollTop;
    document.getElementById('alertBg').style.background.top = document.body.scrollTop;
  },
  
  showBox: function(){
    document.getElementById('alertBg').style.display = 'block';
    document.getElementById('alertMain').style.display = 'block';
    alertHonda.resizeBg();
    alertHonda.addLoadListener('resize', alertHonda.resizeBg);
    alertHonda.addLoadListener('scroll', alertHonda.resizeBg);
  },

  setCookie: function(name,value,days,path,domain,secure){
    var today = new Date();
    var expires = '';
    path = "/";
    document.cookie = name + "=" + escape(value) +
    ((expires) ? ";expires=" + expires.toGMTString() : "") +
    ((path) ? ";path=" + path : "") +
    ((domain) ? ";domain=" + domain : "") +
    ((secure) ? ";secure" : "");
     
    document.getElementById('alertBg').style.display = 'none';
    document.getElementById('alertMain').style.display = 'none';
  },
  
  getCookie: function(){
    var c = /noAlert=1/.test(document.cookie);
    if(!c){
      alertHonda.showBox();
    }
  },
  
  addLoadListener: function(ev, fn){
    if(typeof window.addEventListener != 'undefined'){
      window.addEventListener(ev, fn, false);
    }
    else if(typeof document.addEventListener != 'undefined'){
      document.addEventListener(ev, fn, false);
    }
    else if(typeof window.attachEvent != 'undefined'){
      window.attachEvent('on' + ev, fn);
    }
    else{
      var oldfn = window.onload;
      if(typeof window.onload != 'function'){
        window.onload = fn;
      }
      else{
        window.onload = function(){
        oldfn();
        fn();
        }
      }
    }
  }
}
alertHonda.addLoadListener('load', alertHonda.getCookie);