//───────────────────────────────────────────
//
// Net Contents design Corporation
//
// Main Script
//───────────────────────────────────────────
<!--

function kokoMail() {
	window.open("","mail","toolbar=0,menubar=0,scrollbars=0,width=440,height=460")
	window.document.mailform.action = "kokoMail.asp";
	window.document.mailform.target = "mail";
	window.document.mailform.method = "POST";
	window.document.mailform.OBJX.value = document.mapform.sx.value;
	window.document.mailform.OBJY.value = document.mapform.sy.value;
	window.document.mailform.OBJNM.value = document.mapform.sn.value;
	window.document.mailform.CARX.value = mapCurX;
	window.document.mailform.CARY.value = mapCurY;
	window.document.mailform.submit() ;
}

function searchProc(type) {
	if (type == 2) {
		if (document.mapform.ADD.value == "") {
			alert("検索する住所を入力してください");
			return;
		}
	}
	if (type == 3) {
		if (document.mapform.ZIP.value == "") {
			alert("検索する郵便番号を入力してください");
			return;
		}
		if (document.mapform.ZIP.value.length != 7) {
			alert("郵便番号を正確に入力してください");
			return;
		}
		if (isNaN(document.mapform.ZIP.value)) {
			alert("郵便番号を正確に入力してください");
			return;
		}
	}

	window.open("","list","toolbar=0,menubar=0,scrollbars=0,width=460,height=500")
	window.document.searchform.action = "searchList.asp";
	window.document.searchform.target = "list";
	window.document.searchform.method = "POST";
	window.document.searchform.ADD.value = document.mapform.ADD.value;
	window.document.searchform.ZIP.value = document.mapform.ZIP.value;
	window.document.searchform.TYPE.value = type;
	window.document.searchform.submit() ;
}

// 緯度経度検索
function searchMap() {

	var mapLat	= document.mapform.LAT.value;
	var mapLon	= document.mapform.LON.value;

	if (mapLat.indexOf(".", 0) > 0) {
		if (mapLat.indexOf(".", 0) != 6) {
			alert("緯度の値を正確に入力してください");
		} else {
			csND	= mapLat.substr(0, 2)
			csNM	= mapLat.substr(2, 2)
			csNS	= mapLat.substr(4, 2)
			csNMS	= mapLat.substr(7)

			y = degreeProc(csND,csNM,csNS,csNMS)
		}
	} else {
		if (mapLat.length != 6) {
			alert("緯度の値を正確に入力してください");
		} else {
			csND	= mapLat.substr(0, 2)
			csNM	= mapLat.substr(2, 2)
			csNS	= mapLat.substr(4, 2)
			csNMS	= mapLat.substr(7)

			y = degreeProc(csND,csNM,csNS,csNMS)
		}
	}

	if (y == -1)	alert("緯度の値を正確に入力してください");
	else 			document.mapform.y.value = y;

	if (mapLon.indexOf(".", 0) > 0) {
		if (mapLon.indexOf(".", 0) != 7) {
			alert("経度の値を正確に入力してください");
		} else {
			csED	= mapLon.substr(0, 3)
			csEM	= mapLon.substr(3, 2)
			csES	= mapLon.substr(5, 2)
			csEMS	= mapLon.substr(8)

			x = degreeProc(csED,csEM,csES,csEMS)
		}
	} else {
		if (mapLon.length != 7) {
			alert("経度の値を正確に入力してください");
		} else {
			csED	= mapLon.substr(0, 3)
			csEM	= mapLon.substr(3, 2)
			csES	= mapLon.substr(5, 2)
			csEMS	= mapLon.substr(8)

			x = degreeProc(csED,csEM,csES,csEMS)
		}
	}

	if (x == -1)	alert("経度の値を正確に入力してください");
	else 			document.mapform.x.value = x;

	ToNext();

}

function degreeProc(csDeg,csMin,csSec,csMSec) {

	if (csDeg == "") {
		csRSec = -1;
		return;
	}

	if (csDeg.length > 3 || csMin.length > 2 || csSec.length > 2 || csMSec.length > 3) {
		csRSec = -1;
		return;
	}

	if (csMin == "")	csMin = "0";
	if (csSec == "")	csSec = "0";
	if (csMSec == "")	csMSec = "0";

	if (isNaN(csDeg) || isNaN(csMin) || isNaN(csSec) || isNaN(csMSec)) {
		csRSec = -1
		return;
	}

	csRSec = (parseInt(csDeg-0) * 60 * 60) + (parseInt(csMin-0) * 60) + parseInt(csSec-0) + parseInt((csMSec + "00").substr(0,3)-0)/1000

	return csRSec;
}

function searchSet(x,y) {

	opener.document.mapform.x.value = x;
	opener.document.mapform.y.value = y;
	opener.document.mapform.submit();

}

function datasend() {

	document.sendform.mail.value = document.mapform.senddata.value;
	document.sendform.submit();

}

-->
