header.inc 10.9 KB
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; cahrset=EUC-JP">
<META http-equiv="Content-Style-Type" content="text/css">
<META name="Robots" content="noindex, nofollow">
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<!--[if lt IE 9 ]>
<META http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<![endif]-->

<link rel="stylesheet" type="text/css" href="basefont.css">
<link rel="stylesheet" type="text/css" href="./css/global.css">
<link rel="stylesheet" type="text/css" href="./css/header_menu.css">

<script type="text/javascript" src="./lib/jkl-calendar.js" charset="Shift_JIS"></script>

<script type="text/javascript" src="./lib/jslb_ajax.js"></script>
<script type="text/javascript" src="xmlhttp.js"></script>

<script type="text/javascript">

  var menu_flg = 0;

	function MovePage(URL) {
		location.href = URL;
	}

	function on_movepage(oj) {
		var res  =  oj.responseText;
		document.getElementById("main").innerHTML=res;
	}

  function on_loaded1(oj) {
    var res  =  oj.responseText;
    if(res!="IDERR" && res!="NotID"){

      document.getElementById("login").innerHTML=res;
      document.getElementById("err").innerHTML="";

      MovePage("TOP000.php");

    }else{
      if(res!="IDERR"){
        document.getElementById("err").innerHTML="ユーザーまたはパスワードを入力してください";
      }else{
        document.getElementById("err").innerHTML="ユーザーまたはパスワードが違います";
      }
    }
  }

function loadHTMLFile_Login(fName){
	httpObj = createXMLHttpRequest(displayData_Login);
	if (httpObj){
			httpObj.open(Get_BName(),fName,true);
			httpObj.send(null);
	}else{
	}

}

function onChangeBumon(GroupID,GroupPW){
	loadHTMLFile_Login('login_input.php?LoginID='+GroupID+'&Passwd='+GroupPW+'&group_bumon='+document.top.group_bumon.value);
}

function displayData_Login(){
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		if(httpObj.responseText=="GrpErr"){
			$("err").innerHTML= "グループIDまたはパスワードが違います。";
			$("syain_login").innerHTML = "";
			document.onkeypress = key_Press;
		}else{
			$("syain_login").innerHTML = httpObj.responseText;
			document.onkeypress = key_Press2;
			$("login").innerHTML = "";
			$("err").innerHTML=  "";
		}
		

		
	}else{
//		$("syain_login").innerHTML = "<b>Loading...</b>";
		$("err").innerHTML=  "<b>Loading...</b>";
	}
}

function openMainPage(pageURL){
	
      xmlhttp = createXMLHttp();
      if (xmlhttp){
       xmlhttp.onreadystatechange = setPageData();
       xmlhttp.open('GET', pageURL);
       xmlhttp.send(null);
      }else{
       alert("XMLHttpRequest失敗");
      }
}

function setPageData(){
 if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
  document.getElementById("main").innerHTML = xmlhttp.responseText;
 }else{
  document.getElementById("main").innerHTML = "読み込み中です.....";
 }
}

// XMLHttpsオブジェクト作成
function createXMLHttp(){
try {
 return new ActiveXObject ("Microsoft.XMLHTTP");
}catch(e){
 try {
  return new XMLHttpRequest();
 }catch(e) {
  return null;
 }
}
 return null;
}

var gX;
var gY;

function mousecursor(evt){ //関数の定義
	if(document.all){ //ここからIE用
		gX = event.x; 
		gY = event.y;
	}else{ //ここからNN用
		gX = evt.pageX;
		gY = evt.pageY
	}
	
}

if(document.all) document.onmousemove = mousecursor; //IE用
else if(document.layers){ //NN4.7用
window.onmousemove = mousecursor;
window.captureEvents(Event.MOUSEMOVE);}
else window.document.onmousemove = mousecursor; //NN6用

var mousemovetimer = -1;
var timer_stop;

  function on_loaded2(oj,margin){
    if(menu_flg==0){
	    Select_visibility(0);

	    //レスポンスを取得
			if (document.top.sub_name.length){
			    var res = document.top.sub_name[oj].value
			}else{
			    var res = document.top.sub_name.value
			}

	    //不透明度を0.7に設定
	    setOpacity("sub_menu",1.0)

	    //レスポンスされた文字列をDIVへ出力
	    document.getElementById("sub_menu").innerHTML=res;
    }
  }

  //送信用関数
  function loadMenu(num,margin){
    menu_flg=0;
    var elm = document.getElementById("pd_menu_" + num);
    var header_table = document.getElementById("header_table");
    var offsetLeft = elm.offsetLeft;
    var offsetTop = header_table.offsetHeight;

    margin = elm.offsetLeft;

    if(margin==-1000 || menu_flg !=0){
    	document.getElementById("sub_menu").style.display=none;
    	document.getElementById("sub_menu").innerHTML="";
            Select_visibility(1);
    }else{
    	document.getElementById("sub_menu").style.display="block";
    	
    	clearTimeout(mousemovetimer);
    	timer_stop=setTimeout("on_loaded2("+num+","+margin+")",100);
    	var browser = Get_BName();
        /*
    	if( browser == "POST"){
    		gX = event.clientX;
    		gY = event.clientY;
    	}
    	if(menu_flg==0){
    		marginx = gX;
    		sa = margin - marginx
    		if(sa> 10){
    			marginx= marginx
    		}else{
    			marginx= margin * 2
    		}
    		marginy = gY;
    		if(marginy>100){
    			marginy = marginy
    		}else{
    			marginy = 100
    		}

    	    //メニュー位置を移動
    	    document.getElementById("sub_menu").style.top=marginy
    	    document.getElementById("sub_menu").style.left=marginx
    	}
        */
        
        document.getElementById("sub_menu").style.left = offsetLeft + "px";
        document.getElementById("sub_menu").style.top = offsetTop + "px";
        document.getElementById("sub_menu").style.height = "auto";
    }
  }

  document.onclick=function(){

//     if(document.top.sub_name[0].value!=""){
	Select_visibility(1);
	document.getElementById("sub_menu").style.display="none";
	document.getElementById("sub_menu").innerHTML="";
//	document.getElementById("sub_menu").style.top="100px"
//	document.getElementById("sub_menu").style.left=-1000
//     }
	if(document.getElementById("calid") != null){
		document.getElementById("calid").style.display="none";
		document.getElementById("calid").innerHTML="";
	}
	if(document.getElementById("calid2") != null){
		document.getElementById("calid2").style.display="none";
		document.getElementById("calid2").innerHTML="";
	}
	if(document.getElementById("calid3") != null){
		document.getElementById("calid3").style.display="none";
		document.getElementById("calid3").innerHTML="";
	}
	if(document.getElementById("calid4") != null){
		document.getElementById("calid4").style.display="none";
		document.getElementById("calid4").innerHTML="";
	}
	if(document.getElementById("calid5") != null){
		document.getElementById("calid5").style.display="none";
		document.getElementById("calid5").innerHTML="";
	}
  }


  function sub_menu_disp(flg) {
     if(flg==0){
	Select_visibility(1);
	document.getElementById("sub_menu").style.display="none";
	document.getElementById("sub_menu").innerHTML="";
     }else{

     }	
     window.status=document.getElementById("sub_menu").innerHTML;

  }


  //クロスブラウザ不透明度設定関数 //2006.3 Opera9bpr2対応
  function setOpacity(layName,arg) {
    var ua = navigator.userAgent
    var oj = document.getElementById(layName)
    if(window.opera){//o9bpr2+
       if((typeof oj.style.opacity)=='string') oj.style.opacity = arg
       else return
    } else if(ua.indexOf('layName') !=-1 || ua.indexOf('layName') !=-1 || 
       (typeof oj.style.opacity)=='string') { //s,k,new m
        oj.style.opacity = arg
    } else if(document.all) {          //win-e4,win-e5,win-e6
        document.all(layName).style.filter="alpha(opacity=0)"
        document.all(layName).filters.alpha.Opacity  = (arg * 100)
    } else if(ua.indexOf('Gecko')!=-1){ //n6,n7,m1
        oj.style.MozOpacity = arg
    } else return
  }
  
  //クロスブラウザフェイド関数
  function fadeOpacity(layName,swt,stopOpacity){
    
    if(!window.fadeOpacity[layName]) //カウンター初期化
      fadeOpacity[layName] =0 
    //フェイドスイッチ引数省略時初期値(不透明から透明へ)
    if(!arguments[1]) swt = -1
    //引数swtが -1 なら不透明から透明へ
    //           1 なら透明から不透明へフェイドする
    if(swt==-1)        var f  = "9876543210"
    else if(swt==1)    var f  = "0123456789"
    else               var f  = "9876543210"
    //停止不透明度引数省略時初期値
    if(!arguments[2] && swt==-1)     stopOpacity = 0
    else if(!arguments[2] && swt==1) stopOpacity = 10

    //フェイド処理    
    if( fadeOpacity[layName] < f.length-1 ){
      //カウンター番目の文字列を取り出す
      var opa = f.charAt(fadeOpacity[layName])/10
      //終了時不透明度なら終了
      if( opa == stopOpacity ){
        setOpacity(layName,stopOpacity)  //終了
        fadeOpacity[layName] = 0     //リセット
        return
      }
      // 不透明度変更を実行する
      setOpacity(layName,opa)
      // カウンターを加算
      fadeOpacity[layName]++
      //--50/1000秒後にfadeOpacityを再実行
      setTimeout('fadeOpacity("'+layName+'","'+swt+'","'+stopOpacity+'")',50)
    } else {
      //終了
      setOpacity(layName,stopOpacity)
      //--リセット
      fadeOpacity[layName] = 0
    }
  }

//文字置換
function subRepURI(str){

	if(str.length > 0){
		subRephan = "—ソЫ噂浬欺圭構蚕十申曾箪貼能表暴予禄兔喀媾彌拿杤歃濬畚秉綵臀藹觸軆鐔饅鷭";
		//subRephan = "1234567890";
		subRepstrTemp = "";
		for (subRepi=0; subRepi<str.length; subRepi++)
		{
			subRepc = str.charAt(subRepi);
			subRepn = subRephan.indexOf(subRepc,0);
			//if (subRepn >= 0) subRepc = "<"+subRephan.charAt(subRepn)+">";
			if (subRepn >= 0) subRepc = "<KJ"+subRepn+">";
			subRepstrTemp += subRepc;
		}
		str = subRepstrTemp;
	}
//alert(str);
	while(str.match(/\+/) != null){
		str = str.replace(/\+/,"<+>");
	}
	while(str.match(/\&/) != null){
		str = str.replace(/\&/,"<&>");
	}
	while(str.match(/\r\n/) != null){
		str = str.replace(/\r\n/,"<BR>");
	}
	while(str.match(/\r/) != null){
		str = str.replace(/\r/,"<BR>");
	}
	while(str.match(/\n/) != null){
		str = str.replace(/\n/,"<BR>");
	}

	var tmp = navigator.userAgent;
	if (navigator.appName == "Netscape" && tmp.match(/Firefox/i) == null){
		return escape(str);
	}else{
		return str;
	}
}

function Select_visibility(flg){


	var MaxCount = document.e_gru.getElementsByTagName("select").length;
	for(i=0;i<MaxCount;i++){
//		if(document.e_gru.getElementsByTagName("select")[i].style.visibility != "hidden"){
		if(flg==0){
			document.e_gru.getElementsByTagName("select")[i].style.visibility = "hidden";
		}else{
			document.e_gru.getElementsByTagName("select")[i].style.visibility = "";
		}
	}
}

function Disp_Help(strFileNm){
	window.open("./help/"+strFileNm,"omi","width=600,height=400,left=100,top=100,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,favorites=no,resizable=yes");
}

function Disp_Help2(strFileNm){
	window.open("./help/"+strFileNm,"omi","width=800,height=400,left=100,top=100,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,favorites=no,resizable=yes");
}

//ブラウザ判定

function Get_BName(){
	if (navigator.appName == "Microsoft Internet Explorer"){
		return "POST";
	}else if (navigator.appName == "Netscape"){
		return "GET";
	}else{
		return "GET";
	}
}

function loadMenuStop(){
//	alert(timer_stop);
	menu_flg=1;
	clearTimeout(timer_stop);
//	on_loaded1(0,-1000);
}

</script>