function submitCheck()
{
	if(document.order.product.selectedIndex == 0) {
		alert("ご注文商品を選択して下さい") ;
		return false ;
	}
	if(document.order.count.value == "") {
		alert("数量を入力して下さい") ;
		return false ;
	}
	if(document.order.count.value == "0") {
		alert("数量を入力して下さい") ;
		return false ;
	}
	if(document.order.pay.selectedIndex == 0) {
		alert("お支払方法を選択して下さい") ;
		return false ;
	}
	if(document.order.name.value == "") {
		alert("お客様名を記入して下さい") ;
		return false ;
	}
	if(document.order.post.value == "") {
		alert("郵便番号を記入して下さい") ;
		return false ;
	}
	if(document.order.prefec.selectedIndex == 0) {
		alert("都道府県名を選択して下さい") ;
		return false ;
	}
	if(document.order.address.value == "") {
		alert("住所を記入して下さい") ;
		return false ;
	}
	if(document.order.addressno.value == "") {
		alert("番地を記入して下さい") ;
		return false ;
	}
	if(document.order.tel.value == "") {
		alert("電話番号を記入して下さい") ;
		return false ;
	}
	if(document.order.mail.value == "") {
		alert("メールアドレスを記入して下さい") ;
		return false ;
	}


//------------------ add 2007/10/27 by hro ------------------

	//日付変数取得
	var Delivery_day = new Date(document.order.deliday.value);
	var Delivery_day_time = Date.parse(Delivery_day);

	var on_the_day = new Date();
	var on_the_day_time = Date.parse(on_the_day);


	//配達指定日入力形式チェック
	if(!Delivery_day_time){
		alert("配達指定日は 9999/99/99 形式で入力願います");
		document.order.deliday.focus();
		return false ;
	}


	//配達日指定有無チェック
	if(document.order.deliday.value == "0000/00/00"){
	ans=confirm("配達日が指定されてませんが宜しいですか？");
		if(ans==true){
		return true;
		}
		else{
		document.order.deliday.focus();
		return false;
		}
	}


	//有効日付チェック
    	PARA = new Array();
        PARA = document.order.deliday.value.split("/");

	var nYear = PARA[0];
	var nMonth = PARA[1];
	var nDay = PARA[2];

	var dtCal = new Date;
	var strDate;
	var nMonthCount = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

	//年度のチェック （ここでは4桁チェック)
	if (nYear.length != 4)
	{
		alert ("正しい年を入力してください。");
		document.order.deliday.focus();
		return false;
	}
	//月のチェック
	if ((nMonth < 1) || (nMonth > 12))
	{
		alert ("正しい月を入力してください。");
		document.order.deliday.focus();
		return false;
	}

	dtCal.setYear(nYear);
	dtCal.setMonth(nMonth-1);
	var nDayCount = nMonthCount[nMonth-1];
	if ((nMonth == 2)&&(((nYear%4 == 0)&&(nYear%100 != 0))||(nYear%400 == 0)))
	{
		nDayCount = 29;
	}

	//日付チェック
	if ((nDay < 1) || (nDay > nDayCount))
	{
		alert (nYear+"年"+nMonth+"月は"+nDayCount+"日までです。");
		document.order.deliday.focus();
		return false;
	}


	//配達指定日猶予チェック
	if(Delivery_day_time < (on_the_day_time + (3 * 1000 * 60 * 60 * 24))) {
		dt = new Date(on_the_day_time + (4 * 1000 * 60 * 60 * 24));

		year = dt.getYear();
		mouth = dt.getMonth() + 1;
		day = dt.getDate();

		str = "配達指定日は ";
		str = str + year + "/" + mouth + "/" + day;
		str = str + " 以降を指定してください";

		alert(str);
		document.order.deliday.focus();
		return false ;
	}

//------------------ add 2007/10/27 by hro ------------------


	if(document.order.progress.selectedIndex == 0) {
		if(document.order.s_name.value != "") {
			alert("発送先指定が間違っています。") ;
			return false ;
		}
		if(document.order.s_post.value != "") {
			alert("発送先指定が間違っています。") ;
			return false ;
		}
		if(document.order.s_prefec.selectedIndex != 0) {
			alert("発送先指定が間違っています。") ;
			return false ;
		}
		if(document.order.s_address.value != "") {
			alert("発送先指定が間違っています。") ;
			return false ;
		}
		if(document.order.s_addressno.value != "") {
			alert("発送先指定が間違っています。") ;
			return false ;
		}
		if(document.order.s_tel.value != "") {
			alert("発送先指定が間違っています。") ;
			return false ;
		}
	}

	if(document.order.progress.selectedIndex == 1) {
		if(document.order.s_name.value == "") {
			alert("お届け先を記入して下さい") ;
			return false ;
		}
		if(document.order.s_post.value == "") {
			alert("郵便番号を記入して下さい") ;
			return false ;
		}
		if(document.order.s_prefec.selectedIndex == 0) {
			alert("都道府県名を選択して下さい") ;
			return false ;
		}
		if(document.order.s_address.value == "") {
			alert("住所を記入して下さい") ;
			return false ;
		}
		if(document.order.s_addressno.value == "") {
			alert("番地を記入して下さい") ;
			return false ;
		}
		if(document.order.s_tel.value == "") {
			alert("電話番号を記入して下さい") ;
			return false ;
		}
	}

	return true ;
}

function newpage(page_no)
{
	if(page_no == 1) {
		window.open("./charge.html","window1","width=600,height=550,scrollbars=1") ;
	}
	if(page_no == 2) {
		window.open("./paylist.html","window2","width=600,height=450,scrollbars=1") ;
	}
}
