function init(){
BrowserCheck();
}

function BrowserCheck(){

// Macチェック : true = macintosh, false = other os
macCheck = navigator.userAgent.indexOf('Mac')!=-1;
// MacMSIE5.12チェック : true = MSIE 5.12(mac), false = others
macIE512=navigator.userAgent.indexOf('MSIE 5.12')!=-1;
// ブラウザバージョンチェック
//        IE4 = 1, IE5+ = 2, NN4 = 3, NN6+ = 4, others = 0
browsVer = document.all?(document.getElementById?2:1)
		   :(document.getElementById?4 :(document.layers?3:0));
}

function PopMenu(divname,x,y,speed){
PopSizeX = x;
PopSizeY = y;
PopSpeed = speed;
PopDiv=getDivFromName(divname);
PopClip = 0;
PopMenuTIMEID=setTimeout("PopMenuMain()",50);
}

function MenuHide(divname){
PopDiv=getDivFromName(divname);
setDivVisibility(PopDiv,false);
clearInterval(PopMenuTIMEID);
}

function setDivVisibility(div,visible){
if(browsVer==4 || browsVer==2 || browsVer==1){
div.style.visibility=(visible)?'inherit':'hidden';
return;
}
if(browsVer==3){
div.visibility      =(visible)?'inherit':'hide';
return;
}
}

function getDivFromName(nm){
if(browsVer==4 || browsVer==2) return document.getElementById(nm);
if(browsVer==1)            return document.all(nm);
if(browsVer==3){
var s='';
for(var i=1; i<arguments.length; i++)
s+='document.layers.'+arguments[i]+'.';
return eval(s+'document.layers.'+nm);
}
return null;
}

function setDivZIndex(div,order){
if(browsVer==4 || browsVer==2 || browsVer==1){
div.style.zIndex=order;
return;
}
if(browsVer==3){
div.zIndex      =order;
return;
}
}

function PopMenuMain(){
PopClip = PopClip + (PopSizeY / PopSpeed);
setDivVisibility(PopDiv,true);
setDivClip(PopDiv,0,PopSizeX,PopClip,0);
if(PopClip >= PopSizeY){
clearTimeout(PopMenuTIMEID);
}else{
	PopMenuTIMEID=setTimeout("PopMenuMain()",50);
}
}

function setDivClip(div,top,right,bottom,left){
if(browsVer==4 || browsVer==2 || browsVer==1){
div.style.clip=
'rect('+top+'px '+right+'px '+bottom+'px '+left+'px)';
return;
}
if(browsVer==3){
div.clip.top   =top;   div.clip.right=right;
div.clip.bottom=bottom;div.clip.left =left;
return;
}
}

//サブメニュー
function PopMenu2(divname){
	PopDiv=getDivFromName(divname);
	setDivVisibility(PopDiv,true);
	setDivClip(PopDiv,0,PopSizeX,PopSizeY,0);
}

function MenuHide(divname){
	PopDiv=getDivFromName(divname);
	setDivVisibility(PopDiv,false);
	clearInterval(PopMenuTIMEID);
}