WML001.inc 17.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
<script type="text/javascript" src="xmlhttp.js"></script>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--

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

//--------------------------
//  メールボックス表示
//--------------------------
function Load_MailBox(){
	fName="WML110.php";
	httpObj110 = createXMLHttpRequest(DispMailBox);
	if (httpObj110){
			httpObj110.open(Get_BName(),fName,true);
			httpObj110.send(null);
	}

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

//--------------------------
//  アカウント設定
//--------------------------
function Account_Set(){
		document.e_gru.action = "WML003.php";
		document.e_gru.method="POST";
		document.e_gru.submit();
}

//--------------------------
//  受信メール一覧
//--------------------------
//*** 受信メール一覧ページ遷移 ***//
function WML020_Top(){
		location.href = "WML020.php";
}
function WML020_Page(start_from){
		document.e_gru.start_from.value=start_from;
		document.e_gru.action = "WML020.php";
		document.e_gru.method="POST";
		document.e_gru.submit();
}

//*** メールアドレス登録 ***//
function Input_Address(dataNM,dataAdd){
		document.e_gru.strName.value=dataNM;
		document.e_gru.strAddress.value=dataAdd;
		document.e_gru.intGmSts.value=1;
		document.e_gru.action = "WML041.php";
		document.e_gru.method="POST";
		document.e_gru.submit();
}

//*** メール内容表示 ***
function LoadMail_Disp(mail_id,seq){
		if(document.getElementById("MIL"+seq).innerHTML !=""){
			document.getElementById("MIL"+seq).innerHTML = "";
		}else{
			loadHTML_Sousai("WML021.php?view_uid="+mail_id,seq);
		}

		function loadHTML_Sousai(fName,seq){
			httpObj21 = createXMLHttpRequest(displayData_Mail);
			if (httpObj21){
				httpObj21.open(Get_BName(),fName,true);
				httpObj21.send(null);
			}
			function displayData_Mail(){
				if ((httpObj21.readyState == 4) && (httpObj21.status == 200)){
						document.getElementById("MIL"+seq).innerHTML = httpObj21.responseText;
						Load_MailBox();
				}else{
						document.getElementById("MIL"+seq).innerHTML = "<b>Loading...</b>";
				}
			}
		}

		//document.e_gru.view_uid.value=mail_id;
		//document.e_gru.action = "WML021.php";
		//document.e_gru.method="POST";
		//document.e_gru.submit();
}

function Data_get(mode,mail_id){
		document.e_gru.view_uid.value=mail_id;
		document.e_gru.intReturn.value=mode;
		document.e_gru.action = "WML010.php";
		document.e_gru.method="POST";
		document.e_gru.submit();
}

function All_chk(del_flg){
	//削除チェックボックス一括チェック処理
	
	var intFlg = 0;              //一括チェックFLG
	if (del_flg==1){
		if (document.e_gru.del_flg1.checked==true){
				intFlg = 1;
		}else{
				intFlg = 0;
		}
	}else if (del_flg==2){
		if (document.e_gru.del_flg2.checked==true){
				intFlg = 1;
		}else{
				intFlg = 0;
		}
	}
	if (document.e_gru.del_seq.length){
		if (intFlg==1){
			//未チェックがある場合
			for(i = 0 ; i <= document.e_gru.del_seq.length-1; i++ ){
				document.e_gru.del_seq[i].checked=true;
			}
			if (del_flg==1){
					document.e_gru.del_flg2.checked=true;
			}else{
					document.e_gru.del_flg1.checked=true;
			}
		}else{
			//未チェックがない場合
			for(i = 0 ; i <= document.e_gru.del_seq.length-1; i++ ){
				document.e_gru.del_seq[i].checked=false;
			}
			if (del_flg==1){
					document.e_gru.del_flg2.checked=false;
			}else{
					document.e_gru.del_flg1.checked=false;
			}
		}
	}else{
		//チェックボックス1個の場合
		if (document.e_gru.del_seq.checked==false){
			document.e_gru.del_seq.checked=true;
			if (del_flg==1){
					document.e_gru.del_flg2.checked=true;
			}else{
					document.e_gru.del_flg1.checked=true;
			}
		}else{
			document.e_gru.del_seq.checked=false;
			if (del_flg==1){
					document.e_gru.del_flg2.checked=false;
			}else{
					document.e_gru.del_flg1.checked=false;
			}
		}
	}
}

function Delete_Mail(){
		if (confirm("選択したメールを削除します。よろしいですか?") == true) {
				if (document.e_gru.del_seq.length){
						for(i = 0 ; i <= document.e_gru.del_seq.length-1; i++ ){
								if (document.e_gru.del_seq[i].checked==true){
										document.e_gru.strChkDat.value=document.e_gru.strChkDat.value+document.e_gru.del_seq[i].value+"#";
								}
						}
				}else{
						if (document.e_gru.del_seq.checked==true){
								document.e_gru.strChkDat.value=document.e_gru.del_seq.value+"#";
						}
				}
				document.e_gru.action = "WML023.php";
				document.e_gru.method="POST";
				document.e_gru.submit();
		}
}


//--------------------------
// 送信ボックス
//--------------------------
//*** 一覧移動 ***
function WML030_Page(start_from){
		document.e_gru.start_from.value=start_from;
		document.e_gru.action = "WML030.php";
		document.e_gru.method="POST";
		document.e_gru.submit();
}

function WML030_Top(){
		location.href = 'WML030.php';
}

//*** メール内容表示 ***
function WML030_Disp(seq,mail_id){
		if(document.getElementById("MIL"+seq).innerHTML !=""){
			document.getElementById("MIL"+seq).innerHTML = "";
		}else{
			loadHTML_Sousai("WML031.php?view_uid="+mail_id,seq);
		}

		function loadHTML_Sousai(fName,seq){
			httpObj31 = createXMLHttpRequest(displayData_Mail);
			if (httpObj31){
				httpObj31.open(Get_BName(),fName,true);
				httpObj31.send(null);
			}
			function displayData_Mail(){
				if ((httpObj31.readyState == 4) && (httpObj31.status == 200)){
						document.getElementById("MIL"+seq).innerHTML = httpObj31.responseText;
				}else{
						document.getElementById("MIL"+seq).innerHTML = "<b>Loading...</b>";
				}
			}
		}

		//document.e_gru.view_uid.value=mail_id;
		//document.e_gru.action = "WML031.php";
		//document.e_gru.method="POST";
		//document.e_gru.submit();
}

function WML030_All_chk(del_flg){
	//削除チェックボックス一括チェック処理
	
	var intFlg = 0;              //一括チェックFLG
	if (del_flg==1){
		if (document.e_gru.del_flg1.checked==true){
				intFlg = 1;
		}else{
				intFlg = 0;
		}
	}else if (del_flg==2){
		if (document.e_gru.del_flg2.checked==true){
				intFlg = 1;
		}else{
				intFlg = 0;
		}
	}
	
	if (document.e_gru.del_seq.length){
		if (intFlg==1){
			//未チェックがある場合
			for(i = 0 ; i <= document.e_gru.del_seq.length-1; i++ ){
				document.e_gru.del_seq[i].checked=true;
			}
			if (del_flg==1){
					document.e_gru.del_flg2.checked=true;
			}else{
					document.e_gru.del_flg1.checked=true;
			}
		}else{
			//未チェックがない場合
			for(i = 0 ; i <= document.e_gru.del_seq.length-1; i++ ){
				document.e_gru.del_seq[i].checked=false;
			}
			if (del_flg==1){
					document.e_gru.del_flg2.checked=false;
			}else{
					document.e_gru.del_flg1.checked=false;
			}
		}
	}else{
		//チェックボックス1個の場合
		if (document.e_gru.del_seq.checked==false){
			document.e_gru.del_seq.checked=true;
			if (del_flg==1){
					document.e_gru.del_flg2.checked=true;
			}else{
					document.e_gru.del_flg1.checked=true;
			}
		}else{
			document.e_gru.del_seq.checked=false;
			if (del_flg==1){
					document.e_gru.del_flg2.checked=false;
			}else{
					document.e_gru.del_flg1.checked=false;
			}
		}
	}
}

function WML030_Delete(){
	if (confirm("選択したメールを削除します。よろしいですか?") == true) {
			if (document.e_gru.del_seq.length){
					for(i = 0 ; i <= document.e_gru.del_seq.length-1; i++ ){
							if (document.e_gru.del_seq[i].checked==true){
									document.e_gru.strChkDat.value=document.e_gru.strChkDat.value+document.e_gru.del_seq[i].value+"#";
							}
					}
			}else{
					if (document.e_gru.del_seq.checked==true){
							document.e_gru.strChkDat.value=document.e_gru.del_seq.value+"#";
					}
			}
			document.e_gru.action = "WML032.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
	}
}


//--------------------------
//  メール送信
//--------------------------
function Send_Mail(){

	if (hissu_chk("宛先:",document.e_gru.MailTo.value)==false) {
		document.e_gru.MailTo.focus();
		return false;
	}

	strCode=document.e_gru.MailTo.value;
	if (strCode !=""){
		strlength=strCode.split(",");
		intlength=strlength.length;
		for (i=0; i<intlength; i++){
			strdata = strlength[i];
			if (strdata !=""){
				if (!strdata.match(/.*@.*\..*/i)){
					alert("不正なメールアドレスがあります\n["+strdata+"]");
					document.e_gru.MailTo.focus();
					return false;
				}
			}
		}
	}
	strCode1=document.e_gru.MailCC.value;
	if (strCode1 !=""){
		strlength1=strCode1.split(",");
		intlength1=strlength1.length;
		for (i=0; i<intlength1; i++){
			strdata1 = strlength1[i];
			if (strdata1 !=""){
				if (!strdata1.match(/.*@.*\..*/i)){
					alert("不正なメールアドレスがあります\n["+strdata1+"]");
					document.e_gru.MailCC.focus();
					return false;
				}
			}
		}
	}

	strCode2=document.e_gru.MailBCC.value;
	if (strCode2 !=""){
		strlength2=strCode2.split(",");
		intlength2=strlength2.length;
		for (i=0; i<intlength2; i++){
			strdata2 = strlength2[i];
			if (strdata2 !=""){
				if (!strdata2.match(/.*@.*\..*/i)){
					alert("不正なメールアドレスがあります\n["+strdata2+"]");
					document.e_gru.MailBCC.focus();
					return false;
				}
			}
		}
	}

	if (hissu_chk("件名:",document.e_gru.MailSubject.value)==false) {
		document.e_gru.MailSubject.focus();
		return false;
	}
	if (hissu_chk("本文:",document.e_gru.MailBody.value)==false) {
		document.e_gru.MailBody.focus();
		return false;
	}
	strArr1=document.e_gru.upfile1.value.split("\\");
	strFName1=strArr1[strArr1.length-1].toUpperCase();			
	strArr2=document.e_gru.upfile2.value.split("\\");
	strFName2=strArr2[strArr2.length-1].toUpperCase();
	strArr3=document.e_gru.upfile3.value.split("\\");
	strFName3=strArr3[strArr3.length-1].toUpperCase();

	if (DoubleSubmit()) {
			document.e_gru.file_name1.value=strFName1;
			document.e_gru.file_name2.value=strFName2;
			document.e_gru.file_name3.value=strFName3;
			document.e_gru.action = "WML012.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
	}
}

function del_temp(flg){
	switch (flg) {
		case 1:
			document.e_gru.TempDel1.value=1;
			break;
		case 2:
			document.e_gru.TempDel2.value=1;
			break;
		default:
			document.e_gru.TempDel3.value=1;
			break;
	}
	document.e_gru.action = "WML010.php";
	document.e_gru.method="POST";
	document.e_gru.submit();
	return true;
}


function return_SetAddr(intParam){
	window.open("WML011.php?intParam="+intParam,"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 Set_Syomei(){
	var length = document.e_gru.memo_seq.length;
	if (document.e_gru.title.value!=0){
			for( i = length - 1 ; i >= 0 ; i-- ){
				if (document.e_gru.memo_seq[i].value==document.e_gru.title.value){
						document.e_gru.MailBody.value=document.e_gru.MailBody.value+"\n"+document.e_gru.memo_naiyo[i].value;
						break;
				}
			}
	}
}

//--------------------------
//  メールアドレス設定
//--------------------------
function Addr_Set(){

	if (document.adresslist.intParam.value==0){
		if (opener.e_gru.MailTo.value!=""){
			opener.e_gru.MailTo.value=opener.e_gru.MailTo.value+",";
		}
		opener.e_gru.MailTo.value=opener.e_gru.MailTo.value+document.adresslist.strAtesaki.value;
	}
	else if (document.adresslist.intParam.value==1){
		if (opener.e_gru.MailCC.value!=""){
			opener.e_gru.MailCC.value=opener.e_gru.MailCC.value+",";
		}
		opener.e_gru.MailCC.value=opener.e_gru.MailCC.value+document.adresslist.strAtesaki.value;
	}
	else if (document.adresslist.intParam.value==2){
		if (opener.e_gru.MailBCC.value!=""){
			opener.e_gru.MailBCC.value=opener.e_gru.MailBCC.value+",";
		}
		opener.e_gru.MailBCC.value=opener.e_gru.MailBCC.value+document.adresslist.strAtesaki.value;
	}

	window.close();

}

function Addr_Add(stradd_s){

	var strsel_s;

	strsel_s="";
	for (i=0; i<document.adresslist.syain_list.options.length; i++){ 
		if(document.adresslist.syain_list.options[i].selected){ 
			strsel_s =strsel_s + "/" + document.adresslist.syain_list.options[i].value;
		}
	}
	if (DoubleSubmit()) {
		document.adresslist.strsel_s.value=stradd_s+strsel_s;
		document.adresslist.action="WML011.php";
		document.adresslist.method="POST"
		document.adresslist.submit();
		return false;
	}
}

function Addr_Tori(stradd_t){

	var strsel_t;

	strsel_t="";
	for (i=0; i<document.adresslist.torihiki_list.options.length; i++){ 
		if(document.adresslist.torihiki_list.options[i].selected){ 
			strsel_t = strsel_t+"/"+document.adresslist.torihiki_list.options[i].value;
		}
	}
	if (DoubleSubmit()) {
		document.adresslist.strsel_t.value=stradd_t+strsel_t;
		document.adresslist.action="WML011.php";
		document.adresslist.method="POST"
		document.adresslist.submit();
		return false;
	}
}


function Addr_Kojin(stradd_k){

	var strsel_k;

	strsel_k="";
	for (i=0; i<document.adresslist.kojin_list.options.length; i++){ 
		if(document.adresslist.kojin_list.options[i].selected){ 
			strsel_k = strsel_k+"/"+document.adresslist.kojin_list.options[i].value;
		}
	}
	if (DoubleSubmit()) {
		document.adresslist.strsel_k.value=stradd_k+strsel_k;
		document.adresslist.action="WML011.php";
		document.adresslist.method="POST"
		document.adresslist.submit();
		return false;
	}
}

function Addr_Modo(){
	if (DoubleSubmit()) {
		document.adresslist.action = "WML011.php";
		document.adresslist.method="POST";
		document.adresslist.submit();
	}
}

function Addr_Search(add_search){
	if (DoubleSubmit()) {
		document.adresslist.add_search.value =add_search;
		document.adresslist.action = "WML011.php";
		document.adresslist.method="POST";
		document.adresslist.submit();
	}
}


function Addr_Del(del_flg){
	if (DoubleSubmit()) {
		document.adresslist.del_flg.value =del_flg;
		document.adresslist.action = "WML011.php";
		document.adresslist.method="POST";
		document.adresslist.submit();
	}
}

//--------------------------
//  個人アドレス帳
//--------------------------
//*** アドレス追加 ***//
function mail_add(){
	location.href = 'WML041.php';
}

//*** アドレス追加 ***//
function chk_addr(kind_flg){

	if (hissu_chk("氏名(表示名)",document.e_gru.view_name.value)==false) {
		document.e_gru.view_name.focus();
		return false;
	}
	if (script_chk("氏名(表示名)",document.e_gru.view_name.value)==false) {
		document.e_gru.view_name.focus();
		return false;
	}

	if (hissu_chk("氏名(フリガナ)",document.e_gru.name_furi.value)==false) {
		document.e_gru.name_furi.focus();
		return false;
	}
	if (script_chk("氏名(フリガナ)",document.e_gru.name_furi.value)==false) {
		document.e_gru.name_furi.focus();
		return false;
	}
	if (kana_chk("氏名(フリガナ)",document.e_gru.name_furi.value)==false) {
		document.e_gru.name_furi.focus();
		return false;
	}
	if (hissu_chk("メールアドレス",document.e_gru.e_mail.value)==false) {
		document.e_gru.e_mail.focus();
		return false;
	}
	if (script_chk("メールアドレス",document.e_gru.e_mail.value)==false) {
		document.e_gru.e_mail.focus();
		return false;
	}
	
	if (checkEmail(document.e_gru.e_mail.value)==false) {
		document.e_gru.e_mail.focus();
		return false;
	}


	function checkEmail(checkString){
		var newstr = "";
		var at = false;
		var dot = false;

		if (checkString.indexOf("@") != -1) {
			at = true;
		} else if (checkString.indexOf(".") != -1) {
			dot = true;
		}
		for (var i = 0; i < checkString.length; i++) {
			ch = checkString.substring(i, i + 1)
			if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z")
				|| (ch == "@") || (ch == ".") || (ch == "_")
				|| (ch == "-") || (ch >= "0" && ch <= "9")) {
				newstr += ch;
				if (ch == "@") {
					at=true;
				}
				if (ch == ".") {
					dot=true;
				}
			}
		}
		if ((at == true) && (dot == true)) {
			return newstr;
		} else {
			alert ("入力されたメールアドレスは\n不正なアドレスのようです。\n再度入力し直してください。");
			return false;
		}
	}

	if (DoubleSubmit()) {
		document.e_gru.kind_flg.value =kind_flg;
		document.e_gru.action = "WML042.php";
		document.e_gru.method="POST";
		document.e_gru.submit();
		return true;
	}
}

//*** アドレス修正 ***//
function edit_address(seq){
	if (DoubleSubmit()) {
		document.e_gru.seq.value = seq;
		document.e_gru.action = "WML041.php";
		document.e_gru.method="POST";
		document.e_gru.submit();
		return true;
	}
}

//*** アドレス削除 ***//
function del_chk(kind_flg){
	if (confirm("アドレス帳を削除します\nよろしいですか?")){
		if (DoubleSubmit()) {
			document.e_gru.kind_flg.value = kind_flg;
			document.e_gru.action = "WML042.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
		}
	}
}

//--------------------------
//  署名設定
//--------------------------
//*** 署名保存 ***//
function memo_save(){
		if ((document.e_gru.title_nm.value=="")) {
				alert("署名タイトルは必須入力です");
				document.e_gru.title_nm.focus();
				return false;
		}
		if (DoubleSubmit()) {
			document.e_gru.action = "WML051.php";
			document.e_gru.method="POST";
			document.e_gru.submit();
		}
}

//*** 署名削除 ***//
function memo_clear(type){
	if (document.e_gru.title.value==0){
			alert("署名タイトルを選択してください");
			document.e_gru.title.focus();
			return false;
	}

	if (confirm("署名を削除します\nよろしいですか?")){
			if (DoubleSubmit()) {
				document.e_gru.type.value=type;
				document.e_gru.action = "WML051.php";
				document.e_gru.method="POST";
				document.e_gru.submit();
			}
	}
}

//*** 署名切り替え ***//
function SetCombo(){
	var length = document.e_gru.memo_seq.length;
	for( i = length - 1 ; i >= 0 ; i-- ){
		if (document.e_gru.memo_seq[i].value==document.e_gru.title.value){
				document.e_gru.title_nm.value=document.e_gru.memo_title[i].value;
				document.e_gru.memo.value=document.e_gru.memo_naiyo[i].value;
				if (document.e_gru.memo_disp[i].value=="1"){
						document.e_gru.disp_set.checked=true;
				}else{
						document.e_gru.disp_set.checked=false;
				}
				break;
		}
	}
}

-->
</SCRIPT>