﻿// 画像の先読み
var tmp = new Array(
  "menu_sp",
  "menu_printing",
  "menu_marketing",
  "menu_sign",
  "menu_av",
  "menu_web");

var img = new Array();
for (i = 0; i < (tmp.length * 2)+1; i++){
  img[tmp[i]] = new Image();
  img[tmp[i]].src = '/skins/fp/img/' + tmp[i] + '.gif';
  var hover = tmp[i] + '_hover';
  img[hover] = new Image();
  img[hover].src = '/skins/fp/img/' + tmp[i] + '_hover' + '.gif';
}

var rollover = {
  '#menu-sp img' : function(element){
    element.onmouseover = function(){
      this.src = img["menu_sp_hover"].src;
    };
    element.onmouseout = function(){
      this.src = img["menu_sp"].src;
    };
  },
'#menu-printing img' : function(element){
    element.onmouseover = function(){
      this.src = img["menu_printing_hover"].src;
    };
    element.onmouseout = function(){
      this.src = img["menu_printing"].src;
    };
  },
  '#menu-marketing img' : function(element){
    element.onmouseover = function(){
      this.src = img["menu_marketing_hover"].src;
    };
    element.onmouseout = function(){
      this.src = img["menu_marketing"].src;
    };
  },
  '#menu-sign img' : function(element){
    element.onmouseover = function(){
      this.src = img["menu_sign_hover"].src;
    };
    element.onmouseout = function(){
      this.src = img["menu_sign"].src;
    };
  },
  '#menu-av img' : function(element){
    element.onmouseover = function(){
      this.src = img["menu_av_hover"].src;
    };
    element.onmouseout = function(){
      this.src = img["menu_av"].src;
    };
  },
  '#menu-web img' : function(element){
    element.onmouseover = function(){
      this.src = img["menu_web_hover"].src;
    };
    element.onmouseout = function(){
      this.src = img["menu_web"].src;
    };
  }
};
	
Behaviour.register(rollover);
