﻿var currentId = "";
function showMenu (e, id) {
    if(!document.getElementById) return;
    if(currentId == id) return;
    closeMenu();
    var obj = document.getElementById(id);
    var x = e.clientX + scrollLeft();
    var y = e.clientY + scrollTop();
    obj.style.visibility = "visible";
    currentId = id;
}
function closeMenu () {
    if(!document.getElementById) return;
    if(!currentId) return;
    var obj = document.getElementById(currentId);
    obj.style.visibility = "hidden";
    currentId = "";
}
function bodyClick (e) {
    closeMenu();
}
if(document.getElementById)
    document.onclick = bodyClick;

function scrollLeft () {
    if(window.pageXOffset)
        return window.pageXOffset;
    if(document.compatMode == "CSS1Compat")
        return document.body.parentNode.scrollLeft;
    if(document.body.scrollLeft)
        return document.body.scrollLeft;
    return 0;
}
function scrollTop () {
    if(window.pageYOffset)
        return window.pageYOffset;
    if(document.compatMode == "CSS1Compat")
        return document.body.parentNode.scrollTop;
    if(document.body.scrollTop)
        return document.body.scrollTop;
    return 0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function CloseWin(){
window.close();
}



/* イベントリストへのリンク */

function event_list()
{
dt= new Date();
year=dt.getYear();
month=dt.getMonth()+1 
day=dt.getDate()
 if (month<10){month="0" + month}
 if (navigator.appName.substring(0,8)=="Netscape"){year=year+1900; }
location = "http://www.karuizawa,or,jp/ed_list.php?y=" +year + "&m=" +month
}

/* イベントカレンダーへのリンク */
function event_cal()
{
dt= new Date();
year=dt.getYear();
month=dt.getMonth()+1 
day=dt.getDate()
 if (month<10){month="0" + month}
 if (navigator.appName.substring(0,8)=="Netscape"){year=year+1900; }
location = "http://www.karuizawa,or,jp/ed_cal.php?y=" +year + "&m=" +month
}




/* デジタルカタログの起動 */

function openNewWindow(URLtoOpen, windowName, windowFeatures) { 
			newWindow=window.open(URLtoOpen, windowName, windowFeatures);
		}