TOP000.inc 28.6 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005
<script type="text/javascript" src="inc/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="xmlhttp.js"></script>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
// cross domain ajax
jQuery.ajax = (function(_ajax){

    var protocol = location.protocol,
        hostname = location.hostname,
        exRegex = RegExp(protocol + '//' + hostname),
        YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?',
        query = 'select * from html where url="{URL}" and xpath="*"';

    function isExternal(url) {
        return !exRegex.test(url) && /:\/\//.test(url);
    }

    return function(o) {

        var url = o.url;

        if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) {

            // Manipulate options so that JSONP-x request is made to YQL

            o.url = YQL;
            o.dataType = 'json';

            o.data = {
                q: query.replace(
                    '{URL}',
                    url + (o.data ?
                        (/\?/.test(url) ? '&' : '?') + jQuery.param(o.data)
                    : '')
                ),
                format: 'xml'
            };

            // Since it's a JSONP request
            // complete === success
            if (!o.success && o.complete) {
                o.success = o.complete;
                delete o.complete;
            }

            o.success = (function(_success){
                return function(data) {

                    if (_success) {
                        // Fake XHR callback.
                        _success.call(this, {
                            responseText: (data.results[0] || '')
                                // YQL screws with <script>s
                                // Get rid of them
                                .replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
                        }, 'success');
                    }

                };
            })(o.success);

        }

        return _ajax.apply(this, arguments);

    };

})(jQuery.ajax);


var SFlg = false;				//サブミットフラグを定義
function DoubleSubmit(){		//ダブルサブミットチェック関数
	 if (SFlg){					//ダブルサブミットの場合
		alert("応答中です");		//メッセージを出力
		return false;
	 }
	 SFlg = true;					//サブミットフラグを設定
	 return true;					//戻り値を設定
}



var Load_Flg = false;			//ロードフラグを定義
window.onload=Load_chk;
function Load_chk(){			//ロードチェック関数
	Load_Flg = true;				//サブミットフラグを設定
	return true;					//戻り値を設定
}

function loadHTMLFile(fName){
		$("schedule1").innerHTML = "";
		$("schedule2").innerHTML = "";
		loadHTMLFile1(fName+"&disp=1");		//自分のスケジュール
		loadHTMLFile2(fName+"&disp=2");		//他人のスケジュール
}

//********** 自分のスケジュール **********
function loadHTMLFile1(fName){
	httpObj1 = createXMLHttpRequest(displayData1);
	httpObj1.onload = function(e) {
        	//LoadGoogleCal();
	        LoadGoogleCal_API();

	};
	if (httpObj1){
		httpObj1.open(Get_BName(),fName,true);
        httpObj1.send(null);
	}
}

function displayData1(){
		if ((httpObj1.readyState == 4) && (httpObj1.status == 200)){
			$("schedule1").innerHTML = httpObj1.responseText;
			$("message1").innerHTML = "";
		}else{
			$("message1").innerHTML = "<b>Loading...</b>";
		}
}

//********** 他人のスケジュール **********
function loadHTMLFile2(fName){

	httpObj2 = createXMLHttpRequest(displayData2);
	httpObj2.onload = function(e) {
	        //LoadGoogleCal2();
	        LoadGoogleCal2_API();

    };
	if (httpObj2){
		httpObj2.open(Get_BName(),fName,true);
        httpObj2.send(null);
	}
}
function displayData2(){
	if ((httpObj2.readyState == 4) && (httpObj2.status == 200)){
		$("schedule2").innerHTML = httpObj2.responseText;
		$("message2").innerHTML = "";
		Init();
	}else{
		$("message2").innerHTML = "<b>Loading...</b>";
	}
}

//********** Googleカレンダー **********
function LoadGoogleCal(/*syain_cd , kijyundate*/){
    var syain_cd = document.getElementById("gc_syain_cd").value;
    var kijyundate = document.getElementById("gc_strwkdate").value;

	var $j = jQuery.noConflict(); 
	$j.ajax({
				Async: false,
				type: "POST",
				url: "TOP000_G3.php?syain_cd="+syain_cd,
				contentType: "json",
				success: function (data, dataType) {

					obj = $j.parseJSON(data);

					for (i=0; i < 7;i++){

						var st_date = kijyundate;
						var num1=+parseInt(st_date.substring(6,8),10)+i;

						var Dt = new Date(st_date.substring(0,4),parseInt(st_date.substring(4,6),10)-1,parseInt(st_date.substring(6,8),10)+i);

						var Year	= Dt.getFullYear();
						var Month = Dt.getMonth()+1;
						var Day	  = Dt.getDate();
						var chk_date = String(Year) + "-" + String(ZeroFormat(Month,2)) + "-" +String(ZeroFormat(Day,2));
						var div_date = String(Year) + String(ZeroFormat(Month,2)) + String(ZeroFormat(Day,2));
						
						var chk_date = String(Year) + "-" + String(ZeroFormat(Month,2)) + "-" +String(ZeroFormat(Day,2));
						var div_date = String(Year) + String(ZeroFormat(Month,2)) + String(ZeroFormat(Day,2));
				

		
						initialize(div_date , chk_date,obj["syain_cd"],obj["id"],obj["key"],"1");

					}
				}
	});


}

function LoadGoogleCal2(/*kijyundate , scdl_bumon*/){
    var scdl_bumon = document.getElementById("gc_scdl_bumon").value;
    var kijyundate = document.getElementById("gc_strwkdate").value;
	var $l = jQuery.noConflict(); 
	$l.ajax({
				Async: false,
				type: "POST",
				url: "TOP000_G2.php?scdl_bumon="+scdl_bumon,
				contentType: "json",
				success: function (data, dataType) {
					obj = $l.parseJSON(data);

					for (var key in obj) {
							//alert(key+"-"+obj[key]["id"]+"-"+obj[key]["key"]+"-");
							if (obj[key]["id"]!=""){
									for (i=0; i < 7;i++){

										var st_date = kijyundate;
										var num1=+parseInt(st_date.substring(6,8),10)+i;
										//alert(st_date.substring(0,4)+"/"+st_date.substring(4,6)+"/"+num1);

										var Dt = new Date(st_date.substring(0,4),parseInt(st_date.substring(4,6),10)-1,parseInt(st_date.substring(6,8),10)+i);

										var Year	= Dt.getFullYear();
										var Month = Dt.getMonth()+1;
										var Day	  = Dt.getDate();
										var chk_date = String(Year) + "-" + String(ZeroFormat(Month,2)) + "-" +String(ZeroFormat(Day,2));
										var div_date = String(Year) + String(ZeroFormat(Month,2)) + String(ZeroFormat(Day,2));
										
										var chk_date = String(Year) + "-" + String(ZeroFormat(Month,2)) + "-" +String(ZeroFormat(Day,2));
										var div_date = String(Year) + String(ZeroFormat(Month,2)) + String(ZeroFormat(Day,2));

										initialize(div_date , chk_date,key,obj[key]["id"],obj[key]["key"],"");
									}
							}
					}
				}
	});
}

//********** Googleカレンダー(API) **********
function LoadGoogleCal2_API(/*kijyundate , scdl_bumon*/){
    var scdl_bumon = document.getElementById("gc_scdl_bumon").value;
    var kijyundate = document.getElementById("gc_strwkdate").value;



	var $o = jQuery.noConflict(); 

	$o.ajax({
		Async: false,
		type: "POST",
		url: "TOP000_G5.php?scdl_bumon="+scdl_bumon,
		contentType: "json",
		success: function (data, dataType) {


			obj = $o.parseJSON(data);

			for (var key in obj) {

				for (i=0; i < 7;i++){


					var st_date = kijyundate;
					var num1=+parseInt(st_date.substring(6,8),10)+i;
					var Dt = new Date(st_date.substring(0,4),parseInt(st_date.substring(4,6),10)-1,parseInt(st_date.substring(6,8),10)+i);

					var Year	= Dt.getFullYear();
					var Month = Dt.getMonth()+1;
					var Day	  = Dt.getDate();
					var chk_date = String(Year) + "-" + String(ZeroFormat(Month,2)) + "-" +String(ZeroFormat(Day,2));
					var div_date = String(Year) + String(ZeroFormat(Month,2)) + String(ZeroFormat(Day,2));
						
					var chk_date = String(Year) + "-" + String(ZeroFormat(Month,2)) + "-" +String(ZeroFormat(Day,2));
					var div_date = String(Year) + String(ZeroFormat(Month,2)) + String(ZeroFormat(Day,2));
				
					var mode = "0";

					initialize_API(div_date, chk_date, obj[key]["syain_cd"], obj[key]["access_token"], obj[key]["calender_id"], mode);
	
				}
			}

		}

	});
}

//********** Googleカレンダー(API) **********
function LoadGoogleCal_API(/*syain_cd , kijyundate*/){
	var syain_cd = document.getElementById("gc_syain_cd").value;
	var kijyundate = document.getElementById("gc_strwkdate").value;

	var $m = jQuery.noConflict(); 

	$m.ajax({
				Async: false,
				type: "POST",
				url: "TOP000_G4.php?syain_cd="+syain_cd,
				contentType: "json",
				success: function (data, dataType) {
					obj = $m.parseJSON(data);

					for (i=0; i < 7;i++){

						var st_date = kijyundate;
						var num1=+parseInt(st_date.substring(6,8),10)+i;
						var Dt = new Date(st_date.substring(0,4),parseInt(st_date.substring(4,6),10)-1,parseInt(st_date.substring(6,8),10)+i);

						var Year	= Dt.getFullYear();
						var Month = Dt.getMonth()+1;
						var Day	  = Dt.getDate();
						var chk_date = String(Year) + "-" + String(ZeroFormat(Month,2)) + "-" +String(ZeroFormat(Day,2));
						var div_date = String(Year) + String(ZeroFormat(Month,2)) + String(ZeroFormat(Day,2));
						
						var chk_date = String(Year) + "-" + String(ZeroFormat(Month,2)) + "-" +String(ZeroFormat(Day,2));
						var div_date = String(Year) + String(ZeroFormat(Month,2)) + String(ZeroFormat(Day,2));
				
						var mode = "1";

						initialize_API(div_date, chk_date, obj["syain_cd"], obj["access_token"], obj["calender_id"], mode);

					}

				}

	});
}


//********** Googleカレンダー取得 **********
function ZeroFormat(num,max){
		var tmp=""+num;
		while(tmp.length<max){
				tmp="0"+tmp;
		}
		return tmp;
}

function formatTime(str) {
		var txt="";
		if (str.length===10){
		}else{
	    txt = str.match(/T(\d{2}):(\d{2})/);
	    txt = txt[1].replace(/^0/,'') + ':' + txt[2];
		}
    return txt;
}

function initialize(div_date , chk_date ,syain_cd,id,key,mode) {

	if ((syain_cd === undefined) || (id === undefined) ||(key === undefined)){
	}else{

	
			var $k = jQuery.noConflict(); 
			var feedurl = "https://www.google.com/calendar/feeds/" + id + "/private-" + key + "/basic?alt=json&start-min=" + chk_date +"T00:00:00&start-max=" + chk_date + "T23:59:59&orderby=starttime&sortorder=ascend&singleevents=true&max-results=300";

			$k.getJSON(feedurl, function (json) {

				var items = json.feed.entry;
				

				if (items){

						var container = document.getElementById(syain_cd+"_"+div_date);

						var htmlstr="";

						$k.each(items,function(i){
								
								var disp_time ="";
								var wk_strar_day ="";
								var strar_day ="";
								
								var title   = items[i].title.$t;

								var link    = items[i].link[0].href;
								var startTime = "";
								var endTime = "";
								if (items[i].summary){
									var text1 = items[i].summary.$t;

									//時間セット
									disp_time = text1.match(/[0-2][0-9]:[0-5][0-9]〜[0-2][0-9]:[0-5][0-9]/);

									if (disp_time==null){
											disp_time="";
									}
									//開始日確認(終日表示の対応)
									wk_strar_day = text1.match(/[0-9]{4}[/][0-9]{2}[/][0-9]{2}/);

									//
									if (wk_strar_day==null){
											strar_day="";
									}else{
										strar_day = new Date(wk_strar_day + " 00:00:00");
									}
								}						
								
								//表示日

								var wk_day = new Date(chk_date.replace(/-/g, "/") + " 00:00:00");

								//開始日と表示日の大小チェック
								if(strar_day.getTime() <= wk_day.getTime()) {
									if (mode=="1"){
										htmlstr += '<li style="margin-left: 4px;padding: 4px 0px 4px 16px;background-image: url(image/g_calendar.gif);background-position: left;background-repeat: no-repeat;background :url(image/g_calendar.gif) no-repeat left;"><SPAN class="Flowfont"><a href="' + link + '" target="_blank">' + disp_time + " " + title + '</a></SPAN></li>';
									}else{
										htmlstr += '<li style="margin-left: 4px;padding: 4px 0px 4px 16px;background-image: url(image/g_calendar.gif);background-position: left;background-repeat: no-repeat;background :url(image/g_calendar.gif) no-repeat left;"><SPAN class="Flowfont">' + disp_time + " " +  title  + '</SPAN></li>';
									}
								}
		        });

						container.innerHTML = htmlstr;

				}else{
				}

	    });

	}
}

//********** Googleカレンダー取得(API) **********
function initialize_API(div_date, chk_date, syain_cd, access_token, calender_id, mode) {

	if (syain_cd && access_token && calender_id){
	
		var $n = jQuery.noConflict(); 

		var timeMin = chk_date + "T00:00:00%2B09:00";
		var timeMax = chk_date + "T23:59:59%2B09:00";

		var url = "https://www.googleapis.com/calendar/v3/calendars/" + calender_id + "/events?access_token=" + access_token + "&timeMin=" + timeMin + "&timeMax=" + timeMax + "&singleEvents=true&orderBy=startTime";


		$n.getJSON(url, function (json) {

			var items = json.items;

			if (items){

				var container = document.getElementById(syain_cd+"_"+div_date);
				var htmlstr="";

				$n.each(items,function(i){

					var disp_time ="";			
					var title   = items[i].summary;
					var link    = items[i].htmlLink;
					var startTime = "";
					var endTime = "";
					var wk_strar_day ="";
					var strar_day ="";

					//alert(title);

					if (items[i].start.dateTime){

						//時間予定

						var start_time = items[i].start.dateTime;
						var end_time = items[i].end.dateTime;

						//開始日(繰り返し予定の対応)
						wk_strar_day = start_time.match(/[0-9]{4}[-][0-9]{2}[-][0-9]{2}/).toString();
						strar_day = new Date(wk_strar_day.replace(/-/g, "/") + " 00:00:00");

						//表示日
						var wk_day = new Date(chk_date.replace(/-/g, "/") + " 00:00:00");

						//時間セット
						start_time = start_time.match(/[0-2][0-9]:[0-5][0-9]/);

						end_time = end_time.match(/[0-2][0-9]:[0-5][0-9]/);
						disp_time = start_time + "〜" + end_time;

					if(strar_day.getTime() <= wk_day.getTime()) {
						if (mode=="1"){
							htmlstr += '<li style="margin-left: 4px;padding: 4px 0px 4px 16px;background-image: url(image/g_calendar.gif);background-position: left;background-repeat: no-repeat;background :url(image/g_calendar.gif) no-repeat left;"><SPAN class="Flowfont"><a href="' + link + '" target="_blank">' + disp_time + " " + title + '</a></SPAN></li>';
						}else{
							htmlstr += '<li style="margin-left: 4px;padding: 4px 0px 4px 16px;background-image: url(image/g_calendar.gif);background-position: left;background-repeat: no-repeat;background :url(image/g_calendar.gif) no-repeat left;"><SPAN class="Flowfont">' + disp_time + " " +  title  + '</SPAN></li>';
						}
}

					}else{

						//終日予定
						if (mode=="1"){
							htmlstr += '<li style="margin-left: 4px;padding: 4px 0px 4px 16px;background-image: url(image/g_calendar.gif);background-position: left;background-repeat: no-repeat;background :url(image/g_calendar.gif) no-repeat left;"><SPAN class="Flowfont"><a href="' + link + '" target="_blank">' + disp_time + " " + title + '</a></SPAN></li>';
						}else{
							htmlstr += '<li style="margin-left: 4px;padding: 4px 0px 4px 16px;background-image: url(image/g_calendar.gif);background-position: left;background-repeat: no-repeat;background :url(image/g_calendar.gif) no-repeat left;"><SPAN class="Flowfont">' + disp_time + " " +  title  + '</SPAN></li>';
						}
					}

					//表示日
					var wk_day = new Date(chk_date.replace(/-/g, "/") + " 00:00:00");		


			        });

				container.innerHTML = htmlstr;

			}

		});

	}

}

//google.setOnLoadCallback(initialize);
google.setOnLoadCallback(initialize_API);


function loadHTMLFile3(fName){
	httpObj3 = createXMLHttpRequest(displayData3);
	if (httpObj3)	{
		httpObj3.open(Get_BName(),fName,true);
		httpObj3.send(null);
	}
}
//20081008 get→post
//function loadHTMLFile4(fName)
function loadHTMLFile4(fName,prm){
	httpObj4 = createXMLHttpRequest(displayData4);
	if (httpObj4){
		//httpObj4.open(Get_BName(),fName,true);
		//httpObj4.send(null);
		httpObj4.open("POST",fName,true);
		httpObj4.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		httpObj4.send(prm);

	}
}

function displayData(){
	if ((httpObj.readyState == 4) && (httpObj.status == 200)){
		$("schedule").innerHTML = httpObj.responseText;
		$("message").innerHTML = "";
		
	}else{
		$("message").innerHTML = "<b>Loading...</b>";
	}
}

function displayData3(){
	if ((httpObj3.readyState == 4) && (httpObj3.status == 200)){
		$("TOP001").innerHTML = httpObj3.responseText;
		$("message1").innerHTML = "";
		fnc_opt(0);
		Init();
	}else{
		$("message1").innerHTML = "<b>Loading...</b>";
	}
}

function displayData4(){
	if ((httpObj4.readyState == 4) && (httpObj4.status == 200)){
		if(((document.e_gru.flg_share[1].checked==true) && (document.e_gru.flg_share_def.value==0)) || ((document.e_gru.flg_share[1].checked==false) && (document.e_gru.flg_share_def.value==1))){
			$("TOP001").innerHTML = "";
			//loadHTMLFile2("TOP000_SCHE.php?disp=2&strwkdate="+document.e_gru.strkijyunDate.value);
			loadHTMLFile("TOP000_SCHE.php?strwkdate="+document.e_gru.strkijyunDate.value);
		}else{
			$("TOP001").innerHTML = "";
			loadHTMLFile1("TOP000_SCHE.php?disp=1&strwkdate="+document.e_gru.strkijyunDate.value);
		}
//		Init();
	}else{
		$("message1").innerHTML = "<b>Loading...</b>";
	}
}

function schedule(intseq,syain_cd,strDate){
	//if (Load_Flg==true){
		if (DoubleSubmit()) {
			document.e_gru.intseq.value=intseq;
			document.e_gru.syain_cd.value=syain_cd;
			document.e_gru.strwkdate.value=strDate;
			if (intseq==0){
				document.e_gru.action = "TOP001.php";
				document.e_gru.method="POST";
				document.e_gru.submit();
			}else{
				document.e_gru.action = "TOP005.php";
				document.e_gru.method="POST";
				document.e_gru.submit();
			}
	//	}
	}
}

function schedule_ajax(intseq,syain_cd,strDate){
	//if (Load_Flg==true){
//		if (DoubleSubmit()) {
	cal1 = new JKL.Calendar("calid","e_gru","colname");
	cal2 = new JKL.Calendar("calid2","e_gru","colname2");
	cal3 = new JKL.Calendar("calid3","e_gru","colname3");
	cal4 = new JKL.Calendar("calid4","e_gru","colname4");
	cal5 = new JKL.Calendar("calid5","e_gru","colname5");

			document.e_gru.intseq.value=intseq;
			document.e_gru.syain_cd.value=syain_cd;
			document.e_gru.strwkdate.value=strDate;
			if (intseq==0){
				loadHTMLFile3("TOP001_1.php?strwkdate="+strDate+"&syain_cd="+syain_cd+"&intseq="+intseq);
				//document.e_gru.action = "TOP001.php";
				//document.e_gru.method="POST";
				//document.e_gru.submit();
			}else{
				loadHTMLFile3("TOP005_1.php?strwkdate="+strDate+"&syain_cd="+syain_cd+"&intseq="+intseq);
				//document.e_gru.action = "TOP005.php";
				//document.e_gru.method="POST";
				//document.e_gru.submit();
			}
	//	}
//	}
}

function scheduleDay(intseq,syain_cd,strDate){
	//if (Load_Flg==true){
		if (DoubleSubmit()) {
			document.e_gru.intseq.value=intseq;
			document.e_gru.syain_cd.value=syain_cd;
			document.e_gru.strwkdate.value=strDate;
			if (intseq==0){
				document.e_gru.action = "TOP000_DAY.php";
				document.e_gru.method="POST";
				document.e_gru.submit();
			}else{
				document.e_gru.action = "TOP005.php";
				document.e_gru.method="POST";
				document.e_gru.submit();
			}
	//	}
	}
}

function bnschedule(intseq,syain_cd,strDate){
	//if (Load_Flg==true){
		if (DoubleSubmit()) {
			document.e_gru.intseq.value=intseq;
			document.e_gru.syain_cd.value=syain_cd;
			document.e_gru.strwkdate.value=strDate;
			document.e_gru.action = "TOP001.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
		}
	//}
}

function bnschedule_ajax(intseq,syain_cd,strDate){
	//if (Load_Flg==true){
//		if (DoubleSubmit()) {
	cal1 = new JKL.Calendar("calid","e_gru","colname");
	cal2 = new JKL.Calendar("calid2","e_gru","colname2");
	cal3 = new JKL.Calendar("calid3","e_gru","colname3");
	cal4 = new JKL.Calendar("calid4","e_gru","colname4");
	cal5 = new JKL.Calendar("calid5","e_gru","colname5");

			document.e_gru.intseq.value=intseq;
			document.e_gru.syain_cd.value=syain_cd;
			document.e_gru.strwkdate.value=strDate;
			loadHTMLFile3("TOP001_1.php?strwkdate="+strDate+"&syain_cd="+syain_cd+"&intseq="+intseq);
			//document.e_gru.action = "TOP001.php";
			//document.e_gru.method="POST";
			//document.e_gru.submit();
//		}
	//}
}

function tantou(strDate){
	//if (Load_Flg==true){
		if (DoubleSubmit()) {
			document.e_gru.strwkdate.value=strDate;
			document.e_gru.action = "DUT001.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
		}
	//}
}


function calendar(syain_cd,strDate){
	//if (Load_Flg==true){
		if (DoubleSubmit()) {
			document.e_gru.syain_cd.value=syain_cd;
			document.e_gru.strwkdate.value=strDate;
			document.e_gru.action = "TOP002.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
		}
	//}
}

//ページの読み込み確認
intRead_Flg=0;
function start(){
	intRead_Flg=1;
}

window.onload = start;

function move_date(strDate){

	cal1 = new JKL.Calendar("calid","e_gru","colname");
	cal2 = new JKL.Calendar("calid2","e_gru","colname2");
	cal3 = new JKL.Calendar("calid3","e_gru","colname3");
	cal4 = new JKL.Calendar("calid4","e_gru","colname4");
	cal5 = new JKL.Calendar("calid5","e_gru","colname5");

			document.e_gru.strkijyunDate.value = strDate;
//			loadHTMLFile("TOP000_SCHE.php?strwkdate="+strDate);
			loadHTMLFile("TOP000_SCHE.php?strwkdate="+strDate+"&scdl_bumon="+document.e_gru.scdl_bumon.value);

}

function jyokyo(syain_cd){
	//if (Load_Flg==true){
		if (DoubleSubmit()) {
			document.e_gru.syain_cd.value=syain_cd;
			document.e_gru.action = "TOP003.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
		}
	//}
}

function move_bbs(intseq){
	//if (Load_Flg==true){
		if (DoubleSubmit()) {
			document.e_gru.seq.value=intseq;
			document.e_gru.action = "BBS003.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
		}
	//}
}

function project(intseq){
	//if (Load_Flg==true){
		if (DoubleSubmit()) {
			document.e_gru.seq.value=intseq;
			document.e_gru.action = "PRO002.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
		}
	//}
}


function reload(){
	loadHTMLFile2("TOP000_SCHE.php?intsts=1&scdl_bumon="+document.e_gru.scdl_bumon.value+"&disp=2");
}


function telmemo(syain_cd){
	//if (Load_Flg==true){
		if (DoubleSubmit()) {
			document.e_gru.syain_cd.value=syain_cd;
			document.e_gru.action = "TEL001.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
		}
	//}
}

function getDate(flg){
	//if (Load_Flg==true){
//	if (intRead_Flg ==1){
			document.e_gru.strkijyunDate.value = document.e_gru.main_year[flg].value+document.e_gru.main_mon[flg].value+"01";
//			loadHTMLFile("TOP000_SCHE.php?strwkdate="+document.e_gru.main_year[flg].value+document.e_gru.main_mon[flg].value+"01");
			loadHTMLFile("TOP000_SCHE.php?strwkdate="+document.e_gru.main_year[flg].value+document.e_gru.main_mon[flg].value+"01"+"&scdl_bumon="+document.e_gru.scdl_bumon.value);
//			document.e_gru.strwkdate.value=document.e_gru.main_year.value+document.e_gru.main_mon.value+"01";
//			document.e_gru.action = "TOP000.php";
//			document.e_gru.method="POST";
//			document.e_gru.submit();
//		}
//	}
}

function print_schedule(intParam,intParam2,intParam3) { 
	window.open("TOP000_3.php?strwkdate="+intParam+"&scdl_bumon="+intParam2+"&intsts="+intParam3,"omi","width=1000,height=700,left=200,top=200,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,favorites=no,resizable=yes");

} 

function csv_out() { 
	window.open("TOP900.php?","omi","width=700,height=500,left=100,top=100,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,favorites=no,resizable=yes");
} 

function loadHTMLMemo(){
	fName="TOP000_1.php?seq="+document.e_gru.MEM_title.value;
	httpObj3 = createXMLHttpRequest(displayMemo);
	if (httpObj3){
		httpObj3.open(Get_BName(),fName,true);
		httpObj3.send(null);
	}
}

function loadHTMLToDo(){
	fName="TDLMIN.php?srt_mode="+document.e_gru.ToDo_title.value;
	httpObj4 = createXMLHttpRequest(displayToDo);
	if (httpObj4){
		httpObj4.open(Get_BName(),fName,true);
		httpObj4.send(null);
	}
}

function displayMemo(){
	if ((httpObj3.readyState == 4) && (httpObj3.status == 200)){
		$("memo").innerHTML = httpObj3.responseText;
	}else{
		$("memo").innerHTML = "<b>Loading...</b>";
	}
}

function displayToDo(){
	if ((httpObj4.readyState == 4) && (httpObj4.status == 200)){
		$("ToDo").innerHTML = httpObj4.responseText;
	}else{
		$("ToDo").innerHTML = "<b>Loading...</b>";
	}
}

var layW = 150;		//ウインドウの幅:IE用
var KojinLaymax = 5;		//ウインドウの最大数
var EtcLaymax = 5;		//ウインドウの最大数
var Kojincomments = new Array();
var Etccomments = new Array();

function Init(){
	if (document.e_gru.Kojincomments){
			for (i=0; i<document.e_gru.Kojincomments.length;i++){
				Kojincomments[i] = document.e_gru.Kojincomments[i].value;
			}
			KojinLaymax = document.e_gru.Kojincomments.length-1;		//ウインドウの最大数
			
			for (i=0; i<document.e_gru.Etccomments.length;i++){
				Etccomments[i] = document.e_gru.Etccomments[i].value;
			}
			EtcLaymax = document.e_gru.Etccomments.length-1;		//ウインドウの最大数
            
            /*
			for(i = 1; i <= KojinLaymax; i++){
				if(iIE4){
					lay[i] = document.all("KojiniL"+i);
					lay[i].style.visibility = "hidden";
				}
				if(iNN4){
					//クロームもフォックスも機能していない
					//lay[i] = document.layers["KojiniL"+i];
					//lay[i].visibility = "hide";
				}

			}

			for(i = 1; i <= EtcLaymax; i++){
				if(iIE4){
					lay[i] = document.all("EtciL"+i);
					lay[i].style.visibility = "hidden";
				}
				
				if(iNN4){
					//クロームもフォックスも機能していない
					//lay[i] = document.layers["EtciL"+i];
					//lay[i].visibility = "hide";
				}
				
			}
            */
			Lflag = true;
	}
}

function MoverK(n){
    /*
	if(Lflag){
		if(Kojincomments[n]!=""){
			if(iIE4){
				lay[n].innerHTML = Kojincomments[n];
				lay[n].style.left = layX;
				lay[n].style.top = layY;
				lay[n].style.width = layW;
				layH = lay[n].style.height;
				lay[n].style.visibility = "visible";
			}
			if(iNN4){
				lay[n].document.open();
				lay[n].document.fgColor = "#000000";
				lay[n].document.bgColor = "#fffacd";
				lay[n].document.write(Kojincomments[n]);
				lay[n].document.close();
				lay[n].left = layX;
				lay[n].top = layY;
				layW = lay[n].clip.width;
				layH = lay[n].clip.height;
				lay[n].visibility = "show";
			}
		}
	}
    */
}

function MoverE(n){
    /*
	if(Lflag){
		if(Etccomments[n]!=""){
			if(iIE4){
				lay[n].innerHTML = Etccomments[n];
				lay[n].style.left = layX;
				lay[n].style.top = layY;
				lay[n].style.width = layW;
				layH = lay[n].style.height;
				lay[n].style.visibility = "visible";
			}
			if(iNN4){
				lay[n].document.open();
				lay[n].document.fgColor = "#000000";
				lay[n].document.bgColor = "#fffacd";
				lay[n].document.write(Etccomments[n]);
				lay[n].document.close();
				lay[n].left = layX;
				lay[n].top = layY;
				layW = lay[n].clip.width;
				layH = lay[n].clip.height;
				lay[n].visibility = "show";
			}
		}
	}
    */
}

function cal_get(strDate, divid){
	arrYMD = strDate.split("/");

	if(divid == "calid"){
		objY = document.e_gru.main_year[0];
		objM = document.e_gru.main_mon[0];
	}else if(divid == "calid2"){
		objY = document.e_gru.main_year[1];
		objM = document.e_gru.main_mon[1];
	}else if(divid == "calid3"){
		objY = document.e_gru.st_year;
		objM = document.e_gru.st_mon;
		objD = document.e_gru.st_day;

		objY2 = document.e_gru.ed_year;
		objM2 = document.e_gru.ed_mon;
		objD2 = document.e_gru.ed_day;

	}else if(divid == "calid4"){
		objY = document.e_gru.ed_year;
		objM = document.e_gru.ed_mon;
		objD = document.e_gru.ed_day;
	}else if(divid == "calid5"){
		objY = document.e_gru.alarm_nen;
		objM = document.e_gru.alarm_mon;
		objD = document.e_gru.alarm_day;
	}

	//年
	for(i=0;i<objY.options.length;i++){
		if(objY.options[i].value == arrYMD[0]){
			objY.selectedIndex = i;
			if(divid == "calid3"){
				objY2.selectedIndex = i;
			}
			break;
		}
	}
	//月
	for(i=0;i<objM.options.length;i++){
		if(objM.options[i].value == arrYMD[1]){
			objM.selectedIndex = i;
			if(divid == "calid3"){
				objM2.selectedIndex = i;
			}
			break;
		}
	}

	if(divid == "calid" || divid == "calid2"){
		document.e_gru.strkijyunDate.value = arrYMD[0]+arrYMD[1]+arrYMD[2];
		loadHTMLFile("TOP000_SCHE.php?strwkdate="+arrYMD[0]+arrYMD[1]+arrYMD[2]+"&scdl_bumon="+document.e_gru.scdl_bumon.value);
	}else{
		//月
		for(i=0;i<objD.options.length;i++){
			if(objD.options[i].value == arrYMD[2]){
				objD.selectedIndex = i;
				if(divid == "calid3"){
					objD2.selectedIndex = i;
				}
				break;
			}
		}
	}

cal1 = new JKL.Calendar("calid","e_gru","colname");
cal2 = new JKL.Calendar("calid2","e_gru","colname2");
cal3 = new JKL.Calendar("calid3","e_gru","colname3");
cal4 = new JKL.Calendar("calid4","e_gru","colname4");
cal5 = new JKL.Calendar("calid5","e_gru","colname5");
}

-->
</SCRIPT>


<SCRIPT language="JavaScript" src="popupmess205b.js"></SCRIPT>
<script>
var cal1 = new JKL.Calendar("calid","e_gru","colname");
var cal2 = new JKL.Calendar("calid2","e_gru","colname2");
var cal3 = new JKL.Calendar("calid3","e_gru","colname3");
var cal4 = new JKL.Calendar("calid4","e_gru","colname4");
var cal5 = new JKL.Calendar("calid5","e_gru","colname5");
</script>