<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript"
	src="${contextRoot}/js/common/jquery/jquery.min.js"></script>
</head>
<body>
	<iframe id="geoLocation" style="display: none;"></iframe>
</body>
<script type="text/javascript">
	/* var ims  	 	= parent.$("#ims").attr("class");
	var cctv 	 	= parent.$("#cctv").attr("class");
	var roadCctv 	= parent.$("#roadCctv").attr("class");
	var roadCctvE05 = parent.$("#roadCctvE05").attr("class");
	
	console.log('cctv : '+cctv); */

	var optionGeo = {
		enableHighAccuracy : true,
		maximumAge : 0,
		timeout : 10000
	}
	if (navigator.geolocation) {
		navigator.geolocation.getCurrentPosition(successGeo, errorGeo, optionGeo);
	} else {
		alert("Geolocation is not supported by this browser.");
	}
	function successGeo(position) {

		var idLatitude = position.coords.latitude;
		var idLongitude = position.coords.longitude;

		//alert('idLatitude : ' + idLatitude + ' , idLongitude : '+idLongitude);

		$(parent.document).find("#idLatitude").val(idLatitude); // x
		$(parent.document).find("#idLongitude").val(idLongitude); // y

	}
	function errorGeo(error) {
		switch (error.code) {

			case error.TIMEOUT:
				alert('시간이 초과되었습니다.');
				break;

			case error.POSITION_UNAVAILABLE:
				alert('일시적으로 위치를 사용할 수 없습니다.');
				break;

			case error.PERMISSION_DENIED:
				alert('권한이 거부되었습니다.');
				break;
		}
	}
</script>
</html>