
// 株式会社ALBERT
// ポップアップメニュー　左メニュー用

// ポップアップメニュー入口

var openedMenu = null;
var submenuTimer;

function menuOvr(id){
  if (openedMenu && openedMenu != id){
    CloseMenu(id);
  }
  OpenMenu(id);
}

function OpenMenu(id){
  var pTop, pLeft;
  if(id == 'menu01') { pTop = 320;}
  if(id == 'menu02') { pTop = 357;}
  if(id == 'menu03') { pTop = 394;}
  if(id == 'menu04') { pTop = 431;}
  if(id == 'menu05') { pTop = 467;}
  if(id == 'menu06') { pTop = 503;}
  if(id == 'menu07') { pTop = 539;}
  if(id == 'menu08') { pTop = 675;}

  if ( document.all ){
    if(document.body.clientWidth > 780){
      pLeft = ((document.body.clientWidth - 780) / 2) + 180 ;
    }else{
      pLeft = 180 ;
    }
    document.all( id ).style.posTop = pTop; 
    document.all( id ).style.posLeft = pLeft; 
    document.all( id ).style.visibility = 'visible';
  }else if ( document.getElementById ){
    if(innerWidth > 780){
      pLeft = ((innerWidth - 780) / 2) + 172;
    }else{
      pLeft = 180;
    }
    document.getElementById( id ).style.top = pTop +"px"; 
    document.getElementById( id ).style.left = pLeft +"px"; 
    document.getElementById( id ).style.visibility = 'visible';
  }else if ( document.layers ){
    if(innerWidth > 780){
      pLeft = ((innerWidth - 780) / 2) + 180;
    }else{
      pLeft = 180;
    }
    document.layers[ id ].moveTo(pLeft, pTop); 
    document.layers[ id ].visibility = 'show';
  }
  clearTimeout(submenuTimer);
  openedMenu = id;
}

function CloseMenu(){ 
  if ( document.all ){
    document.all( openedMenu ).style.visibility = 'hidden';
  }else if ( document.getElementById ){
    document.getElementById( openedMenu ).style.visibility = 'hidden';
  }else if ( document.layers ){
    document.layers[ openedMenu ].visibility = 'hide';
  }
  openedMenu = null;
}

// ポップアップメニュー　ここまで

// プリロードイメージ用　スクリプト入口

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// プリロードイメージ用　スクリプトここまで
