d = new Date(); 
// _HpbJumpURL: 指定したURLにジャンプします。
function _HpbJumpURL(url) 
{
  if (url != '')
  {
    window.location = url;
  }
}
// _HpbJumpURLinNewWindow: 新規ウィンドウを開いて指定したURLにジャンプします。
function _HpbJumpURLinNewWindow(url) 
{
  if (url != '')
  {
    window.open(url, '_blank');
  }
}
/* IFrameの高さをリサイズする */;
function resizeIFrame(){;
	var wnd = document.getElementById('iframe_id').contentWindow;
	var the_height = wnd.document.body.scrollHeight;
	var the_width = 650;
	var this_height = document.body.scrollHeight;
	var this_width = document.body.scrollWidth;
	//alert("the_height="+the_height+",this_height="+this_height+",this_width="+this_width);
	this_height = this_height - 160;
	this_width = this_width - 300;
	if(this_height <= the_height){
		the_height = this_height;
	}else if(0==the_height){
		the_height = 40;
	}
	if(640 > this_width){
		the_width = this_width;
	}
	document.getElementById('iframe_id').style.height = the_height+10;
	//document.getElementById('iframe_id').style.width = the_width;
	//scrollTo(0,0);
};
//-----------------------------------------------------------------------------
//kl_layer_moveto(id,x,y)/moveby(id,dx,dy)
//返り値：成功時は１失敗時は０
//id：対象となるレイヤー(オブジェクト)かそのID
//x,y：移動先の座標
//dx,dy：移動量
//-----------------------------------------------------------------------------
function kl_layer_moveto(id,x,y){
        var e=kl_getelem(id); if(!e) return 0;
        if(KL_NS4) e.moveTo(x,y);
        else if(document.getElementById){ e.style.left=x; e.style.top=y; }
        else if(document.all){ e.style.pixelLeft=x; e.style.pixelTop=y; }
        else return 0;
        return 1;
}
function kl_layer_moveby(id,dx,dy){
        var e=kl_getelem(id); if(!e) return 0;
        if(KL_NS4) e.moveBy(dx,dy);
        else if(document.getElementById){
                var x=kl_toint(e.style.left); if(isNaN(x)) return 0;
                var y=kl_toint(e.style.top ); if(isNaN(y)) return 0;
                e.style.left=x+dx;
                e.style.top =y+dy;
        }
        else if(document.all){ e.style.pixelLeft+=dx; e.style.pixelTop+=dy; }
        else return 0;
        return 1;
}

//-----------------------------------------------------------------------------
//kl_layer_setpos(id,pos,check)
//返り値：移動時は１失敗時は０
//id：対象となるレイヤー(オブジェクト)かそのID
//pos：位置を次の形式で指定 "[left/center/right(:px)]_[top/center/bottom(:px)](_absolute)"
//check：実際に移動が必要な場合にのみ移動を実行し１を返す(略可)
//-----------------------------------------------------------------------------
function kl_layer_setpos(id,pos,check){
        if(pos=="center") return kl_layer_setpos_raw(id,pos,pos,0,0,0,check);

        var posx,posy; var dx=0; var dy=0; var is_abs=0;
        var v,t;
        v=pos.split("_");
        t=v[0].split(":"); posx=t[0]; if(t.length>=2) dx=parseInt(t[1])
        t=v[1].split(":"); posy=t[0]; if(t.length>=2) dy=parseInt(t[1])
        if(v.length>=3) if(v[2]=="absolute") is_abs=1;
        return kl_layer_setpos_raw(id,posx,posy,is_abs,dx,dy,check);
}
function kl_layer_centralize(id,check){
        return kl_layer_setpos_raw(id,"center","center",0,0,0,check);
}
//オンマウスで説明文を表示
function up(text){
	document.getElementById('te').innerHTML=text;
	set.style.posLeft =document.body.scrollLeft+window.event.clientX+0;
	//set.style.posLeft =document.body.scrollLeft;
	set.style.posTop =document.body.scrollTop+window.event.clientY-80;
	document.all('set').style.display="block";
}
function down(text){
	document.getElementById('te').innerHTML=text;
	set.style.posLeft = 0;
	set.style.posTop = 90;
	document.all('set').style.display="block";
}
function kes(){document.all('set').style.display="none";}
//スライドを消す
function kesu(para){
	//if(document.all[ para ].style.display==none){
	//	document.all[ para ].style.display="block";
	//}else{
		document.all[ para ].style.display="none";
	//}
}
//スライドを表示
function tuku(para){
	document.all[ para ].style.display="block";
}
//サブウインドウを開く
function m_win(url,windowname,width,height,bar) {
 var features;
 if (bar==0) {
  features="location=no, menubar=no, status=yes, scrollbars=no, resizable=yes, toolbar=no";
 } else {
  features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no";
 }
 if (width) {
  if (window.screen.width > width)
   features+=", left="+(window.screen.width-width)/2;
  else width=window.screen.width;
  features+=", width="+width;
 }
 if (height) {
  if (window.screen.height > height)
   features+=", top="+(window.screen.height-height)/2;
  else height=window.screen.height;
  features+=", height="+height;
 }
 window.open(url,windowname,features);
}

//展開・省略
function CheckMenu1( tName1,para ){
	if(para == 1){
		tName1 = document.all[ tName1 ].style;
		tName1.display = "block";
	}else{
		tName1 = document.all[ tName1 ].style;
		tName1.display = "none";
	}
}
//展開・省略、2div切替仕様
function CheckMenu2( tName1,tName2,para ){
	if(para == 0){
		tName1 = document.all[ tName1 ].style;
		tName2 = document.all[ tName2 ].style;
		tName1.display = "block";
		tName2.display = "none";
	}else{
		tName1 = document.all[ tName1 ].style;
		tName2 = document.all[ tName2 ].style;
		tName1.display = "none";
		tName2.display = "block";
	}
}

