function receipt_upd_action(rid, rsid, updlabel, rcode) {
	document.upd.receipt_rid.value   = rid;
	document.upd.receipt_rsid.value  = rsid;

	if (confirm("予約番号：" + rcode + " を" + updlabel + "に更新します。よろしいですか？")) {
		document.upd.submit();
	}
}

function cal_submit_slide(mode, yval, mval){
	document.rsv.action = 'cal_redirect.php';
	if (mode == 1) {
		document.rsv.fyear_bk.value  = yval;
		document.rsv.fmonth_bk.value = mval;
	} else if(mode == 2) {
		document.rsv.fyear_nt.value  = yval;
		document.rsv.fmonth_nt.value = mval;
	}
	document.rsv.submit();
}

function cal_submit_day(mode, yval, mval, dval, pos){
	document.rsv.action = 'cal_redirect.php';
	if (mode == 1) {
		document.rsv.fyear.value  = yval;
		document.rsv.fmonth.value = mval;
		document.rsv.fday.value   = dval;
		document.rsv.cpos.value   = pos;
	} else if(mode == 2) {
		document.rsv.tyear.value  = yval;
		document.rsv.tmonth.value = mval;
		document.rsv.tday.value   = dval;
		document.rsv.cpos.value   = pos;
	}

	document.rsv.submit();
}

function cal_submit_reset(){
	document.rsv.action = 'cal_redirect.php';
	document.rsv.col.value  = 'clear';
	document.rsv.submit();
}

function slade_np() {
	var set_mail = new Array();
	var n = 1;
	for (m=1; m<=3; m++) {
		val_mail = eval('rsv.info_mail_address' + m + '.value');
		if (val_mail != "") {
			set_mail[n] = val_mail;
			n = n + 1;
		}
	}

	if (set_mail.length > 0) {
		for (m=1; m<=3; m++) {
			val_mail = eval('rsv.info_mail_address' + m);
			val_mail.value = "";
		}

		for (m=1; m<=set_mail.length-1; m++) {
			val_mail = eval('rsv.info_mail_address' + m);
			val_mail.value = set_mail[m];
		}
	}

	return true;
}

function np_null_chk(cnum, mode) {
	c1 = eval('rsv.car_maker_' + cnum);
	c2 = eval('rsv.car_name_' + cnum);
	c3 = eval('rsv.car_color_' + cnum);

	c4 = eval('rsv.car_np_tran_' + cnum);
	c5 = eval('rsv.car_np_bunrui_' + cnum);
	c6 = eval('rsv.car_np_kana_' + cnum);
	c7 = eval('rsv.car_np_num_' + cnum);

	c8 = eval('rsv.car_handicapped_' + cnum);
	c9 = eval('rsv.handicapped_number_' + cnum);

	chk_flag = 0;
	if (mode == 2) {
		if ( c1.value == "" && c2.value == "" && c3.value == "" && 
				 c4.options[c4.selectedIndex].value == "" && c5.value == "" && 
				 c6.options[c6.selectedIndex].value == "" && c7.value == "" && 
				 c8.checked == false && c9.value == "" ) {
			return true;
		} else {
			return false;
		}
	} else {
		if ( c1.value != "" || c2.value != "" || c3.value != "" || 
				 c4.options[c4.selectedIndex].value != "" || c5.value != "" || 
				 c6.options[c6.selectedIndex].value != "" || c7.value != "" || 
				 c8.checked == true || c9.value != "" ) {
			return true;
		} else {
			return false;
		}
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function work_in_chk() {
	if (work_in_fm.workinnew.value == "") {
		alert("メールアドレスが未入力です");
		return false;
	} else {
		return true;
	}
}

function cancel_chk() {
	if (confirm("キャンセル処理を実行します。よろしいですか？")) {
		return true;
	} else {
		return false;
	}
}

function regist_chk() {
	if (confirm("登録処理を実行します。よろしいですか？")) {
		return true;
	} else {
		return false;
	}
}

function open_win(turl, mode){
	owin = window.open(turl,"parkingwin","width=900,height=610,menubar=0,status=0,toolbar=0,scrollbars=0,resizable=0,left=2,top=2");
	owin.focus();
}


