
allOpened = false;
function foldingMenu(evt) {

  if (evt.srcElement) { 
   /* IE or Safari or Opera or Google Chrome */ 
    obj = evt.srcElement; 
  } else if (evt.originalTarget) { 
   /* firefox */ 
    obj = evt.originalTarget; 
  } else { 
    ; /* なんだかよくわからないブラウザ */ 
  }

  if(!obj.id || obj.id.indexOf("li")!=0)return false;
  if(obj.id=="allopenbutton") {
    allOpen();return false
  }
  obj2 = "u" + obj.id;

  if(document.all) {
    if(!document.all(obj2))return false;
    obj2 = document.all(obj2);
/*    obj2.className = obj2.className== "open" ? "close" : "open";*/

    if (obj2.className.search(/open/) != -1) {
       obj2.className = obj2.className.replace(/open/, "close");
/*       window.status=document.all(obj.id).className + obj2.className; */
    } else if (obj2.className.search(/close/) != -1) {
       obj2.className = obj2.className.replace(/close/, "open");
/*       window.status=document.all(obj.id).className + obj2.className; */
    }

/*    obj.className = obj2.className;*/
  } else if(document.getElementById) {
    if(!document.getElementById(obj2))return false;
    obj2 = document.getElementById(obj2);
/*    obj2.className = obj2.className=="open" ? "close" : "open";*/
    if (obj2.className == "open") {
      obj2.className = obj2.className.replace("open", "close");
    } else if (obj2.className == "close") {
      obj2.className = obj2.className.replace("close", "open");
    }
/*    obj.className = obj2.className;*/
  }
}


function open_iblog_window() {
	window.open("http://knowledgepartners.blog95.fc2.com/");
}

function open_map_window() {
	window.open("http://maps.google.co.jp/maps?f=q&hl=ja&geocode=&q=%E5%90%8D%E5%8F%A4%E5%B1%8B%E5%B8%82%E4%B8%AD%E5%8C%BA%E9%8C%A62-18-5&sll=36.5626,136.362305&sspn=41.554201,55.986328&ie=UTF8&ll=35.168985,136.899111&spn=0.013068,0.018089&z=16&iwloc=addr");
}

/**
 * 画像サイズと合ったポップアップウィンドウを開く関数
 * @param src string ポップアップ表示する画像
 */
function openImageSizedWindow(src){
    var i = new Image(); 
    i.onload = function() {
        var pop_win = window.open(
                          "",
                          "_blank",
                          "width="+i.width+",height="+i.height+",scrollbars=no,resizable=yes"
                      );
        if ( pop_win ) {
            pop_win.window.document.open();
            pop_win.window.document.write(
             '<html>'
            +'<head><title>'+i.alt+'</title></head>'
            +'<body style="margin:0;padding:0;border:0;">'
            +'<img src="'+i.src+'" width="100%" alt="" />'
            +'</body>'
            +'</html>'
            );
            pop_win.window.document.close();
        } else {
            location.href = i.src;
        }
        i.onload = function(){};
    }
    i.src = src;
}

function disp(url){

	window.open(url);
	return false;

}

function calc_d(yyyy,mm,dd) {

	// http://www.red.oit-net.jp/tatsuya/java/birthda2.htmより
	//現在から、誕生日を引き、基準日に足す
	//つまり、現在から、誕生日の日にち分の時間だけ引く
	myNow   = new Date();
	myBirth = new Date(1970,0,dd);
	myBirth.setTime(myNow.getTime()-myBirth.getTime());

	//求めた年月日から基準日を引く
	myYear  = myBirth.getUTCFullYear() - yyyy;
	myMonth = myBirth.getUTCMonth() - (mm - 1);
	if(myMonth < 0){   //月がマイナスなので年から繰り下げ
		myYear --;
		myMonth += 12;
	}
	myDate  = myBirth.getUTCDate();

	document.write('特許実務経験、', myYear ,'</FONT>年', myMonth ,'</FONT>ヶ月と', myDate ,'</FONT>日。');

/*
	var now = new Date();
	var point = new Date(yyyy,mm,dd);

	if ( now.getMonth()>4) {
		var countyr = Math.ceil( now.getYear() - point.getYear() );
		var countmt = Math.ceil( now.getMonth() - point.getMonth() );
		var countdy = Math.ceil( now.getDate() - point.getDate() );
		document.write('特許実務経験、', countyr ,'</FONT>年', countmt ,'</FONT>ヶ月と', countdy ,'</FONT>日。');
	} else {
		var countyr = Math.ceil( now.getYear() - point.getYear() -1);
		var countmt = Math.ceil( now.getMonth() - point.getMonth() +12);
		var countdy = Math.ceil( now.getDate() - point.getDate() );
		document.write('特許実務経験、', countyr ,'</FONT>年', countmt ,'</FONT>ヶ月と', countdy ,'</FONT>日。');
	}
*/
	/* UTF-8でファイルを保存すること */

}
