// 半角カナの文字列。
var hwKanas="ｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜｦﾝｧｨｩｪｫｬｭｮｰｯﾞﾟ";

// 全角カタカナチェック
function checkTypeHankaku(theElmName, theElmValue) {
   for(j = 0; j < theElmValue.length; j ++){
		if(hwKanas.indexOf(theElmValue.charAt(j), 0) >= 0){
			alert(theElmName + "に半角カタカナは入力できません。全角で入力してください。");
			return false;
		}
	}
	return true;
}

function form1_onSubmit(theFrm){
	var theElmName;
	var theElmValue;
	var theMsg = "";
	// お名前
	theElmName = "お名前";
	theElmValue = theFrm.data2.value;
	if (!checkTypeHankaku(theElmName, theElmValue)) {
		return false;
	}
	// ご住所の郵便番号１
	theElmName = "ご住所";
	theElmValue = theFrm.data3a.value;
	if (!checkTypeHankaku(theElmName, theElmValue)) {
		return false;
	}
	// ご住所の郵便番号2
	theElmName = "ご住所";
	theElmValue = theFrm.data3b.value;
	if (!checkTypeHankaku(theElmName, theElmValue)) {
		return false;
	}
	// ご住所
	theElmName = "ご住所";
	theElmValue = theFrm.data4b.value;

	if (!checkTypeHankaku(theElmName, theElmValue)) {
		return false;
	}
	// コメント
	theElmName = "コメント";
	theElmValue = theFrm.data6.value;
	if (!checkTypeHankaku(theElmName, theElmValue)) {
		return false;
	}
	return true;
}

var windowCloserHTMLiq
= "<img src=\"http://www.n-keitai.com/common/images/form_iq_windowcloser.gif\" width=\"59\" height=\"20\" alt=\"このウィンドウを閉じる\" />";

var windowCloserHTMLpq
= "<img src=\"http://www.n-keitai.com/common/images/form_pq_windowcloser.gif\" width=\"59\" height=\"20\" alt=\"このウィンドウを閉じる\" />";

var windowCloserHTMLdf
= "<img src=\"http://www.n-keitai.com/common/images/form_df_windowcloser.gif\" width=\"59\" height=\"20\" alt=\"このウィンドウを閉じる\" />";

N_setWindowCloser = function(m){
	windowCloser = document.createElement("p");
	     if(m == "df")      windowCloser.innerHTML = windowCloserHTMLdf;
	else if(m == "inquiry") windowCloser.innerHTML = windowCloserHTMLiq;
	else                    windowCloser.innerHTML = windowCloserHTMLpq;
	windowCloser.id = "windowCloser";
	if(document.all) windowCloser.style.cursor = "hand";
	else             windowCloser.style.cursor = "pointer";
	windowCloser.onclick = function(){ window.close(); };
	document.getElementById("footer").appendChild(windowCloser);
}

var submitPanelHTML
= "<input class=\"input_submit\" type=\"submit\" value=\"送信\" />"
+ "<input class=\"input_submit\" type=\"button\" value=\"修正\" onclick=\"history.back();\" onkeypress=\"history.back();\" />";

N_setSubmitPanel = function(){
	submitPanel = document.createElement("p");
	submitPanel.innerHTML = submitPanelHTML;
	submitPanel.id = "submitPanel";
	document.getElementById("submitPanelArea").appendChild(submitPanel);
}

