//--------------------------------------K,Tori
function KT_subwin(theURL){
  window.open(theURL,'subwindow');
}
function open_ideaonline(theURL){
  window.open(theURL,'ideaonline');
}
function KT_winName(theURL,winName){
  window.open(theURL,winName);
}
function KT_mainwin(theURL){
  window.open(theURL,'subwindow');
  window.close();
}
function KT_miniwin(theURL,theSize){
  window.open(theURL,'miniwin','menubar=yes,scrollbars=yes,resizable=yes,status=yes,'+theSize);
}
function KT_miniwinTo(theURL,winName,theSize){
  window.open(theURL,winName,'menubar=no,scrollbars=yes,toolbar=no,location=yes,resizable=yes,status=yes,'+theSize);
}
function KT_fullwin(theURL){
  window.open(theURL,'fullwin','menubar=no,scrollbars=yes,resizable=yes,');
}
//--------------------------------------
function winOpen(){
    window.open("", "viewwindow");
    document.postform.target = "viewwindow";
}
//--------------------------------------
function historyback() {
	history.back();
}
//--------------------------------------
function focusColor(i){
	i.style.borderColor='#737373';
	i.style.backgroundColor='#FFFFFF';
}
function blurColor(i){
	i.style.borderColor='#979797';
	i.style.backgroundColor='#F9F7F5';
}
//--------------------------------------

//=======================================
function showblock(num) {
	if(document.all) {document.all("shblock" + num).style.display = "block";}
	else if(document.getElementById) {document.getElementById("shblock" + num).style.display = "block";}
}
function hideblock(num) {
	if(document.all) {document.all("shblock" + num).style.display = "none";}
	else if(document.getElementById) {document.getElementById("shblock" + num).style.display = "none";}
}
//=======================================
function showpara(num) {
   if(document.all) {
      document.all("answer" + num).style.display = "block";
      document.all("sw" + num + "a").style.display = "none";
      document.all("sw" + num + "b").style.display = "inline";
   } else if(document.getElementById) {
      document.getElementById("answer" + num).style.display = "block";
      document.getElementById("sw" + num + "a").style.display = "none";
      document.getElementById("sw" + num + "b").style.display = "inline";
   }
   //document.cookie="showhide=1";
}
//--------------------------------------
function hidepara(num) {
   if(document.all) {
      document.all("answer" + num).style.display = "none";
      document.all("sw" + num + "a").style.display = "inline";
      document.all("sw" + num + "b").style.display = "none";
   } else if(document.getElementById) {
      document.getElementById("answer" + num).style.display = "none";
      document.getElementById("sw" + num + "a").style.display = "inline";
      document.getElementById("sw" + num + "b").style.display = "none";
   }
	 //document.cookie="showhide=0";
}
//=======================================enter key block
 function BlockEnter(evt){
	evt = (evt) ? evt : event; 
	var charCode=(evt.charCode) ? evt.charCode : 
		((evt.which) ? evt.which : evt.keyCode);
	if ( Number(charCode) == 13 || Number(charCode) == 3) {
		return false;
	} else {
		return true;
	}
}
//--------------------------------------
  function attachBlockEnter(formid) {
	var elements = document.forms[formid].elements;
	for (var j=0; j < elements.length; j++) {
		var e = elements[j];	
		if (e.type == "text" || e.type == "password"){
			e.onkeypress=BlockEnter;
		}
	}
}
//=======================================スクロールしてページtopへ
var goTopMove = 20; // 加速度（0:停止〜大きいほど遅くなる）
function goTopKT() { // 距離取得と実行
	var yPos = document.body.scrollTop || document.documentElement.scrollTop;
	mObj(yPos);
	return false;
}
function mObj(y, s) { // 上に加速移動
	if (s) goTopMove = s;
	goTopPosi = parseInt(y - y * 4 / goTopMove);
	scrollTo(0, goTopPosi);
	if (goTopPosi > 0) setTimeout('mObj(goTopPosi, goTopMove)', 1);
}
//=======================================
window.focus();



